1 #ifndef DRIVER_I2C_MASTER_H 2 #define DRIVER_I2C_MASTER_H 41 #include <hal/nrf_twi.h> 88 I2C_BUS_HUNG_SDA_LOW = (1 << 0),
89 I2C_ADDRESS_NAK = (1 << 1),
90 I2C_DATA_NACK = (1 << 2),
91 I2C_UNEXPECTED_STOP = (1 << 3),
173 uint8_t SlaveAddress,
174 const void *SrcBuffer,
219 const void* SrcBuffer, uint8_t SrcCount,
220 void* DstBuffer, uint8_t DstCount,
225 DstBuffer, DstCount, Callback, CallbackData))
256 uint8_t SlaveAddress,
257 const void *SrcBuffer,
275 #endif //DRIVER_I2C_MASTER_H
bool I2cMasterAsyncWait(const struct i2c_t *I2cMaster, uint8_t SlaveAddress, const void *SrcBuffer, uint8_t SrcCount, void *DstBuffer, uint8_t DstCount, i2c_completion_callback_t Callback, void *CallbackData, struct work_t *Work)
Name: I2cMasterAsyncWait Setup the microcontroller to I2C master based on the i2c_t structure (slave ...
i2c_completion_callback_t CompletionCallback
void I2cMasterSchedule(const struct i2c_t *I2cMaster, struct work_t *Work)
Name: I2cMasterSchedule Schedule work when I2C bus becomes available. In case the bus is already free...
void I2cMasterInit(const struct i2c_t *I2cMaster)
Name: I2cMasterInit Initialize the driver. Function must be called before driver use.
The code implements Dummy Headed Doubly Linked Circularlist (DHDLC) primitive.
void I2cBusReset(const struct i2c_t *I2cMaster)
Name: I2cBusReset Reset the bus (clock through a bus hung)
bool I2cMaster(const struct i2c_t *I2cMaster, uint8_t SlaveAddress, const void *SrcBuffer, uint16_t SrcCount, void *DstBuffer, uint16_t DstCount)
Name: I2cMaster Setup the microcontroller to I2C master based on the i2c_t structure (slave not suppo...
void * CompletionCallbackData
struct i2c_state_t * State
Header file for the EVE work scheduling.
void I2cMasterInterruptHandler(const struct i2c_t *I2cMaster)
Name: I2cInterruptHandler I2C master interrupt handler Called from board.c at hardware interrupt cont...
struct dlist_t PendingI2cWorks
bool I2cMasterAsync(const struct i2c_t *I2cMaster, uint8_t SlaveAddress, const void *SrcBuffer, uint8_t SrcCount, void *DstBuffer, uint8_t DstCount, i2c_completion_callback_t Callback, void *CallbackData)
Name: I2cMasterAsync Setup the microcontroller to I2C master based on the i2c_t structure (slave not ...
void(* i2c_completion_callback_t)(const struct i2c_t *I2c, uint8_t ErrorMask, void *Data)