157 #define I2C_CMD_RESERVED 32 164 #define I2C_CMD_PROBE (0U) 172 #define I2C_CMD_SET_BUS_FREQUENCY (1U) 180 #define I2C_CMD_RECOVER_BUS (2U) 189 #define I2C_CMD_SMBUS_TYPE (3U) 203 #define I2C_STATUS_RESERVED (-((int32_t)32)) 211 #define I2C_STATUS_SUCCESS ((int32_t)(0)) 219 #define I2C_STATUS_ERROR (-((int32_t)1)) 228 #define I2C_STATUS_UNDEFINEDCMD (-((int32_t)2)) 236 #define I2C_STS_SUCCESS ((int16_t)(1)) 244 #define I2C_STS_RESTART ((int16_t)(2)) 251 #define I2C_STS_ERR ((int16_t)(0)) 259 #define I2C_STS_ERR_TIMEOUT (-(int16_t)(1)) 263 #define I2C_STS_ERR_BUS_BUSY (-(int16_t)(2)) 267 #define I2C_STS_ERR_NO_ACK (-(int16_t)(3)) 271 #define I2C_STS_ERR_ARBITRATION_LOST (-(int16_t)(4)) 275 #define I2C_STS_ERR_ACCESS_ERROR (-(int16_t)(5)) 279 #define I2C_STS_ERR_COMMAND_FAILURE (-(int16_t)(6)) 283 #define I2C_STS_ERR_INVALID_COMMAND (-(int16_t)(7)) 299 #define I2C_TRANS_VALID_PARAM_MASTER_MODE (0x00000001U) 300 #define I2C_TRANS_VALID_PARAM_EXPAND_SA (0x00000002U) 327 typedef struct I2C_Transaction_s {
366 typedef enum I2C_TransferMode_e {
397 typedef enum I2C_BitRate_e {
424 typedef struct I2C_Params_s {
438 #define I2C_WAIT_FOREVER (~((uint32_t)0U)) 479 typedef struct I2C_FxnTable_s {
507 typedef struct I2C_Config_s {
518 #define I2C_MAX_CONFIG_CNT (14U) void * arg
Definition: I2C.h:350
I2C_InitFxn initFxn
Definition: I2C.h:487
void * custom
Definition: I2C.h:431
void I2C_close(I2C_Handle i2cHnd)
Function to close a I2C peripheral specified by the I2C handle.
I2C Parameters.
Definition: I2C.h:424
void I2C_init(void)
Function to initializes the I2C module.
void * nextPtr
Definition: I2C.h:351
I2C_TransferFxn transferFxn
Definition: I2C.h:493
I2C_Handle(* I2C_OpenFxn)(I2C_Handle handle, const I2C_Params *params)
A function pointer to a driver specific implementation of I2C_open().
Definition: I2C.h:464
int32_t I2C_control(I2C_Handle i2cHnd, uint32_t cmd, void *arg)
Function performs implementation specific features on a given I2C_Handle.
I2C_BitRate bitRate
Definition: I2C.h:430
I2C_Config I2C_config_list[I2C_MAX_CONFIG_CNT]
Definition: I2C.h:519
I2C_CloseFxn closeFxn
Definition: I2C.h:481
void * writeBuf
Definition: I2C.h:332
uint32_t validParams
Definition: I2C.h:328
I2C_TransferMode
I2C transfer mode.
Definition: I2C.h:366
void const * hwAttrs
Definition: I2C.h:515
void * object
Definition: I2C.h:512
uint32_t timeout
Definition: I2C.h:352
int16_t I2C_transfer(I2C_Handle i2cHnd, I2C_Transaction *transaction)
Function that handles the I2C transfer for SYS/BIOS.
uint32_t slaveAddress
Definition: I2C.h:344
int16_t(* I2C_TransferFxn)(I2C_Handle handle, I2C_Transaction *transaction)
A function pointer to a driver specific implementation of I2C_transfer().
Definition: I2C.h:471
void I2C_Params_init(I2C_Params *params)
Function to initialize the I2C_Params struct to its defaults.
I2C_Handle I2C_open(uint32_t idx, I2C_Params *params)
Function to initialize a given I2C peripheral specified by the particular index value....
bool expandSA
Definition: I2C.h:355
I2C Global configuration.
Definition: I2C.h:507
void(* I2C_InitFxn)(I2C_Handle handle)
A function pointer to a driver specific implementation of I2C_init().
Definition: I2C.h:458
gptp_ipc_command_t cmd
Definition: gptpipc.h:140
#define I2C_MAX_CONFIG_CNT
Definition: I2C.h:518
size_t readCount
Definition: I2C.h:341
size_t writeCount
Definition: I2C.h:335
struct I2C_Config_s * I2C_Handle
A handle that is returned from a I2C_open() call.
Definition: I2C.h:288
void * readBuf
Definition: I2C.h:338
bool masterMode
Definition: I2C.h:354
void(* I2C_CloseFxn)(I2C_Handle handle)
A function pointer to a driver specific implementation of I2C_close().
Definition: I2C.h:444
int32_t(* I2C_ControlFxn)(I2C_Handle handle, uint32_t cmd, void *arg)
A function pointer to a driver specific implementation of I2C_control().
Definition: I2C.h:450
void(* I2C_CallbackFxn)(I2C_Handle handle, I2C_Transaction *msg, int16_t transferStatus)
I2C callback function.
Definition: I2C.h:389
I2C_FxnTable const * fxnTablePtr
Definition: I2C.h:509
void I2C_transactionInit(I2C_Transaction *transaction)
I2C_TransferMode transferMode
Definition: I2C.h:425
I2C_BitRate
I2C bitRate.
Definition: I2C.h:397
I2C_OpenFxn openFxn
Definition: I2C.h:490
The definition of a I2C function table that contains the required set of functions to control a speci...
Definition: I2C.h:479
I2C_ControlFxn controlFxn
Definition: I2C.h:484