273 #ifndef ti_drivers_I2C__include 274 #define ti_drivers_I2C__include 305 #define I2C_CMD_RESERVED (32) 320 #define I2C_STATUS_RESERVED (-32) 333 #define I2C_STATUS_SUCCESS (0) 338 #define I2C_STATUS_ERROR (-1) 343 #define I2C_STATUS_TIMEOUT (-2) 349 #define I2C_STATUS_UNDEFINEDCMD (-2) 369 #define I2C_WAIT_FOREVER (~(0U)) 509 bool transferStatus);
560 typedef void (*I2C_CancelFxn) (I2C_Handle handle);
567 typedef void (*I2C_CloseFxn) (I2C_Handle handle);
574 typedef int_fast16_t (*I2C_ControlFxn) (I2C_Handle handle, uint_fast16_t cmd,
582 typedef void (*I2C_InitFxn) (I2C_Handle handle);
596 typedef int_fast16_t (*I2C_TransferFxn) (I2C_Handle handle,
605 I2C_CancelFxn cancelFxn;
606 I2C_CloseFxn closeFxn;
607 I2C_ControlFxn controlFxn;
610 I2C_TransferFxn transferFxn;
663 extern void I2C_close(I2C_Handle handle);
686 extern int_fast16_t
I2C_control(I2C_Handle handle, uint_fast16_t cmd,
void * writeBuf
Definition: I2C.h:386
void * arg
Definition: I2C.h:442
I2C_TransferMode transferMode
Definition: I2C.h:537
void * object
Definition: I2C.h:626
void * readBuf
Definition: I2C.h:408
void I2C_Params_init(I2C_Params *params)
Initialize an I2C_Params structure to its default values.
I2C_BitRate
Bit rate for an I2C driver instance specified in the I2C_Params.
Definition: I2C.h:519
struct I2C_Config_ * I2C_Handle
A handle that is returned from an I2C_open() call.
Definition: I2C.h:374
void const * hwAttrs
Definition: I2C.h:630
int_fast16_t I2C_control(I2C_Handle handle, uint_fast16_t cmd, void *controlArg)
Function performs implementation specific features on a driver instance.
I2C_TransferMode
Return behavior of I2C_Transfer() specified in the I2C_Params.
Definition: I2C.h:458
I2C_CallbackFxn transferCallbackFxn
Definition: I2C.h:543
I2C_Handle I2C_open(uint_least8_t index, I2C_Params *params)
Open an I2C driver instance.
The definition of an I2C function table that contains the required set of functions to control a spec...
Definition: I2C.h:604
I2C_BitRate bitRate
Definition: I2C.h:549
void I2C_close(I2C_Handle handle)
Function to close an I2C driver instance.
I2C parameters used with I2C_open().
Definition: I2C.h:535
struct I2C_Config_ I2C_Config
I2C driver's custom configuration structure.
uint_least8_t slaveAddress
Definition: I2C.h:430
void I2C_cancel(I2C_Handle handle)
Cancels all I2C transfers.
void * custom
Definition: I2C.h:552
I2C driver's custom configuration structure.
Definition: I2C.h:620
void(* I2C_CallbackFxn)(I2C_Handle handle, I2C_Transaction *transaction, bool transferStatus)
The definition of a callback function.
Definition: I2C.h:508
void I2C_init(void)
Function to initialize the I2C driver.
I2C_FxnTable const * fxnTablePtr
Definition: I2C.h:623
Defines a transaction to be used with I2C_transfer()
Definition: I2C.h:381
bool I2C_transfer(I2C_Handle handle, I2C_Transaction *transaction)
Perform an I2C transaction with an I2C slave peripheral.
size_t writeCount
Definition: I2C.h:402
size_t readCount
Definition: I2C.h:422
int_fast16_t I2C_transferTimeout(I2C_Handle handle, I2C_Transaction *transaction, uint32_t timeout)
Perform an I2C transaction with an I2C slave peripheral.