ARM: CMSIS-CORE: Introduce NVIC_IsIRQEnabled()
This function returns the enable state of an interrupt. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
parent
d3158897c2
commit
9195b49c18
@ -621,6 +621,19 @@ typedef struct
|
||||
#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
|
||||
|
||||
|
||||
/**
|
||||
\brief Get External Interrupt Enable State
|
||||
\details Returns whether a device-specific interrupt is enabled in the NVIC interrupt controller.
|
||||
\param [in] IRQn External interrupt number. Value cannot be negative.
|
||||
\return 0 Interrupt is disabled.
|
||||
\return 1 Interrupt is enabled.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t NVIC_IsIRQEnabled(IRQn_Type IRQn)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Enable External Interrupt
|
||||
\details Enables a device-specific interrupt in the NVIC interrupt controller.
|
||||
|
@ -737,6 +737,19 @@ typedef struct
|
||||
#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
|
||||
|
||||
|
||||
/**
|
||||
\brief Get External Interrupt Enable State
|
||||
\details Returns whether a device-specific interrupt is enabled in the NVIC interrupt controller.
|
||||
\param [in] IRQn External interrupt number. Value cannot be negative.
|
||||
\return 0 Interrupt is disabled.
|
||||
\return 1 Interrupt is enabled.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t NVIC_IsIRQEnabled(IRQn_Type IRQn)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Enable External Interrupt
|
||||
\details Enables a device-specific interrupt in the NVIC interrupt controller.
|
||||
|
@ -1444,6 +1444,19 @@ __STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get External Interrupt Enable State
|
||||
\details Returns whether a device-specific interrupt is enabled in the NVIC interrupt controller.
|
||||
\param [in] IRQn External interrupt number. Value cannot be negative.
|
||||
\return 0 Interrupt is disabled.
|
||||
\return 1 Interrupt is enabled.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t NVIC_IsIRQEnabled(IRQn_Type IRQn)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Enable External Interrupt
|
||||
\details Enables a device-specific interrupt in the NVIC interrupt controller.
|
||||
|
@ -1618,6 +1618,19 @@ __STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get External Interrupt Enable State
|
||||
\details Returns whether a device-specific interrupt is enabled in the NVIC interrupt controller.
|
||||
\param [in] IRQn External interrupt number. Value cannot be negative.
|
||||
\return 0 Interrupt is disabled.
|
||||
\return 1 Interrupt is enabled.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t NVIC_IsIRQEnabled(IRQn_Type IRQn)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Enable External Interrupt
|
||||
\details Enables a device-specific interrupt in the NVIC interrupt controller.
|
||||
|
@ -1826,6 +1826,19 @@ __STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get External Interrupt Enable State
|
||||
\details Returns whether a device-specific interrupt is enabled in the NVIC interrupt controller.
|
||||
\param [in] IRQn External interrupt number. Value cannot be negative.
|
||||
\return 0 Interrupt is disabled.
|
||||
\return 1 Interrupt is enabled.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t NVIC_IsIRQEnabled(IRQn_Type IRQn)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Enable External Interrupt
|
||||
\details Enables a device-specific interrupt in the NVIC interrupt controller.
|
||||
|
Loading…
Reference in New Issue
Block a user