unleashed-firmware/applications/plugins/spi_mem_manager/spi_mem_app_i.h
Sergey Gavrilov 777a4d109d
[FL-3055] Getter for application data path (#2181)
* Threads: application id
* Unit tests: appsdata getter test
* Unit tests: moar test cases for appsdata getter
* Unit tests: remove folders after test
* Storage: dir_is_exist, migrate, + unit_tests
* Plugins: migration
* Storage: common_exists, moar unit_tests 4 "common_migrate", "common_migrate" and "common_merge" bugfixes
* Storage: use FuriString for path handling
* Storage API: send caller thread id with path
* Storage: remove StorageType field in storage file list
* Storage: simplify processing
* Storage API: send caller thread id with path everywhere
* Storage: /app alias, unit tests and path creation
* Storage, path helper: remove unused
* Examples: app data example
* App plugins: use new VFS path
* Storage: file_info_is_dir
* Services: handle alias if the service accepts a path.
* App plugins: fixes
* Make PVS happy
* Storage: fix storage_merge_recursive
* Storage: rename process_aliases to resolve_path. Rename APPS_DATA to APP_DATA.
* Apps: use predefined macro instead of raw paths. Example Apps Data: README fixes.
* Storage: rename storage_common_resolve_path to storage_common_resolve_path_and_ensure_app_directory
* Api: fix version
* Storage: rename alias message
* Storage: do not create app folders in path resolving process in certain cases.

---------

Co-authored-by: Astra <93453568+Astrrra@users.noreply.github.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2023-03-02 03:57:27 +10:00

79 lines
1.9 KiB
C

#pragma once
#include <furi.h>
#include <furi_hal_spi.h>
#include <furi_hal_spi_config.h>
#include "spi_mem_app.h"
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/submenu.h>
#include <gui/modules/dialog_ex.h>
#include <gui/modules/popup.h>
#include <notification/notification_messages.h>
#include <dialogs/dialogs.h>
#include <gui/modules/widget.h>
#include <gui/modules/text_input.h>
#include <storage/storage.h>
#include <toolbox/path.h>
#include <toolbox/random_name.h>
#include "scenes/spi_mem_scene.h"
#include "lib/spi/spi_mem_worker.h"
#include "spi_mem_manager_icons.h"
#include "views/spi_mem_view_progress.h"
#include "views/spi_mem_view_detect.h"
#define TAG "SPIMem"
#define SPI_MEM_FILE_EXTENSION ".bin"
#define SPI_MEM_FILE_NAME_SIZE 100
#define SPI_MEM_TEXT_BUFFER_SIZE 128
typedef enum {
SPIMemModeRead,
SPIMemModeWrite,
SPIMemModeCompare,
SPIMemModeErase,
SPIMemModeDelete,
SPIMemModeUnknown
} SPIMemMode;
struct SPIMemApp {
Gui* gui;
ViewDispatcher* view_dispatcher;
SceneManager* scene_manager;
Submenu* submenu;
DialogEx* dialog_ex;
Popup* popup;
NotificationApp* notifications;
FuriString* file_path;
DialogsApp* dialogs;
Storage* storage;
File* file;
Widget* widget;
SPIMemWorker* worker;
SPIMemChip* chip_info;
found_chips_t found_chips;
uint32_t chip_vendor_enum;
SPIMemProgressView* view_progress;
SPIMemDetectView* view_detect;
TextInput* text_input;
SPIMemMode mode;
char text_buffer[SPI_MEM_TEXT_BUFFER_SIZE + 1];
};
typedef enum {
SPIMemViewSubmenu,
SPIMemViewDialogEx,
SPIMemViewPopup,
SPIMemViewWidget,
SPIMemViewTextInput,
SPIMemViewProgress,
SPIMemViewDetect
} SPIMemView;
typedef enum {
SPIMemCustomEventViewReadCancel,
SPIMemCustomEventViewVerifySkip,
SPIMemCustomEventTextEditResult,
SPIMemCustomEventPopupBack
} SPIMemCustomEvent;