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 ( defined (__GNUC__) && ( defined (__AVR32_UC3A0128__) || defined (__AVR32_UC3A0256__) || defined (__AVR32_UC3A0512__) || defined (__AVR32_UC3A0512ES__) || defined (__AVR32_UC3A1128__) || defined (__AVR32_UC3A1256__) || defined (__AVR32_UC3A1512__) || defined (__AVR32_UC3A1512ES__))) \
00057 ||( defined (__ICCAVR32__) && ( defined (__AT32UC3A0128__) || defined (__AT32UC3A0256__) || defined (__AT32UC3A0512__) || defined (__AT32UC3A0512ES__) || defined (__AT32UC3A1128__) || defined (__AT32UC3A1256__) || defined (__AT32UC3A1512__) || defined (__AT32UC3A1512ES__))) \
00058 ||( defined (__GNUC__) && ( defined (__AVR32_UC3B064__) || defined (__AVR32_UC3B0128__) || defined (__AVR32_UC3B0256__) || defined (__AVR32_UC3B0256ES__) || defined (__AVR32_UC3B164__) || defined (__AVR32_UC3B1128__) || defined (__AVR32_UC3B1256__) || defined (__AVR32_UC3B1256ES__))) \
00059 ||( defined (__ICCAVR32__) && ( defined (__AT32UC3B064__) || defined (__AT32UC3B0128__) || defined (__AT32UC3B0256__) || defined (__AT32UC3B0256ES__) || defined (__AT32UC3B164__) || defined (__AT32UC3B1128__) || defined (__AT32UC3B1256__) || defined (__AT32UC3B1256ES__))) \
00060 ||( defined (__GNUC__) && ( defined (__AVR32_UC3A364__) || defined (__AVR32_UC3A364S__) || defined (__AVR32_UC3A3128__) || defined (__AVR32_UC3A3128S__) || defined (__AVR32_UC3B164__) || defined (__AVR32_UC3A3256__) || defined (__AVR32_UC3A3256S__))) \
00061 ||( defined (__ICCAVR32__) && ( defined (__AT32UC3A364__) || defined (__AT32UC3A364S__) || defined (__AT32UC3A3128__) || defined (__AT32UC3A3128S__) || defined (__AT32UC3B164__) || defined (__AT32UC3A3256__) || defined (__AT32UC3A3256S__)))
00062 #define EXT_INT0 AVR32_EIC_INT0
00063 #define EXT_INT1 AVR32_EIC_INT1
00064 #define EXT_INT2 AVR32_EIC_INT2
00065 #define EXT_INT3 AVR32_EIC_INT3
00066 #define EXT_INT4 AVR32_EIC_INT4
00067 #define EXT_INT5 AVR32_EIC_INT5
00068 #define EXT_INT6 AVR32_EIC_INT6
00069 #define EXT_INT7 AVR32_EIC_INT7
00070 #define EXT_NMI AVR32_EIC_NMI
00071 #else
00072 #define EXT_INT0 AVR32_EIC_INT1
00073 #define EXT_INT1 AVR32_EIC_INT2
00074 #define EXT_INT2 AVR32_EIC_INT3
00075 #define EXT_INT3 AVR32_EIC_INT4
00076 #define EXT_INT4 AVR32_EIC_INT5
00077 #define EXT_INT5 AVR32_EIC_INT6
00078 #define EXT_INT6 AVR32_EIC_INT7
00079 #define EXT_INT7 AVR32_EIC_INT8
00080 #define EXT_NMI AVR32_EIC_NMI
00081
00082 #endif
00083
00085
00088
00089 #define EIC_MODE_EDGE_TRIGGERED AVR32_EIC_EDGE_IRQ
00090 #define EIC_MODE_LEVEL_TRIGGERED AVR32_EIC_LEVEL_IRQ
00091
00092
00093
00095
00096 #define EIC_EDGE_FALLING_EDGE AVR32_EIC_FALLING_EDGE
00097 #define EIC_EDGE_RISING_EDGE AVR32_EIC_RISING_EDGE
00098
00099
00100
00102
00103 #define EIC_LEVEL_LOW_LEVEL AVR32_EIC_LOW_LEVEL
00104 #define EIC_LEVEL_HIGH_LEVEL AVR32_EIC_HIGH_LEVEL
00105
00106
00107
00109
00110 #define EIC_FILTER_ENABLED AVR32_EIC_FILTER_ON
00111 #define EIC_FILTER_DISABLED AVR32_EIC_FILTER_OFF
00112
00113
00114
00116
00117 #define EIC_SYNCH_MODE AVR32_EIC_SYNC
00118 #define EIC_ASYNCH_MODE AVR32_EIC_USE_ASYNC
00119
00120
00122 typedef struct
00123 {
00125 unsigned char eic_line;
00126
00128 unsigned char eic_mode;
00129
00131 unsigned char eic_edge;
00132
00134 unsigned char eic_level;
00135
00137 unsigned char eic_filter;
00138
00140 unsigned char eic_async;
00141
00142 } eic_options_t;
00143
00144
00151 extern void eic_init(volatile avr32_eic_t *eic, const eic_options_t *opt, unsigned int nb_lines);
00152
00158 extern void eic_enable_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00159
00165 extern void eic_enable_line(volatile avr32_eic_t *eic, unsigned int line_number);
00166
00172 extern void eic_disable_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00173
00179 extern void eic_disable_line(volatile avr32_eic_t *eic, unsigned int line_number);
00180
00188 extern Bool eic_is_line_enabled(volatile avr32_eic_t *eic, unsigned int line_number);
00189
00192
00193
00199 extern void eic_enable_interrupt_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00200
00206 extern void eic_enable_interrupt_line(volatile avr32_eic_t *eic, unsigned int line_number);
00207
00213 extern void eic_disable_interrupt_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00214
00220 extern void eic_disable_interrupt_line(volatile avr32_eic_t *eic, unsigned int line_number);
00221
00229 extern Bool eic_is_interrupt_line_enabled(volatile avr32_eic_t *eic, unsigned int line_number);
00230
00237 extern void eic_clear_interrupt_lines(volatile avr32_eic_t *eic, unsigned int mask_lines);
00238
00245 extern void eic_clear_interrupt_line(volatile avr32_eic_t *eic, unsigned int line_number);
00246
00254 extern Bool eic_is_interrupt_line_pending(volatile avr32_eic_t *eic, unsigned int line_number);
00255
00261 extern void eic_enable_interrupt_scan(volatile avr32_eic_t *eic, unsigned int presc);
00262
00267 extern void eic_disable_interrupt_scan(volatile avr32_eic_t *eic);
00268
00273 extern unsigned long eic_get_interrupt_pad_scan(volatile avr32_eic_t *eic);
00274
00276
00277
00278 #endif // _EIC_H_