flipperzero-firmware/core/furi_hal/api_interrupt_mgr.h
あく c4a0847c99
FuriHal: replace HAL with LL in RFID Part 1. Drop F6. (#1049)
* FuriHal: new speaker HAL
* FuriHal: drop PWM
* FuriHal: move COMP1 to LL
* FuriHal: move COMP1 to LL backport to F6
* FuriHal: remove missing gpio_rfid_carrier from F6
* FurHal: use LL for system controls in flash HAL
* Drop F6 source tree
* Drop F6 from GitHub workflow
* Tie USE_FULL_ASSERT with APP_UNIT_TESTS
* Speaker: return to old volume calculation
* FreeRTOS: move TCB header to glue

Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
2022-03-23 20:59:20 +03:00

75 lines
1.6 KiB
C

/**
* @file api_interrupt_mgr.h
* Furi: interrupt API
*/
#pragma once
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Interrupt callback prototype */
typedef void (*InterruptCallback)(void*, void*);
/** Interupt type */
typedef enum {
InterruptTypeTimerUpdate,
InterruptTypeLast,
} InterruptType;
/** Interrupt callback type */
typedef struct {
InterruptCallback callback;
void* context;
bool ready;
} InterruptCallbackItem;
/** Init interrupt
*
* @return true on succsessful initialization, false otherwise
*/
bool api_interrupt_init();
/** Add interrupt
*
* @param callback InterruptCallback
* @param type InterruptType
* @param context context for callback
*/
void api_interrupt_add(InterruptCallback callback, InterruptType type, void* context);
/** Remove interrupt
*
* @param callback InterruptCallback
* @param type InterruptType
*/
void api_interrupt_remove(InterruptCallback callback, InterruptType type);
/** Enable interrupt
*
* @param callback InterruptCallback
* @param type InterruptType
*/
void api_interrupt_enable(InterruptCallback callback, InterruptType type);
/** Disable interrupt
*
* @param callback InterruptCallback
* @param type InterruptType
*/
void api_interrupt_disable(InterruptCallback callback, InterruptType type);
/** Call interrupt
*
* @param type InterruptType
* @param hw pointer to hardware peripheral
*/
void api_interrupt_call(InterruptType type, void* hw);
#ifdef __cplusplus
}
#endif