flip_trader_e.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #ifndef FLIP_TRADE_E_H
  2. #define FLIP_TRADE_E_H
  3. #include <flipper_http.h>
  4. #include <easy_flipper.h>
  5. #include <furi.h>
  6. #include <furi_hal.h>
  7. #include <gui/gui.h>
  8. #include <gui/view.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <notification/notification.h>
  12. #include <dialogs/dialogs.h>
  13. #include <jsmn.h>
  14. #define TAG "FlipTrader"
  15. // Define the submenu items for our FlipTrader application
  16. typedef enum {
  17. // FlipTraderSubmenuIndexMain, // Click to run get the info of the selected pair
  18. FlipTradeSubmenuIndexAssets, // Click to view the assets screen (ETHUSD, BTCUSD, etc.)
  19. FlipTraderSubmenuIndexAbout, // Click to view the about screen
  20. FlipTraderSubmenuIndexSettings, // Click to view the WiFi settings screen
  21. //
  22. FlipTraderSubmenuIndexAssetStartIndex, // Start of the submenu items for the assets
  23. } FlipTraderSubmenuIndex;
  24. // Define a single view for our FlipTrader application
  25. typedef enum {
  26. FlipTraderViewMain, // The screen that displays the info of the selected pair
  27. FlipTraderViewMainSubmenu, // The main submenu of the FlipTrader app
  28. FlipTraderViewAbout, // The about screen
  29. FlipTraderViewWiFiSettings, // The WiFi settings screen
  30. FlipTraderViewTextInputSSID, // The text input screen for the SSID
  31. FlipTraderViewTextInputPassword, // The text input screen for the password
  32. //
  33. FlipTraderViewAssetsSubmenu, // The submenu for the assets
  34. } FlipTraderView;
  35. // Each screen will have its own view
  36. typedef struct {
  37. ViewDispatcher* view_dispatcher; // Switches between our views
  38. View* view_main; // The main screen that displays "Hello, World!"
  39. Submenu* submenu_main; // The submenu
  40. Submenu* submenu_assets; // The submenu for the assets
  41. Widget* widget; // The widget
  42. VariableItemList* variable_item_list_wifi; // The variable item list (settngs)
  43. VariableItem* variable_item_ssid; // The variable item for the SSID
  44. VariableItem* variable_item_password; // The variable item for the password
  45. TextInput* uart_text_input_ssid; // The text input for the SSID
  46. TextInput* uart_text_input_password; // The text input for the password
  47. char* uart_text_input_buffer_ssid; // Buffer for the text input (SSID)
  48. char* uart_text_input_temp_buffer_ssid; // Temporary buffer for the text input (SSID)
  49. uint32_t uart_text_input_buffer_size_ssid; // Size of the text input buffer (SSID)
  50. char* uart_text_input_buffer_password; // Buffer for the text input (password)
  51. char* uart_text_input_temp_buffer_password; // Temporary buffer for the text input (password)
  52. uint32_t uart_text_input_buffer_size_password; // Size of the text input buffer (password)
  53. } FlipTraderApp;
  54. static char* asset_names[] = {
  55. // Crypto pairs
  56. "ETHUSD",
  57. "BTCUSD",
  58. // Stocks (will add mroe later)
  59. "AAPL",
  60. "AMZN",
  61. "GOOGL",
  62. "MSFT",
  63. "TSLA",
  64. "NFLX",
  65. "META",
  66. "NVDA",
  67. "AMD",
  68. // Forex pairs
  69. "EURUSD",
  70. "GBPUSD",
  71. "AUDUSD",
  72. "NZDUSD",
  73. "XAUUSD",
  74. "USDJPY",
  75. "USDCHF",
  76. "USDCAD",
  77. "EURJPY",
  78. "EURGBP",
  79. "EURCHF",
  80. "EURCAD",
  81. "EURAUD",
  82. "EURNZD",
  83. "AUDJPY",
  84. "AUDCHF",
  85. "AUDCAD",
  86. "NZDJPY",
  87. "NZDCHF",
  88. "NZDCAD",
  89. "GBPJPY",
  90. "GBPCHF",
  91. "GBPCAD",
  92. "CHFJPY",
  93. "CADJPY",
  94. "CADCHF",
  95. "GBPAUD",
  96. "GBPNZD",
  97. "AUDNZD",
  98. };
  99. // index
  100. static uint32_t asset_index = 0;
  101. #endif // FLIP_TRADE_E_H