api-interrupt-mgr.h 545 B

123456789101112131415161718192021
  1. #pragma once
  2. #include "flipper_v2.h"
  3. typedef void (*InterruptCallback)(void*, void*);
  4. typedef enum {
  5. InterruptTypeComparatorTrigger,
  6. InterruptTypeTimerCapture,
  7. } InterruptType;
  8. typedef struct {
  9. InterruptCallback callback;
  10. InterruptType type;
  11. void* context;
  12. bool ready;
  13. } InterruptCallbackItem;
  14. bool api_interrupt_init();
  15. void api_interrupt_add(InterruptCallback callback, InterruptType type, void* context);
  16. void api_interrupt_remove(InterruptCallback callback);
  17. void api_interrupt_call(InterruptType type, void* hw);