flipperzero-firmware/core/api-hal/api-interrupt-mgr.h
DrZlo13 9ed8bebba1
SPI Device API (#304)
* spi device config
* fix api_interrupt_call warning
* added configs for spi2 bus devices
* simplified spi bus api
* use new spi device api
2021-01-12 20:33:36 +03:00

21 lines
545 B
C

#pragma once
#include "flipper_v2.h"
typedef void (*InterruptCallback)(void*, void*);
typedef enum {
InterruptTypeComparatorTrigger,
InterruptTypeTimerCapture,
} 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);
void api_interrupt_remove(InterruptCallback callback);
void api_interrupt_call(InterruptType type, void* hw);