isr.h
Go to the documentation of this file.
#ifndef _ISR_H_INCLUDE_
#define _ISR_H_INCLUDE_
#include <stdint.h>
#include <types.h>
// #define VECTOR_VBL 0x40 // you can not define raw vector for VBlank interrupt
#define VECTOR_STAT 0x48
#define VECTOR_TIMER 0x50
#define VECTOR_SERIAL 0x58
#define VECTOR_JOYPAD 0x60
typedef struct isr_vector_t {
uint8_t opcode;
void * func;
} isr_vector_t;
#define ISR_VECTOR(ADDR, FUNC) \
static const isr_vector_t AT((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)};
typedef struct isr_nested_vector_t {
uint8_t opcode[2];
void * func;
} isr_nested_vector_t;
#define ISR_NESTED_VECTOR(ADDR, FUNC) \
static const isr_nested_vector_t AT((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)};
#endif // _ISR_H_INCLUDE_
isr_nested_vector_t
struct isr_nested_vector_t isr_nested_vector_t
isr_vector_t
struct isr_vector_t isr_vector_t
stdint.h
uint8_t
unsigned char uint8_t
Definition: stdint.h:51
isr_nested_vector_t
Definition: isr.h:55
isr_nested_vector_t::func
void * func
Definition: isr.h:57
isr_nested_vector_t::opcode
uint8_t opcode[2]
Definition: isr.h:56
isr_vector_t
Definition: isr.h:21
isr_vector_t::func
void * func
Definition: isr.h:23
isr_vector_t::opcode
uint8_t opcode
Definition: isr.h:22