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> 298 #ifdef ENABLE_LEGACY_TERMINOLOGY 327 #define I2C_STATUS_RESERVED (-32) 333 #define I2C_STATUS_QUEUED (1) 338 #define I2C_STATUS_SUCCESS (0) 343 #define I2C_STATUS_ERROR (-1) 349 #define I2C_STATUS_UNDEFINEDCMD (-2) 354 #define I2C_STATUS_TIMEOUT (-3) 359 #define I2C_STATUS_CLOCK_TIMEOUT (-4) 364 #define I2C_STATUS_ADDR_NACK (-5) 369 #define I2C_STATUS_DATA_NACK (-6) 374 #define I2C_STATUS_ARB_LOST (-7) 379 #define I2C_STATUS_INCOMPLETE (-8) 385 #define I2C_STATUS_BUS_BUSY (-9) 390 #define I2C_STATUS_CANCEL (-10) 399 #define I2C_STATUS_INVALID_TRANS (-11) 405 #define I2C_WAIT_FOREVER (~(0U)) 619 #define I2C_BASE_OBJECT \ 621 I2C_TransferMode transferMode; \ 622 I2C_CallbackFxn transferCallbackFxn; \ 623 I2C_Transaction *currentTransaction; \ 626 I2C_Transaction *volatile headPtr; \ 627 I2C_Transaction *tailPtr; \ 631 SemaphoreP_Struct mutex; \ 632 SemaphoreP_Struct transferComplete; \ 635 const uint8_t *writeBuf; \ 655 #define I2C_BASE_HWATTRS \ 673 uint32_t intPriority; 752 extern void I2C_close(I2C_Handle handle);
775 extern int_fast16_t
I2C_control(I2C_Handle handle, uint_fast16_t cmd,
void *controlArg);
ADC_Params params
Definition: Driver_Init.h:11
void * writeBuf
Definition: I2C.h:427
void * arg
Definition: I2C.h:475
I2C_TransferMode transferMode
Definition: I2C.h:600
void * object
Definition: I2C.h:696
void * readBuf
Definition: I2C.h:449
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:580
struct I2C_Config_ * I2C_Handle
A handle that is returned from an I2C_open() call.
Definition: I2C.h:410
void const * hwAttrs
Definition: I2C.h:700
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[]
uint_least8_t targetAddress
Definition: I2C.h:503
I2C_TransferMode
Return behavior of I2C_Transfer() specified in the I2C_Params.
Definition: I2C.h:519
I2C_CallbackFxn transferCallbackFxn
Definition: I2C.h:606
I2C_Handle I2C_open(uint_least8_t index, I2C_Params *params)
Open an I2C driver instance.
I2C_BitRate bitRate
Definition: I2C.h:612
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:597
struct I2C_Config_ I2C_Config
I2C driver's custom configuration structure.
void I2C_cancel(I2C_Handle handle)
Cancels all I2C transfers.
void * custom
Definition: I2C.h:615
I2C driver's custom configuration structure.
Definition: I2C.h:693
void(* I2C_CallbackFxn)(I2C_Handle handle, I2C_Transaction *transaction, bool transferStatus)
The definition of a callback function.
Definition: I2C.h:570
void I2C_init(void)
Function to initialize the I2C driver.
volatile int_fast16_t status
Definition: I2C.h:495
Defines a transaction to be used with I2C_transfer() or I2C_transferTimeout()
Definition: I2C.h:421
bool I2C_transfer(I2C_Handle handle, I2C_Transaction *transaction)
Perform an I2C transaction with an I2C target peripheral.
size_t writeCount
Definition: I2C.h:443
const uint_least8_t I2C_count
size_t readCount
Definition: I2C.h:463
Provide a translation layer for legacy terminology.
int_fast16_t I2C_transferTimeout(I2C_Handle handle, I2C_Transaction *transaction, uint32_t timeout)
Perform an I2C transaction with an I2C target peripheral.