i2c_dev.h 803 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2012-04-25 weety first version
  9. * 2021-04-20 RiceChen added bus clock command
  10. */
  11. #ifndef __I2C_DEV_H__
  12. #define __I2C_DEV_H__
  13. #include <rtthread.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #define RT_I2C_DEV_CTRL_10BIT 0x20
  18. #define RT_I2C_DEV_CTRL_TIMEOUT 0x22
  19. #define RT_I2C_DEV_CTRL_RW 0x23
  20. #define RT_I2C_DEV_CTRL_CLK 0x24
  21. struct rt_i2c_priv_data
  22. {
  23. struct rt_i2c_msg *msgs;
  24. rt_size_t number;
  25. };
  26. rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus,
  27. const char *name);
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif