finik_eth_app.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #pragma once
  2. #include <furi.h>
  3. #include <gui/gui.h>
  4. #include <notification/notification_messages.h>
  5. #include <power/power_service/power.h>
  6. #include "eth_worker.h"
  7. #include "finik_eth_icons.h"
  8. typedef enum {
  9. DRAW_ALL,
  10. DRAW_ONLY_TEXT,
  11. DRAW_ONLY_PICTURES,
  12. TOTAL_DRAW_MODES = 3,
  13. } DrawMode;
  14. typedef enum {
  15. PROCESS_INIT,
  16. PROCESS_DHCP,
  17. PROCESS_STATIC,
  18. PROCESS_PING,
  19. PROCESS_RESET,
  20. } DrawProcess;
  21. typedef enum {
  22. CURSOR_CHOOSE_PROCESS,
  23. CURSOR_CLICK_PROCESS,
  24. CURSOR_INSIDE_PROCESS,
  25. CURSOR_EXIT_APP,
  26. } CursorPosition;
  27. struct FinikEthApp {
  28. Gui* gui;
  29. ViewPort* view_port;
  30. FuriMessageQueue* event_queue;
  31. NotificationApp* notifications;
  32. EthWorker* eth_worker;
  33. Power* power;
  34. PowerInfo info;
  35. DrawMode draw_mode;
  36. DrawProcess draw_process;
  37. CursorPosition cursor_position;
  38. };
  39. typedef struct FinikEthApp FinikEthApp;
  40. const NotificationSequence example_led_sequence = {
  41. &message_red_255,
  42. &message_blue_255,
  43. &message_delay_500,
  44. &message_red_0,
  45. &message_blue_0,
  46. &message_delay_500,
  47. &message_red_255,
  48. &message_blue_255,
  49. &message_delay_500,
  50. &message_red_0,
  51. &message_blue_0,
  52. &message_delay_500,
  53. &message_red_255,
  54. &message_blue_255,
  55. &message_delay_500,
  56. &message_red_0,
  57. &message_blue_0,
  58. NULL,
  59. };
  60. const NotificationSequence example_vibro_sequence = {
  61. &message_vibro_on,
  62. &message_do_not_reset,
  63. &message_delay_1000,
  64. &message_delay_1000,
  65. &message_delay_1000,
  66. &message_vibro_off,
  67. NULL,
  68. };
  69. const NotificationSequence example_sound_sequence = {
  70. &message_note_e5, &message_delay_100, &message_note_d5,
  71. &message_delay_100, &message_note_fs4, &message_delay_250,
  72. &message_note_gs4, &message_delay_250, &message_note_cs5,
  73. &message_delay_100, &message_note_b4, &message_delay_100,
  74. &message_note_d4, &message_delay_250, &message_note_e4,
  75. &message_delay_250, &message_note_b4, &message_delay_100,
  76. &message_note_a4, &message_delay_100, &message_note_cs4,
  77. &message_delay_250, &message_note_e4, &message_delay_250,
  78. &message_note_a4, &message_delay_500, NULL,
  79. };