GBDK 2020 Docs  4.1.1
API Documentation for GBDK 2020
isr.h
Go to the documentation of this file.
1 
9 #ifndef _ISR_H_INCLUDE_
10 #define _ISR_H_INCLUDE_
11 
12 #include <stdint.h>
13 #include <types.h>
14 
15 // #define VECTOR_VBL 0x40 // you can not define raw vector for VBlank interrupt
16 #define VECTOR_STAT 0x48
17 #define VECTOR_TIMER 0x50
18 #define VECTOR_SERIAL 0x58
19 #define VECTOR_JOYPAD 0x60
21 typedef struct isr_vector_t {
23  void * func;
25 
52 #define ISR_VECTOR(ADDR, FUNC) \
53 static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
54 
55 typedef struct isr_nested_vector_t {
57  void * func;
59 
74 #define ISR_NESTED_VECTOR(ADDR, FUNC) \
75 static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
76 
77 
78 #endif // _ISR_H_INCLUDE_
struct isr_vector_t isr_vector_t
struct isr_nested_vector_t isr_nested_vector_t
unsigned char uint8_t
Definition: stdint.h:51
Definition: isr.h:55
uint8_t opcode[2]
Definition: isr.h:56
void * func
Definition: isr.h:57
Definition: isr.h:21
uint8_t opcode
Definition: isr.h:22
void * func
Definition: isr.h:23