i2c1.h 454 B

1234567891011121314151617181920
  1. #ifndef __I2C_H
  2. #define __I2C_H
  3. #include "stm32f4xx.h"
  4. #define I2C1_SCL_PORT GPIOB
  5. #define I2C1_SCL_PIN GPIO_Pin_8
  6. #define I2C1_SCL_SOURCE GPIO_PinSource8
  7. #define I2C1_SCL_CLK RCC_AHB1Periph_GPIOB
  8. #define I2C1_SDA_PORT GPIOB
  9. #define I2C1_SDA_PIN GPIO_Pin_9
  10. #define I2C1_SDA_SOURCE GPIO_PinSource9
  11. #define I2C1_SDA_CLK RCC_AHB1Periph_GPIOB
  12. #define I2C1_ADDRESS 0xA0
  13. #define I2C1_SPEED 100000U
  14. void i2c1_init(void);
  15. #endif // __I2C_H