i2c.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:1k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef __I2C_H
  2. #define __I2C_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /* Includes --------------------------------------------------------------- */
  7. #include "gendef.h"
  8. /* Array offsets for I2C devices */
  9. enum
  10. {
  11.     I2C_BACK_BUS,
  12.     I2C_FRONT_BUS,
  13.     I2C_DEVICES
  14. };
  15. #define KB_I2C_RATE_100K (100000)
  16. #define KB_I2C_RATE_400K (400000)
  17. INT32 KB_I2CInit(UINT32 bits_per_second);
  18. INT32 KB_I2COpen(UINT32 nSlaveAddress, UINT32 *i2cHandle);
  19. INT32 KB_I2CClose(UINT32 i2cHandle);
  20. INT32 KB_I2CReadWithStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
  21. INT32 KB_I2CReadWithoutStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
  22. INT32 KB_I2CWriteWithStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
  23. INT32 KB_I2CWriteWithoutStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif