C API for BALTECH SDK
i2c.h
Go to the documentation of this file.
1 
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)
17 
20 #define BRP_I2c_ErrI2CWrite BRP_ERR_STATUS(0x0800, 0x02)
21 
27 brp_errcode brp_I2c_SetSpeed(brp_protocol protocol, bool FastMode);
38 brp_errcode brp_I2c_Read(brp_protocol protocol, unsigned Address, unsigned ReadLen, brp_buf* ReadData, size_t* ReadData_len, brp_mempool *mempool);
47 brp_errcode brp_I2c_Write(brp_protocol protocol, unsigned Address, brp_buf WriteData, size_t WriteData_len);
60 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);
61 #endif
62 
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23
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.
Definition: protocol.h:34
brp_errcode brp_I2c_SetSpeed(brp_protocol protocol, bool FastMode)
Set speed of I2C interface.
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:27
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.
Definition: common.h:61