i2c.h 385 B

12345678910111213141516171819
  1. #ifndef _I2C_H_
  2. #define _I2C_H_
  3. /* I2C Status */
  4. typedef enum {
  5. I2C_Ret_OK = 0,
  6. I2C_Ret_NACK = -1,
  7. I2C_Ret_ERR = -2,
  8. I2C_Ret_TOut = -3
  9. } i2c_status_t;
  10. void I2C_Init(void);
  11. void I2C_Close(void);
  12. void I2C_Start(void);
  13. void I2C_Stop(void);
  14. i2c_status_t I2C_WriteByte(const uint8_t data);
  15. i2c_status_t I2C_ReadByte(uint8_t *data, const uint8_t ack);
  16. #endif /* _I2C_H_ */