Classes | Macros | Typedefs | Enumerations
i2c.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _hal_i2c_master_config
 HAL I2C master user configuration. More...
 
struct  _hal_i2c_master_transfer
 HAL I2C master transfer structure. More...
 
struct  _hal_i2c_slave_config
 HAL I2C slave user configuration. More...
 
struct  _hal_i2c_slave_transfer
 HAL I2C slave transfer structure. More...
 

Macros

#define HAL_I2C_MASTER_HANDLE_DEFINE(name)   uint32_t name[(HAL_I2C_MASTER_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t)]
 Defines the I2C master handle. More...
 
#define HAL_I2C_MASTER_HANDLE_SIZE   (80U)
 HAL I2C master handle size. More...
 
#define HAL_I2C_SLAVE_HANDLE_DEFINE(name)   uint32_t name[(HAL_I2C_SLAVE_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t)]
 Defines the I2C slave handle. More...
 
#define HAL_I2C_SLAVE_HANDLE_SIZE   (88U)
 HAL I2C slave handle size. More...
 

Typedefs

typedef enum _hal_i2c_direction hal_i2c_direction_t
 Direction of master and slave transfers. More...
 
typedef struct _hal_i2c_master_config hal_i2c_master_config_t
 HAL I2C master user configuration. More...
 
typedef void * hal_i2c_master_handle_t
 HAL I2C master handle. More...
 
typedef 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. More...
 
typedef enum _hal_i2c_master_transfer_flag hal_i2c_master_transfer_flag_t
 I2C transfer control flag. More...
 
typedef struct _hal_i2c_master_transfer hal_i2c_master_transfer_t
 HAL I2C master transfer structure. More...
 
typedef struct _hal_i2c_slave_config hal_i2c_slave_config_t
 HAL I2C slave user configuration. More...
 
typedef void * hal_i2c_slave_handle_t
 HAL I2C slave handle. More...
 
typedef 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. More...
 
typedef enum _hal_i2c_slave_transfer_event hal_i2c_slave_transfer_event_t
 Set of events sent to the callback for nonblocking slave transfers. More...
 
typedef struct _hal_i2c_slave_transfer hal_i2c_slave_transfer_t
 HAL I2C slave transfer structure. More...
 
typedef enum _hal_i2c_status hal_i2c_status_t
 HAL I2C status. More...
 

Enumerations

enum  _hal_i2c_direction { kHAL_I2cWrite = 0U, kHAL_I2cRead = 1U }
 Direction of master and slave transfers. More...
 
enum  _hal_i2c_master_transfer_flag { kHAL_I2cTransferDefaultFlag = 0x0U, kHAL_I2cTransferNoStartFlag = 0x1U, kHAL_I2cTransferRepeatedStartFlag = 0x2U, kHAL_I2cTransferNoStopFlag = 0x4U }
 I2C transfer control flag. More...
 
enum  _hal_i2c_slave_transfer_event {
  kHAL_I2cSlaveAddressMatchEvent = 0x01U, kHAL_I2cSlaveTransmitEvent = 0x02U, kHAL_I2cSlaveReceiveEvent = 0x04U, kHAL_I2cSlaveTransmitAckEvent = 0x08U,
  kHAL_I2cSlaveCompletionEvent = 0x20U, kHAL_I2cSlaveStartEvent = 0x10U, kHAL_I2cSlaveGenaralcallEvent = 0x40U, kHAL_I2cSlaveAllEvents
}
 Set of events sent to the callback for nonblocking slave transfers. More...
 
enum  _hal_i2c_status {
  kStatus_HAL_I2cSuccess = kStatus_Success, kStatus_HAL_I2cError = MAKE_STATUS(kStatusGroup_HAL_I2C, 1), kStatus_HAL_I2cBusy = MAKE_STATUS(kStatusGroup_HAL_I2C, 2), kStatus_HAL_I2cIdle = MAKE_STATUS(kStatusGroup_HAL_I2C, 3),
  kStatus_HAL_I2cNak = MAKE_STATUS(kStatusGroup_HAL_I2C, 4), kStatus_HAL_I2cArbitrationLost = MAKE_STATUS(kStatusGroup_HAL_I2C, 5), kStatus_HAL_I2cTimeout = MAKE_STATUS(kStatusGroup_HAL_I2C, 6), kStatus_HAL_I2cAddrressNak = MAKE_STATUS(kStatusGroup_HAL_I2C, 7)
}
 HAL I2C status. More...
 

Functions

Initialization and de-initialization
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. The HAL I2C master module can't work unless the HAL_I2cMasterInit is called. More...
 
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. More...
 
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. The HAL I2C slave module can't work unless the HAL_I2cSlaveInit is called to enable the clock. More...
 
hal_i2c_status_t HAL_I2cSlaveInit (hal_i2c_slave_handle_t handle, const hal_i2c_slave_config_t *config)
 Initializes the HAL I2C peripheral. More...
 
Bus Operations
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Transactional
hal_i2c_status_t HAL_I2cMasterTransferAbort (hal_i2c_master_handle_t handle)
 Aborts an interrupt non-blocking transfer early. More...
 
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. More...
 
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. More...
 
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. More...
 
hal_i2c_status_t HAL_I2cSlaveTransferAbort (hal_i2c_slave_handle_t handle)
 Aborts the slave transfer. More...
 
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. More...
 
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. More...
 
hal_i2c_status_t HAL_I2cSlaveTransferNonBlocking (hal_i2c_slave_handle_t handle, uint32_t eventMask)
 Starts accepting slave transfers. More...
 


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:57