I2C#
Modules#
Enumerations#
Enumeration for I2C bus speed.
Enumeration for I2C mode i.e., leader/follower.
Typedefs#
Renaming the I2C register set.
Functions#
Initialize the I2C i.e., set the parameters to the respective registers.
Reset the I2C peripheral.
Transmit one byte on SDA line.
Receive one byte on SDA line.
Configure the frequency of the I2C transmission.
Fetch the frequency of I2C peripheral clock.
Get the release, sqa and dev version of I2C.
Enable the I2C interface.
Disable the I2C interface.
Hold the SCL line low and stalls the leader until new command is available in TX FIFO.
Issue the STOP after completion of transfer irrespective of TX FIFO status.
Get the I2C IC status.
Disable the I2C interrupts.
Enable the I2C interrupts.
Set the interrupts i.e., unmask according to the flags passed in the parameter.
Clear the interrupts i.e., mask according to the flags passed in the parameter.
Get the pending interrupts.
Get the enabled interrupts.
Get the enabled and pending interrupts.
Wait till the process is completed.
Wait till the synchronization is completed.
Set the follower address when I2C is in leader mode.
Fetch the current follower address.
Update the address of leader when it is in follower mode.
Fetch the masked follower address i.e.
Generate NACK only when it is in follower-receiver mode.
Abort the transfer.
Clear the I2C bus.
Update the RX threshold values.
Update the TX threshold values.
Control the direction of the I2C interface.
Configure the SDA hold time.
Macros#
Macro function to assert the I2C instance.
Macro to validate I2C instance number.
Macro function to validate the user input and I2C instance.
I2C enable mask.
I2C write mask.
I2C read mask.
I2C clear mask.
SCL stuck timeout, used to clear the I2C bus.
SDA stick timeout, used to clear the I2C bus.
16 bit mask value
8 bit mask value
4 bit mask value
DMA enable.
DMA disable.
If processor attempts to read receive buffer when buffer is empty.
If receive buffer is full and another byte is received (extra bytes are lost)
When receive buffer is full up to the RX_TL threshold level.
If transmit buffer is full and user attempts to transmit another byte.
When transmit buffer is filled over the TX_TL threshold level.
SCL is on hold in follower mode when another leader attempts to read data.
Transmit is aborted, to validate the reason, read IC_TX_ABRT_SOURCE register.
In follower mode if leader does not acknowledge, happens on last byte.
Ongoing or previous activity was there on bus, to clear read IC_CLR_INTR / IC_CLR_ACTIVITY register.
Stop condition is detected on the bus (leader and follower both mode)
Start or Restart condition is detected on the bus (leader and follower both mode)
General call address is received, to clear read IC_CLR_GEN_CALL register.
Restart condition is detected on bus (follower mode)
Leader is holding the bus and FIFO is empty.
SCL line is stuck at low.
Address sent was not acknowledged by follower in 7-bit mode.
First 10-bit address byte sent was not acknowledged by follower.
Second 10-bit address byte sent was not acknowledged by follower.
Received acknowledgement for address bu did not receive acknowledgement for data.
No follower acknowledged General call.
Leader send general call but program was to read it from bus.
High speed leader call was acknowledged by follower.
Start byte was acknowledged by follower.
Restart is disabled and data transfer is in high speed mode.
Restart is disabled and user tries to send start byte.
Restart is disabled and 10-bit address read command is received.
Leader mode is disabled and leader mode operation is preformed.
Leader has lost arbitration.
Follower flushes old TX FIFO to respond new read command.
Follower lost the bus.
Follower requests for data and user writes 1 in CMD register.
Leader has detected transfer abort.
SDA is stuck at low.
No acknowledgement for Device ID transfer by leader.
No acknowledgement for follower address to leader.
Leader sends device ID transfer and TX FIFO has write command.
'OR' of Leader and Follower activity
Transmit FIFO is not full.
Transmit FIFO is completely empty.
Receive FIFO is not empty.
Receive FIFO is completely full.
Leader is not in idle state.
Follower is not in idle state.
Leader holds SCL as previous command did not have a STOP bit.
Leader holds SCL as RX FIFO is full and additional byte is received.
Follower holds SCL to request read data when TX FIFO is empty.
Follower holds SCL as RX FIFO is full and additional byte is received.
SDA is stuck at low and has not recovered.
Enumeration Documentation#
sl_i2c_clock_hlr_t#
sl_i2c_clock_hlr_t
Enumeration for I2C bus speed.
Enumerator | |
---|---|
SL_I2C_STANDARD_BUS_SPEED | Standard bus speed, 100 Kbps. |
SL_I2C_FAST_BUS_SPEED | Fast bus speed, 400 Kbps. |
SL_I2C_HIGH_BUS_SPEED | High bus speed, 3.4 Mbps. |
SL_I2C_FAST_PLUS_BUS_SPEED | Fast plus bus speed, 1 Mbps. |
138
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_i2c_direction_t#
sl_i2c_direction_t
Enumeration for I2C direction i.e., read/write.
Enumerator | |
---|---|
SL_I2C_WRITE | I2C write operation mask. |
SL_I2C_READ | I2C read operation mask. |
146
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_i2c_mode_t#
sl_i2c_mode_t
Enumeration for I2C mode i.e., leader/follower.
Enumerator | |
---|---|
SL_I2C_LEADER_MODE | I2C Leader mode. |
SL_I2C_FOLLOWER_MODE | I2C Follower mode. |
152
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
Typedef Documentation#
I2C_TypeDef#
typedef I2C0_Type I2C_TypeDef
Renaming the I2C register set.
135
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
Function Documentation#
sl_si91x_i2c_init#
void sl_si91x_i2c_init (I2C_TypeDef * i2c, const sl_i2c_init_params_t * p_config)
Initialize the I2C i.e., set the parameters to the respective registers.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | p_config | (sl_i2c_init_params_t) Pointer to the initialization parameters structure. |
It needs to be called at the beginning of the code. It sets the frequency as per the input given in freq_scl and chlr. It accepts the following members for initialization parameters:
mode (Leader/Follower) sl_i2c_mode_t.
freq_scl (I2C SCL frequency).
chlr (Bus Speed) sl_i2c_clock_hlr_t.
address (Follower address).
is_10bit_addr (pass true if address is of 10 bit).
Returns
none
191
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_reset#
void sl_si91x_i2c_reset (I2C_TypeDef * i2c)
Reset the I2C peripheral.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It resets the initialization parameters to zero and clears all the interrupts. It resets the target and slave addresses.
Returns
none
203
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_tx#
void sl_si91x_i2c_tx (I2C_TypeDef * i2c, uint8_t data)
Transmit one byte on SDA line.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | data | (uint8_t) Data that needs to be transmitted via I2C bus. |
Threshold needs to be set before calling this API sl_si91x_i2c_set_tx_threshold. Direction needs to be selected before calling this API sl_si91x_i2c_control_direction.
sl_si91x_i2c_init(); sl_si91x_i2c_set_tx_threshold(); sl_si91x_i2c_control_direction(); sl_si91x_i2c_enable();
Returns
none
219
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_rx#
uint8_t sl_si91x_i2c_rx (I2C_TypeDef * i2c)
Receive one byte on SDA line.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
Threshold needs to be set before calling this API sl_si91x_i2c_set_rx_threshold. Direction needs to be selected before calling this API sl_si91x_i2c_control_direction.
sl_si91x_i2c_init(); sl_si91x_i2c_set_rx_threshold(); sl_si91x_i2c_control_direction(); sl_si91x_i2c_enable();
Returns
data (uint8_t) Data that is received on the I2C bus.
234
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_set_frequency#
void sl_si91x_i2c_set_frequency (I2C_TypeDef * i2c, uint32_t ref_freq, uint32_t freq_scl, sl_i2c_clock_hlr_t clhr)
Configure the frequency of the I2C transmission.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | ref_freq | (uint32_t) SCL frequency. |
[in] | freq_scl | (sl_i2c_clock_hlr_t) Bus speed for I2C. |
N/A | clhr |
This API is called inside sl_si91x_i2c_init, but can be called separately to change the frequency. According the input of freq_scl frequency is calculated and filled in the register appropriately as the speed selected in chlr. The accepted parameters for chlr are: sl_i2c_clock_hlr_t.
SL_I2C_STANDARD_BUS_SPEED = 1, ///< Standard bus speed, 100 Kbps
SL_I2C_FAST_BUS_SPEED, ///< Fast bus speed, 400 Kbps
SL_I2C_FAST_PLUS_BUS_SPEED, ///< Fast plus bus speed, 1 Mbps
SL_I2C_HIGH_BUS_SPEED, ///< High bus speed, 3.4 Mbps
Returns
none
254
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_frequency#
uint32_t sl_si91x_i2c_get_frequency (I2C_TypeDef * i2c)
Fetch the frequency of I2C peripheral clock.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It returns uint32_t value of the SystemCoreClock frequency.
Returns
frequency (uint32_t) The frequency of the System.
264
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_version#
sl_i2c_version_t sl_si91x_i2c_get_version (void )
Get the release, sqa and dev version of I2C.
[in] |
Returns
(sl_i2c_version_t) type structure
273
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_enable#
__STATIC_INLINE void sl_si91x_i2c_enable (I2C_TypeDef * i2c)
Enable the I2C interface.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address |
It sets the register bit which enabled the I2C interface.
Returns
none
284
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_disable#
__STATIC_INLINE void sl_si91x_i2c_disable (I2C_TypeDef * i2c)
Disable the I2C interface.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It clears the register bit which enabled the I2C interface.
Returns
none
301
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_start_cmd#
__STATIC_INLINE void sl_si91x_i2c_start_cmd (I2C_TypeDef * i2c)
Hold the SCL line low and stalls the leader until new command is available in TX FIFO.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
STOP condition is not issued after completion of transfer irrespective of TX FIFO status.
Returns
none
320
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_stop_cmd#
__STATIC_INLINE void sl_si91x_i2c_stop_cmd (I2C_TypeDef * i2c)
Issue the STOP after completion of transfer irrespective of TX FIFO status.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
If TX FIFO has data, leader sends start byte and starts the transmission.
Returns
none
338
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_status#
__STATIC_INLINE uint32_t sl_si91x_i2c_get_status (I2C_TypeDef * i2c)
Get the I2C IC status.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
The bits of status are set according to the events. The macros are written in this file that can be directly used to mask the value of this register.
Returns
none
357
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_disable_interrupts#
__STATIC_INLINE void sl_si91x_i2c_disable_interrupts (I2C_TypeDef * i2c, uint32_t flags)
Disable the I2C interrupts.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
N/A | flags |
It is mandatory to disable interrupts before configuring the I2C parameters.
Returns
none
374
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_enable_interrupts#
__STATIC_INLINE void sl_si91x_i2c_enable_interrupts (I2C_TypeDef * i2c, uint32_t flags)
Enable the I2C interrupts.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
N/A | flags |
Returns
none
399
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_set_interrupts#
__STATIC_INLINE void sl_si91x_i2c_set_interrupts (I2C_TypeDef * i2c, uint32_t flags)
Set the interrupts i.e., unmask according to the flags passed in the parameter.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | flags | (uint32_t) Interrupt flags which needs to be unmasked. |
Returns
none
426
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_clear_interrupts#
__STATIC_INLINE void sl_si91x_i2c_clear_interrupts (I2C_TypeDef * i2c, uint32_t flags)
Clear the interrupts i.e., mask according to the flags passed in the parameter.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | flags | (uint32_t) Interrupt flags which needs to be masked. |
Returns
none
444
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_pending_interrupts#
__STATIC_INLINE uint32_t sl_si91x_i2c_get_pending_interrupts (I2C_TypeDef * i2c)
Get the pending interrupts.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It returns the uint32_t type interrupt status register. The macros are written in this file that can be directly used to mask the value of this register.
Returns
status (uint32_t) Interrupts which are pending.
463
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_enabled_interrupts#
__STATIC_INLINE uint32_t sl_si91x_i2c_get_enabled_interrupts (I2C_TypeDef * i2c)
Get the enabled interrupts.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It returns the uint32_t type interrupt mask register. The macros are written in this file that can be directly used to mask the value of this register.
Returns
status (uint32_t) Interrupts which are unmasked.
482
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_enabled_pending_interrupts#
__STATIC_INLINE uint32_t sl_si91x_i2c_get_enabled_pending_interrupts (I2C_TypeDef * i2c)
Get the enabled and pending interrupts.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It returns the uint32_t type value which is bitwise end of enabled interrupts and pending interrupts. The macros are written in this file that can be directly used to mask the value of this register.
Returns
status (uint32_t) Interrupts which are unmasked and pending.
503
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_wait_ready#
__STATIC_INLINE void sl_si91x_i2c_wait_ready (I2C_TypeDef * i2c, uint32_t mask)
Wait till the process is completed.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | mask | (uint32_t) Interrupt mask for that it waits. |
Mask takes the interrupt flags and waits until it is triggered. Interrupt is cleared once it is triggered.
Returns
none
525
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_wait_sync#
__STATIC_INLINE void sl_si91x_i2c_wait_sync (I2C_TypeDef * i2c)
Wait till the synchronization is completed.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It checks whether the I2C interface is enabled and the bus is free i.e., no activity is pending on the bus.
Returns
none
542
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_set_follower_address#
__STATIC_INLINE void sl_si91x_i2c_set_follower_address (I2C_TypeDef * i2c, uint16_t addr, bool is_10bit_addr)
Set the follower address when I2C is in leader mode.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | addr | (uint16_t) Follower address. |
[in] | is_10bit_addr | (bool) boolean value for the 10 bit address. |
It validates the is_10bit_addr parameter and sets the 10 bit address register. It updates the register of follower address with the value passed in the parameter. This API is called in sl_si91x_i2c_init function sl_si91x_i2c_init It can also be called separately from to update the follower address.
Returns
none
564
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_follower_address#
__STATIC_INLINE uint16_t sl_si91x_i2c_get_follower_address (I2C_TypeDef * i2c)
Fetch the current follower address.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It returns uint8_t value as the current follower address.
Returns
address(uint8_t) address of the follower.
589
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_set_follower_mask_address#
__STATIC_INLINE void sl_si91x_i2c_set_follower_mask_address (I2C_TypeDef * i2c, uint16_t mask)
Update the address of leader when it is in follower mode.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
N/A | mask |
It updates the register of follower address with the value passed in the parameter. This API is called in sl_si91x_i2c_init function sl_si91x_i2c_init It can also be called separately from to update the address.
Returns
none
607
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_get_follower_mask_address#
__STATIC_INLINE uint16_t sl_si91x_i2c_get_follower_mask_address (I2C_TypeDef * i2c)
Fetch the masked follower address i.e.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
leader address when it is in follower mode. It returns uint8_t value as the current masked follower address.
Returns
address(uint8_t) leader's address when it is in follower mode
625
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_send_nack#
__STATIC_INLINE void sl_si91x_i2c_send_nack (I2C_TypeDef * i2c)
Generate NACK only when it is in follower-receiver mode.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address |
It generates NACK after a byte is received and the transfer will be aborted.
sl_si91x_i2c_enable(); sl_si91x_i2c_inti();
Returns
none
642
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_abort_transfer#
__STATIC_INLINE void sl_si91x_i2c_abort_transfer (I2C_TypeDef * i2c)
Abort the transfer.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It disables the interrupts, I2C interface and waits till the abort is completed. Abort issues the stop condition and flushes the TX FIFO and sets the SL_I2C_EVENT_TRANSMIT_ABORT interrupt after the operation is completed. For abort it is necessary to keep to I2C instance in enable mode.
Returns
none
663
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_clear_bus#
__STATIC_INLINE void sl_si91x_i2c_clear_bus (I2C_TypeDef * i2c)
Clear the I2C bus.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
It disables the I2C interface, loads the SCL and SDA timeout values and again enabled the I2C interface.
Returns
none
687
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_set_rx_threshold#
__STATIC_INLINE void sl_si91x_i2c_set_rx_threshold (I2C_TypeDef * i2c, uint8_t threshold)
Update the RX threshold values.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | threshold | (uint8_t) Threshold value which need to be filled in FIFO. |
Returns
none
712
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_set_tx_threshold#
__STATIC_INLINE void sl_si91x_i2c_set_tx_threshold (I2C_TypeDef * i2c, uint8_t threshold)
Update the TX threshold values.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | threshold | (uint8_t) Threshold value which need to be filled in FIFO. |
Returns
none
729
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_control_direction#
__STATIC_INLINE void sl_si91x_i2c_control_direction (I2C_TypeDef * i2c, sl_i2c_direction_t direction)
Control the direction of the I2C interface.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | direction | (sl_i2c_direction_t) I2C direction for operation.
|
It updates the register with the read mask / write mask value sl_i2c_direction_t
Note
I2C instance should be enabled before calling this API.
Returns
none
750
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_set_sda_hold_time#
__STATIC_INLINE void sl_si91x_i2c_set_sda_hold_time (I2C_TypeDef * i2c, sl_i2c_direction_t direction, uint32_t time)
Configure the SDA hold time.
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address. |
[in] | direction | (sl_i2c_direction_t) C direction for operation.
|
[in] | time | Time which needs to be filled in the SDA hold register. |
According to the direction sl_i2c_direction_t, it updates the registers with the time value which is passed as the function parameter. It holds the SDA in the units of clock period.
Returns
none
771
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
sl_si91x_i2c_send_ack#
__STATIC_INLINE void sl_si91x_i2c_send_ack (I2C_TypeDef * i2c, p_config)
[in] | i2c | (I2C_TypeDef) Pointer to the I2C instance base address |
[in] | p_config | (sl_i2c_init_params_t) Pointer to the initialization parameters structure |
Returns
none
792
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
Macro Definition Documentation#
SL_I2C_ASSERT#
#define SL_I2C_ASSERTValue:
(expr)
Macro function to assert the I2C instance.
49
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
I2C_NUM#
#define I2C_NUMValue:
(ref)
Macro to validate I2C instance number.
50
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
I2C_REF_VALID#
#define I2C_REF_VALIDValue:
(ref)
Macro function to validate the user input and I2C instance.
52
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
UNUSED_VARIABLE#
#define UNUSED_VARIABLEValue:
(var)
53
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ENABLE_MASK#
#define SL_I2C_ENABLE_MASKValue:
0x01
I2C enable mask.
55
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_WRITE_MASK#
#define SL_I2C_WRITE_MASKValue:
0x00
I2C write mask.
56
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_READ_MASK#
#define SL_I2C_READ_MASKValue:
0x01
I2C read mask.
57
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_CLEAR_MASK#
#define SL_I2C_CLEAR_MASKValue:
0x00
I2C clear mask.
58
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_SCL_STUCK_TIMEOUT#
#define SL_I2C_SCL_STUCK_TIMEOUTValue:
20
SCL stuck timeout, used to clear the I2C bus.
59
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_SDA_STUCK_TIMEOUT#
#define SL_I2C_SDA_STUCK_TIMEOUTValue:
20
SDA stick timeout, used to clear the I2C bus.
60
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_16_BIT_MASK#
#define SL_16_BIT_MASKValue:
0xFFFF
16 bit mask value
61
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_8_BIT_MASK#
#define SL_8_BIT_MASKValue:
0xFF
8 bit mask value
62
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_4_BIT_MASK#
#define SL_4_BIT_MASKValue:
0xF
4 bit mask value
63
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_DMA_ENABLE#
#define SL_I2C_DMA_ENABLEValue:
0x1
DMA enable.
64
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_DMA_DISABLE#
#define SL_I2C_DMA_DISABLEValue:
0x0
DMA disable.
65
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_RECEIVE_UNDER#
#define SL_I2C_EVENT_RECEIVE_UNDERValue:
(1UL << 0)
If processor attempts to read receive buffer when buffer is empty.
68
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_RECEIVE_OVER#
#define SL_I2C_EVENT_RECEIVE_OVERValue:
(1UL << 1)
If receive buffer is full and another byte is received (extra bytes are lost)
69
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_RECEIVE_FULL#
#define SL_I2C_EVENT_RECEIVE_FULLValue:
(1UL << 2)
When receive buffer is full up to the RX_TL threshold level.
71
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_TRANSMIT_OVER#
#define SL_I2C_EVENT_TRANSMIT_OVERValue:
(1UL << 3)
If transmit buffer is full and user attempts to transmit another byte.
72
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_TRANSMIT_EMPTY#
#define SL_I2C_EVENT_TRANSMIT_EMPTYValue:
(1UL << 4)
When transmit buffer is filled over the TX_TL threshold level.
73
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_READ_REQ#
#define SL_I2C_EVENT_READ_REQValue:
(1UL << 5)
SCL is on hold in follower mode when another leader attempts to read data.
74
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_TRANSMIT_ABORT#
#define SL_I2C_EVENT_TRANSMIT_ABORTValue:
(1UL << 6)
Transmit is aborted, to validate the reason, read IC_TX_ABRT_SOURCE register.
75
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_RECEIVE_DONE#
#define SL_I2C_EVENT_RECEIVE_DONEValue:
(1UL << 7)
In follower mode if leader does not acknowledge, happens on last byte.
77
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_ACTIVITY_ON_BUS#
#define SL_I2C_EVENT_ACTIVITY_ON_BUSValue:
(1UL << 8)
Ongoing or previous activity was there on bus, to clear read IC_CLR_INTR / IC_CLR_ACTIVITY register.
78
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_STOP_DETECT#
#define SL_I2C_EVENT_STOP_DETECTValue:
(1UL << 9)
Stop condition is detected on the bus (leader and follower both mode)
80
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_START_DETECT#
#define SL_I2C_EVENT_START_DETECTValue:
(1UL << 10)
Start or Restart condition is detected on the bus (leader and follower both mode)
81
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_GENERAL_CALL#
#define SL_I2C_EVENT_GENERAL_CALLValue:
(1UL << 11)
General call address is received, to clear read IC_CLR_GEN_CALL register.
83
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_RESTART_DET#
#define SL_I2C_EVENT_RESTART_DETValue:
(1UL << 12)
Restart condition is detected on bus (follower mode)
85
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_MST_ON_HOLD#
#define SL_I2C_EVENT_MST_ON_HOLDValue:
(1UL << 13)
Leader is holding the bus and FIFO is empty.
86
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_EVENT_SCL_STUCK_AT_LOW#
#define SL_I2C_EVENT_SCL_STUCK_AT_LOWValue:
(1UL << 14)
SCL line is stuck at low.
87
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_7B_ADDRESS_NOACK#
#define SL_I2C_ABORT_7B_ADDRESS_NOACKValue:
(1UL << 0)
Address sent was not acknowledged by follower in 7-bit mode.
90
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_10B_ADDRESS1_NOACK#
#define SL_I2C_ABORT_10B_ADDRESS1_NOACKValue:
(1UL << 1)
First 10-bit address byte sent was not acknowledged by follower.
91
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_10B_ADDRESS2_NOACK#
#define SL_I2C_ABORT_10B_ADDRESS2_NOACKValue:
(1UL << 2)
Second 10-bit address byte sent was not acknowledged by follower.
92
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_TX_DATA_NOACK#
#define SL_I2C_ABORT_TX_DATA_NOACKValue:
(1UL << 3)
Received acknowledgement for address bu did not receive acknowledgement for data.
93
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_GENERAL_CALL_NOACK#
#define SL_I2C_ABORT_GENERAL_CALL_NOACKValue:
(1UL << 4)
No follower acknowledged General call.
95
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_GENERAL_CALL_READ#
#define SL_I2C_ABORT_GENERAL_CALL_READValue:
(1UL << 5)
Leader send general call but program was to read it from bus.
96
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_HIGH_SPEED_ACK#
#define SL_I2C_ABORT_HIGH_SPEED_ACKValue:
(1UL << 6)
High speed leader call was acknowledged by follower.
97
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_START_BYTE_ACK#
#define SL_I2C_ABORT_START_BYTE_ACKValue:
(1UL << 7)
Start byte was acknowledged by follower.
98
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_HIGH_SPEED_NO_RESTART#
#define SL_I2C_ABORT_HIGH_SPEED_NO_RESTARTValue:
(1UL << 8)
Restart is disabled and data transfer is in high speed mode.
99
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_START_BYTE_NO_RESTART#
#define SL_I2C_ABORT_START_BYTE_NO_RESTARTValue:
(1UL << 9)
Restart is disabled and user tries to send start byte.
100
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_10B_READ_NO_RESTART#
#define SL_I2C_ABORT_10B_READ_NO_RESTARTValue:
(1UL << 10)
Restart is disabled and 10-bit address read command is received.
101
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_MASTER_DISABLED#
#define SL_I2C_ABORT_MASTER_DISABLEDValue:
(1UL << 11)
Leader mode is disabled and leader mode operation is preformed.
103
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_MASTER_ARBITRATION_LOST#
#define SL_I2C_ABORT_MASTER_ARBITRATION_LOSTValue:
(1UL << 12)
Leader has lost arbitration.
104
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_SLAVE_FLUSH_TX_FIFO#
#define SL_I2C_ABORT_SLAVE_FLUSH_TX_FIFOValue:
(1UL << 13)
Follower flushes old TX FIFO to respond new read command.
105
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_SLAVE_ARBITRATION_LOST#
#define SL_I2C_ABORT_SLAVE_ARBITRATION_LOSTValue:
(1UL << 14)
Follower lost the bus.
106
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_SLAVE_READ_INTX#
#define SL_I2C_ABORT_SLAVE_READ_INTXValue:
(1UL << 15)
Follower requests for data and user writes 1 in CMD register.
107
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_USER_ABORT#
#define SL_I2C_ABORT_USER_ABORTValue:
(1UL << 16)
Leader has detected transfer abort.
108
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_SDA_STUCK_AT_LOW#
#define SL_I2C_ABORT_SDA_STUCK_AT_LOWValue:
(1UL << 17)
SDA is stuck at low.
109
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_DEVICE_NOACK#
#define SL_I2C_ABORT_DEVICE_NOACKValue:
(1UL << 18)
No acknowledgement for Device ID transfer by leader.
110
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_DEVICE_SLAVE_ADDRESS_NOACK#
#define SL_I2C_ABORT_DEVICE_SLAVE_ADDRESS_NOACKValue:
(1UL << 19)
No acknowledgement for follower address to leader.
111
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ABORT_WRITE#
#define SL_I2C_ABORT_WRITEValue:
(1UL << 20)
Leader sends device ID transfer and TX FIFO has write command.
112
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_ACTIVITY_STATUS#
#define SL_I2C_ACTIVITY_STATUSValue:
(1U << 0)
'OR' of Leader and Follower activity
115
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_TRANSFER_FIFO_NOT_FULL_STATUS#
#define SL_I2C_TRANSFER_FIFO_NOT_FULL_STATUSValue:
(1U << 1)
Transmit FIFO is not full.
116
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_TRANSFER_FIFO_EMPTY_STATUS#
#define SL_I2C_TRANSFER_FIFO_EMPTY_STATUSValue:
(1U << 2)
Transmit FIFO is completely empty.
117
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_RECEIVE_FIFO_NOT_EMPTY_STATUS#
#define SL_I2C_RECEIVE_FIFO_NOT_EMPTY_STATUSValue:
(1U << 3)
Receive FIFO is not empty.
118
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_RECEIVE_FIFO_FULL_STATUS#
#define SL_I2C_RECEIVE_FIFO_FULL_STATUSValue:
(1U << 4)
Receive FIFO is completely full.
119
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_MASTER_ACTIVITY_STATUS#
#define SL_I2C_MASTER_ACTIVITY_STATUSValue:
(1U << 5)
Leader is not in idle state.
120
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_SLAVE_ACTIVITY_STATUS#
#define SL_I2C_SLAVE_ACTIVITY_STATUSValue:
(1U << 6)
Follower is not in idle state.
121
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_MASTER_HOLD_TX_FIFO_EMPTY_STATUS#
#define SL_I2C_MASTER_HOLD_TX_FIFO_EMPTY_STATUSValue:
(1U << 7)
Leader holds SCL as previous command did not have a STOP bit.
122
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_MASTER_HOLD_RX_FIFO_FULL_STATUS#
#define SL_I2C_MASTER_HOLD_RX_FIFO_FULL_STATUSValue:
(1U << 8)
Leader holds SCL as RX FIFO is full and additional byte is received.
124
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_SLAVE_HOLD_TX_FIFO_EMPTY_STATUS#
#define SL_I2C_SLAVE_HOLD_TX_FIFO_EMPTY_STATUSValue:
(1U << 9)
Follower holds SCL to request read data when TX FIFO is empty.
126
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_SLAVE_HOLD_RX_FIFO_FULL_STATUS#
#define SL_I2C_SLAVE_HOLD_RX_FIFO_FULL_STATUSValue:
(1U << 10)
Follower holds SCL as RX FIFO is full and additional byte is received.
128
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h
SL_I2C_SDA_STUCK_NOT_RECOVERED_STATUS#
#define SL_I2C_SDA_STUCK_NOT_RECOVERED_STATUSValue:
(1U << 11)
SDA is stuck at low and has not recovered.
130
of file components/siwx917_soc/drivers/unified_api/inc/sl_si91x_peripheral_i2c.h