xremote.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #pragma once
  2. #include "scenes/xremote_scene.h"
  3. #include "views/xremote_infoscreen.h"
  4. #include "views/xremote_transmit.h"
  5. #include "views/xremote_pause_set.h"
  6. #include "helpers/xremote_storage.h"
  7. #include "models/infrared/xremote_ir_remote.h"
  8. #include "models/cross/xremote_cross_remote.h"
  9. #include "helpers/subghz/subghz_types.h"
  10. #include "helpers/subghz/subghz.h"
  11. #include "xremote_i.h"
  12. typedef struct SubGhz SubGhz;
  13. typedef struct {
  14. Gui* gui;
  15. DialogsApp* dialogs;
  16. FuriString* file_path;
  17. NotificationApp* notification;
  18. SubGhzNotificationState state_notifications;
  19. ViewDispatcher* view_dispatcher;
  20. Submenu* submenu;
  21. Submenu* editmenu;
  22. ButtonMenu* button_menu_create;
  23. ButtonMenu* button_menu_create_add;
  24. ButtonMenu* button_menu_ir;
  25. TextInput* text_input;
  26. Popup* popup;
  27. Loading* loading;
  28. ViewStack* view_stack;
  29. SceneManager* scene_manager;
  30. VariableItemList* variable_item_list;
  31. XRemoteInfoscreen* xremote_infoscreen;
  32. XRemoteTransmit* xremote_transmit;
  33. XRemotePauseSet* xremote_pause_set;
  34. InfraredRemote* ir_remote_buffer;
  35. InfraredWorker* ir_worker;
  36. bool ir_is_otg_enabled; /**< Whether OTG power (external 5V) is enabled for IR. */
  37. uint32_t ir_tx_pin;
  38. SubGhzRemote* sg_remote_buffer;
  39. CrossRemote* cross_remote;
  40. uint32_t haptic;
  41. uint32_t speaker;
  42. uint32_t led;
  43. uint32_t save_settings;
  44. uint32_t loop_transmit;
  45. uint32_t edit_item;
  46. uint32_t ir_timing;
  47. char* ir_timing_char;
  48. uint32_t sg_timing;
  49. char* sg_timing_char;
  50. bool transmitting;
  51. bool stop_transmit;
  52. size_t transmit_item;
  53. char text_store[XREMOTE_TEXT_STORE_NUM][XREMOTE_TEXT_STORE_SIZE + 1];
  54. SubGhz* subghz;
  55. NumberInput* number_input;
  56. bool loadFavorite;
  57. } XRemote;
  58. typedef enum {
  59. XRemoteViewIdInfoscreen,
  60. XRemoteViewIdMenu,
  61. XRemoteViewIdEditItem,
  62. XRemoteViewIdCreate,
  63. XRemoteViewIdCreateAdd,
  64. XRemoteViewIdSettings,
  65. XRemoteViewIdWip,
  66. XRemoteViewIdIrRemote,
  67. XRemoteViewIdStack,
  68. XRemoteViewIdTextInput,
  69. XRemoteViewIdNumberInput,
  70. XRemoteViewIdTransmit,
  71. XRemoteViewIdPauseSet,
  72. } XRemoteViewId;
  73. typedef enum {
  74. XRemoteHapticOff,
  75. XRemoteHapticOn,
  76. } XRemoteHapticState;
  77. typedef enum {
  78. XRemoteSpeakerOff,
  79. XRemoteSpeakerOn,
  80. } XRemoteSpeakerState;
  81. typedef enum {
  82. XRemoteLedOff,
  83. XRemoteLedOn,
  84. } XRemoteLedState;
  85. typedef enum {
  86. XRemoteLoopOff,
  87. XRemoteLoopOn,
  88. } XRemoteLoopState;
  89. typedef enum {
  90. XRemoteSettingsOff,
  91. XRemoteSettingsOn,
  92. } XRemoteSettingsStoreState;
  93. void xremote_popup_closed_callback(void* context);
  94. void xremote_text_input_callback(void* context);
  95. void xremote_ir_enable_otg(XRemote* app, bool enable);
  96. void xremote_ir_set_tx_pin(XRemote* app);