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 |
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... | |
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... | |
#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 cpu_irq_save().
#define cpu_irq_enable | ( | ) |
Enable interrupts globally.
Referenced by cpu_irq_restore().
#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.
Referenced by main().
#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().
Referenced by _uhd_ctrl_request_end(), _uhd_pipe_trans_complete(), sleepmgr_lock_mode(), sleepmgr_unlock_mode(), sw_timer_service(), SYS_TimerTaskHandler(), udd_disable(), udd_enable(), udd_ep_run(), udi_cdc_ctrl_state_change(), udi_cdc_multi_get_free_tx_buffer(), udi_cdc_multi_get_nb_received_data(), udi_cdc_multi_getc(), udi_cdc_multi_putc(), udi_cdc_multi_read_buf(), udi_cdc_multi_read_no_polling(), udi_cdc_multi_write_buf(), udi_cdc_rx_start(), udi_cdc_tx_send(), udi_hid_generic_send_report_in(), udi_hid_kbd_down(), udi_hid_kbd_modifier_down(), udi_hid_kbd_modifier_up(), udi_hid_kbd_up(), udi_hid_mouse_move(), udi_phdc_senddata(), udi_phdc_waitdata(), uhd_disable(), uhd_enable(), uhd_ep_run(), uhd_setup_request(), uhi_cdc_putc(), uhi_cdc_rx_update(), uhi_cdc_tx_send(), uhi_cdc_tx_update(), and uhi_cdc_write_buf().
|
inlinestatic |
Get and clear the global interrupt flags.
Use in conjunction with cpu_irq_restore.
References cpu_irq_disable, and cpu_irq_is_enabled.
Referenced by _uhd_ctrl_request_end(), _uhd_pipe_trans_complete(), sleepmgr_lock_mode(), sleepmgr_unlock_mode(), sw_timer_service(), SYS_TimerTaskHandler(), udd_disable(), udd_enable(), udd_ep_run(), udi_cdc_ctrl_state_change(), udi_cdc_multi_get_free_tx_buffer(), udi_cdc_multi_get_nb_received_data(), udi_cdc_multi_getc(), udi_cdc_multi_putc(), udi_cdc_multi_read_buf(), udi_cdc_multi_read_no_polling(), udi_cdc_multi_write_buf(), udi_cdc_rx_start(), udi_cdc_tx_send(), udi_hid_generic_send_report_in(), udi_hid_kbd_down(), udi_hid_kbd_modifier_down(), udi_hid_kbd_modifier_up(), udi_hid_kbd_up(), udi_hid_mouse_move(), udi_phdc_senddata(), udi_phdc_waitdata(), uhd_disable(), uhd_enable(), uhd_ep_run(), uhd_setup_request(), uhi_cdc_putc(), uhi_cdc_rx_update(), uhi_cdc_tx_send(), uhi_cdc_tx_update(), and uhi_cdc_write_buf().
|
static |
Referenced by cpu_irq_enter_critical(), and cpu_irq_leave_critical().
|
static |
Referenced by cpu_irq_enter_critical(), and cpu_irq_leave_critical().