i2c.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:1k
- #ifndef __I2C_H
- #define __I2C_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* Includes --------------------------------------------------------------- */
- #include "gendef.h"
- /* Array offsets for I2C devices */
- enum
- {
- I2C_BACK_BUS,
- I2C_FRONT_BUS,
- I2C_DEVICES
- };
- #define KB_I2C_RATE_100K (100000)
- #define KB_I2C_RATE_400K (400000)
- INT32 KB_I2CInit(UINT32 bits_per_second);
- INT32 KB_I2COpen(UINT32 nSlaveAddress, UINT32 *i2cHandle);
- INT32 KB_I2CClose(UINT32 i2cHandle);
- INT32 KB_I2CReadWithStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
- INT32 KB_I2CReadWithoutStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
- INT32 KB_I2CWriteWithStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
- INT32 KB_I2CWriteWithoutStop(UINT32 i2cHandle, UINT32 nBufferLength, UINT8 *pBuffer);
- #ifdef __cplusplus
- }
- #endif
- #endif