#ifndef _STM32F411_H_ #define _STM32F411_H_ /* (todo) boundary check? */ #define _MMIO_(base, offset) ((volatile unsigned int * const) (base + offset)) /* AHB1 ------------------------------------------------------------------- */ #define RCC 0x40023800 #define RCC_AHB1ENR _MMIO_ (RCC, 0x30) #define GPIOC 0x40020800 #define GPIOC_MODER _MMIO_ (GPIOC, 0x00) #define GPIOC_ODR _MMIO_ (GPIOC, 0x14) /* APB2 ------------------------------------------------------------------- */ #define USART 0x40011000 /* USART1 */ #define USART_SR _MMIO_ (USART, 0x00) #define USART_DR _MMIO_ (USART, 0x04) #define USART_BRR _MMIO_ (USART, 0x08) #define USART_CR1 _MMIO_ (USART, 0x0c) #define USART_CR2 _MMIO_ (USART, 0x10) #define USART_CR3 _MMIO_ (USART, 0x14) #define USART_GTPR _MMIO_ (USART, 0x18) #endif /* _STM32F411_H_ */