286 #ifndef ti_drivers_I2C__include 287 #define ti_drivers_I2C__include 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)) 640 #define I2C_BASE_OBJECT \ 642 I2C_TransferMode transferMode; \ 643 I2C_CallbackFxn transferCallbackFxn; \ 644 I2C_Transaction *currentTransaction; \ 647 I2C_Transaction *volatile headPtr; \ 648 I2C_Transaction *tailPtr; \ 652 SemaphoreP_Struct mutex; \ 653 SemaphoreP_Struct transferComplete; \ 656 const uint8_t *writeBuf; \ 676 #define I2C_BASE_HWATTRS \ 694 uint32_t intPriority; 773 extern void I2C_close(I2C_Handle handle);
796 extern int_fast16_t
I2C_control(I2C_Handle handle, uint_fast16_t cmd,
void *controlArg);
I2C_AddressMode addressMode
Definition: I2C.h:633
ADC_Params params
Definition: Driver_Init.h:11
void * writeBuf
Definition: I2C.h:422
void * arg
Definition: I2C.h:470
I2C_TransferMode transferMode
Definition: I2C.h:610
void * object
Definition: I2C.h:717
void * readBuf
Definition: I2C.h:444
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:575
struct I2C_Config_ * I2C_Handle
A handle that is returned from an I2C_open() call.
Definition: I2C.h:405
void I2C_setAddressMode(I2C_Handle handle, I2C_AddressMode addressMode)
Set the I2C address mode.
void const * hwAttrs
Definition: I2C.h:721
int_fast16_t I2C_control(I2C_Handle handle, uint_fast16_t cmd, void *controlArg)
Function performs implementation specific features on a driver instance.
I2C_AddressMode
Address mode for an I2C driver instance specified selected by I2C_setAddressMode() ...
Definition: I2C.h:593
const I2C_Config I2C_config[]
I2C_TransferMode
Return behavior of I2C_Transfer() specified in the I2C_Params.
Definition: I2C.h:514
I2C_CallbackFxn transferCallbackFxn
Definition: I2C.h:616
Semaphore module for the RTOS Porting Interface.
I2C_Handle I2C_open(uint_least8_t index, I2C_Params *params)
Open an I2C driver instance.
I2C_BitRate bitRate
Definition: I2C.h:622
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:607
struct I2C_Config_ I2C_Config
I2C driver's custom configuration structure.
uint_least16_t targetAddress
Definition: I2C.h:498
void I2C_cancel(I2C_Handle handle)
Cancels all I2C transfers.
void * custom
Definition: I2C.h:636
I2C driver's custom configuration structure.
Definition: I2C.h:714
void(* I2C_CallbackFxn)(I2C_Handle handle, I2C_Transaction *transaction, bool transferStatus)
The definition of a callback function.
Definition: I2C.h:565
void I2C_init(void)
Function to initialize the I2C driver.
volatile int_fast16_t status
Definition: I2C.h:490
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 target peripheral.
Hardware Interrupt module for the RTOS Porting Interface.
size_t writeCount
Definition: I2C.h:438
const uint_least8_t I2C_count
size_t readCount
Definition: I2C.h:458
int_fast16_t I2C_transferTimeout(I2C_Handle handle, I2C_Transaction *transaction, uint32_t timeout)
Perform an I2C transaction with an I2C target peripheral.