The functions in this group provide management for the I2C controller status conditions and interrupts.
Each I2C controller has a single combined interrupt output (ALT_INT_INTERRUPT_I2Cn_IRQ). The following events can generate an interrupt:
- General Call Address Received
- Start or Restart Condition Occurred
- Stop Condition Occurred
- I2C Controller Activity
- Receive Done
- Transmit Abort
- Read Request
- Transmit Buffer Empty
- Transmit Overflow
- Receive Buffer Full
- Receive Overflow
- Receive Underflow
These interrupt status conditions may be monitored either by polling their status or by configuring interrupt handlers using the HWLIB Interrupt Controller API.
Functions to get the current status, enable or disable (i.e. mass or unmask), and clear interrupt status conditions for the I2C controller are defined in this section.
◆ alt_i2c_int_clear()
Clears the specified I2C controller interrupt status conditions identified in the mask.
This function clears one or more of the status conditions as contributors to the ALT_INT_INTERRUPT_I2Cn_IRQ interrupt signal state.
- Parameters
-
i2c_dev | A pointer to the I2C controller device block instance. |
mask | Specifies the QSPI interrupt status conditions to clear. mask is a mask of logically OR'ed ALT_I2C_STATUS_t values that designate the status conditions to clear. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
◆ alt_i2c_int_disable()
Disable the specified I2C controller interrupt status conditions identified in the mask.
This function disables one or more of the status conditions as contributors to the ALT_INT_INTERRUPT_I2Cn_IRQ interrupt signal state.
NOTE: A cleared bit for any status condition in the mask value does not have the effect of enabling it as a contributor to the ALT_INT_INTERRUPT_I2Cn_IRQ interrupt signal state. The function alt_i2c_int_enable() is used to enable status source conditions.
- Parameters
-
i2c_dev | A pointer to the I2C controller device block instance. |
mask | Specifies the status conditions to disable as interrupt source contributors. mask is a mask of logically OR'ed ALT_I2C_STATUS_t values that designate the status conditions to disable. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
◆ alt_i2c_int_enable()
Enable the specified I2C controller interrupt status conditions identified in the mask.
This function enables one or more of the status conditions as contributors to the ALT_INT_INTERRUPT_I2Cn_IRQ interrupt signal state.
NOTE: A cleared bit for any status condition in the mask value does not have the effect of disabling it as a contributor to the ALT_INT_INTERRUPT_I2Cn_IRQ interrupt signal state. The function alt_i2c_int_disable() is used to disable status source conditions.
- Parameters
-
i2c_dev | A pointer to the I2C controller device block instance. |
mask | Specifies the status conditions to enable as interrupt source contributors. mask is a mask of logically OR'ed ALT_I2C_STATUS_t values that designate the status conditions to enable. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
◆ alt_i2c_int_raw_status_get()
Returns the I2C controller raw interrupt status conditions irrespective of the interrupt status condition enablement state.
This function returns the current value of the I2C controller raw interrupt status register value which reflects the current I2C controller status conditions regardless of whether they are disabled (i.e. masked) or not.
- Parameters
-
i2c_dev | A pointer to the I2C controller device block instance. |
status | [out] A pointer to a bit mask of the active ALT_I2C_STATUS_t interrupt and status conditions. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
◆ alt_i2c_int_status_get()
Returns the current I2C controller interrupt status conditions.
This function returns the current value of the I2C controller interrupt status register value which reflects the current I2C controller status conditions that are not disabled (i.e. masked).
- Parameters
-
i2c_dev | A pointer to the I2C controller device block instance. |
status | [out] A pointer to a bit mask of the active ALT_I2C_STATUS_t interrupt and status conditions. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |
◆ alt_i2c_tx_abort_cause_get()
Gets the cause of I2C transmission abort. A I2C transmission abort indicates that the I2C transmitter is unable to complete the intended actions on the contents of the transmit FIFO. This situation can occur both as an I2C master or an I2C slave, and is referred to as a "transmit abort".
The returned value of this function is the value of the IC_TX_ABRT_SOURCE register which indicates the cause why the transmit abort occurred.
- Parameters
-
i2c_dev | A pointer to the I2C controller device block instance. |
cause | [out] A pointer to a bit mask of the ALT_I2C_TX_ABORT_CAUSE_t causes of the transmission abort. |
- Return values
-
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |