AVR32 External Interrupt Controller driver module.
Definition in file eic.c.
#include <avr32/io.h>
#include "compiler.h"
#include "preprocessor.h"
#include "eic.h"
Go to the source code of this file.
Functions | |
void | eic_clear_interrupt_line (volatile avr32_eic_t *eic, unsigned int line_number) |
Clear the interrupt flag. Call this function once you've handled the interrupt. | |
void | eic_clear_interrupt_lines (volatile avr32_eic_t *eic, unsigned int mask_lines) |
Clear the interrupt flag. Call this function once you've handled the interrupt. | |
void | eic_disable_interrupt_line (volatile avr32_eic_t *eic, unsigned int line_number) |
Disable the interrupt feature of the EIC. | |
void | eic_disable_interrupt_lines (volatile avr32_eic_t *eic, unsigned int mask_lines) |
Disable the interrupt feature of the EIC. | |
void | eic_disable_interrupt_scan (volatile avr32_eic_t *eic) |
Disable the interrupt scan feature of the EIC. | |
void | eic_disable_line (volatile avr32_eic_t *eic, unsigned int line_number) |
Disable the EIC driver. | |
void | eic_disable_lines (volatile avr32_eic_t *eic, unsigned int mask_lines) |
Disable the EIC driver. | |
void | eic_enable_interrupt_line (volatile avr32_eic_t *eic, unsigned int line_number) |
Enable the interrupt feature of the EIC. | |
void | eic_enable_interrupt_lines (volatile avr32_eic_t *eic, unsigned int mask_lines) |
Enable the interrupt feature of the EIC. | |
void | eic_enable_interrupt_scan (volatile avr32_eic_t *eic, unsigned int presc) |
Enable the interrupt scan feature of the EIC. | |
void | eic_enable_line (volatile avr32_eic_t *eic, unsigned int line_number) |
Enable the EIC driver. | |
void | eic_enable_lines (volatile avr32_eic_t *eic, unsigned int mask_lines) |
Enable the EIC driver. | |
unsigned long | eic_get_interrupt_pad_scan (volatile avr32_eic_t *eic) |
Return scan pad number that causes interrupt. | |
void | eic_init (volatile avr32_eic_t *eic, const eic_options_t *opt, unsigned int nb_lines) |
Init the EIC driver. | |
Bool | eic_is_interrupt_line_enabled (volatile avr32_eic_t *eic, unsigned int line_number) |
Tells whether an EIC interrupt line is enabled. | |
Bool | eic_is_interrupt_line_pending (volatile avr32_eic_t *eic, unsigned int line_number) |
Tells whether an EIC interrupt line is pending. | |
Bool | eic_is_line_enabled (volatile avr32_eic_t *eic, unsigned int line_number) |
Tells whether an EIC line is enabled. |
void eic_clear_interrupt_line | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |
Clear the interrupt flag. Call this function once you've handled the interrupt.
eic | Base address of the EIC (i.e. &AVR32_EIC). | |
line_number | Line number to clear |
Definition at line 147 of file eic.c.
Referenced by eic_int_handler1(), and eic_int_handler2().
00148 { 00149 Bool global_interrupt_enabled = Is_global_interrupt_enabled(); 00150 00151 // Clear line line_number 00152 if (global_interrupt_enabled) Disable_global_interrupt(); 00153 eic->icr = 1 << line_number; 00154 eic->isr; 00155 if (global_interrupt_enabled) Enable_global_interrupt(); 00156 }
void eic_clear_interrupt_lines | ( | volatile avr32_eic_t * | eic, | |
unsigned int | mask_lines | |||
) |
Clear the interrupt flag. Call this function once you've handled the interrupt.
eic | Base address of the EIC (i.e. &AVR32_EIC). | |
mask_lines | Mask for current selected lines |
Definition at line 137 of file eic.c.
00138 { 00139 Bool global_interrupt_enabled = Is_global_interrupt_enabled(); 00140 00141 if (global_interrupt_enabled) Disable_global_interrupt(); 00142 eic->icr = mask_lines; 00143 eic->isr; 00144 if (global_interrupt_enabled) Enable_global_interrupt(); 00145 }
void eic_disable_interrupt_line | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |
Disable the interrupt feature of the EIC.
eic | Base address of the EIC (i.e. &AVR32_EIC). | |
line_number | Line number to disable |
Definition at line 121 of file eic.c.
00122 { 00123 Bool global_interrupt_enabled = Is_global_interrupt_enabled(); 00124 00125 // Disable line line_number 00126 if (global_interrupt_enabled) Disable_global_interrupt(); 00127 eic->idr = 1 << line_number; 00128 eic->imr; 00129 if (global_interrupt_enabled) Enable_global_interrupt(); 00130 }
void eic_disable_interrupt_lines | ( | volatile avr32_eic_t * | eic, | |
unsigned int | mask_lines | |||
) |
Disable the interrupt feature of the EIC.
eic | Base address of the EIC (i.e. &AVR32_EIC). | |
mask_lines | Mask for current selected lines |
Definition at line 111 of file eic.c.
00112 { 00113 Bool global_interrupt_enabled = Is_global_interrupt_enabled(); 00114 00115 if (global_interrupt_enabled) Disable_global_interrupt(); 00116 eic->idr = mask_lines; 00117 eic->imr; 00118 if (global_interrupt_enabled) Enable_global_interrupt(); 00119 }
void eic_disable_interrupt_scan | ( | volatile avr32_eic_t * | eic | ) |
void eic_disable_line | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |
void eic_disable_lines | ( | volatile avr32_eic_t * | eic, | |
unsigned int | mask_lines | |||
) |
void eic_enable_interrupt_line | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |
void eic_enable_interrupt_lines | ( | volatile avr32_eic_t * | eic, | |
unsigned int | mask_lines | |||
) |
void eic_enable_interrupt_scan | ( | volatile avr32_eic_t * | eic, | |
unsigned int | presc | |||
) |
Enable the interrupt scan feature of the EIC.
eic | Base address of the EIC (i.e. &AVR32_EIC). | |
presc | Prescale select for the keypad scan rate in the range [0,31]. |
Definition at line 164 of file eic.c.
00165 { 00166 // Enable SCAN function with PRESC value 00167 eic->scan |= (presc << AVR32_EIC_SCAN_PRESC_OFFSET) | (1 << AVR32_EIC_SCAN_EN_OFFSET); 00168 }
void eic_enable_line | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |
void eic_enable_lines | ( | volatile avr32_eic_t * | eic, | |
unsigned int | mask_lines | |||
) |
unsigned long eic_get_interrupt_pad_scan | ( | volatile avr32_eic_t * | eic | ) |
void eic_init | ( | volatile avr32_eic_t * | eic, | |
const eic_options_t * | opt, | |||
unsigned int | nb_lines | |||
) |
Init the EIC driver.
eic | Base address of the EIC module | |
opt | Configuration parameters of the EIC module (see eic_options_t) | |
nb_lines | Number of lines to consider, equal to size of opt buffer |
Definition at line 55 of file eic.c.
References eic_options_t::eic_async, eic_options_t::eic_edge, eic_options_t::eic_filter, eic_options_t::eic_level, eic_options_t::eic_line, and eic_options_t::eic_mode.
Referenced by main().
00056 { 00057 int i; 00058 for (i = 0; i < nb_lines; i++) 00059 { 00060 // Set up mode level 00061 eic->mode = (opt[i].eic_mode == 1) ? (eic->mode | (1 << opt[i].eic_line)) : (eic->mode & ~(1 << opt[i].eic_line)); 00062 // Set up edge type 00063 eic->edge = (opt[i].eic_edge == 1) ? (eic->edge | (1 << opt[i].eic_line)) : (eic->edge & ~(1 << opt[i].eic_line)); 00064 // Set up level 00065 eic->level = (opt[i].eic_level == 1) ? (eic->level | (1 << opt[i].eic_line)) : (eic->level & ~(1 << opt[i].eic_line)); 00066 // Set up if filter is used 00067 eic->filter = (opt[i].eic_filter == 1) ? (eic->filter | (1 << opt[i].eic_line)) : (eic->filter & ~(1 << opt[i].eic_line)); 00068 // Set up which mode is used : asynchronous mode/ synchronous mode 00069 eic->async = (opt[i].eic_async == 1) ? (eic->async | (1 << opt[i].eic_line)) : (eic->async & ~(1 << opt[i].eic_line)); 00070 } 00071 }
Bool eic_is_interrupt_line_enabled | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |
Bool eic_is_interrupt_line_pending | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |
Bool eic_is_line_enabled | ( | volatile avr32_eic_t * | eic, | |
unsigned int | line_number | |||
) |