Nut/OS  4.10.3
API Reference
ihndlr.c File Reference

INTC driver for AVR32 UC3. More...

#include <arch/avr32.h>
#include <dev/irqreg.h>
#include <avr32/io.h>
#include <arch/avr32/preprocessor.h>
Include dependency graph for ihndlr.c:

Go to the source code of this file.

Defines

#define AVR32_INTC_MAX_NUM_IRQS_PER_GRP   32
 Maximum number of interrupt request lines per group.
#define AVR32_INTC_NUM_INT_LEVELS   (1 << AVR32_INTC_IPR_INTLEVEL_SIZE)
 Number of interrupt priority levels.
#define Max(a, b)   (((a) > (b)) ? (a) : (b))
#define DECL_INT_LINE_HANDLER_TABLE(GRP, unused)   static volatile __int_handler _int_line_handler_table_##GRP[Max(AVR32_INTC_NUM_IRQS_PER_GRP##GRP, 1)];
#define INSERT_INT_LINE_HANDLER_TABLE(GRP, unused)   {AVR32_INTC_NUM_IRQS_PER_GRP##GRP, _int_line_handler_table_##GRP},

Typedefs

typedef void(* __int_handler )(void)
 Pointer to interrupt handler.

Functions

 MREPEAT (AVR32_INTC_NUM_INT_GRPS, DECL_INT_LINE_HANDLER_TABLE,~)
__int_handler _get_interrupt_handler (unsigned int int_level)
 Gets the interrupt handler of the current event at the int_level interrupt priority level (called from exception.S).
void init_interrupts (void)
void register_interrupt (__int_handler handler, unsigned int irq, unsigned int int_level)

Variables

void _evba
const unsigned int ipr_val [AVR32_INTC_NUM_INT_LEVELS]
 Values to store in the interrupt priority registers for the various interrupt priority levels.

Detailed Description

INTC driver for AVR32 UC3.

AVR32 Interrupt Controller driver module.

  • Compiler: IAR EWAVR32 and GNU GCC for AVR32
  • Supported devices: All AVR32 devices with an INTC module can be used.
  • AppNote:
Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file ihndlr.c.


Define Documentation

#define AVR32_INTC_MAX_NUM_IRQS_PER_GRP   32

Maximum number of interrupt request lines per group.

Definition at line 58 of file ihndlr.c.

Referenced by register_interrupt().

#define AVR32_INTC_NUM_INT_LEVELS   (1 << AVR32_INTC_IPR_INTLEVEL_SIZE)

Number of interrupt priority levels.

Definition at line 61 of file ihndlr.c.

#define Max (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 66 of file ihndlr.c.

#define DECL_INT_LINE_HANDLER_TABLE (   GRP,
  unused 
)    static volatile __int_handler _int_line_handler_table_##GRP[Max(AVR32_INTC_NUM_IRQS_PER_GRP##GRP, 1)];

Creates a table of interrupt line handlers per interrupt group in order to optimize RAM space. Each line handler table contains a set of pointers to interrupt handlers.

Definition at line 79 of file ihndlr.c.

#define INSERT_INT_LINE_HANDLER_TABLE (   GRP,
  unused 
)    {AVR32_INTC_NUM_IRQS_PER_GRP##GRP, _int_line_handler_table_##GRP},

Typedef Documentation

typedef void(* __int_handler)(void)

Pointer to interrupt handler.

Definition at line 64 of file ihndlr.c.


Function Documentation

MREPEAT ( AVR32_INTC_NUM_INT_GRPS  ,
DECL_INT_LINE_HANDLER_TABLE  ,
 
)
__int_handler _get_interrupt_handler ( unsigned int  int_level)

Gets the interrupt handler of the current event at the int_level interrupt priority level (called from exception.S).

Parameters:
int_levelInterrupt priority level to handle.
Returns:
Interrupt handler to execute.
Note:
Taken and adapted from Newlib.

Definition at line 121 of file ihndlr.c.

void init_interrupts ( void  )

Definition at line 183 of file ihndlr.c.

References ipr_val.

Referenced by NutIdle().

void register_interrupt ( __int_handler  handler,
unsigned int  irq,
unsigned int  int_level 
)

Definition at line 207 of file ihndlr.c.

References AVR32_INTC_MAX_NUM_IRQS_PER_GRP, and ipr_val.

Referenced by NutRegisterTimer().


Variable Documentation

void _evba
const unsigned int ipr_val[AVR32_INTC_NUM_INT_LEVELS]

Values to store in the interrupt priority registers for the various interrupt priority levels.

Referenced by init_interrupts(), and register_interrupt().

unsigned int num_irqs

Definition at line 92 of file ihndlr.c.

Definition at line 93 of file ihndlr.c.