![]() |
LUFA Library
120219
|
Interrupt Controller Driver for the AVR32 UC3 microcontrollers. More...
Defines | |
#define | INTC_IRQ_GROUP(IRQIndex) (IRQIndex / 32) |
#define | INTC_IRQ_LINE(IRQIndex) (IRQIndex % 32) |
Functions | |
void | INTC_Init (void) |
static void | INTC_RegisterGroupHandler (const uint16_t GroupNumber, const uint8_t InterruptLevel, const InterruptHandlerPtr_t Handler) ATTR_ALWAYS_INLINE |
static uint_reg_t | INTC_GetGroupInterrupts (const uint16_t GroupNumber) ATTR_ALWAYS_INLINE |
The following files must be built with any user project that uses this module:
Interrupt controller driver for the AVR32 UC3 microcontrollers, for the configuration of interrupt handlers within the device.
Usage Example:
#include <LUFA/Platform/UC3/InterruptManagement.h> ISR(USB_Group_IRQ_Handler) { // USB group handler code here } void main(void) { INTC_Init(); INTC_RegisterGroupHandler(INTC_IRQ_GROUP(AVR32_USBB_IRQ), AVR32_INTC_INT0, USB_Group_IRQ_Handler); }
#define INTC_IRQ_GROUP | ( | IRQIndex | ) | (IRQIndex / 32) |
Converts a given interrupt index into its assocated interrupt group.
[in] | IRQIndex | Index of the interrupt request to convert. |
#define INTC_IRQ_LINE | ( | IRQIndex | ) | (IRQIndex % 32) |
Converts a given interrupt index into its assocated interrupt line.
[in] | IRQIndex | Index of the interrupt request to convert. |
static uint_reg_t INTC_GetGroupInterrupts | ( | const uint16_t | GroupNumber | ) | [inline, static] |
Retrieves the pending interrupts for a given interrupt group. The result of this function should be masked against interrupt request indexes converted to a request line number via the INTC_IRQ_LINE() macro. To obtain the group number of a given interrupt request, use the INTC_IRQ_GROUP() macro.
[in] | GroupNumber | Group number of the interrupt group to check. |
void INTC_Init | ( | void | ) |
Initializes the interrupt controller, nulling out all interrupt handlers ready for new registration. This function should be called once on startup to ensure the interrupt controller is ready for use.
static void INTC_RegisterGroupHandler | ( | const uint16_t | GroupNumber, |
const uint8_t | InterruptLevel, | ||
const InterruptHandlerPtr_t | Handler | ||
) | [inline, static] |
Registers a handler for a given interrupt group. On the AVR32 UC3 devices, interrupts are grouped by peripheral. To save on SRAM used, a single ISR handles all interrupt lines within a single group - to determine the exact line that has interrupted within the group ISR handler, use INTC_GetGroupInterrupts().
If multiple interrupts with the same group are registered, the last registered handler will become the handler called for interrupts raised within that group.
To obtain the group number of a specific interrupt index, use the INTC_IRQ_GROUP() macro.
[in] | GroupNumber | Group number of the interrupt group to register a handler for. |
[in] | InterruptLevel | Priority level for the specified interrupt, a AVR32_INTC_INT* mask. |
[in] | Handler | Address of the ISR handler for the interrupt group. |