swd_probe_app.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 <furi_hal.h>
  8. #include <furi_hal_speaker.h>
  9. #include <gui/gui.h>
  10. #include <input/input.h>
  11. #include <lib/subghz/receiver.h>
  12. #include <lib/subghz/transmitter.h>
  13. #include <lib/subghz/subghz_file_encoder_worker.h>
  14. #include <notification/notification.h>
  15. #include <notification/notification_messages.h>
  16. #define TAG "SWD"
  17. #define TIMER_HZ 50
  18. #define TIMEOUT 3
  19. typedef enum { KeyNone, KeyUp, KeyRight, KeyDown, KeyLeft, KeyOK } KeyCode;
  20. typedef enum {
  21. EventTimerTick,
  22. EventKeyPress,
  23. } EventType;
  24. typedef struct {
  25. EventType type;
  26. InputEvent input;
  27. } AppEvent;
  28. typedef struct {
  29. KeyCode last_key;
  30. FuriTimer* _timer;
  31. FuriMessageQueue* _event_queue;
  32. NotificationApp* notification;
  33. uint8_t current_mask_id;
  34. uint32_t current_mask;
  35. uint8_t io_swc;
  36. uint8_t io_swd;
  37. uint32_t dpidr;
  38. uint32_t detected_timeout;
  39. bool detected;
  40. bool detected_device;
  41. bool detected_notified;
  42. char state_string[32];
  43. } AppFSM;
  44. const NotificationSequence seq_c_minor = {
  45. &message_note_c4,
  46. &message_delay_100,
  47. &message_sound_off,
  48. &message_delay_10,
  49. &message_note_ds4,
  50. &message_delay_100,
  51. &message_sound_off,
  52. &message_delay_10,
  53. &message_note_g4,
  54. &message_delay_100,
  55. &message_sound_off,
  56. &message_delay_10,
  57. &message_vibro_on,
  58. &message_delay_50,
  59. &message_vibro_off,
  60. NULL,
  61. };
  62. #endif