GPIO PC mock & Update docs (#76)
* Updated docs * Make HAL to mock GPIO API for PC * Update screenshots
14
README.md
@ -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.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
**Status: Alpha**
|
**Status: Alpha**
|
||||||
|
|
||||||
Tactility features a desktop that can launch apps:
|
Tactility features a desktop with a set of applications:
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
Through the Settings app you can connect to Wi-Fi or change the display settings:
|

|
||||||
|
|
||||||
 
|
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
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
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
docs/pics/screenshot-gpio.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 100 KiB |
BIN
docs/pics/tactility-devices.webp
Normal file
|
After Width: | Height: | Size: 221 KiB |
@ -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
|
|
||||||
7
tactility/src/apps/gpio/gpio_hal.c
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#ifndef ESP_PLATFORM
|
||||||
|
|
||||||
|
int gpio_get_level(int gpio_num) {
|
||||||
|
return gpio_num % 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
21
tactility/src/apps/gpio/gpio_hal.h
Normal 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
|
||||||
@ -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
|
||||||
};
|
};
|
||||||
|
|||||||