2020-12-19 05:26:03 +10:00
|
|
|
#pragma once
|
|
|
|
|
#include "flipper_v2.h"
|
|
|
|
|
|
|
|
|
|
typedef void (*InterruptCallback)(void*, void*);
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2021-01-08 02:28:35 +10:00
|
|
|
InterruptTypeComparatorTrigger,
|
|
|
|
|
InterruptTypeTimerCapture,
|
2020-12-19 05:26:03 +10:00
|
|
|
} InterruptType;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
InterruptCallback callback;
|
|
|
|
|
InterruptType type;
|
|
|
|
|
void* context;
|
|
|
|
|
bool ready;
|
|
|
|
|
} InterruptCallbackItem;
|
|
|
|
|
|
|
|
|
|
bool api_interrupt_init();
|
|
|
|
|
void api_interrupt_add(InterruptCallback callback, InterruptType type, void* context);
|
2021-01-13 03:33:36 +10:00
|
|
|
void api_interrupt_remove(InterruptCallback callback);
|
|
|
|
|
void api_interrupt_call(InterruptType type, void* hw);
|