290 #ifndef ti_drivers_I2C__include 291 #define ti_drivers_I2C__include 297 #include <ti/devices/msp/msp.h> 298 #include <ti/drivers/dpl/HwiP.h> 299 #include <ti/drivers/dpl/SemaphoreP.h> 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) 401 #define I2C_STATUS_INVALID_TRANS (-11) 407 #define I2C_WAIT_FOREVER (~(0U)) 616 #define I2C_BASE_OBJECT \ 618 I2C_TransferMode transferMode; \ 619 I2C_CallbackFxn transferCallbackFxn; \ 620 I2C_Transaction *currentTransaction; \ 623 I2C_Transaction *volatile headPtr; \ 624 I2C_Transaction *tailPtr; \ 628 SemaphoreP_Struct mutex; \ 629 SemaphoreP_Struct transferComplete; \ 632 const uint8_t *writeBuf; \ 651 #define I2C_BASE_HWATTRS \ 669 uint32_t intPriority; 776 I2C_Handle handle, uint_fast16_t cmd,
void *controlArg);
void * writeBuf
Definition: I2C.h:428
struct I2C_Config_ * I2C_Handle
A handle that is returned from an I2C_open() call.
Definition: I2C.h:412
void * arg
Definition: I2C.h:476
void I2C_Params_init(I2C_Params *params)
Initialize an I2C_Params structure to its default values.
I2C_TransferMode transferMode
Definition: I2C.h:597
void I2C_cancel(I2C_Handle handle)
Cancels all I2C transfers.
void * object
Definition: I2C.h:690
void * readBuf
Definition: I2C.h:450
I2C_Handle I2C_open(uint_least8_t index, I2C_Params *params)
Open an I2C driver instance.
void(* I2C_CallbackFxn)(I2C_Handle handle, I2C_Transaction *transaction, bool transferStatus)
The definition of a callback function.
Definition: I2C.h:570
void const * hwAttrs
Definition: I2C.h:694
I2C_TransferMode
Return behavior of I2C_Transfer() specified in the I2C_Params.
Definition: I2C.h:520
uint_least8_t targetAddress
Definition: I2C.h:504
I2C_CallbackFxn transferCallbackFxn
Definition: I2C.h:603
void I2C_close(I2C_Handle handle)
Function to close an I2C driver instance.
bool I2C_transfer(I2C_Handle handle, I2C_Transaction *transaction)
Perform an I2C transaction with an I2C target peripheral.
int_fast16_t I2C_control(I2C_Handle handle, uint_fast16_t cmd, void *controlArg)
Function performs implementation specific features on a driver instance.
void I2C_init(void)
Function to initialize the I2C driver.
I2C_BitRate bitRate
Definition: I2C.h:609
const I2C_Config I2C_config[]
Instance of I2C driver's configuration structure.
I2C parameters used with I2C_open().
Definition: I2C.h:595
int_fast16_t I2C_setClockTimeout(I2C_Handle handle, uint32_t timeout)
Set the I2C SCL clock timeout.
void * custom
Definition: I2C.h:612
int_fast16_t I2C_transferTimeout(I2C_Handle handle, I2C_Transaction *transaction, uint32_t timeout)
Perform an I2C transaction with an I2C target peripheral.
struct I2C_Config_ I2C_Config
I2C driver's configuration structure.
I2C driver's configuration structure.
Definition: I2C.h:688
const uint_least8_t I2C_count
Count of I2C instance.
volatile int_fast16_t status
Definition: I2C.h:496
Defines a transaction to be used with I2C_transfer() or I2C_transferTimeout().
Definition: I2C.h:423
size_t writeCount
Definition: I2C.h:444
I2C_BitRate
Bit rate for an I2C driver instance specified in the I2C_Params.
Definition: I2C.h:581
size_t readCount
Definition: I2C.h:464