00001
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef _EIC_H_
00049 #define _EIC_H_
00050
00051 #include "compiler.h"
00052
00055
00056 #if (UC3A || UC3B)
00057 #define EXT_INT0 AVR32_EIC_INT0
00058 #define EXT_INT1 AVR32_EIC_INT1
00059 #define EXT_INT2 AVR32_EIC_INT2
00060 #define EXT_INT3 AVR32_EIC_INT3
00061 #define EXT_INT4 AVR32_EIC_INT4
00062 #define EXT_INT5 AVR32_EIC_INT5
00063 #define EXT_INT6 AVR32_EIC_INT6
00064 #define EXT_INT7 AVR32_EIC_INT7
00065 #define EXT_NMI AVR32_EIC_NMI
00066 #else
00067 #define EXT_INT0 AVR32_EIC_INT1
00068 #define EXT_INT1 AVR32_EIC_INT2
00069 #define EXT_INT2 AVR32_EIC_INT3
00070 #define EXT_INT3 AVR32_EIC_INT4
00071 #define EXT_INT4 AVR32_EIC_INT5
00072 #define EXT_INT5 AVR32_EIC_INT6
00073 #define EXT_INT6 AVR32_EIC_INT7
00074 #define EXT_INT7 AVR32_EIC_INT8
00075 #define EXT_NMI AVR32_EIC_NMI
00076
00077 #endif
00078
00080
00083
00084 #define EIC_MODE_EDGE_TRIGGERED AVR32_EIC_EDGE_IRQ
00085 #define EIC_MODE_LEVEL_TRIGGERED AVR32_EIC_LEVEL_IRQ
00086
00087
00088
00090
00091 #define EIC_EDGE_FALLING_EDGE AVR32_EIC_FALLING_EDGE
00092 #define EIC_EDGE_RISING_EDGE AVR32_EIC_RISING_EDGE
00093
00094
00095
00097
00098 #define EIC_LEVEL_LOW_LEVEL AVR32_EIC_LOW_LEVEL
00099 #define EIC_LEVEL_HIGH_LEVEL AVR32_EIC_HIGH_LEVEL
00100
00101
00102
00104
00105 #define EIC_FILTER_ENABLED AVR32_EIC_FILTER_ON
00106 #define EIC_FILTER_DISABLED AVR32_EIC_FILTER_OFF
00107
00108
00109
00111
00112 #define EIC_SYNCH_MODE AVR32_EIC_SYNC
00113 #define EIC_ASYNCH_MODE AVR32_EIC_USE_ASYNC
00114
00115
00117 typedef struct
00118 {
00120 unsigned char eic_line;
00121
00123 unsigned char eic_mode;
00124
00126 unsigned char eic_edge;
00127
00129 unsigned char eic_level;
00130
00132 unsigned char eic_filter;
00133
00135 unsigned char eic_async;
00136
00137 } eic_options_t;
00138
00139
00146 extern void eic_init(volatile avr32_eic_t *eic, const eic_options_t *opt, unsigned int nb_lines);
00147
00153 extern void eic_enable_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00154
00160 extern void eic_enable_line(volatile avr32_eic_t *eic, unsigned int line_number);
00161
00167 extern void eic_disable_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00168
00174 extern void eic_disable_line(volatile avr32_eic_t *eic, unsigned int line_number);
00175
00183 extern Bool eic_is_line_enabled(volatile avr32_eic_t *eic, unsigned int line_number);
00184
00187
00188
00194 extern void eic_enable_interrupt_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00195
00201 extern void eic_enable_interrupt_line(volatile avr32_eic_t *eic, unsigned int line_number);
00202
00208 extern void eic_disable_interrupt_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00209
00215 extern void eic_disable_interrupt_line(volatile avr32_eic_t *eic, unsigned int line_number);
00216
00224 extern Bool eic_is_interrupt_line_enabled(volatile avr32_eic_t *eic, unsigned int line_number);
00225
00232 extern void eic_clear_interrupt_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00233
00240 extern void eic_clear_interrupt_line(volatile avr32_eic_t *eic, unsigned int line_number);
00241
00249 extern Bool eic_is_interrupt_line_pending(volatile avr32_eic_t *eic, unsigned int line_number);
00250
00256 extern void eic_enable_interrupt_scan(volatile avr32_eic_t *eic, unsigned int presc);
00257
00262 extern void eic_disable_interrupt_scan(volatile avr32_eic_t *eic);
00263
00268 extern unsigned long eic_get_interrupt_pad_scan(volatile avr32_eic_t *eic);
00269
00271
00272
00273 #endif // _EIC_H_