-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
3,404 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# FlipTDI | ||
|
||
This is a FT232H device emulation application | ||
|
||
## Usage | ||
|
||
Сonnect Flipper to your computer and open the application, a new FT232H compatible device will appear in the system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## 1.0 | ||
- Initial release |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
App( | ||
appid="flip_tdi", | ||
name="FlipTDI", | ||
apptype=FlipperAppType.EXTERNAL, | ||
entry_point="flip_tdi_app", | ||
requires=[ | ||
"gui", | ||
"dialogs", | ||
], | ||
stack_size=2 * 1024, | ||
fap_description="Flipper FTDI232H emulator.", | ||
fap_version="1.0", | ||
fap_icon="flip_tdi_icon_10px.png", | ||
fap_category="USB", | ||
fap_icon_assets="images", | ||
fap_author="SkorP", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#include <furi.h> | ||
#include "flip_tdi_app_i.h" | ||
|
||
static bool flip_tdi_app_custom_event_callback(void* context, uint32_t event) { | ||
furi_assert(context); | ||
FlipTDIApp* app = context; | ||
return scene_manager_handle_custom_event(app->scene_manager, event); | ||
} | ||
|
||
static bool flip_tdi_app_back_event_callback(void* context) { | ||
furi_assert(context); | ||
FlipTDIApp* app = context; | ||
return scene_manager_handle_back_event(app->scene_manager); | ||
} | ||
|
||
static void flip_tdi_app_tick_event_callback(void* context) { | ||
furi_assert(context); | ||
FlipTDIApp* app = context; | ||
scene_manager_handle_tick_event(app->scene_manager); | ||
} | ||
|
||
FlipTDIApp* flip_tdi_app_alloc() { | ||
FlipTDIApp* app = malloc(sizeof(FlipTDIApp)); | ||
|
||
// GUI | ||
app->gui = furi_record_open(RECORD_GUI); | ||
|
||
// View Dispatcher | ||
app->view_dispatcher = view_dispatcher_alloc(); | ||
app->scene_manager = scene_manager_alloc(&flip_tdi_scene_handlers, app); | ||
|
||
view_dispatcher_set_event_callback_context(app->view_dispatcher, app); | ||
view_dispatcher_set_custom_event_callback( | ||
app->view_dispatcher, flip_tdi_app_custom_event_callback); | ||
view_dispatcher_set_navigation_event_callback( | ||
app->view_dispatcher, flip_tdi_app_back_event_callback); | ||
view_dispatcher_set_tick_event_callback( | ||
app->view_dispatcher, flip_tdi_app_tick_event_callback, 100); | ||
|
||
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen); | ||
|
||
// Open Notification record | ||
app->notifications = furi_record_open(RECORD_NOTIFICATION); | ||
|
||
// SubMenu | ||
app->submenu = submenu_alloc(); | ||
view_dispatcher_add_view( | ||
app->view_dispatcher, FlipTDIViewSubmenu, submenu_get_view(app->submenu)); | ||
|
||
// Widget | ||
app->widget = widget_alloc(); | ||
view_dispatcher_add_view( | ||
app->view_dispatcher, FlipTDIViewWidget, widget_get_view(app->widget)); | ||
|
||
// Field Presence | ||
app->flip_tdi_view_main_instance = flip_tdi_view_main_alloc(); | ||
view_dispatcher_add_view( | ||
app->view_dispatcher, | ||
FlipTDIViewMain, | ||
flip_tdi_view_main_get_view(app->flip_tdi_view_main_instance)); | ||
|
||
// FTDI emulation Start | ||
flip_tdi_start(app); | ||
|
||
scene_manager_next_scene(app->scene_manager, FlipTDISceneMain); | ||
|
||
return app; | ||
} | ||
|
||
void flip_tdi_app_free(FlipTDIApp* app) { | ||
furi_assert(app); | ||
|
||
// FTDI emulation Stop | ||
flip_tdi_stop(app); | ||
|
||
// Submenu | ||
view_dispatcher_remove_view(app->view_dispatcher, FlipTDIViewSubmenu); | ||
submenu_free(app->submenu); | ||
|
||
// Widget | ||
view_dispatcher_remove_view(app->view_dispatcher, FlipTDIViewWidget); | ||
widget_free(app->widget); | ||
|
||
// FlipTDIViewMain | ||
view_dispatcher_remove_view(app->view_dispatcher, FlipTDIViewMain); | ||
flip_tdi_view_main_free(app->flip_tdi_view_main_instance); | ||
|
||
// View dispatcher | ||
view_dispatcher_free(app->view_dispatcher); | ||
scene_manager_free(app->scene_manager); | ||
|
||
// Notifications | ||
furi_record_close(RECORD_NOTIFICATION); | ||
app->notifications = NULL; | ||
|
||
// Close records | ||
furi_record_close(RECORD_GUI); | ||
|
||
free(app); | ||
} | ||
|
||
int32_t flip_tdi_app(void* p) { | ||
UNUSED(p); | ||
FlipTDIApp* flip_tdi_app = flip_tdi_app_alloc(); | ||
|
||
view_dispatcher_run(flip_tdi_app->view_dispatcher); | ||
|
||
flip_tdi_app_free(flip_tdi_app); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "flip_tdi_app_i.h" | ||
|
||
#include <furi.h> | ||
|
||
#define TAG "FlipTDI" | ||
|
||
void flip_tdi_start(FlipTDIApp* app) { | ||
furi_assert(app); | ||
|
||
app->ftdi_usb = ftdi_usb_start(); | ||
} | ||
|
||
void flip_tdi_stop(FlipTDIApp* app) { | ||
furi_assert(app); | ||
|
||
ftdi_usb_stop(app->ftdi_usb); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include "helpers/flip_tdi_types.h" | ||
#include "helpers/flip_tdi_event.h" | ||
|
||
#include "scenes/flip_tdi_scene.h" | ||
#include <gui/gui.h> | ||
#include <gui/view_dispatcher.h> | ||
#include <gui/scene_manager.h> | ||
#include <gui/modules/submenu.h> | ||
#include <gui/modules/widget.h> | ||
#include <notification/notification_messages.h> | ||
#include "views/flip_tdi_view_main.h" | ||
#include <flip_tdi_icons.h> | ||
|
||
#include "helpers/ftdi_usb.h" | ||
|
||
|
||
typedef struct FlipTDIApp FlipTDIApp; | ||
|
||
struct FlipTDIApp { | ||
Gui* gui; | ||
ViewDispatcher* view_dispatcher; | ||
SceneManager* scene_manager; | ||
NotificationApp* notifications; | ||
Submenu* submenu; | ||
Widget* widget; | ||
FlipTDIViewMainType* flip_tdi_view_main_instance; | ||
|
||
FtdiUsb* ftdi_usb; | ||
}; | ||
|
||
void flip_tdi_start(FlipTDIApp* app); | ||
void flip_tdi_stop(FlipTDIApp* app); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
typedef enum { | ||
//SubmenuIndex | ||
SubmenuIndexWiringUart = 10, | ||
SubmenuIndexWiringSpi, | ||
SubmenuIndexWiringGpio, | ||
SubmenuIndexAbout, | ||
|
||
//FlipTDICustomEvent | ||
FlipTDICustomEventStartId = 100, | ||
FlipTDICustomEventMainMore, | ||
|
||
} FlipTDICustomEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include <furi.h> | ||
#include <furi_hal.h> | ||
|
||
#define FLIP_TDI_DEVELOPED "SkorP" | ||
#define FLIP_TDI_GITHUB "https://github.com/flipperdevices/flipperzero-good-faps" | ||
|
||
typedef enum { | ||
FlipTDIViewVariableItemList, | ||
FlipTDIViewSubmenu, | ||
FlipTDIViewMain, | ||
FlipTDIViewWidget, | ||
} FlipTDIView; |
Oops, something went wrong.