X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Farm.git;a=blobdiff_plain;f=betty%2Finterrupts.h;h=21d741338e9fbec7ea104de163801954a77b36a9;hp=194dd9adc2ad02d2bbd81faccfbe5f057a916434;hb=1473a4be06e0cc16875bf6c49719a2c92826f908;hpb=a409cb5b36482767f766ec9efc5dbecaa2274660 diff --git a/betty/interrupts.h b/betty/interrupts.h index 194dd9a..21d7413 100644 --- a/betty/interrupts.h +++ b/betty/interrupts.h @@ -50,14 +50,44 @@ #define INTERRUPT_EXT2 2 #define INTERRUPT_EXT3 3 +#define INTERRUPT_TC_MODE_T 0x00 +#define INTERRUPT_TC_MODE_CR 0x01 +#define INTERRUPT_TC_MODE_CF 0x02 +#define INTERRUPT_TC_MODE_CB 0x03 + +#define INTERRUPT_TC_MATCH_IR 0x01 +#define INTERRUPT_TC_MATCH_RESET 0x02 +#define INTERRUPT_TC_MATCH_STOP 0x04 + +#define INTERRUPT_TC_CAPT_R 0x01 +#define INTERRUPT_TC_CAPT_F 0x02 +#define INTERRUPT_TC_CAPT_I 0x04 + +#define INTERRUPT_CAP0 0x00 +#define INTERRUPT_CAP1 0x01 +#define INTERRUPT_CAP2 0x02 +#define INTERRUPT_CAP3 0x03 + +#define INTERRUPT_M0 0x01 +#define INTERRUPT_M1 0x02 +#define INTERRUPT_M2 0x04 +#define INTERRUPT_M3 0x08 +#define INTERRUPT_C0 0x10 +#define INTERRUPT_C1 0x20 +#define INTERRUPT_C2 0x40 +#define INTERRUPT_C3 0x80 + #define INTERRUPT_SET 0x00 #define INTERRUPT_USED 0x01 #define INTERRUPT_PRIORITY_USED 0x02 +#define INTERRUPT_CALLBACK_CHANGED 0x03 +#define INTERRUPT_SRC_NOT_USED 0x04 /* type definitions */ typedef struct s_interrupt { void (*default_soft_callback)(void); + void (*fiq_callback)(void); } t_interrupt; /* function prototypes */ @@ -65,11 +95,21 @@ typedef struct s_interrupt { void interrupt_init(void); void interrupt_set_default_callback(u32 callback_addr); void interrupt_set_soft_callback(void (*callback)(void)); +void interrupt_set_fiq_callback(void (*callback)(void)); void interrupt_soft_clear(u8 src_number); void interrupt_clear(u8 src_number); void interrupt_soft_enable(u8 src_number); -int interrupt_enable(u8 src_number,u8 mode,u8 priority,u32 callback_addr); +int interrupt_enable(u8 src_number,u8 mode,u8 prio,u32 callback_addr); +int interrupt_change_callback(u8 src_number,u32 callback_addr); + void interrupt_ext_ir_config(u8 eint,u8 wakeup,u8 mode,u8 polarity); +void interrupt_ext_ir_set(u8 eint); +void interrupt_ack(void); + +void interrupt_tc_config(u8 tcnum,u8 mode,u8 cap,u32 psc); +void interrupt_tc_match_config(u8 tcnum,u8 mnum,u32 val,u8 mode); +void interrupt_tc_capt_config(u8 tcnum,u8 cnum,u8 mode); +void interrupt_tc_ir_set(u8 tcnum,u8 tcmc); void interrupt_handler_reset(void); void interrupt_handler_undef_instruction(void);