Go to the documentation of this file.
99 assert(callbackParam);
112 assert(callbackParam);
198 const uint8_t *txBuff,
254 i2cMasterHandle->
callback = callback;
317 i2cSlaveHandle->
callback = callback;
static hal_i2c_status_t HAL_I2cGetStatus(status_t status)
i2c slave state structure.
void LPI2C_MasterGetDefaultConfig(lpi2c_master_config_t *masterConfig)
Provides a default configuration for the LPI2C master peripheral.
static void HAL_I2cSlaveCallback(LPI2C_Type *base, lpi2c_slave_transfer_t *xfer, void *callbackParam)
struct _hal_i2c_master hal_i2c_master_t
i2c master state structure.
hal_i2c_slave_transfer_event_t event
static LPI2C_Type *const s_i2cBases[]
Pointers to i2c bases for each instance.
hal_i2c_status_t HAL_I2cSlaveInit(hal_i2c_slave_handle_t handle, const hal_i2c_slave_config_t *config)
Initializes the HAL I2C peripheral.
void LPI2C_SlaveDeinit(LPI2C_Type *base)
Deinitializes the LPI2C slave peripheral.
enum _hal_i2c_slave_transfer_event hal_i2c_slave_transfer_event_t
Set of events sent to the callback for nonblocking slave transfers.
hal_i2c_slave_transfer_callback_t callback
hal_i2c_direction_t direction
void LPI2C_MasterDeinit(LPI2C_Type *base)
Deinitializes the LPI2C master peripheral.
void LPI2C_MasterTransferCreateHandle(LPI2C_Type *base, lpi2c_master_handle_t *handle, lpi2c_master_transfer_callback_t callback, void *userData)
Creates a new handle for the LPI2C master non-blocking APIs.
hal_i2c_status_t HAL_I2cSlaveDeinit(hal_i2c_slave_handle_t handle)
De-initializes the HAL I2C slave peripheral. Calling this API gates the HAL I2C clock....
hal_i2c_status_t HAL_I2cMasterTransferGetCount(hal_i2c_master_handle_t handle, size_t *count)
Gets the master transfer status during a interrupt non-blocking transfer.
HAL I2C slave user configuration.
hal_i2c_status_t HAL_I2cSlaveWriteBlocking(hal_i2c_slave_handle_t handle, const uint8_t *txBuff, size_t txSize)
Performs a polling send transaction on the HAL I2C bus.
void LPI2C_SlaveGetDefaultConfig(lpi2c_slave_config_t *slaveConfig)
Provides a default configuration for the LPI2C slave peripheral.
Structure with settings to initialize the LPI2C master module.
hal_i2c_status_t HAL_I2cSlaveTransferGetCount(hal_i2c_slave_handle_t handle, size_t *count)
Gets the slave transfer remaining bytes during a interrupt non-blocking transfer.
lpi2c_master_handle_t hardwareHandle
@ kStatus_LPI2C_ArbitrationLost
Driver handle for master non-blocking APIs.
HAL I2C slave transfer structure.
HAL I2C master user configuration.
@ kStatus_HAL_I2cArbitrationLost
hal_i2c_status_t HAL_I2cMasterTransferInstallCallback(hal_i2c_master_handle_t handle, hal_i2c_master_transfer_callback_t callback, void *callbackParam)
Installs a callback and callback parameter.
enum _hal_i2c_status hal_i2c_status_t
HAL I2C status.
hal_i2c_status_t HAL_I2cMasterWriteBlocking(hal_i2c_master_handle_t handle, const uint8_t *txBuff, size_t txSize, uint32_t flags)
Performs a polling send transaction on the HAL I2C bus.
hal_i2c_status_t HAL_I2cSlaveTransferNonBlocking(hal_i2c_slave_handle_t handle, uint32_t eventMask)
Starts accepting slave transfers.
void LPI2C_SlaveTransferCreateHandle(LPI2C_Type *base, lpi2c_slave_handle_t *handle, lpi2c_slave_transfer_callback_t callback, void *userData)
Creates a new handle for the LPI2C slave non-blocking APIs.
hal_i2c_status_t HAL_I2cSlaveTransferInstallCallback(hal_i2c_slave_handle_t handle, hal_i2c_slave_transfer_callback_t callback, void *callbackParam)
Installs a callback and callback parameter.
hal_i2c_status_t HAL_I2cSlaveReadBlocking(hal_i2c_slave_handle_t handle, uint8_t *rxBuff, size_t rxSize)
Performs a polling receive transaction on the HAL I2C bus.
lpi2c_direction_t direction
void LPI2C_SlaveInit(LPI2C_Type *base, const lpi2c_slave_config_t *slaveConfig, uint32_t sourceClock_Hz)
Initializes the LPI2C slave peripheral.
hal_i2c_status_t HAL_I2cMasterInit(hal_i2c_master_handle_t handle, const hal_i2c_master_config_t *config)
Initializes the HAL I2C master peripheral.
static void HAL_I2cMasterCallback(LPI2C_Type *base, lpi2c_master_handle_t *handle, status_t status, void *callbackParam)
#define HAL_I2C_SLAVE_HANDLE_SIZE
HAL I2C slave handle size.
void * hal_i2c_slave_handle_t
HAL I2C slave handle.
LPI2C slave handle structure.
struct _hal_i2c_slave hal_i2c_slave_t
i2c slave state structure.
Structure with settings to initialize the LPI2C slave module.
hal_i2c_status_t HAL_I2cMasterTransferBlocking(hal_i2c_master_handle_t handle, hal_i2c_master_transfer_t *xfer)
Performs a master polling transfer on the HAL I2C bus.
hal_i2c_slave_transfer_t transfer
status_t LPI2C_MasterTransferNonBlocking(LPI2C_Type *base, lpi2c_master_handle_t *handle, lpi2c_master_transfer_t *transfer)
Performs a non-blocking transaction on the I2C bus.
status_t LPI2C_MasterTransferGetCount(LPI2C_Type *base, lpi2c_master_handle_t *handle, size_t *count)
Returns number of bytes transferred so far.
hal_i2c_status_t HAL_I2cMasterTransferAbort(hal_i2c_master_handle_t handle)
Aborts an interrupt non-blocking transfer early.
hal_i2c_status_t HAL_I2cSlaveTransferAbort(hal_i2c_slave_handle_t handle)
Aborts the slave transfer.
status_t LPI2C_SlaveTransferGetCount(LPI2C_Type *base, lpi2c_slave_handle_t *handle, size_t *count)
Gets the slave transfer status during a non-blocking transfer.
hal_i2c_status_t HAL_I2cMasterTransferNonBlocking(hal_i2c_master_handle_t handle, hal_i2c_master_transfer_t *xfer)
Performs a master interrupt non-blocking transfer on the HAL I2C bus.
hal_i2c_status_t HAL_I2cMasterDeinit(hal_i2c_master_handle_t handle)
De-initializes the HAL I2C master peripheral. Call this API to gate the HAL I2C clock....
status_t completionStatus
#define HAL_I2C_MASTER_HANDLE_SIZE
HAL I2C master handle size.
lpi2c_slave_handle_t hardwareHandle
i2c master state structure.
void LPI2C_MasterTransferAbort(LPI2C_Type *base, lpi2c_master_handle_t *handle)
Terminates a non-blocking LPI2C master transmission early.
lpi2c_slave_transfer_event_t event
status_t LPI2C_MasterTransferBlocking(LPI2C_Type *base, lpi2c_master_transfer_t *transfer)
Performs a master polling transfer on the I2C bus.
static sai_transceiver_t config
void LPI2C_MasterInit(LPI2C_Type *base, const lpi2c_master_config_t *masterConfig, uint32_t sourceClock_Hz)
Initializes the LPI2C master peripheral.
LPI2C slave transfer structure.
hal_i2c_status_t completionStatus
void(* hal_i2c_master_transfer_callback_t)(hal_i2c_master_handle_t handle, hal_i2c_status_t completionStatus, void *callbackParam)
Master completion callback function pointer type.
void * hal_i2c_master_handle_t
HAL I2C master handle.
int32_t status_t
Type used for all status and error return values.
HAL I2C master transfer structure.
hal_i2c_status_t HAL_I2cMasterReadBlocking(hal_i2c_master_handle_t handle, uint8_t *rxBuff, size_t rxSize, uint32_t flags)
Performs a polling receive transaction on the HAL I2C bus.
void LPI2C_SlaveTransferAbort(LPI2C_Type *base, lpi2c_slave_handle_t *handle)
Aborts the slave non-blocking transfers.
Non-blocking transfer descriptor structure.
void(* hal_i2c_slave_transfer_callback_t)(hal_i2c_slave_handle_t handle, hal_i2c_slave_transfer_t *transfer, void *callbackParam)
Slave event callback function pointer type.
status_t LPI2C_SlaveTransferNonBlocking(LPI2C_Type *base, lpi2c_slave_handle_t *handle, uint32_t eventMask)
Starts accepting slave transfers.
hal_i2c_master_transfer_callback_t callback