weather_station_app_i.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "helpers/weather_station_types.h"
  3. #include "scenes/weather_station_scene.h"
  4. #include <gui/gui.h>
  5. #include <gui/view_dispatcher.h>
  6. #include <gui/scene_manager.h>
  7. #include <gui/modules/submenu.h>
  8. #include <gui/modules/variable_item_list.h>
  9. #include <gui/modules/widget.h>
  10. #include <notification/notification_messages.h>
  11. #include "views/weather_station_receiver.h"
  12. #include "views/weather_station_receiver_info.h"
  13. #include "weather_station_history.h"
  14. #include <lib/subghz/subghz_setting.h>
  15. #include <lib/subghz/subghz_worker.h>
  16. #include <lib/subghz/receiver.h>
  17. #include <lib/subghz/transmitter.h>
  18. #include <lib/subghz/registry.h>
  19. typedef struct WeatherStationApp WeatherStationApp;
  20. struct WeatherStationTxRx {
  21. SubGhzWorker* worker;
  22. SubGhzEnvironment* environment;
  23. SubGhzReceiver* receiver;
  24. SubGhzRadioPreset* preset;
  25. WSHistory* history;
  26. uint16_t idx_menu_chosen;
  27. WSTxRxState txrx_state;
  28. WSHopperState hopper_state;
  29. uint8_t hopper_timeout;
  30. uint8_t hopper_idx_frequency;
  31. WSRxKeyState rx_key_state;
  32. };
  33. typedef struct WeatherStationTxRx WeatherStationTxRx;
  34. struct WeatherStationApp {
  35. Gui* gui;
  36. ViewDispatcher* view_dispatcher;
  37. WeatherStationTxRx* txrx;
  38. SceneManager* scene_manager;
  39. NotificationApp* notifications;
  40. VariableItemList* variable_item_list;
  41. Submenu* submenu;
  42. Widget* widget;
  43. WSReceiver* ws_receiver;
  44. WSReceiverInfo* ws_receiver_info;
  45. WSLock lock;
  46. SubGhzSetting* setting;
  47. };
  48. void ws_preset_init(
  49. void* context,
  50. const char* preset_name,
  51. uint32_t frequency,
  52. uint8_t* preset_data,
  53. size_t preset_data_size);
  54. bool ws_set_preset(WeatherStationApp* app, const char* preset);
  55. void ws_get_frequency_modulation(
  56. WeatherStationApp* app,
  57. FuriString* frequency,
  58. FuriString* modulation);
  59. void ws_begin(WeatherStationApp* app, uint8_t* preset_data);
  60. uint32_t ws_rx(WeatherStationApp* app, uint32_t frequency);
  61. void ws_idle(WeatherStationApp* app);
  62. void ws_rx_end(WeatherStationApp* app);
  63. void ws_sleep(WeatherStationApp* app);
  64. void ws_hopper_update(WeatherStationApp* app);