![]() |
Altera HWLIB
16.0
The Altera HW Manager API Reference Manual
|
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 enum ALT_SPI_STATUS_e ALT_SPI_STATUS_t |
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.
enum ALT_SPI_STATUS_e |
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.
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).
spi_dev | A 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. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details 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.
spi_dev | A 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. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details 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.
spi_dev | A pointer to the SPI controller device block instance. |
mask | Specifies 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. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details 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.
spi_dev | A pointer to the SPI controller device block instance. |
mask | Specifies 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. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details 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.
spi_dev | A pointer to the SPI controller device block instance. |
mask | Specifies 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. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Details about error status code |