mp_flipper_context.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include <stdint.h>
  2. #include <furi.h>
  3. #include <gui/gui.h>
  4. #include <dialogs/dialogs.h>
  5. #include <storage/storage.h>
  6. #include <mp_flipper_modflipperzero.h>
  7. #define MP_FLIPPER_GPIO_PIN_OFF (1 << 15)
  8. #define MP_FLIPPER_GPIO_PIN_BLOCKED (1 << 7)
  9. #define MP_FLIPPER_GPIO_PIN_PWM ((MP_FLIPPER_GPIO_PIN_BLOCKED) | (1 << 8))
  10. typedef uint16_t mp_flipper_gpio_pin_t;
  11. #define MP_FLIPPER_INFRARED_RX_BUFFER_SIZE (1024)
  12. typedef struct {
  13. uint16_t size;
  14. uint32_t* buffer;
  15. uint16_t pointer;
  16. bool running;
  17. } mp_flipper_infrared_rx_t;
  18. typedef struct {
  19. size_t size;
  20. void* signal;
  21. size_t index;
  22. uint32_t repeat;
  23. bool level;
  24. mp_flipper_infrared_signal_tx_provider provider;
  25. } mp_flipper_infrared_tx_t;
  26. typedef struct {
  27. Gui* gui;
  28. ViewPort* view_port;
  29. Canvas* canvas;
  30. FuriPubSub* input_event_queue;
  31. FuriPubSubSubscription* input_event;
  32. DialogMessage* dialog_message;
  33. const char* dialog_message_button_left;
  34. const char* dialog_message_button_center;
  35. const char* dialog_message_button_right;
  36. Storage* storage;
  37. FuriHalAdcHandle* adc_handle;
  38. mp_flipper_gpio_pin_t* gpio_pins;
  39. mp_flipper_infrared_rx_t* infrared_rx;
  40. mp_flipper_infrared_tx_t* infrared_tx;
  41. } mp_flipper_context_t;