AVR32 Interrupt Controller driver module.
Definition in file intc.h.
#include "compiler.h"
Go to the source code of this file.
Defines | |
#define | AVR32_INTC_MAX_NUM_IRQS_PER_GRP 32 |
Maximal number of interrupt request lines per group. | |
#define | AVR32_INTC_NUM_INT_LEVELS (1 << AVR32_INTC_IPR_INTLEVEL_SIZE) |
Number of interrupt priority levels. | |
Typedefs | |
typedef void(* | __int_handler )(void) |
Pointer to interrupt handler. | |
Functions | |
void | INTC_register_interrupt (__int_handler handler, unsigned int irq, unsigned int int_level) |
Registers an interrupt handler. |
#define AVR32_INTC_MAX_NUM_IRQS_PER_GRP 32 |
Maximal number of interrupt request lines per group.
Definition at line 55 of file intc.h.
Referenced by INTC_register_interrupt().
#define AVR32_INTC_NUM_INT_LEVELS (1 << AVR32_INTC_IPR_INTLEVEL_SIZE) |
typedef void(* __int_handler)(void) |
void INTC_register_interrupt | ( | __int_handler | handler, | |
unsigned int | irq, | |||
unsigned int | int_level | |||
) |
Registers an interrupt handler.
handler | Interrupt handler to register. | |
irq | IRQ of the interrupt handler to register. | |
int_level | Interrupt priority level to assign to the group of this IRQ. |
If several interrupt handlers of a same group are registered, all interrupts of this group will fetch the last interrupt handler registered for this group with the last registered interrupt priority level.
Definition at line 57 of file intc.c.
References _evba, and AVR32_INTC_MAX_NUM_IRQS_PER_GRP.
00058 { 00059 // Program the IPRX register of the IRQ group to set the interrupt priority 00060 // level and the interrupt vector offset that will be fetched by the core 00061 // interrupt system. 00062 AVR32_INTC.ipr[irq / AVR32_INTC_MAX_NUM_IRQS_PER_GRP] = 00063 ((((U32)handler - (U32)&_evba) << AVR32_INTC_IPR_AUTOVECTOR_OFFSET) & AVR32_INTC_IPR_AUTOVECTOR_MASK) | 00064 ((int_level << AVR32_INTC_IPR_INTLEVEL_OFFSET) & AVR32_INTC_IPR_INTLEVEL_MASK); 00065 }