i2c_dev.h 933 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * File : i2c_dev.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2012-04-25 weety first version
  13. */
  14. #ifndef __I2C_DEV_H__
  15. #define __I2C_DEV_H__
  16. #include <rtthread.h>
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define RT_I2C_DEV_CTRL_10BIT 0x20
  21. #define RT_I2C_DEV_CTRL_ADDR 0x21
  22. #define RT_I2C_DEV_CTRL_TIMEOUT 0x22
  23. #define RT_I2C_DEV_CTRL_RW 0x23
  24. struct rt_i2c_priv_data
  25. {
  26. struct rt_i2c_msg *msgs;
  27. rt_size_t number;
  28. };
  29. rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus,
  30. const char *name);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif