i2c_dev.h 523 B

12345678910111213141516171819202122232425262728
  1. #ifndef __I2C_DEV_H__
  2. #define __I2C_DEV_H__
  3. #include <rtthread.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define RT_I2C_DEV_CTRL_10BIT 0x20
  8. #define RT_I2C_DEV_CTRL_ADDR 0x21
  9. #define RT_I2C_DEV_CTRL_TIMEOUT 0x22
  10. #define RT_I2C_DEV_CTRL_RW 0x23
  11. struct rt_i2c_priv_data {
  12. struct rt_i2c_msg *msgs;
  13. rt_size_t number;
  14. };
  15. rt_err_t rt_i2c_bus_device_init(struct rt_i2c_bus* bus, const char* name);
  16. rt_err_t rt_i2c_bus_device_exit(struct rt_i2c_bus* bus);
  17. #ifdef __cplusplus
  18. }
  19. #endif
  20. #endif