]> wirehaze git hosting - stm32f411ceu6.git/blob - stm32f411.h

wirehaze git hosting

57ceb900fa00c9ca466fc50a5e0164460087dc74
[stm32f411ceu6.git] / stm32f411.h
1 #ifndef _STM32F411_H_
2 #define _STM32F411_H_
3
4 /* (todo) boundary check? */
5 #define _MMIO_(base, offset) ((volatile unsigned int * const) (base + offset))
6
7
8 /* AHB1 ------------------------------------------------------------------- */
9
10 #define RCC 0x40023800
11 #define RCC_AHB1ENR _MMIO_ (RCC, 0x30)
12
13 #define GPIOC 0x40020800
14 #define GPIOC_MODER _MMIO_ (GPIOC, 0x00)
15 #define GPIOC_ODR _MMIO_ (GPIOC, 0x14)
16
17
18 /* APB2 ------------------------------------------------------------------- */
19
20 #define USART 0x40011000 /* USART1 */
21 #define USART_SR _MMIO_ (USART, 0x00)
22 #define USART_DR _MMIO_ (USART, 0x04)
23 #define USART_BRR _MMIO_ (USART, 0x08)
24 #define USART_CR1 _MMIO_ (USART, 0x0c)
25 #define USART_CR2 _MMIO_ (USART, 0x10)
26 #define USART_CR3 _MMIO_ (USART, 0x14)
27 #define USART_GTPR _MMIO_ (USART, 0x18)
28
29
30 #endif /* _STM32F411_H_ */