Actions

EmSys

Tm4clib-nvic-functions

From EdWiki

Revision as of 10:31, 27 December 2018 by Jshankar (Talk | contribs) (nvic_set_priority())

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

NVIC Functions

nvic_clear_pending_irq()

void nvic_clear_pending_irq(uint8_t irqn)
NVIC Clear Pending Interrupt.

Force remove a user interrupt from a pending state. This has no effect if the interrupt is actively being serviced.

Parameters
[in] irqn → Unsigned int8. Interrupt number

nvic_disable_irq()

void nvic_disable_irq(uint8_t irqn)
NVIC Disable Interrupt.

Disables a user interrupt.

Parameters
[in] irqn → Unsigned int8. Interrupt number

nvic_enable_irq()

void nvic_enable_irq(uint8_t irqn)
NVIC Enable Interrupt.

Enables a user interrupt.

Parameters
[in] irqn → Unsigned int8. Interrupt number

nvic_get_irq_enabled()

uint8_t nvic_get_irq_enabled(uint8_t irqn)
NVIC Return Enabled Interrupt.

Parameters
[in] irqn → Unsigned int8. Interrupt number
Returns
Boolean. Interrupt enabled.

nvic_get_pending_irq()

uint8_t nvic_get_pending_irq(uint8_t irqn)
NVIC Return Pending Interrupt.

True if the interrupt has occurred and is waiting for service.

Parameters
[in] irqn → Unsigned int8. Interrupt number
Returns
Boolean. Interrupt pending.

nvic_set_pending_irq()

void nvic_set_pending_irq(uint8_t irqn)
NVIC Set Pending Interrupt.

Force a user interrupt to a pending state. This has no effect if the interrupt is already pending.

Parameters
[in] irqn → Unsigned int8. Interrupt number

nvic_set_priority()

void nvic_set_priority(uint8_t irqn, uint8_t priority)
NVIC Set Interrupt Priority.

CM3, CM4:
There are 16 priority levels only, given by the upper four bits of the priority byte, as required by ARM standards. The priority levels are interpreted according to the pre-emptive priority grouping set in the SCB Application Interrupt and Reset Control Register (SCB_AIRCR), as done in scb_set_priority_grouping.

CM0:

There are 4 priority levels only, given by the upper two bits of the priority byte, as required by ARM standards. No grouping available.

Parameters
[in] irqn → Unsigned int8. Interrupt number
[in] priority → Unsigned int8. Interrupt priority (0 ... 255 in steps of 16)