Add usart.{h, c}
This commit is contained in:
@@ -17,6 +17,10 @@ struct gpio {
|
||||
volatile uint32_t AFRH; // Alternative function high register
|
||||
};
|
||||
|
||||
// AFRH, AFRL registers
|
||||
#define GPIO_AF_USART2_RX (0b0111) // Alternative function 7 (AF7)
|
||||
#define GPIO_AF_USART2_TX (0b0111) // Alternative function 7 (AF7)
|
||||
|
||||
#define GPIO_BASE_ADDR (0x40020000U)
|
||||
#define GPIO_PORT_OFFSET (0x400U)
|
||||
#define GPIO(port) ((struct gpio*)(uintptr_t)(GPIO_BASE_ADDR + (GPIO_PORT_OFFSET * port)))
|
||||
|
||||
Reference in New Issue
Block a user