summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/irq.h
diff options
context:
space:
mode:
authorDave Curtis <davecurtis@sonic.net>2015-10-31 10:44:20 -0700
committerDamien George <damien.p.george@gmail.com>2015-11-01 23:23:39 +0000
commit32b3549cce7a965d92a81db02c7adc973f08d74c (patch)
tree8159317d2091e30cf33093dacdbfae76c8d374fc /stmhal/irq.h
parent056cb288d9a3d5aa35b3cf549f88688b9ba60163 (diff)
downloadmicropython-32b3549cce7a965d92a81db02c7adc973f08d74c.tar.gz
micropython-32b3549cce7a965d92a81db02c7adc973f08d74c.zip
stmhal: Add symbolic #defines for interrupt levels in irq.h.
Diffstat (limited to 'stmhal/irq.h')
-rw-r--r--stmhal/irq.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/stmhal/irq.h b/stmhal/irq.h
index 6689e995dc..3417345790 100644
--- a/stmhal/irq.h
+++ b/stmhal/irq.h
@@ -37,3 +37,48 @@ static inline mp_uint_t query_irq(void) {
MP_DECLARE_CONST_FUN_OBJ(pyb_wfi_obj);
MP_DECLARE_CONST_FUN_OBJ(pyb_disable_irq_obj);
MP_DECLARE_CONST_FUN_OBJ(pyb_enable_irq_obj);
+
+// IRQ priority definitions.
+// Lower number implies higher interrupt priority.
+
+#define IRQ_PRI_CAN 0x7
+#define IRQ_SUBPRI_CAN 0x0
+
+#define IRQ_PRI_DMA 0x6
+#define IRQ_SUBPRI_DMA 0x0
+
+#define IRQ_PRI_EXTINT 0xf
+#define IRQ_SUBPRI_EXTINT 0xf
+
+// Flash IRQ must be higher priority than interrupts of all those components
+// that rely on the flash storage.
+#define IRQ_PRI_FLASH 0x1
+#define IRQ_SUBPRI_FLASH 0x1
+
+#define IRQ_PRI_OTG_FS 0x6
+#define IRQ_SUBPRI_OTG_FS 0x0
+
+#define IRQ_PRI_OTG_HS 0x6
+#define IRQ_SUBPRI_OTG_HS 0x0
+
+// PENDSV should be at the lowst priority so that other interrupts complete
+// before exception is raised.
+#define IRQ_PRI_PENDSV 0xf
+#define IRQ_SUBPRI_PENDSV 0xf
+
+#define IRQ_PRI_RTC_WKUP 0xf
+#define IRQ_SUBPRI_RTC_WKUP 0xf
+
+#define IRQ_PRI_TIM3 0x6
+#define IRQ_SUBPRI_TIM3 0x0
+
+#define IRQ_PRI_TIM5 0x6
+#define IRQ_SUBPRI_TIM5 0x0
+
+// Interrupt priority for non-special timers.
+#define IRQ_PRI_TIMX 0xe
+#define IRQ_SUBPRI_TIMX 0xe
+
+#define IRQ_PRI_UART 0xd
+#define IRQ_SUBPRI_UART 0xd
+