X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fio%2Fstm32.h;h=49ee9b1ab183cbdc721f098187dbfc383f3385cc;hb=9525bb5f7e0bf15bd0b11a21055adf804c6aa478;hp=9d7cba87a0d8012c889d093aa4d04c4e7e514c1d;hpb=300cdf2bf61ba3f4e723b6bc2bc81edf579b7a34;p=bertos.git diff --git a/bertos/cpu/cortex-m3/io/stm32.h b/bertos/cpu/cortex-m3/io/stm32.h index 9d7cba87..49ee9b1a 100644 --- a/bertos/cpu/cortex-m3/io/stm32.h +++ b/bertos/cpu/cortex-m3/io/stm32.h @@ -45,19 +45,44 @@ #include "stm32_nvic.h" #include "stm32_ints.h" +#include "stm32_gpio.h" #include "stm32_uart.h" #include "stm32_adc.h" #include "stm32_i2c.h" +#include "stm32_flash.h" -#define GPIO_USART1_TX_PIN BV(9) -#define GPIO_USART1_RX_PIN BV(10) -#define GPIO_USART2_TX_PIN BV(2) -#define GPIO_USART2_RX_PIN BV(3) -#define GPIO_USART3_TX_PIN BV(10) -#define GPIO_USART3_RX_PIN BV(11) +#if CPU_CM3_STM32F101C4 + #define GPIO_USART1_TX_PIN BV(9) + #define GPIO_USART1_RX_PIN BV(10) + #define GPIO_USART2_TX_PIN BV(2) + #define GPIO_USART2_RX_PIN BV(3) +#elif CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE + #define GPIO_USART1_TX_PIN BV(9) + #define GPIO_USART1_RX_PIN BV(10) + #define GPIO_USART2_TX_PIN BV(2) + #define GPIO_USART2_RX_PIN BV(3) + #define GPIO_USART3_TX_PIN BV(10) + #define GPIO_USART3_RX_PIN BV(11) +#else + #error No USART pins are defined for select cpu +#endif +#if CPU_CM3_STM32F101C4 + #define GPIO_I2C1_SCL_PIN BV(6) + #define GPIO_I2C1_SDA_PIN BV(7) +#elif CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE + #define GPIO_I2C1_SCL_PIN BV(6) + #define GPIO_I2C1_SDA_PIN BV(7) + #define GPIO_I2C2_SCL_PIN BV(10) + #define GPIO_I2C2_SDA_PIN BV(11) +#else + #error No i2c pins are defined for select cpu +#endif -#define GPIO_I2C1_SCL_PIN BV(6) -#define GPIO_I2C1_SDA_PIN BV(7) +#if CPU_CM3_STM32F101C4 || CPU_CM3_STM32F103RB || CPU_CM3_STM32F103RE + #define FLASH_PAGE_SIZE 1024 +#else + #error No embedded definition for select cpu +#endif #endif /* STM32_H */