Microchip® Advanced Software Framework

eic_example3.c File Reference
#include <avr32/io.h>
#include "compiler.h"
#include "gpio.h"
#include "board.h"
#include "eic.h"
#include "intc.h"

Macros

Keypad scan index configuration

Choose the scan index for each scan column in the [0,7] range.

Warning
: caution should be taken in the choice of this index regarding the board schematics. For instance, on EVK1100, if scan[4] & scan[5] were chosen, LED5 will blink at the keypad scan rate because LED5 and scan[4] and scan[5] are using the same pins(PB19 & PB20).
#define SCAN_COL1_IDX   0
 
#define SCAN_COL1_MUX   _0
 
#define SCAN_COL2_IDX   1
 
#define SCAN_COL2_MUX   _0
 
External Interrupt pin Mappings
#define EXT_INT_EXAMPLE_PIN_LINE1   AVR32_EIC_EXTINT_6_PIN
 
#define EXT_INT_EXAMPLE_FUNCTION_LINE1   AVR32_EIC_EXTINT_6_FUNCTION
 
#define EXT_INT_EXAMPLE_LINE1   EXT_INT6
 
#define EXT_INT_EXAMPLE_IRQ_LINE1   AVR32_EIC_IRQ_6
 
#define EXT_INT_EXAMPLE_PIN_LINE2   AVR32_EIC_EXTINT_7_PIN
 
#define EXT_INT_EXAMPLE_FUNCTION_LINE2   AVR32_EIC_EXTINT_7_FUNCTION
 
#define EXT_INT_EXAMPLE_LINE2   EXT_INT7
 
#define EXT_INT_EXAMPLE_IRQ_LINE2   AVR32_EIC_IRQ_7
 
#define EXT_SCAN_EXAMPLE_PIN_LINE1   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL1_IDX,SCAN_COL1_MUX,_PIN)
 
#define EXT_SCAN_EXAMPLE_FUNCTION_LINE1   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL1_IDX,SCAN_COL1_MUX,_FUNCTION)
 
#define EXT_SCAN_EXAMPLE_PIN_LINE2   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL2_IDX,SCAN_COL2_MUX,_PIN)
 
#define EXT_SCAN_EXAMPLE_FUNCTION_LINE2   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL2_IDX,SCAN_COL2_MUX,_FUNCTION)
 

Functions

static void eic_int_handler1 (void)
 Interrupt handler of the External interrupt line "1". More...
 
static void eic_int_handler2 (void)
 Interrupt handler of the External interrupt line "2". More...
 
int main (void)
 
static void software_delay (void)
 

Variables

static volatile bool bCancelSwDelay = false
 Global var used to cancel the software delay if an External Interrupt occurs. More...
 
eic_options_t eic_options [2]
 Structure holding the configuration parameters of the EIC module. More...
 
unsigned char key_number = 0
 Global var used to switch between different LED patterns. More...
 

#define EXT_INT_EXAMPLE_FUNCTION_LINE1   AVR32_EIC_EXTINT_6_FUNCTION

Referenced by main().

#define EXT_INT_EXAMPLE_FUNCTION_LINE2   AVR32_EIC_EXTINT_7_FUNCTION

Referenced by main().

#define EXT_INT_EXAMPLE_IRQ_LINE1   AVR32_EIC_IRQ_6

Referenced by main().

#define EXT_INT_EXAMPLE_IRQ_LINE2   AVR32_EIC_IRQ_7

Referenced by main().

#define EXT_INT_EXAMPLE_LINE1   EXT_INT6
#define EXT_INT_EXAMPLE_LINE2   EXT_INT7

Referenced by eic_int_handler2(), and main().

#define EXT_INT_EXAMPLE_PIN_LINE1   AVR32_EIC_EXTINT_6_PIN

Referenced by main().

#define EXT_INT_EXAMPLE_PIN_LINE2   AVR32_EIC_EXTINT_7_PIN

Referenced by main().

#define EXT_SCAN_EXAMPLE_FUNCTION_LINE1   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL1_IDX,SCAN_COL1_MUX,_FUNCTION)

Referenced by main().

#define EXT_SCAN_EXAMPLE_FUNCTION_LINE2   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL2_IDX,SCAN_COL2_MUX,_FUNCTION)

Referenced by main().

#define EXT_SCAN_EXAMPLE_PIN_LINE1   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL1_IDX,SCAN_COL1_MUX,_PIN)

Referenced by main().

#define EXT_SCAN_EXAMPLE_PIN_LINE2   ATPASTE4(AVR32_EIC_SCAN_,SCAN_COL2_IDX,SCAN_COL2_MUX,_PIN)

Referenced by main().

#define SCAN_COL1_IDX   0
#define SCAN_COL1_MUX   _0
#define SCAN_COL2_IDX   1
#define SCAN_COL2_MUX   _0

static void eic_int_handler1 ( void  )
static

Interrupt handler of the External interrupt line "1".

References bCancelSwDelay, eic_clear_interrupt_line(), eic_get_interrupt_pad_scan(), EXT_INT_EXAMPLE_LINE1, key_number, SCAN_COL1_IDX, and SCAN_COL2_IDX.

Referenced by main().

static void eic_int_handler2 ( void  )
static

Interrupt handler of the External interrupt line "2".

References bCancelSwDelay, eic_clear_interrupt_line(), eic_get_interrupt_pad_scan(), EXT_INT_EXAMPLE_LINE2, key_number, SCAN_COL1_IDX, and SCAN_COL2_IDX.

Referenced by main().

static void software_delay ( void  )
static

References bCancelSwDelay, and i.

Referenced by main().

volatile bool bCancelSwDelay = false
static

Global var used to cancel the software delay if an External Interrupt occurs.

Referenced by eic_int_handler1(), eic_int_handler2(), and software_delay().

eic_options_t eic_options[2]

Structure holding the configuration parameters of the EIC module.

unsigned char key_number = 0

Global var used to switch between different LED patterns.

Referenced by eic_int_handler1(), eic_int_handler2(), eic_nmi_handler(), and main().