Atmel Software Framework

intc.c File Reference

INTC software driver for AVR UC3 devices.

Copyright (c) 2009-2011 Atmel Corporation. All rights reserved.

#include <avr32/io.h>
#include "compiler.h"
#include "preprocessor.h"
#include "intc.h"

Macros

#define DECL_INT_LINE_HANDLER_TABLE(GRP, unused)
 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. More...
 
#define INSERT_INT_LINE_HANDLER_TABLE(GRP, unused)   {AVR32_INTC_NUM_IRQS_PER_GRP##GRP, _int_line_handler_table_##GRP},
 
#define IPR_INT0
 Values to store in the interrupt priority registers for the various interrupt priority levels. More...
 
#define IPR_INT1
 
#define IPR_INT2
 
#define IPR_INT3
 

Functions

__int_handler _get_interrupt_handler (uint32_t int_level)
 Gets the interrupt handler of the current event at the int_level interrupt priority level (called from exception.S). More...
 
static void _unhandled_interrupt (void)
 Default interrupt handler. More...
 
static __inline__ void INTC_init_evba (void)
 Init EVBA address. This operation may or may not have been done by the C startup process. More...
 
void INTC_init_interrupts (void)
 Initializes the hardware interrupt controller driver. More...
 
void INTC_register_interrupt (__int_handler handler, uint32_t irq, uint32_t int_level)
 Registers an interrupt handler. More...
 
 MREPEAT (AVR32_INTC_NUM_INT_GRPS, DECL_INT_LINE_HANDLER_TABLE,~)
 

Variables

void _evba
 Import the _evba symbol from exception.S. More...
 
void _int0
 Import the symbols _int0, _int1, _int2, _int3 defined in exception.S. More...
 
void _int1
 
void _int2
 
void _int3
 
struct {
   volatile __int_handler *   _int_line_handler_table
 
   unsigned int   num_irqs
 
_int_handler_table [AVR32_INTC_NUM_INT_GRPS]
 Table containing for each interrupt group the number of interrupt request lines and a pointer to the table of interrupt line handlers. More...
 

#define DECL_INT_LINE_HANDLER_TABLE (   GRP,
  unused 
)
Value:
static volatile __int_handler \
_int_line_handler_table_##GRP[Max(AVR32_INTC_NUM_IRQS_PER_GRP##GRP, 1)];
#define Max(a, b)
Definition: filt_dsp16_lpfirdesign.c:55

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.

#define INSERT_INT_LINE_HANDLER_TABLE (   GRP,
  unused 
)    {AVR32_INTC_NUM_IRQS_PER_GRP##GRP, _int_line_handler_table_##GRP},
#define IPR_INT0
Value:
((AVR32_INTC_INT0 << AVR32_INTC_IPR_INTLEVEL_OFFSET) \
| ((int)&_int0 - (int)&_evba))
void _evba
Import the _evba symbol from exception.S.
void _int0
Import the symbols _int0, _int1, _int2, _int3 defined in exception.S.

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

Referenced by INTC_init_interrupts(), and INTC_register_interrupt().

#define IPR_INT1
Value:
((AVR32_INTC_INT1 << AVR32_INTC_IPR_INTLEVEL_OFFSET) \
| ((int)&_int1 - (int)&_evba))
void _evba
Import the _evba symbol from exception.S.
void _int1

Referenced by INTC_register_interrupt().

#define IPR_INT2
Value:
((AVR32_INTC_INT2 << AVR32_INTC_IPR_INTLEVEL_OFFSET) \
| ((int)&_int2 - (int)&_evba))
void _int2
void _evba
Import the _evba symbol from exception.S.

Referenced by INTC_register_interrupt().

#define IPR_INT3
Value:
((AVR32_INTC_INT3 << AVR32_INTC_IPR_INTLEVEL_OFFSET) \
| ((int)&_int3 - (int)&_evba))
void _evba
Import the _evba symbol from exception.S.
void _int3

Referenced by INTC_register_interrupt().

__int_handler _get_interrupt_handler ( uint32_t  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.

References _int_handler_table, clz, and NULL.

static void _unhandled_interrupt ( void  )
static

Default interrupt handler.

Referenced by INTC_init_interrupts().

static __inline__ void INTC_init_evba ( void  )
static

Init EVBA address. This operation may or may not have been done by the C startup process.

References _evba, and Set_system_register.

Referenced by INTC_init_interrupts().

void _evba

Import the _evba symbol from exception.S.

Referenced by _init_startup(), init_exceptions(), and INTC_init_evba().

void _int0

Import the symbols _int0, _int1, _int2, _int3 defined in exception.S.

void _int1
void _int2
void _int3
struct { ... } _int_handler_table[AVR32_INTC_NUM_INT_GRPS]
Initial value:
=
{
#define INSERT_INT_LINE_HANDLER_TABLE(GRP, unused)
}

Table containing for each interrupt group the number of interrupt request lines and a pointer to the table of interrupt line handlers.

Referenced by _get_interrupt_handler(), INTC_init_interrupts(), and INTC_register_interrupt().

volatile __int_handler* _int_line_handler_table
unsigned int num_irqs