RTEMS  5.0.0
Functions

Functions

ALT_STATUS_CODE alt_i2c_int_status_get (ALT_I2C_DEV_t *i2c_dev, uint32_t *status)
 
ALT_STATUS_CODE alt_i2c_int_raw_status_get (ALT_I2C_DEV_t *i2c_dev, uint32_t *status)
 
ALT_STATUS_CODE alt_i2c_int_clear (ALT_I2C_DEV_t *i2c_dev, const uint32_t mask)
 
ALT_STATUS_CODE alt_i2c_int_disable (ALT_I2C_DEV_t *i2c_dev, const uint32_t mask)
 
ALT_STATUS_CODE alt_i2c_int_enable (ALT_I2C_DEV_t *i2c_dev, const uint32_t mask)
 
ALT_STATUS_CODE alt_i2c_tx_abort_cause_get (ALT_I2C_DEV_t *i2c_dev, ALT_I2C_TX_ABORT_CAUSE_t *cause)
 

Detailed Description

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:

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.

Function Documentation

◆ alt_i2c_int_clear()

ALT_STATUS_CODE alt_i2c_int_clear ( ALT_I2C_DEV_t i2c_dev,
const uint32_t  mask 
)

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_devA pointer to the I2C controller device block instance.
maskSpecifies 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_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code

◆ alt_i2c_int_disable()

ALT_STATUS_CODE alt_i2c_int_disable ( ALT_I2C_DEV_t i2c_dev,
const uint32_t  mask 
)

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_devA pointer to the I2C controller device block instance.
maskSpecifies 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_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code

◆ alt_i2c_int_enable()

ALT_STATUS_CODE alt_i2c_int_enable ( ALT_I2C_DEV_t i2c_dev,
const uint32_t  mask 
)

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_devA pointer to the I2C controller device block instance.
maskSpecifies 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_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code

◆ alt_i2c_int_raw_status_get()

ALT_STATUS_CODE alt_i2c_int_raw_status_get ( ALT_I2C_DEV_t i2c_dev,
uint32_t *  status 
)

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_devA 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_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code

◆ alt_i2c_int_status_get()

ALT_STATUS_CODE alt_i2c_int_status_get ( ALT_I2C_DEV_t i2c_dev,
uint32_t *  status 
)

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_devA 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_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code

◆ alt_i2c_tx_abort_cause_get()

ALT_STATUS_CODE alt_i2c_tx_abort_cause_get ( ALT_I2C_DEV_t i2c_dev,
ALT_I2C_TX_ABORT_CAUSE_t cause 
)

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_devA 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_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code