HWA
Bare metal programming with style
Class _irq: Interrupt Request

Interrupts are HWA objects of class _irq.

Interface




HW_ISR( IRQ [,naked] [,interruptible] ): implement an Interrupt Service Routine. This can be used with assembly language.




HW_ISR( IRQ2, alias, IRQ1 ): make IRQ1 ISR handle IRQ2.




hw( enable, IRQ ) and hwa( enable, IRQ ): enable an IRQ

Example:

hw( enable, (counter2,irq) );




hw( disable, IRQ ) and hwa( disable, IRQ ): disable an IRQ

Example:

hw( disable, (counter1,capture0,irq) );




hw( is_enabled, IRQ ): verify if an IRQ is enabled.

if ( hw( is_enabled, (counter1,capture0,irq) ) ) {
// IRQ is enabled
}




hw( read, IRQ ): read the IRQ flag

Example:

hw( read, (adc,irq) );




hw( clear, IRQ ) and hwa( clear, IRQ ): clear the IRQ flag

Example:

hw( clear, (counter2,overflow,irq) );




hw( enable, interrupts ): enable interrupts

Example:

hw( enable, interrupts );




hw( disable, interrupts ): disable interrupts

Example:

hw( disable, interrupts );
hw
#define hw(...)
hw( action, object [,...] ) executes an action immediately on an object.
Definition: hwa_macros.h:523