GPIO PC mock & Update docs (#76)

* Updated docs

* Make HAL to mock GPIO API for PC

* Update screenshots
This commit is contained in:
Ken Van Hoeylandt 2024-11-10 16:15:33 +01:00 committed by GitHub
parent 85f47aa43c
commit 8086cd5d82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 40 additions and 20 deletions

View File

@ -3,22 +3,20 @@
Tactility is a front-end application platform for ESP32. It is mainly intended for touchscreen devices. Tactility is a front-end application platform for ESP32. It is mainly intended for touchscreen devices.
It provides an application framework that is based on code from the [Flipper Zero](https://github.com/flipperdevices/flipperzero-firmware/) project. It provides an application framework that is based on code from the [Flipper Zero](https://github.com/flipperdevices/flipperzero-firmware/) project.
![photo of devices running Tactility](docs/pics/tactility-devices.webp)
**Status: Alpha** **Status: Alpha**
Tactility features a desktop that can launch apps: Tactility features a desktop with a set of applications:
![screenshot of desktop app](docs/pics/screenshot-desktop.png) ![screenshot of files app](docs/pics/screenshot-files.png) ![screenshot of desktop app](docs/pics/screenshot-desktop.png) ![screenshot of settings app](docs/pics/screenshot-settings.png)
![screenshot of system info app](docs/pics/screenshot-systeminfo.png) ![hello world app screenshot](docs/pics/screenshot-helloworld.png) ![screenshot of system info app](docs/pics/screenshot-systeminfo.png) ![screenshot of files app](docs/pics/screenshot-files.png)
Through the Settings app you can connect to Wi-Fi or change the display settings: ![screenshot of GPIO app](docs/pics/screenshot-gpio.png)
![screenshot of settings app](docs/pics/screenshot-settings.png) ![screenshot of display settings app](docs/pics/screenshot-display.png)
Play with the built-in apps or build your own! Use one of the supported devices or set up the drivers for your own hardware platform. Play with the built-in apps or build your own! Use one of the supported devices or set up the drivers for your own hardware platform.
![photo of devices running Tactility](docs/pics/tactility-devices.jpg)
Noteworthy features: Noteworthy features:
- Touch UI capabilities (via LVGL) with support for input devices such as on-device trackball or keyboard. - Touch UI capabilities (via LVGL) with support for input devices such as on-device trackball or keyboard.
- An application platform that can run apps and services. - An application platform that can run apps and services.

BIN
data/screenshot-files.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

View File

@ -1,11 +1,9 @@
#ifdef ESP_TARGET
#include "services/loader/loader.h" #include "services/loader/loader.h"
#include "ui/toolbar.h" #include "ui/toolbar.h"
#include "thread.h" #include "thread.h"
#include "mutex.h" #include "mutex.h"
#include "driver/gpio.h" #include "gpio_hal.h"
#include "ui/lvgl_sync.h" #include "ui/lvgl_sync.h"
typedef struct { typedef struct {
@ -136,7 +134,7 @@ static void app_show(App app, lv_obj_t* parent) {
lv_obj_align(row_wrapper, LV_ALIGN_TOP_MID, 0, 0); lv_obj_align(row_wrapper, LV_ALIGN_TOP_MID, 0, 0);
lock(gpio); lock(gpio);
for (int i = GPIO_NUM_0; i < GPIO_NUM_MAX; ++i) { for (int i = GPIO_NUM_MIN; i < GPIO_NUM_MAX; ++i) {
// Add the GPIO number before the first item on a row // Add the GPIO number before the first item on a row
if (column == 0) { if (column == 0) {
@ -206,5 +204,3 @@ const AppManifest gpio_app = {
.on_show = &app_show, .on_show = &app_show,
.on_hide = &on_hide .on_hide = &on_hide
}; };
#endif // ESP_TARGET

View File

@ -0,0 +1,7 @@
#ifndef ESP_PLATFORM
int gpio_get_level(int gpio_num) {
return gpio_num % 3;
}
#endif

View File

@ -0,0 +1,21 @@
#pragma once
#ifdef ESP_PLATFORM
#include "driver/gpio.h"
#define GPIO_NUM_MIN GPIO_NUM_0
#else
#define GPIO_NUM_MIN 0
#define GPIO_NUM_MAX 50
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef ESP_PLATFORM
int gpio_get_level(int gpio_num);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -35,6 +35,7 @@ static const ServiceManifest* const system_services[] = {
extern const AppManifest desktop_app; extern const AppManifest desktop_app;
extern const AppManifest display_app; extern const AppManifest display_app;
extern const AppManifest files_app; extern const AppManifest files_app;
extern const AppManifest gpio_app;
extern const AppManifest image_viewer_app; extern const AppManifest image_viewer_app;
extern const AppManifest power_app; extern const AppManifest power_app;
extern const AppManifest settings_app; extern const AppManifest settings_app;
@ -43,9 +44,7 @@ extern const AppManifest text_viewer_app;
extern const AppManifest wifi_connect_app; extern const AppManifest wifi_connect_app;
extern const AppManifest wifi_manage_app; extern const AppManifest wifi_manage_app;
#ifdef ESP_PLATFORM #ifndef ESP_PLATFORM
extern const AppManifest gpio_app;
#else
extern const AppManifest screenshot_app; extern const AppManifest screenshot_app;
#endif #endif
@ -53,15 +52,14 @@ static const AppManifest* const system_apps[] = {
&desktop_app, &desktop_app,
&display_app, &display_app,
&files_app, &files_app,
&gpio_app,
&image_viewer_app, &image_viewer_app,
&settings_app, &settings_app,
&system_info_app, &system_info_app,
&text_viewer_app, &text_viewer_app,
&wifi_connect_app, &wifi_connect_app,
&wifi_manage_app, &wifi_manage_app,
#ifdef ESP_PLATFORM #ifndef ESP_PLATFORM
&gpio_app,
#else
&screenshot_app, // Screenshots don't work yet on ESP32 &screenshot_app, // Screenshots don't work yet on ESP32
#endif #endif
}; };