286 #ifndef ti_drivers_I2C__include 287 #define ti_drivers_I2C__include 294 #include <ti/drivers/dpl/HwiP.h> 295 #include <ti/drivers/dpl/SemaphoreP.h> 322 #define I2C_STATUS_RESERVED (-32) 328 #define I2C_STATUS_QUEUED (1) 333 #define I2C_STATUS_SUCCESS (0) 338 #define I2C_STATUS_ERROR (-1) 344 #define I2C_STATUS_UNDEFINEDCMD (-2) 349 #define I2C_STATUS_TIMEOUT (-3) 354 #define I2C_STATUS_CLOCK_TIMEOUT (-4) 359 #define I2C_STATUS_ADDR_NACK (-5) 364 #define I2C_STATUS_DATA_NACK (-6) 369 #define I2C_STATUS_ARB_LOST (-7) 374 #define I2C_STATUS_INCOMPLETE (-8) 380 #define I2C_STATUS_BUS_BUSY (-9) 385 #define I2C_STATUS_CANCEL (-10) 394 #define I2C_STATUS_INVALID_TRANS (-11) 400 #define I2C_WAIT_FOREVER (~(0U)) 564 bool transferStatus);
611 #define I2C_BASE_OBJECT \ 613 I2C_TransferMode transferMode; \ 614 I2C_CallbackFxn transferCallbackFxn; \ 615 I2C_Transaction *currentTransaction; \ 618 I2C_Transaction * volatile headPtr; \ 619 I2C_Transaction *tailPtr; \ 623 SemaphoreP_Struct mutex; \ 624 SemaphoreP_Struct transferComplete; \ 627 const uint8_t *writeBuf; \ 646 #define I2C_BASE_HWATTRS \ 664 uint32_t intPriority; ADC_Params params
Definition: Driver_Init.h:11
void * writeBuf
Definition: I2C.h:421
void * arg
Definition: I2C.h:469
I2C_TransferMode transferMode
Definition: I2C.h:592
void * object
Definition: I2C.h:685
void * readBuf
Definition: I2C.h:443
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:574
struct I2C_Config_ * I2C_Handle
A handle that is returned from an I2C_open() call.
Definition: I2C.h:405
void const * hwAttrs
Definition: I2C.h:689
int_fast16_t I2C_control(I2C_Handle handle, uint_fast16_t cmd, void *controlArg)
Function performs implementation specific features on a driver instance.
const I2C_Config I2C_config[]
I2C_TransferMode
Return behavior of I2C_Transfer() specified in the I2C_Params.
Definition: I2C.h:513
I2C_CallbackFxn transferCallbackFxn
Definition: I2C.h:598
I2C_Handle I2C_open(uint_least8_t index, I2C_Params *params)
Open an I2C driver instance.
I2C_BitRate bitRate
Definition: I2C.h:604
void I2C_close(I2C_Handle handle)
Function to close an I2C driver instance.
int_fast16_t I2C_setClockTimeout(I2C_Handle handle, uint32_t timeout)
Set the I2C SCL clock timeout.
I2C parameters used with I2C_open().
Definition: I2C.h:590
struct I2C_Config_ I2C_Config
I2C driver's custom configuration structure.
uint_least8_t slaveAddress
Definition: I2C.h:497
void I2C_cancel(I2C_Handle handle)
Cancels all I2C transfers.
void * custom
Definition: I2C.h:607
I2C driver's custom configuration structure.
Definition: I2C.h:683
void(* I2C_CallbackFxn)(I2C_Handle handle, I2C_Transaction *transaction, bool transferStatus)
The definition of a callback function.
Definition: I2C.h:563
void I2C_init(void)
Function to initialize the I2C driver.
volatile int_fast16_t status
Definition: I2C.h:489
Defines a transaction to be used with I2C_transfer() or I2C_transferTimeout()
Definition: I2C.h:416
bool I2C_transfer(I2C_Handle handle, I2C_Transaction *transaction)
Perform an I2C transaction with an I2C slave peripheral.
size_t writeCount
Definition: I2C.h:437
const uint_least8_t I2C_count
size_t readCount
Definition: I2C.h:457
int_fast16_t I2C_transferTimeout(I2C_Handle handle, I2C_Transaction *transaction, uint32_t timeout)
Perform an I2C transaction with an I2C slave peripheral.