diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-11-13 23:05:32 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-11-13 23:05:32 -0700 |
commit | c9402e5a5d67ef877fa7f5f67c07a794574ded35 (patch) | |
tree | aad50c7d861f3f4c68d985abe1b8fce79d10bc86 /include/isr_vector.h | |
parent | da45a7210ef634fcdb0270bffc90d4da97c61230 (diff) | |
download | ch573-c9402e5a5d67ef877fa7f5f67c07a794574ded35.tar.gz ch573-c9402e5a5d67ef877fa7f5f67c07a794574ded35.tar.bz2 ch573-c9402e5a5d67ef877fa7f5f67c07a794574ded35.zip |
Added a whole bunch of fiddle files. Started improving boot process.
It still works.
Diffstat (limited to 'include/isr_vector.h')
-rw-r--r-- | include/isr_vector.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/include/isr_vector.h b/include/isr_vector.h new file mode 100644 index 0000000..d916db0 --- /dev/null +++ b/include/isr_vector.h @@ -0,0 +1,81 @@ +#pragma once + +#include <stdint.h> + +/* Type def to a void function to make things mor ereadable. */ +typedef void (*isr_routine)(void); + +typedef struct { + // What NULL points to. nothing useful. + uint32_t reserved__; + // Called when the device boots or reset is pressed. + isr_routine reset_cb; + isr_routine nmi_cb; + isr_routine exc_cb; + + uint32_t _reserved_1[8]; + + isr_routine systick_cb; + + uint32_t _reserved_2; + + isr_routine swi_cb; + + uint32_t _reserved_3; + + isr_routine tmr0_cb; + isr_routine gpio_a_cb; + isr_routine gpio_b_cb; + isr_routine spi0_cb; + isr_routine blel_cb; + isr_routine bleb_cb; + isr_routine usb_cb; + + uint32_t _reserved_4; + + isr_routine tmr1_cb; + isr_routine tmr2_cb; + isr_routine uart0_cb; + isr_routine uart1_cb; + isr_routine rtc_cb; + isr_routine adc_cb; + + uint32_t _reserved_5; + + isr_routine pwmx_cb; + isr_routine tmr3_cb; + isr_routine uart2_cb; + isr_routine uart3_cb; + isr_routine wdog_bat_cb; +} isr_vector_t; + +/** Reference to the global ISR vector. */ +extern isr_vector_t isr_vector; + +/** Default IRQ handler. This is weakly defined and can be overridden. */ +void default_irq_handler(void); + +/** Weakly defined interrput service routine vectors. These just alias to + * default_irq_handler if not overridden. */ +void irq_on_nmi(void); +void irq_on_exc(void); +void irq_on_systick(void); +void irq_on_swi(void); +void irq_on_tmr0(void); +void irq_on_gpio_a(void); +void irq_on_gpio_b(void); +void irq_on_spi0(void); +void irq_on_blel(void); +void irq_on_bleb(void); +void irq_on_usb(void); +void irq_on_tmr1(void); +void irq_on_tmr2(void); +void irq_on_uart0(void); +void irq_on_uart1(void); +void irq_on_rtc(void); +void irq_on_adc(void); +void irq_on_pwmx(void); +void irq_on_tmr3(void); +void irq_on_uart2(void); +void irq_on_uart3(void); +void irq_on_wdog_bat(void); |