Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Interrupt Status Conditions

Description

The SPI controller supports combined interrupt requests, which can be masked. The combined interrupt request is the ORed result of all other SPI interrupts after masking. All SPI interrupts have active-high polarity level. The SPI interrupts are described as follows:

Interrupt status conditions may be monitored by polling () or setting up an interrupt handler using the HWLIB Interrupt Manager API.

Typedefs

typedef enum ALT_SPI_STATUS_e ALT_SPI_STATUS_t
 

ENUMS

enum  ALT_SPI_STATUS_e {
  ALT_SPI_STATUS_TXEI = 1UL << 0, ALT_SPI_STATUS_TXOI = 1UL << 1, ALT_SPI_STATUS_RXUI = 1UL << 2, ALT_SPI_STATUS_RXOI = 1UL << 3,
  ALT_SPI_STATUS_RXFI = 1UL << 4, ALT_SPI_STATUS_ALL = 0x1f
}
 

Functions

ALT_STATUS_CODE alt_spi_int_status_get (ALT_SPI_DEV_t *spi_dev, uint32_t *status)
 
ALT_STATUS_CODE alt_spi_int_raw_status_get (ALT_SPI_DEV_t *spi_dev, uint32_t *status)
 
ALT_STATUS_CODE alt_spi_int_clear (ALT_SPI_DEV_t *spi_dev, const uint32_t mask)
 
ALT_STATUS_CODE alt_spi_int_disable (ALT_SPI_DEV_t *spi_dev, const uint32_t mask)
 
ALT_STATUS_CODE alt_spi_int_enable (ALT_SPI_DEV_t *spi_dev, const uint32_t mask)
 

Typedef Documentation

This type enumerates interrupt status conditions for the SPI controller.

For any interrupt status condition, a 0 value indicates the interrupt condition is not active and a 1 value indicates the interrupt condition is active.

Enumeration Type Documentation

This type enumerates interrupt status conditions for the SPI controller.

For any interrupt status condition, a 0 value indicates the interrupt condition is not active and a 1 value indicates the interrupt condition is active.

Enumerator:
ALT_SPI_STATUS_TXEI 

Transmit FIFO Empty Interrupt Status

ALT_SPI_STATUS_TXOI 

Transmit FIFO Overflow Interrupt Status

ALT_SPI_STATUS_RXUI 

Receive FIFO Underflow Interrupt Status

ALT_SPI_STATUS_RXOI 

Receive FIFO Overflow Interrupt Status

ALT_SPI_STATUS_RXFI 

Receive FIFO Full Interrupt Status

ALT_SPI_STATUS_ALL 

All interrupt status conditions

Function Documentation

ALT_STATUS_CODE alt_spi_int_status_get ( ALT_SPI_DEV_t *  spi_dev,
uint32_t *  status 
)

Returns the current SPI controller interrupt status conditions.

This function returns the current value of the SPI controller interrupt status register value which reflects the current SPI controller interrupt status conditions that are not disabled (i.e. masked).

Parameters
spi_devA pointer to the SPI controller device block instance.
status[out] A pointer to a bit mask of the active ALT_SPI_STATUS_t interrupt and status conditions.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code
ALT_STATUS_CODE alt_spi_int_raw_status_get ( ALT_SPI_DEV_t *  spi_dev,
uint32_t *  status 
)

Returns the SPI controller raw interrupt status conditions irrespective of the interrupt status condition enablement state.

This function returns the current value of the SPI controller raw interrupt status register value which reflects the current SPI controller status conditions regardless of whether they are disabled (i.e. masked) or not.

Parameters
spi_devA pointer to the SPI controller device block instance.
status[out] A pointer to a bit mask of the active ALT_SPI_STATUS_t interrupt and status conditions.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code
ALT_STATUS_CODE alt_spi_int_clear ( ALT_SPI_DEV_t *  spi_dev,
const uint32_t  mask 
)

Clears the specified SPI controller interrupt status conditions identified in the mask.

This function clears one or more of the interrupt status conditions that contribute to the combined ALT_INT_INTERRUPT_SPIn_IRQ interrupt signal state.

Parameters
spi_devA pointer to the SPI controller device block instance.
maskSpecifies the QSPI interrupt status conditions to clear. mask is a mask of logically OR'ed ALT_SPI_STATUS_t values that designate the status conditions to clear.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code
ALT_STATUS_CODE alt_spi_int_disable ( ALT_SPI_DEV_t *  spi_dev,
const uint32_t  mask 
)

Disable the specified SPI controller interrupt status conditions identified in the mask.

This function disables one or more of the interrupt status conditions that contribute to the combined ALT_INT_INTERRUPT_SPIn_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_SPIn_IRQ interrupt signal state. The function alt_spi_int_enable() is used to enable status source conditions.

Parameters
spi_devA pointer to the SPI controller device block instance.
maskSpecifies the status conditions to disable as interrupt source contributors. mask is a mask of logically OR'ed ALT_SPI_STATUS_t values that designate the status conditions to disable.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code
ALT_STATUS_CODE alt_spi_int_enable ( ALT_SPI_DEV_t *  spi_dev,
const uint32_t  mask 
)

Enable the specified SPI controller interrupt status conditions identified in the mask.

This function enables one or more of the interrupt status conditions that contribute to the combined ALT_INT_INTERRUPT_SPIn_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_SPIn_IRQ interrupt signal state. The function alt_spi_int_disable() is used to disable status source conditions.

Parameters
spi_devA pointer to the SPI controller device block instance.
maskSpecifies the status conditions to enable as interrupt source contributors. mask is a mask of logically OR'ed ALT_SPI_STATUS_t values that designate the status conditions to enable.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code