This is a driver for global enabling and disabling of interrupts.
Modules | |
Deprecated interrupt definitions | |
Macros | |
#define | CONFIG_INTERRUPT_FORCE_INTC |
Force usage of the ASF INTC driver. More... | |
Functions | |
void | cpu_irq_enter_critical (void) |
void | cpu_irq_leave_critical (void) |
Variables | |
static volatile uint32_t | cpu_irq_critical_section_counter |
static volatile bool | cpu_irq_prev_interrupt_state |
Global interrupt flags | |
typedef uint32_t | irqflags_t |
Type used for holding state of interrupt flag. More... | |
static irqflags_t | cpu_irq_save (void) |
Get and clear the global interrupt flags. More... | |
static bool | cpu_irq_is_enabled_flags (irqflags_t flags) |
Check if interrupts are globally enabled in supplied flags. More... | |
static void | cpu_irq_restore (irqflags_t flags) |
Restore global interrupt flags. More... | |
#define | cpu_irq_enable() |
Enable interrupts globally. More... | |
#define | cpu_irq_disable() |
Disable interrupts globally. More... | |
#define | cpu_irq_is_enabled() (__get_PRIMASK() == 0) |
Check if interrupts are globally enabled. More... | |
Interrupt Service Routine definition | |
#define | ISR(func) void func (void) |
Define service routine. More... | |
#define | irq_initialize_vectors() |
Initialize interrupt vectors. More... | |
#define | irq_register_handler(int_num, int_prio) |
Register handler for interrupt. More... | |
#define CONFIG_INTERRUPT_FORCE_INTC |
Force usage of the ASF INTC driver.
Predefine this symbol when preprocessing to force the use of the ASF INTC driver. This is useful to ensure compatibility across compilers and shall be used only when required by the application needs.
#define cpu_irq_disable | ( | ) |
Disable interrupts globally.
Referenced by buffered_uart_getchar_nowait(), buffered_uart_rx(), cpu_irq_enter_critical(), cpu_irq_save(), and system_interrupt_disable_global().
#define cpu_irq_enable | ( | ) |
Enable interrupts globally.
Referenced by buffered_uart_getchar_nowait(), buffered_uart_rx(), cpu_irq_leave_critical(), cpu_irq_restore(), and system_interrupt_enable_global().
#define cpu_irq_is_enabled | ( | ) | (__get_PRIMASK() == 0) |
Check if interrupts are globally enabled.
Referenced by cpu_irq_enter_critical(), cpu_irq_save(), and system_interrupt_is_global_enabled().
#define irq_initialize_vectors | ( | ) |
Initialize interrupt vectors.
For NVIC the interrupt vectors are put in vector table. So nothing to do to initialize them, except defined the vector function with right name.
This must be called prior to irq_register_handler.
#define irq_register_handler | ( | int_num, | |
int_prio | |||
) |
Register handler for interrupt.
For NVIC the interrupt vectors are put in vector table. So nothing to do to register them, except defined the vector function with right name.
Usage:
#define ISR | ( | func | ) | void func (void) |
Define service routine.
Usage:
func | Name for the function. |
Type used for holding state of interrupt flag.
void cpu_irq_enter_critical | ( | void | ) |
References cpu_irq_critical_section_counter, cpu_irq_disable, cpu_irq_is_enabled, and cpu_irq_prev_interrupt_state.
Referenced by system_interrupt_enter_critical_section().
|
inlinestatic |
Check if interrupts are globally enabled in supplied flags.
flags | Currents state of interrupt flags. |
Referenced by cpu_irq_restore().
void cpu_irq_leave_critical | ( | void | ) |
References Assert, cpu_irq_critical_section_counter, cpu_irq_enable, and cpu_irq_prev_interrupt_state.
Referenced by system_interrupt_leave_critical_section().
|
inlinestatic |
Restore global interrupt flags.
Use in conjunction with cpu_irq_save.
flags | State to set interrupt flag to. |
References cpu_irq_enable, and cpu_irq_is_enabled_flags().
|
inlinestatic |
Get and clear the global interrupt flags.
Use in conjunction with cpu_irq_restore.
References cpu_irq_disable, and cpu_irq_is_enabled.
|
static |
Referenced by cpu_irq_enter_critical(), and cpu_irq_leave_critical().
|
static |
Referenced by cpu_irq_enter_critical(), and cpu_irq_leave_critical().