flipbip.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #pragma once
  2. #include <furi.h>
  3. #include <furi_hal.h>
  4. #include <gui/gui.h>
  5. #include <input/input.h>
  6. #include <stdlib.h>
  7. #include <notification/notification_messages.h>
  8. #include <gui/view_dispatcher.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/scene_manager.h>
  11. #include <gui/modules/variable_item_list.h>
  12. #include <gui/modules/text_input.h>
  13. #include "scenes/flipbip_scene.h"
  14. #include "views/flipbip_startscreen.h"
  15. #include "views/flipbip_scene_1.h"
  16. #define FLIPBIP_VERSION "v1.11.0"
  17. #define COIN_BTC 0
  18. #define COIN_DOGE 3
  19. #define COIN_ETH 60
  20. #define TEXT_BUFFER_SIZE 256
  21. typedef struct {
  22. Gui* gui;
  23. NotificationApp* notification;
  24. ViewDispatcher* view_dispatcher;
  25. Submenu* submenu;
  26. SceneManager* scene_manager;
  27. VariableItemList* variable_item_list;
  28. TextInput* text_input;
  29. FlipBipStartscreen* flipbip_startscreen;
  30. FlipBipScene1* flipbip_scene_1;
  31. // Settings options
  32. int haptic;
  33. int led;
  34. int bip39_strength;
  35. int passphrase;
  36. // Main menu options
  37. int bip44_coin;
  38. int overwrite_saved_seed;
  39. int import_from_mnemonic;
  40. // Text input
  41. int input_state;
  42. char passphrase_text[TEXT_BUFFER_SIZE];
  43. char import_mnemonic_text[TEXT_BUFFER_SIZE];
  44. char input_text[TEXT_BUFFER_SIZE];
  45. } FlipBip;
  46. typedef enum {
  47. FlipBipViewIdStartscreen,
  48. FlipBipViewIdMenu,
  49. FlipBipViewIdScene1,
  50. FlipBipViewIdSettings,
  51. FlipBipViewIdTextInput,
  52. } FlipBipViewId;
  53. typedef enum {
  54. FlipBipHapticOff,
  55. FlipBipHapticOn,
  56. } FlipBipHapticState;
  57. typedef enum {
  58. FlipBipLedOff,
  59. FlipBipLedOn,
  60. } FlipBipLedState;
  61. typedef enum {
  62. FlipBipStrength128,
  63. FlipBipStrength192,
  64. FlipBipStrength256,
  65. } FlipBipStrengthState;
  66. typedef enum {
  67. FlipBipPassphraseOff,
  68. FlipBipPassphraseOn,
  69. } FlipBipPassphraseState;
  70. typedef enum {
  71. FlipBipCoinBTC0,
  72. FlipBipCoinETH60,
  73. FlipBipCoinDOGE3,
  74. } FlipBipCoin;
  75. typedef enum {
  76. FlipBipTextInputDefault,
  77. FlipBipTextInputPassphrase,
  78. FlipBipTextInputMnemonic
  79. } FlipBipTextInputState;
  80. typedef enum {
  81. FlipBipStatusSuccess = 0,
  82. FlipBipStatusReturn = 10,
  83. FlipBipStatusLoadError = 11,
  84. FlipBipStatusSaveError = 12,
  85. FlipBipStatusMnemonicCheckError = 13,
  86. } FlipBipStatus;