Functions | |
cy_en_sysint_status_t | Cy_SysInt_Init (const cy_stc_sysint_t *config, cy_israddress userIsr) |
Initializes the referenced interrupt by setting the priority and the interrupt vector. More... | |
cy_israddress | Cy_SysInt_SetVector (IRQn_Type IRQn, cy_israddress userIsr) |
Changes the ISR vector for the interrupt. More... | |
cy_israddress | Cy_SysInt_GetVector (IRQn_Type IRQn) |
Gets the address of the current ISR vector for the interrupt. More... | |
void | Cy_SysInt_SetInterruptSource (IRQn_Type IRQn, cy_en_intr_t devIntrSrc) |
Configures the interrupt selection for the specified NVIC channel. More... | |
cy_en_intr_t | Cy_SysInt_GetInterruptSource (IRQn_Type IRQn) |
Gets the interrupt source of the NVIC channel. More... | |
IRQn_Type | Cy_SysInt_GetNvicConnection (cy_en_intr_t devIntrSrc) |
Gets the NVIC channel to which the interrupt source is connected. More... | |
cy_en_intr_t | Cy_SysInt_GetInterruptActive (IRQn_Type IRQn) |
Gets the highest priority active interrupt for the selected NVIC channel. More... | |
void | Cy_SysInt_DisconnectInterruptSource (IRQn_Type IRQn, cy_en_intr_t devIntrSrc) |
Disconnect the interrupt source from the specified NVIC channel. More... | |
__STATIC_INLINE void | Cy_SysInt_SetNmiSource (cy_en_sysint_nmi_t nmiNum, IRQn_Type intrSrc) |
Sets the interrupt source of the CPU core NMI. More... | |
__STATIC_INLINE IRQn_Type | Cy_SysInt_GetNmiSource (cy_en_sysint_nmi_t nmiNum) |
Gets the interrupt source of the CPU core NMI for the given NMI source number. More... | |
__STATIC_INLINE void | Cy_SysInt_SoftwareTrig (IRQn_Type IRQn) |
Triggers an interrupt using software (Not applicable for CM0+). More... | |
cy_en_sysint_status_t Cy_SysInt_Init | ( | const cy_stc_sysint_t * | config, |
cy_israddress | userIsr | ||
) |
Initializes the referenced interrupt by setting the priority and the interrupt vector.
Use the CMSIS core function NVIC_EnableIRQ(config.intrSrc) to enable the interrupt.
config | Interrupt configuration structure |
userIsr | Address of the ISR |
cy_israddress Cy_SysInt_SetVector | ( | IRQn_Type | IRQn, |
cy_israddress | userIsr | ||
) |
Changes the ISR vector for the interrupt.
This function relies on the assumption that the vector table is relocated to __ramVectors[RAM_VECTORS_SIZE] in SRAM. Otherwise it will return the address of the default ISR location in the flash vector table.
IRQn | Interrupt source |
userIsr | Address of the ISR to set in the interrupt vector table |
cy_israddress Cy_SysInt_GetVector | ( | IRQn_Type | IRQn | ) |
Gets the address of the current ISR vector for the interrupt.
This function relies on the assumption that the vector table is relocated to __ramVectors[RAM_VECTORS_SIZE] in SRAM. Otherwise it will return the address of the default ISR location in the flash vector table.
IRQn | Interrupt source |
void Cy_SysInt_SetInterruptSource | ( | IRQn_Type | IRQn, |
cy_en_intr_t | devIntrSrc | ||
) |
Configures the interrupt selection for the specified NVIC channel.
To disconnect the interrupt source from the NVIC channel use the Cy_SysInt_DisconnectInterruptSource.
IRQn | NVIC channel number connected to the CPU core. |
devIntrSrc | Device interrupt to be routed to the NVIC channel. |
cy_en_intr_t Cy_SysInt_GetInterruptSource | ( | IRQn_Type | IRQn | ) |
Gets the interrupt source of the NVIC channel.
IRQn | NVIC channel number connected to the CPU core |
IRQn_Type Cy_SysInt_GetNvicConnection | ( | cy_en_intr_t | devIntrSrc | ) |
Gets the NVIC channel to which the interrupt source is connected.
devIntrSrc | Device interrupt that is potentially connected to the NVIC channel. |
cy_en_intr_t Cy_SysInt_GetInterruptActive | ( | IRQn_Type | IRQn | ) |
Gets the highest priority active interrupt for the selected NVIC channel.
The priority of the interrupt in a given channel is determined by the index value of the interrupt in the cy_en_intr_t enum. The lower the index, the higher the priority. E.g. Consider a case where an interrupt source with value 29 and an interrupt source with value 46 both source the same NVIC channel. If both are active (triggered) at the same time, calling Cy_SysInt_GetInterruptActive() will return 29 as the active interrupt.
IRQn | NVIC channel number connected to the CPU core |
void Cy_SysInt_DisconnectInterruptSource | ( | IRQn_Type | IRQn, |
cy_en_intr_t | devIntrSrc | ||
) |
Disconnect the interrupt source from the specified NVIC channel.
IRQn | NVIC channel number connected to the CPU core. This parameter is ignored for devices using CPUSS_ver2. |
devIntrSrc | Device interrupt routed to the NVIC channel. This parameter is ignored for devices using CPUSS_ver1. |
__STATIC_INLINE void Cy_SysInt_SetNmiSource | ( | cy_en_sysint_nmi_t | nmiNum, |
IRQn_Type | intrSrc | ||
) |
Sets the interrupt source of the CPU core NMI.
The interrupt source must be a positive number. Setting the value to "unconnected_IRQn" or "disconnected_IRQn" disconnects the interrupt source from the NMI. Depending on the device, the number of interrupt sources that can provide the NMI trigger signal to the core can vary.
nmiNum | NMI source number. CPUSS_ver2 allows up to 4 sources to trigger the core NMI. CPUSS_ver1 allows only one source to trigger the core NMI and the specified NMI number is ignored. |
intrSrc | Interrupt source. This parameter can either be of type cy_en_intr_t or IRQn_Type based on the selected core. |
__STATIC_INLINE IRQn_Type Cy_SysInt_GetNmiSource | ( | cy_en_sysint_nmi_t | nmiNum | ) |
Gets the interrupt source of the CPU core NMI for the given NMI source number.
nmiNum | NMI source number. CPUSS_ver2 allows up to 4 sources to trigger the core NMI (i.e. #1, 2, 3, 4). CPUSS_ver1 allows only 1 source to trigger the core NMI (i.e #1). |
__STATIC_INLINE void Cy_SysInt_SoftwareTrig | ( | IRQn_Type | IRQn | ) |
Triggers an interrupt using software (Not applicable for CM0+).
IRQn | Interrupt source |