Go to the documentation of this file.
9 #ifndef __HAL_I2C_ADAPTER_H__
10 #define __HAL_I2C_ADAPTER_H__
21 #define HAL_I2C_MASTER_HANDLE_SIZE (80U)
24 #define HAL_I2C_SLAVE_HANDLE_SIZE (88U)
146 #define HAL_I2C_MASTER_HANDLE_DEFINE(name) \
147 uint32_t name[(HAL_I2C_MASTER_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t)]
164 #define HAL_I2C_SLAVE_HANDLE_DEFINE(name) \
165 uint32_t name[(HAL_I2C_SLAVE_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t)]
179 void *callbackParam);
193 void *callbackParam);
199 #if defined(__cplusplus)
311 const uint8_t *txBuff,
395 void *callbackParam);
449 void *callbackParam);
497 #if defined(__cplusplus)
hal_i2c_slave_transfer_event_t event
hal_i2c_status_t HAL_I2cSlaveInit(hal_i2c_slave_handle_t handle, const hal_i2c_slave_config_t *config)
Initializes the HAL I2C 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_master_transfer_flag
I2C transfer control flag.
hal_i2c_direction_t direction
@ kHAL_I2cSlaveTransmitEvent
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....
@ kHAL_I2cTransferNoStopFlag
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.
enum _hal_i2c_master_transfer_flag hal_i2c_master_transfer_flag_t
I2C transfer control flag.
struct _hal_i2c_slave_transfer hal_i2c_slave_transfer_t
HAL I2C slave transfer structure.
enum _hal_i2c_direction hal_i2c_direction_t
Direction of master and slave transfers.
struct _hal_i2c_master_transfer hal_i2c_master_transfer_t
HAL I2C master transfer structure.
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.
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.
@ kHAL_I2cSlaveTransmitAckEvent
HAL I2C slave transfer structure.
HAL I2C master user configuration.
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
struct _hal_i2c_slave_config hal_i2c_slave_config_t
HAL I2C slave user configuration.
_hal_i2c_direction
Direction of master and slave transfers.
@ kHAL_I2cSlaveAddressMatchEvent
@ 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.
struct _hal_i2c_master_config hal_i2c_master_config_t
HAL I2C master user configuration.
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.
@ kHAL_I2cSlaveReceiveEvent
hal_i2c_status_t HAL_I2cSlaveTransferNonBlocking(hal_i2c_slave_handle_t handle, uint32_t eventMask)
Starts accepting slave transfers.
_hal_i2c_status
HAL I2C status.
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.
@ kHAL_I2cSlaveStartEvent
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.
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.
void * hal_i2c_slave_handle_t
HAL I2C slave handle.
@ kStatus_HAL_I2cAddrressNak
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.
@ kHAL_I2cTransferNoStartFlag
@ kHAL_I2cTransferRepeatedStartFlag
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.
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.
@ kHAL_I2cTransferDefaultFlag
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....
static sai_transceiver_t config
@ kHAL_I2cSlaveCompletionEvent
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.
_hal_i2c_slave_transfer_event
Set of events sent to the callback for nonblocking slave transfers.
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(* 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.
@ kHAL_I2cSlaveGenaralcallEvent