6 #define STM32_FLASH_BASE 0x40022000
7 #define STM32_RCC_BASE 0x40021000
8 #define STM32_USART1_BASE 0x40013800
9 #define STM32_GPIO_BASE(x) (0x40010800+0x400*(x))
10 #define STM32_EXTI_BASE 0x40010400
11 #define STM32_AFIO_BASE 0x40010000
12 #define STM32_PWR_BASE 0x40007000
13 #define STM32_I2C1_BASE 0x40005400
14 #define STM32_I2C2_BASE 0x40005800
17 struct stm32_i2c_regs
{
28 #define STM32_I2C1 ((struct stm32_i2c_regs*)STM_I2C1_BASE)
29 #define STM32_I2C2 ((struct stm32_i2c_regs*)STM_I2C2_BASE)
31 struct stm32_rcc_regs
{
35 volatile u32 APB2RSTR
;
36 volatile u32 APB1RSTR
;
43 #define STM32_RCC ((struct stm32_rcc_regs*)STM32_RCC_BASE)
45 struct stm32_gpio_regs
{
54 #define STM32_GPIO(x) ((struct stm32_gpio_regs*)STM32_GPIO_BASE(x))
56 struct stm32_exti_regs
{
64 #define STM32_EXTI ((struct stm32_exti_regs*)STM32_EXTI_BASE)
66 struct stm32_afio_regs
{
74 #define STM32_AFIO ((struct stm32_afio_regs*)STM32_AFIO_BASE)
76 struct stm32_usart_regs
{
85 #define STM32_USART1 ((struct stm32_usart_regs*)STM32_USART1_BASE)
87 #define FLASH_ACR *(volatile u32 *)0x40022000
89 #define APB1_DAC (1<<29)
90 #define APB1_PWR (1<<28)
91 #define APB1_BKP (1<<27)
92 #define APB1_CAN (1<<25)
93 #define APB1_USB (1<<23)
94 #define APB1_I2C2 (1<<22)
95 #define APB1_I2C1 (1<<21)
96 #define APB1_UART5 (1<<20)
97 #define APB1_UART4 (1<<19)
98 #define APB1_USART3 (1<<18)
99 #define APB1_USART2 (1<<17)
100 #define APB1_SPI3 (1<<15)
101 #define APB1_SPI2 (1<<14)
102 #define APB1_WWDG (1<<11)
103 #define APB1_TIM7 (1<<5)
104 #define APB1_TIM6 (1<<4)
105 #define APB1_TIM5 (1<<3)
106 #define APB1_TIM4 (1<<2)
107 #define APB1_TIM3 (1<<1)
108 #define APB1_TIM2 (1<<0)
110 #define APB2_ADC3 (1<<15)
111 #define APB2_USART1 (1<<14)
112 #define APB2_TIM8 (1<<13)
113 #define APB2_SPI1 (1<<12)
114 #define APB2_TIM1 (1<<11)
115 #define APB2_ADC2 (1<<10)
116 #define APB2_ADC1 (1<<9)
117 #define APB2_IOPG (1<<8)
118 #define APB2_IOPF (1<<7)
119 #define APB2_IOPE (1<<6)
120 #define APB2_IOPD (1<<5)
121 #define APB2_IOPC (1<<4)
122 #define APB2_IOPB (1<<3)
123 #define APB2_IOPA (1<<2)
124 #define APB2_AFIO (1<<0)
127 #define REMAP_USART2 (1<<3)
128 #define REMAP_USART1 (1<<2)
129 #define REMAP_I2C1 (1<<1)
130 #define REMAP_SPI1 (1<<0)
159 IRQ_TIM1_TRG_COM
= 26,
175 IRQ_OTG_FS_WKUP
= 42,