i2c_dev.h 747 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. */
  10. #ifndef __I2C_DEV_H__
  11. #define __I2C_DEV_H__
  12. #include <rtthread.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define RT_I2C_DEV_CTRL_10BIT 0x20
  17. #define RT_I2C_DEV_CTRL_ADDR 0x21
  18. #define RT_I2C_DEV_CTRL_TIMEOUT 0x22
  19. #define RT_I2C_DEV_CTRL_RW 0x23
  20. struct rt_i2c_priv_data
  21. {
  22. struct rt_i2c_msg *msgs;
  23. rt_size_t number;
  24. };
  25. rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus,
  26. const char *name);
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif