finik_eth_app.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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_ICON,
  26. CURSOR_EXIT,
  27. } CursorPosition;
  28. struct FinikEthApp {
  29. Gui* gui;
  30. ViewPort* view_port;
  31. FuriMessageQueue* event_queue;
  32. NotificationApp* notifications;
  33. EthWorker* eth_worker;
  34. Power* power;
  35. PowerInfo info;
  36. DrawMode draw_mode;
  37. DrawProcess draw_process;
  38. CursorPosition cursor_position;
  39. };
  40. typedef struct FinikEthApp FinikEthApp;
  41. const NotificationSequence example_led_sequence = {
  42. &message_red_255,
  43. &message_blue_255,
  44. &message_delay_500,
  45. &message_red_0,
  46. &message_blue_0,
  47. &message_delay_500,
  48. &message_red_255,
  49. &message_blue_255,
  50. &message_delay_500,
  51. &message_red_0,
  52. &message_blue_0,
  53. &message_delay_500,
  54. &message_red_255,
  55. &message_blue_255,
  56. &message_delay_500,
  57. &message_red_0,
  58. &message_blue_0,
  59. NULL,
  60. };
  61. const NotificationSequence example_vibro_sequence = {
  62. &message_vibro_on,
  63. &message_do_not_reset,
  64. &message_delay_1000,
  65. &message_delay_1000,
  66. &message_delay_1000,
  67. &message_vibro_off,
  68. NULL,
  69. };
  70. const NotificationSequence example_sound_sequence = {
  71. &message_note_e5, &message_delay_100, &message_note_d5,
  72. &message_delay_100, &message_note_fs4, &message_delay_250,
  73. &message_note_gs4, &message_delay_250, &message_note_cs5,
  74. &message_delay_100, &message_note_b4, &message_delay_100,
  75. &message_note_d4, &message_delay_250, &message_note_e4,
  76. &message_delay_250, &message_note_b4, &message_delay_100,
  77. &message_note_a4, &message_delay_100, &message_note_cs4,
  78. &message_delay_250, &message_note_e4, &message_delay_250,
  79. &message_note_a4, &message_delay_500, NULL,
  80. };