10 #ifndef __BRP_BALTECH_API_CMDS_I2C_H__    11 #define __BRP_BALTECH_API_CMDS_I2C_H__    12 #include "../typedefs.h"    16 #define BRP_I2c_ErrI2CRead BRP_ERR_STATUS(0x0800, 0x01)    20 #define BRP_I2c_ErrI2CWrite BRP_ERR_STATUS(0x0800, 0x02) unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions. 
 
brp_errcode brp_I2c_Read(brp_protocol protocol, unsigned Address, unsigned ReadLen, brp_buf *ReadData, size_t *ReadData_len, brp_mempool *mempool)
Read data from I2C interface. 
 
brp_errcode brp_I2c_Write(brp_protocol protocol, unsigned Address, brp_buf WriteData, size_t WriteData_len)
Write data to I2C interface. 
 
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol. 
 
brp_errcode brp_I2c_SetSpeed(brp_protocol protocol, bool FastMode)
Set speed of I2C interface. 
 
struct brp_mempool_object_t * brp_mempool
mempool handle. 
 
brp_errcode brp_I2c_TxRx(brp_protocol protocol, unsigned Address, brp_buf CmdData, size_t CmdData_len, unsigned ReadLen, brp_buf *ReadData, size_t *ReadData_len, brp_mempool *mempool)
Write data and directly after that read from I2C interface. 
 
unsigned char * brp_buf
represents a pointer to a protocol data buffer.