2 * interrupts.h - arm exception handling header file
4 * author: hackbard@hackdaworld.org
16 #define INTERRUPT_MAX_VIC 16
18 #define INTERRUPT_WATCHDOG 0
19 #define INTERRUPT_DBG_COMM_RX 2
20 #define INTERRUPT_DBG_COMM_TX 3
21 #define INTERRUPT_TIMER0 4
22 #define INTERRUPT_TIMER1 5
23 #define INTERRUPT_UART0 6
24 #define INTERRUPT_UART1 7
25 #define INTERRUPT_PWM 8
26 #define INTERRUPT_I2C 9
27 #define INTERRUPT_SPI0 10
28 #define INTERRUPT_SPI1 11
29 #define INTERRUPT_PLL 12
30 #define INTERRUPT_RTC 13
31 #define INTERRUPT_EINT0 14
32 #define INTERRUPT_EINT1 15
33 #define INTERRUPT_EINT2 16
34 #define INTERRUPT_EINT3 17
35 #define INTERRUPT_ADC 18
37 #define INTERRUPT_MODE_IRQ 0
38 #define INTERRUPT_MODE_VIRQ 1
39 #define INTERRUPT_MODE_FIQ 2
41 #define INTERRUPT_EXT_MODE_EDGE 0
42 #define INTERRUPT_EXT_MODE_LEVEL 1
43 #define INTERRUPT_EXT_POLAR_LOW 0
44 #define INTERRUPT_EXT_POLAR_HIGH 1
45 #define INTERRUPT_EXT_NOWAKE 0
46 #define INTERRUPT_EXT_WAKEUP 1
48 #define INTERRUPT_EXT0 0
49 #define INTERRUPT_EXT1 1
50 #define INTERRUPT_EXT2 2
51 #define INTERRUPT_EXT3 3
53 #define INTERRUPT_TC_MODE_T 0x00
54 #define INTERRUPT_TC_MODE_CR 0x01
55 #define INTERRUPT_TC_MODE_CF 0x02
56 #define INTERRUPT_TC_MODE_CB 0x03
58 #define INTERRUPT_TC_MATCH_IR 0x01
59 #define INTERRUPT_TC_MATCH_RESET 0x02
60 #define INTERRUPT_TC_MATCH_STOP 0x04
62 #define INTERRUPT_TC_CAPT_R 0x01
63 #define INTERRUPT_TC_CAPT_F 0x02
64 #define INTERRUPT_TC_CAPT_I 0x04
66 #define INTERRUPT_CAP0 0x00
67 #define INTERRUPT_CAP1 0x01
68 #define INTERRUPT_CAP2 0x02
69 #define INTERRUPT_CAP3 0x03
71 #define INTERRUPT_M0 0x01
72 #define INTERRUPT_M1 0x02
73 #define INTERRUPT_M2 0x04
74 #define INTERRUPT_M3 0x08
75 #define INTERRUPT_C0 0x10
76 #define INTERRUPT_C1 0x20
77 #define INTERRUPT_C2 0x40
78 #define INTERRUPT_C3 0x80
80 #define INTERRUPT_TC0 0
81 #define INTERRUPT_TC1 1
83 #define INTERRUPT_SET 0x00
84 #define INTERRUPT_USED 0x01
85 #define INTERRUPT_PRIORITY_USED 0x02
86 #define INTERRUPT_CALLBACK_CHANGED 0x03
87 #define INTERRUPT_SRC_NOT_USED 0x04
89 /* type definitions */
91 typedef struct s_interrupt {
92 void (*default_soft_callback)(void);
93 void (*fiq_callback)(void);
96 /* function prototypes */
98 void interrupt_init(void);
99 void interrupt_set_default_callback(u32 callback_addr);
100 void interrupt_set_soft_callback(void (*callback)(void));
101 void interrupt_set_fiq_callback(void (*callback)(void));
102 void interrupt_soft_clear(u8 src_number);
103 void interrupt_clear(u8 src_number);
104 void interrupt_soft_enable(u8 src_number);
105 int interrupt_enable(u8 src_number,u8 mode,u8 prio,u32 callback_addr);
106 int interrupt_change_callback(u8 src_number,u32 callback_addr);
108 void interrupt_ext_ir_config(u8 eint,u8 wakeup,u8 mode,u8 polarity);
109 void interrupt_ext_ir_set(u8 eint);
110 void interrupt_ack(void);
112 void interrupt_tc_config(u8 tcnum,u8 mode,u8 cap,u32 psc);
113 void interrupt_tc_match_config(u8 tcnum,u8 mnum,u32 val,u8 mode);
114 void interrupt_tc_capt_config(u8 tcnum,u8 cnum,u8 mode);
115 void interrupt_tc_ir_set(u8 tcnum,u8 tcmc);
117 void interrupt_pwm_ir_set(u8 pwm_channel);
119 void interrupt_handler_reset(void);
120 void interrupt_handler_undef_instruction(void);
121 void interrupt_handler_soft_ir(void);
122 void interrupt_handler_prefetch_abort(void);
123 void interrupt_handler_data_abort(void);
124 void interrupt_handler_fiq(void);