BeRTOS
stm32.h
Go to the documentation of this file.
00001 
00036 #ifndef STM32_H
00037 #define STM32_H
00038 
00039 #include <cfg/compiler.h>
00040 #include <cfg/macros.h>
00041 
00042 #include <cpu/types.h>
00043 
00044 #include <io/stm32_memmap.h>
00045 
00046 #include "stm32_nvic.h"
00047 #include "stm32_ints.h"
00048 #include "stm32_gpio.h"
00049 #include "stm32_uart.h"
00050 #include "stm32_adc.h"
00051 #include "stm32_i2c.h"
00052 #include "stm32_flash.h"
00053 
00054 #if CPU_CM3_STM32F101C4
00055     #define GPIO_USART1_TX_PIN  BV(9)
00056     #define GPIO_USART1_RX_PIN  BV(10)
00057     #define GPIO_USART2_TX_PIN  BV(2)
00058     #define GPIO_USART2_RX_PIN  BV(3)
00059 #elif CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE
00060     #define GPIO_USART1_TX_PIN  BV(9)
00061     #define GPIO_USART1_RX_PIN  BV(10)
00062     #define GPIO_USART2_TX_PIN  BV(2)
00063     #define GPIO_USART2_RX_PIN  BV(3)
00064     #define GPIO_USART3_TX_PIN  BV(10)
00065     #define GPIO_USART3_RX_PIN  BV(11)
00066 #else
00067     #error No USART pins are defined for select cpu
00068 #endif
00069 
00070 #if CPU_CM3_STM32F101C4
00071     #define GPIO_I2C1_SCL_PIN   BV(6)
00072     #define GPIO_I2C1_SDA_PIN   BV(7)
00073 #elif CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE
00074     #define GPIO_I2C1_SCL_PIN   BV(6)
00075     #define GPIO_I2C1_SDA_PIN   BV(7)
00076     #define GPIO_I2C2_SCL_PIN   BV(10)
00077     #define GPIO_I2C2_SDA_PIN   BV(11)
00078 #else
00079     #error No i2c pins are defined for select cpu
00080 #endif
00081 
00082 #if CPU_CM3_STM32F101C4 || CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE
00083     #define FLASH_PAGE_SIZE   1024
00084 #else
00085     #error No embedded definition for select cpu
00086 #endif
00087 
00088 #endif /* STM32_H */