* functions
*/
-void interrupt_set_default_callback(t_interrupt *ir,void *callback) {
+void interrupt_set_default_callback(void *callback) {
- ir->default_callback=callback;
+ VICDefVectAddr=(u32)callback;
+
}
+void interrupt_clear(u8 src_number) {
+}
+
+int interrupt_set(u8 src_number,u8 mode,u8 priority,void *callback) {
+
+ /* check whether this ir source is allready assigned */
+ if(VICSoftInt&(1<<src_number))
+ return INTERRUPT_EINUSE;
+
+ /* force interrupt */
+ VICSoftInt|=(1<<src_number);
+ VICIntEnable|=(1<<src_number);
+
+ switch(mode) {
+ case INTERRUPT_FIQ:
+ VICIntSelect|=(1<<src_number);
+ break;
+ case INTERRUPT_VIRQ:
+ case INTERRUPT_IRQ:
+ case default:
+ }
+
+ return INTERRUPT_SET;
+}
/*
* the actual exception handlers (as defined in startup.s)
#define INTERRUPT_MAX_VIC 16
+#define INTERRUPT_WATCHDOG 0
+#define INTERRUPT_DBG_COMM_RX 2
+#define INTERRUPT_DBG_COMM_TX 3
+#define INTERRUPT_TIMER0 4
+#define INTERRUPT_TIMER1 5
+#define INTERRUPT_UART0 6
+#define INTERRUPT_UART1 7
+#define INTERRUPT_PWM 8
+#define INTERRUPT_I2C 9
+#define INTERRUPT_SPI0 10
+#define INTERRUPT_SPI1 11
+#define INTERRUPT_PLL 12
+#define INTERRUPT_RTC 13
+#define INTERRUPT_EINT0 14
+#define INTERRUPT_EINT1 15
+#define INTERRUPT_EINT2 16
+#define INTERRUPT_EINT3 17
+#define INTERRUPT_ADC 18
+
+#define INTERRUPT_IRQ 0
+#define INTERRUPT_VIRQ 1
+#define INTERRUPT_FIQ 2
+
#define INTERRUPT_EXT_MODE_EDGE 0
#define INTERRUPT_EXT_MODE_LEVEL 1
#define INTERRUPT_EXT_POLAR_LOW 0
#define INTERRUPT_EXT_POLAR_HIGH 1
+#define INTERRUPT_SET 0x00
+#define INTERRUPT_EINUSE 0x01
+
/* type definitions */
typedef struct s_interrupt {