CCS811_IIC.h 665 B

1234567891011121314151617
  1. #ifndef _IIC_H
  2. #define _IIC_H
  3. #include "stm32f10x.h"
  4. #define SCL_H GPIOA->BSRR = GPIO_Pin_6
  5. #define SCL_L GPIOA->BRR = GPIO_Pin_6
  6. #define SDA_H GPIOA->BSRR = GPIO_Pin_7
  7. #define SDA_L GPIOA->BRR = GPIO_Pin_7
  8. #define SCL_read GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_6)
  9. #define SDA_read GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_7)
  10. void CCS811_I2C_GPIO_Config(void);
  11. void CCS811_I2C_Stop(void);
  12. u8 CCS811_WriteI2C_byte(u8 Slave_Address,u8 REG_Address,u8 data);
  13. u8 CCS811_MWriteI2C_byte(u8 Slave_Address,u8 REG_Address,u8 const *data,u8 length);
  14. u8 CCS811_ReadI2C(u8 Slave_Address,u8 REG_Address,u8 *REG_data,u8 length);
  15. #endif