flipbip.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 "v0.0.5"
  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. int haptic;
  32. int led;
  33. int passphrase;
  34. int bip39_strength;
  35. int bip44_coin;
  36. int overwrite_saved_seed;
  37. int input_state;
  38. char passphrase_text[TEXT_BUFFER_SIZE];
  39. char input_text[TEXT_BUFFER_SIZE];
  40. } FlipBip;
  41. typedef enum {
  42. FlipBipViewIdStartscreen,
  43. FlipBipViewIdMenu,
  44. FlipBipViewIdScene1,
  45. FlipBipViewIdSettings,
  46. FlipBipViewIdTextInput,
  47. } FlipBipViewId;
  48. typedef enum {
  49. FlipBipHapticOff,
  50. FlipBipHapticOn,
  51. } FlipBipHapticState;
  52. typedef enum {
  53. FlipBipLedOff,
  54. FlipBipLedOn,
  55. } FlipBipLedState;
  56. typedef enum {
  57. FlipBipStrength128,
  58. FlipBipStrength192,
  59. FlipBipStrength256,
  60. } FlipBipStrengthState;
  61. typedef enum {
  62. FlipBipPassphraseOff,
  63. FlipBipPassphraseOn,
  64. } FlipBipPassphraseState;
  65. typedef enum {
  66. FlipBipCoinBTC0,
  67. FlipBipCoinETH60,
  68. FlipBipCoinDOGE3,
  69. } FlipBipCoin;
  70. typedef enum {
  71. FlipBipTextInputDefault,
  72. FlipBipTextInputPassphrase,
  73. FlipBipTextInputMnemonic
  74. } FlipBipTextInputState;