logic_analyzer_app.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef __ARHA_FLIPPERAPP_DEMO
  2. #define __ARHA_FLIPPERAPP_DEMO
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include <stdio.h>
  6. #include <furi.h>
  7. #include <gui/gui.h>
  8. #include <gui/elements.h>
  9. #include <dialogs/dialogs.h>
  10. #include <input/input.h>
  11. #include <storage/storage.h>
  12. #include <stdlib.h>
  13. #include <dolphin/dolphin.h>
  14. #include <notification/notification.h>
  15. #include <notification/notification_messages.h>
  16. #include "sump.h"
  17. #include "usb_uart.h"
  18. #define TAG "LogicAnalyzer"
  19. #define TIMER_HZ 50
  20. #define TIMEOUT 3
  21. #define QUEUE_SIZE 32
  22. typedef enum { KeyNone, KeyUp, KeyRight, KeyDown, KeyLeft, KeyOK } KeyCode;
  23. typedef enum { EventKeyPress, EventBufferFilled } EventType;
  24. typedef struct {
  25. EventType type;
  26. InputEvent input;
  27. } AppEvent;
  28. typedef struct {
  29. FuriMessageQueue* event_queue;
  30. NotificationApp* notification;
  31. Storage* storage;
  32. ViewPort* view_port;
  33. Gui* gui;
  34. DialogsApp* dialogs;
  35. UsbUart* uart;
  36. Sump* sump;
  37. FuriMutex* mutex;
  38. bool triggered;
  39. bool processing;
  40. FuriThread* capture_thread;
  41. uint8_t* capture_buffer;
  42. size_t capture_pos;
  43. uint8_t current_levels;
  44. char state_string[64];
  45. } AppFSM;
  46. #endif