2021-06-30 00:19:20 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stm32wbxx_ll_tim.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** Timer ISR */
|
2022-03-29 20:37:23 +03:00
|
|
|
typedef void (*FuriHalInterruptISR)(void* context);
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
// TIM1, TIM16, TIM17
|
|
|
|
FuriHalInterruptIdTim1TrgComTim17,
|
|
|
|
FuriHalInterruptIdTim1Cc,
|
|
|
|
FuriHalInterruptIdTim1UpTim16,
|
|
|
|
|
|
|
|
// TIM2
|
|
|
|
FuriHalInterruptIdTIM2,
|
|
|
|
|
|
|
|
// DMA1
|
|
|
|
FuriHalInterruptIdDma1Ch1,
|
|
|
|
FuriHalInterruptIdDma1Ch2,
|
|
|
|
FuriHalInterruptIdDma1Ch3,
|
|
|
|
FuriHalInterruptIdDma1Ch4,
|
|
|
|
FuriHalInterruptIdDma1Ch5,
|
|
|
|
FuriHalInterruptIdDma1Ch6,
|
|
|
|
FuriHalInterruptIdDma1Ch7,
|
|
|
|
|
|
|
|
// DMA2
|
|
|
|
FuriHalInterruptIdDma2Ch1,
|
|
|
|
FuriHalInterruptIdDma2Ch2,
|
|
|
|
FuriHalInterruptIdDma2Ch3,
|
|
|
|
FuriHalInterruptIdDma2Ch4,
|
|
|
|
FuriHalInterruptIdDma2Ch5,
|
|
|
|
FuriHalInterruptIdDma2Ch6,
|
|
|
|
FuriHalInterruptIdDma2Ch7,
|
|
|
|
|
|
|
|
// RCC
|
|
|
|
FuriHalInterruptIdRcc,
|
|
|
|
|
|
|
|
// Comp
|
|
|
|
FuriHalInterruptIdCOMP,
|
|
|
|
|
|
|
|
// HSEM
|
|
|
|
FuriHalInterruptIdHsem,
|
|
|
|
|
|
|
|
// Service value
|
|
|
|
FuriHalInterruptIdMax,
|
|
|
|
} FuriHalInterruptId;
|
2021-06-30 00:19:20 +03:00
|
|
|
|
2021-07-15 16:54:11 +03:00
|
|
|
/** Initialize interrupt subsystem */
|
2021-08-08 21:03:25 +03:00
|
|
|
void furi_hal_interrupt_init();
|
2021-07-15 16:54:11 +03:00
|
|
|
|
2022-03-29 20:37:23 +03:00
|
|
|
/** Set ISR and enable interrupt with default priority
|
2021-07-15 16:54:11 +03:00
|
|
|
* We don't clear interrupt flags for you, do it by your self.
|
2022-03-29 20:37:23 +03:00
|
|
|
* @param index - interrupt ID
|
2021-07-15 16:54:11 +03:00
|
|
|
* @param isr - your interrupt service routine or use NULL to clear
|
2022-03-29 20:37:23 +03:00
|
|
|
* @param context - isr context
|
2021-07-15 16:54:11 +03:00
|
|
|
*/
|
2022-03-29 20:37:23 +03:00
|
|
|
void furi_hal_interrupt_set_isr(FuriHalInterruptId index, FuriHalInterruptISR isr, void* context);
|
2021-07-15 16:54:11 +03:00
|
|
|
|
2022-03-29 20:37:23 +03:00
|
|
|
/** Set ISR and enable interrupt with custom priority
|
2021-06-30 00:19:20 +03:00
|
|
|
* We don't clear interrupt flags for you, do it by your self.
|
2022-03-29 20:37:23 +03:00
|
|
|
* @param index - interrupt ID
|
|
|
|
* @param priority - 0 to 15, 0 highest
|
2021-07-15 16:54:11 +03:00
|
|
|
* @param isr - your interrupt service routine or use NULL to clear
|
2022-03-29 20:37:23 +03:00
|
|
|
* @param context - isr context
|
2021-06-30 00:19:20 +03:00
|
|
|
*/
|
2022-03-29 20:37:23 +03:00
|
|
|
void furi_hal_interrupt_set_isr_ex(
|
|
|
|
FuriHalInterruptId index,
|
|
|
|
uint16_t priority,
|
|
|
|
FuriHalInterruptISR isr,
|
|
|
|
void* context);
|
2021-06-30 00:19:20 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|