139 #ifndef ti_drivers_I2CSLAVE__include 140 #define ti_drivers_I2CSLAVE__include 166 #define I2CSLAVE_CMD_RESERVED (32) 180 #define I2CSLAVE_STATUS_RESERVED (-32) 194 #define I2CSLAVE_STATUS_SUCCESS (0) 202 #define I2CSLAVE_STATUS_ERROR (-1) 211 #define I2CSLAVE_STATUS_UNDEFINEDCMD (-2) 240 I2CSLAVE_IDLE_MODE = 0,
241 I2CSLAVE_WRITE_MODE = 1,
242 I2CSLAVE_READ_MODE = 2,
243 I2CSLAVE_START_MODE = 3,
244 I2CSLAVE_ERROR = 0xFF
322 typedef void (*I2CSlave_CloseFxn) (I2CSlave_Handle handle);
329 typedef int_fast16_t (*I2CSlave_ControlFxn) (I2CSlave_Handle handle,
338 typedef void (*I2CSlave_InitFxn) (I2CSlave_Handle handle);
353 typedef bool (*I2CSlave_WriteFxn) (I2CSlave_Handle handle,
354 const void *buffer,
size_t size);
362 typedef bool (*I2CSlave_ReadFxn) (I2CSlave_Handle handle,
void *buffer,
373 I2CSlave_CloseFxn closeFxn;
376 I2CSlave_ControlFxn controlFxn;
379 I2CSlave_InitFxn initFxn;
382 I2CSlave_OpenFxn openFxn;
385 I2CSlave_ReadFxn readFxn;
388 I2CSlave_WriteFxn writeFxn;
441 extern int_fast16_t
I2CSlave_control(I2CSlave_Handle handle, uint_fast16_t cmd,
509 extern bool I2CSlave_read(I2CSlave_Handle handle,
void *buffer,
537 extern bool I2CSlave_write(I2CSlave_Handle handle,
const void *buffer,
struct I2CSlave_Config_ * I2CSlave_Handle
A handle that is returned from a I2CSlave_open() call.
Definition: I2CSlave.h:231
struct I2CSlave_Config_ I2CSlave_Config
I2C Slave driver's custom configuration structure.
I2CSlave_TransferMode
Return behavior of I2CSlave_write() and I2CSlave_read() specified in the I2CSlave_Params.
Definition: I2CSlave.h:253
void * object
Definition: I2CSlave.h:404
void I2CSlave_close(I2CSlave_Handle handle)
Function to close an I2CSlave driver instance.
bool I2CSlave_write(I2CSlave_Handle handle, const void *buffer, size_t size)
Perform an I2C write to an I2C master.
I2C Slave driver's custom configuration structure.
Definition: I2CSlave.h:398
I2CSlave_CallbackFxn transferCallbackFxn
Definition: I2CSlave.h:311
void const * hwAttrs
Definition: I2CSlave.h:408
int_fast16_t I2CSlave_control(I2CSlave_Handle handle, uint_fast16_t cmd, void *arg)
Function performs implementation specific features on a driver instance.
bool I2CSlave_read(I2CSlave_Handle handle, void *buffer, size_t size)
Perform an I2C read from an I2C master.
void(* I2CSlave_CallbackFxn)(I2CSlave_Handle handle, bool status)
The definition of a callback function.
Definition: I2CSlave.h:295
I2CSlave_FxnTable const * fxnTablePtr
Definition: I2CSlave.h:401
void * custom
Definition: I2CSlave.h:314
void I2CSlave_Params_init(I2CSlave_Params *params)
Initialize an I2CSlave_Params structure to its default values.
I2CSlave parameters used with I2CSlave_open().
Definition: I2CSlave.h:305
The definition of a I2CSlave function table that contains the required set of functions to control a ...
Definition: I2CSlave.h:371
I2CSlave_TransferMode transferMode
Definition: I2CSlave.h:307
Definition: I2CSlave.h:275
Definition: I2CSlave.h:266
void I2CSlave_init(void)
Function to initialize the I2C Slave driver.
I2CSlave_Handle I2CSlave_open(uint_least8_t index, I2CSlave_Params *params)
Function to initialize the I2CSlave peripheral.