Loading...
Searching...
No Matches
furi_hal_interrupt.h
1#pragma once
2
3#include <stm32wbxx_ll_tim.h>
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
10typedef void (*FuriHalInterruptISR)(void* context);
11
12typedef enum {
13 // TIM1, TIM16, TIM17
14 FuriHalInterruptIdTim1TrgComTim17,
15 FuriHalInterruptIdTim1Cc,
16 FuriHalInterruptIdTim1UpTim16,
17
18 // TIM2
19 FuriHalInterruptIdTIM2,
20
21 // DMA1
22 FuriHalInterruptIdDma1Ch1,
23 FuriHalInterruptIdDma1Ch2,
24 FuriHalInterruptIdDma1Ch3,
25 FuriHalInterruptIdDma1Ch4,
26 FuriHalInterruptIdDma1Ch5,
27 FuriHalInterruptIdDma1Ch6,
28 FuriHalInterruptIdDma1Ch7,
29
30 // DMA2
31 FuriHalInterruptIdDma2Ch1,
32 FuriHalInterruptIdDma2Ch2,
33 FuriHalInterruptIdDma2Ch3,
34 FuriHalInterruptIdDma2Ch4,
35 FuriHalInterruptIdDma2Ch5,
36 FuriHalInterruptIdDma2Ch6,
37 FuriHalInterruptIdDma2Ch7,
38
39 // RCC
40 FuriHalInterruptIdRcc,
41
42 // Comp
43 FuriHalInterruptIdCOMP,
44
45 // RTC
46 FuriHalInterruptIdRtcAlarm,
47
48 // HSEM
49 FuriHalInterruptIdHsem,
50
51 // LPTIMx
52 FuriHalInterruptIdLpTim1,
53 FuriHalInterruptIdLpTim2,
54
55 //UARTx
56 FuriHalInterruptIdUart1,
57
58 //LPUARTx
59 FuriHalInterruptIdLpUart1,
60
61 // Service value
62 FuriHalInterruptIdMax,
63} FuriHalInterruptId;
64
65typedef enum {
66 FuriHalInterruptPriorityLowest =
67 -3,
68 FuriHalInterruptPriorityLower =
69 -2,
70 FuriHalInterruptPriorityLow =
71 -1,
72 FuriHalInterruptPriorityNormal =
73 0,
74 FuriHalInterruptPriorityHigh =
75 1,
76 FuriHalInterruptPriorityHigher =
77 2,
78 FuriHalInterruptPriorityHighest =
79 3,
81 /* Special group, read docs first(ALL OF THEM: especially FreeRTOS configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY) */
82 FuriHalInterruptPriorityKamiSama =
83 6,
84} FuriHalInterruptPriority;
85
87void furi_hal_interrupt_init(void);
88
98void furi_hal_interrupt_set_isr(FuriHalInterruptId index, FuriHalInterruptISR isr, void* context);
99
110void furi_hal_interrupt_set_isr_ex(
111 FuriHalInterruptId index,
112 FuriHalInterruptPriority priority,
113 FuriHalInterruptISR isr,
114 void* context);
115
122const char* furi_hal_interrupt_get_name(uint8_t exception_number);
123
128uint32_t furi_hal_interrupt_get_time_in_isr_total(void);
129
130#ifdef __cplusplus
131}
132#endif