Commit Graph

115 Commits

Author SHA1 Message Date
Ken Van Hoeylandt f9453d8956 Migrate devices, create drivers, other improvements & fixes (#574)
Migrated devices to kernel drivers:

- guition-jc3248w535c
- m5stack-core2
- m5stack-cores3
- m5stack-papers3

New drivers:

- axp192-module
- axp2101-module

Fixes:

- Fix SD card LDO for P4 devices
- Updated PowerOff app to work with kernel displays
- Fix for `lvgl_try_lock()` timing
- Fix for touch events with slow updating displays

Improvements:

- `GuiService` now keeps trying to lock to prevent silent failures caused by drivers.
- `GuiService` now uses lvgl-module calls for locking/unlocking
- display driver now has capability `DISPLAY_CAPABILITY_SLOW_REFRESH`
2026-07-19 00:39:26 +02:00
Ken Van Hoeylandt 8af6204ba1 New kernel drivers and device migrations (#563) 2026-07-14 20:26:57 +02:00
Shadowtrance 955416dac8 Audio System + Drivers (#562) 2026-07-14 08:34:29 +02:00
Ken Van Hoeylandt 50c0a14a93 New kernel drivers and more (#560)
- Added kernel base drivers for: display, pointer (touch, mouse, etc.), keyboard, adc, power supply and backlight
- Implement new kernel driver modules: `st7789-module` and `gt911-module`
- Implement ESP32 ADC "oneshot" kernel driver
- Implement ESP32  backlight kernel driver with ledc API
- Implemented `battery-sense` driver that allows for voltage measurement and creates a power supply child device
- Updated github actions
- Updated flash scripts
- Fix for esp32 legacy driver conflict with ADC
- Created separate `lilygo-tdeck` and `lilygo-tdeck-plus` devices
- Created `lilygo-module` with LilyGO kernel drivers
- Fix for intermittent errors in build related to code generation of `devicetree.c`
- `lvgl-module` can now map kernel drivers onto LVGL devices
- Created `KernelDisplayApp` as a mirror of `HalDisplayApp` (formerly `DisplayApp`)
- Removed `struct` and `enum` prefix in a lot of kernel driver cpp source files
- `lilygo-tdeck` and `lilygo-tdeck-plus` are now fully relying on kernel drivers and don't use any of the old HAL
2026-07-12 00:29:12 +02:00
Shadowtrance 7a7f09be35 Tab5 camera + other stuff (#558)
* Tab5 camera + other stuff

Tab5 camera driver - SC2356
Custom SliderBox widget - slider with plus and minus buttons + value label and snapping
Rtc Time service + rtc api
Sdk release - only include drivers built for that specific target, eg: sc2356 driver is mipi / p4 only.
No more hardcoded manual sdk cmakelists
New function to find device by compatible string match. no more static cast bool wildness when trying to match a single device (like M5Stack PaperS3 for example)

* feedback + fixes

Fixed external app user data path.
fix(gui): block app teardown until onHide() completes, preventing ELF unload racing a still-running app
added camera device type and api

* drain the snake sssem

---------

Co-authored-by: Ken Van Hoeylandt <git@kenvanhoeylandt.net>
2026-07-10 08:45:03 +02:00
Ken Van Hoeylandt 1c2806bddf Added WiFi kernel drivers and refactored Wifi service (#557)
+ other improvements
2026-07-09 21:03:38 +02:00
Ken Van Hoeylandt f4f91f81d6 Service logic moved to kernel (#554)
+ fix BT service file paths
2026-07-07 22:52:19 +02:00
Ken Van Hoeylandt dfaeb9a2d9 Crypt module (#549)
- Moved cryptography code out of Tactility project and into a kernel module.
- Converted C++ code to C style interface
- Hardened security
2026-07-05 11:17:42 +02:00
Ken Van Hoeylandt 9d5993930d Replaced Logger usage with LOG_x (#548) 2026-07-04 23:49:19 +02:00
Ken Van Hoeylandt ecad2248d9 Various improvements (#547)
- Fixed crash when returning to Setup app (from any of the steps)
- Fixed crash when returning to TimeDateSettings app (after locale selection)
- Fixed GuiService inconsistent behaviour: now always perform operations async (e.g. to show/hide apps). This fixes crashes in some onHide() calls where onHide() might be called before onShow() was called.
- Fix for incorrect WebServService path
- Remove CYD-4848S040C SD card functionality, but added a GPIO fix for releasing 3-wire SPI pin sharing.
- Fix for saving/loading settings for various apps
2026-07-04 21:26:43 +02:00
Ken Van Hoeylandt 05720821f8 Require SD card or >4MB flash (#545) 2026-07-03 23:56:03 +02:00
Ken Van Hoeylandt d3439f6f45 Fixes & memory optimizations (#540)
- Disable BlueTooth driver by default, to ensure it doesn't allocate memory
- Update BlueTooth settings app behaviour to make sure it starts/stops the devices
- Disable SPI RAM usage for ST7789 as it broke App Hub
- Reduce T-Display and T-Deck display buffers from 1/3rd to 1/10th of resolution
- Enabled dynamic buffers for MbedTLS to optimize memory
- TLS 1.3 did not work with dynamic buffers: downgrade to 1.2 for now
- WiFi is now enabled from the Boot app callback to the WiFi service, instead of the WiFi service start() function. This avoids a lockup when WiFi is started by the service while the Boot app is updating the WiFi settings.
2026-07-01 21:11:46 +02:00
Ken Van Hoeylandt 599fa46766 Driver improvements (#535)
- New drivers:
  - SD SPI
  - spi_peripheral
  - touch_placeholder
  - display_placeholder
- Devicetree compiler:
  - Implement phandle-arrays
  - Implement device addresses
- Add placeholder drivers to all devices with a SPI display
- SPI driver: add `cs-pins` and set them to high on driver start
- FileSystem: add `file_system_set_owner()` and `file_system_get_owner()`
- File locking is now checking if the related `FileSystem` is part of a shared SPI bus
- Add `device_get_child_count()`
- SDMMC driver: Remove default of `slot` value
- Fix for Crowpanel Basic 3.5" display (add delay to booting)
- Fix for LilyGO T-HMI SD card mounting (delayed mounting by disabling it initially in the dts)
2026-06-27 17:32:05 +02:00
Shadowtrance 3dcc95f6f3 USB host support (#527) 2026-06-03 23:10:37 +02:00
Shadowtrance a59fbf4ed5 Tab5 features, StackChan, fixes, drivers.... (#526) 2026-05-28 23:31:25 +02:00
Shadowtrance 5c78d55b04 Bluetooth (#518)
* Bluetooth LE addition

* fixes

* use the psram!

helps a little on S3 (t-deck)

* custom device name

* Update symbols.c

* Feedback + fixes

Fixes external app start/stop server (child devices)
Fixes BtManage causing a full system hang upon disabling bt when a device is connected to the host.

* updoot

* more updoot

* move back!

* Revert "move back!"

This reverts commit d3694365c634acc5db62ac59771c496cb971a727.

* fix some of the things

* Addressing feedback? hmm

* Fixes

Bug 1 — Reconnect loop / Reconnect not working fixed
Bug 2 — Name-only advertising overwrites HID advertising
Bug 3 — BleHidDeviceCtx leak on re-enable
Enhancement — HID device auto-start on radio re-enable

* stuff...

* update for consistency with others

* fix crashes

and some bonus symbols

* a few symbols, i2c speed, cdn message

100kHz i2c speed seems to be more compatible with m5stack modules...and probably in general.
cdn message no longer applies

* Hide BT Settings when bt not enabled

* Addressing things and device fixes

* Missed one!

* stuff
2026-05-22 22:49:37 +02:00
Ken Van Hoeylandt aa7530e515 New kernel drivers, filesystem API, and more (#513)
* **New Features**
  * BMI270 6-axis IMU driver added; new unified filesystem abstraction for mounted filesystems.
  * Public Wi‑Fi API surface (no implementation yet)
  * SDMMC driver added (kernel drive$)
  * expanded GPIO interrupt/callback support
* **Improvements**
  * M5Stack Tab5: revamped GPIO/power initialization and IMU integration.
  * LVGL updates including device fontSize configuration.
  * Updated all code related to SD card device/fs handling
  * Rename LilyGO T-HMI S3 to LilyGO T-HMI
* **Bug Fixes**
  * Simplified and consolidated SD card handling and mount discovery.
2026-03-07 16:13:39 +01:00
Shadowtrance 2de35b2d2d M5Stack PaperS3 improvements and other bug fixes (#512) 2026-03-06 21:45:56 +01:00
Ken Van Hoeylandt 3a24d058c9 Rename icons, fix T-Lora Pager config and more (#502)
* **New Features**
  * Added NFC chip-select to SD card hardware configuration.

* **Refactor**
  * Consolidated and renamed icon resources; apps and status-bar now reference unified icon headers and new icon constants.
  * Renamed LVGL lock API (timed → lvgl_try_lock) and updated callers.

* **Documentation**
  * Updated module README and license files; added Apache-2.0 license document.
2026-02-15 13:32:52 +01:00
Ken Van Hoeylandt 9a11e6f47b Implement UI scaling and more (#501)
**New Features**
 * Runtime font accessors and new symbol fonts for text, launcher, statusbar, and shared icons.
 * Added font height base setting to device.properties
 * Text fonts now have 3 sizes: small, default, large

**Improvements**
 * Renamed `UiScale` to `UiDensity`
 * Statusbar, toolbar and many UI components now compute heights and spacing from fonts/density.
 * SSD1306 initialization sequence refined for more stable startup.
 * Multiple image assets replaced by symbol-font rendering.
 * Many layout improvements related to density, font scaling and icon scaling
 * Updated folder name capitalization for newer style
2026-02-15 01:41:47 +01:00
Ken Van Hoeylandt d27404964a SPI device migration (#490)
- Implement SPI devices in dts files for all devices
- Removed `tt::hal::spi` HAL and its configurations
- Fix for devicetree generator "boolean" support
- Remove unused custom locks in all `DisplayDevice` implementations
- Fixed some bugs with devices
- Updated XPT2046 driver
- Fix for `WifiEsp` deadlock
- Export a lot of new `math.h` symbols with `tt_init.cpp`
- Created `SpiDeviceLock` in `TactilityCore` as a wrapper for kernel SPI locking
- Improved `TactilityKernel` SPI driver.
2026-02-08 22:14:18 +01:00
Ken Van Hoeylandt 9f721e6655 Refactor LVGL code into kernel module (#472)
* **New Features**
  * Added a standalone LVGL module and enabled LVGL support in the simulator for richer local UI testing.

* **Refactor**
  * HAL and LVGL split into distinct modules; startup and device attach/detach flows reorganized for clearer lifecycle management.
  * Public APIs tightened with clearer nullability/documentation.

* **Bug Fixes**
  * More consistent LVGL start/stop and device attach/detach behavior for improved stability.
2026-02-01 22:57:45 +01:00
Ken Van Hoeylandt 3fe1dc0312 Create hal-device module, fix GPIO, fix tests, fix TactilityC (#471)
* **New Features**
  * Added a HAL device module providing device enumeration, type queries and a HAL↔kernel bridge.

* **Improvements**
  * Integrated HAL module into startup; standardized module names, includes and lifecycle logging; safer file append behavior; broader build support.

* **API Changes**
  * Driver lifecycle now uses explicit add/remove semantics; C and HAL device type/lookup APIs clarified.

* **Chores**
  * Added module README and Apache‑2.0 license; updated build configuration to include the new module.

* **Fixes**
  * Updated tests and object file handling to behave correctly.
2026-02-01 01:05:16 +01:00
Shadowtrance f6ddb14ec1 Dashboard auto refresh toggle (#465)
asset sync now works (AssetVersion)...could probably do with some improvements.
disable auth username and password if not enabled.
2026-01-28 21:15:36 +01:00
Ken Van Hoeylandt d551e467b8 Moved and renamed files for consistent C code style (#463)
* **Documentation**
  * Added new C coding style guide detailing naming conventions for files, directories, macros, constants, variables, functions, and type definitions with illustrative examples.
  * Updated C++ coding style documentation with clarifications on C naming conventions and header directory organization patterns.

* **Refactor**
  * Updated header include paths throughout the codebase to use lowercase naming conventions consistently.
2026-01-27 20:17:33 +01:00
Shadowtrance c05d46a28c Screensavers (#462)
Adds screensavers in addition to the backlight idle off. 
More info in screensavers.md

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Added a screensaver system with multiple styles (Bouncing Balls, Mystify, Matrix Rain) and a common screensaver interface; auto-starts after inactivity, dismisses on interaction, and supports auto-off/backlight behavior.
  * New Display setting and UI dropdown to choose and persist the screensaver.

* **Documentation**
  * Added comprehensive screensaver docs covering usage, extension, and configuration.

* **Chores**
  * Registered the display-idle service.

* **Bug Fixes**
  * Updated LVGL API calls to match renamed functions.

<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-27 17:21:16 +01:00
Ken Van Hoeylandt e6abd496f9 Various improvements (#461)
* **New Features**
  * Time and delay utilities added (ticks, ms, µs); SD card now uses an expansion-header CS pin; HTTP downloads warn when run on the GUI task and yield to avoid blocking.

* **Bug Fixes / Reliability**
  * Many hard-crash paths converted to guarded checks to reduce abrupt termination and improve stability.

* **Tests**
  * Unit tests added to validate time and delay accuracy.

* **Chores**
  * License header and build/macro updates.
2026-01-27 08:04:21 +01:00
Shadowtrance 10381b10cd Chat app update, EspNow v2 & GPS Info (#460) 2026-01-26 17:32:57 +01:00
Ken Van Hoeylandt dfe2c865d1 TactilityKernel improvements and more (#459) 2026-01-25 23:54:33 +01:00
Shadowtrance 0d16eb606f ESP-NOW chat & P4 fixes (#454)
* Espnow chat fix

Fixes chat app not appearing and coexistence with wifi STA mode.
Wifi OFF and obviously not connected, espnow starts.
Wifi ON and connected, espnow starts.
Wifi ON and NOT connected, espnow starts.

* Fix P4 build
2026-01-24 12:42:49 +01:00
Shadowtrance 01ffe420eb Webserver addition and TactilityC symbols (#451) 2026-01-21 21:47:59 +01:00
Ken Van Hoeylandt c98cb2bf10 Add Guition JC1060P470CIWY and update other Guition device IDs (#447)
This commit contains @josemalm32 's  implementation for the Guition JC1060P470CIWY  (see https://github.com/ByteWelder/Tactility/issues/427)

I've added these changes:
- Updated the branch for the new logging method
- Updated the branch for the PR that I mentioned in the above linked issue
- Replaced the manually pasted in esp_lcd_jd9165 driver with the one from the component registry
- Updated Spanish to English
- Updated all drivers' mutexes/locks
- Fixed the display color format
- Fixed bug in power deinit
- Renamed I2C bus in config
- Added device to continuous integration
- Renamed several Guition devices from CYD to Guition
- Fix for `EspLcdDisplayV2` init for when features are not supported
- Pin esp_wifi_remote to version 1.2.3
- Fix in `WifiManage` logging
- Fix for `WifiEsp.cpp`'s check for wifi presence
- Fix for `WifiEsp`'s scan list logging
- Fix for `gcc_soft_float_symbols` in TactiltyC
2026-01-07 22:41:45 +01:00
Ken Van Hoeylandt f620255c41 New logging and more (#446)
- `TT_LOG_*` macros are replaced by `Logger` via `#include<Tactility/Logger.h>`
- Changed default timezone to Europe/Amsterdam
- Fix for logic bug in unPhone hardware
- Fix for init/deinit in DRV2605 driver
- Other fixes
- Removed optimization that broke unPhone (disabled the moving of heap-related functions to flash)
2026-01-06 22:35:39 +01:00
Ken Van Hoeylandt 719f7bcece Fixes and improvements (#445)
- Remove unnecessary CS work-around for Cardputers
- Don't compile WifiMock when not necessary
- Fix for running apps on devices without SPIRAM
- Disable backlight dimming by default
2026-01-04 14:27:10 +01:00
Ken Van Hoeylandt 2ca8ae62fb Various fixes (#444)
- Add missing symbols for TactilitySDK
- Disable display idle logic when there's no LVGL display
2026-01-04 01:50:33 +01:00
Ken Van Hoeylandt 7283920def Create TactilityFreertos subproject (#440) 2026-01-03 00:19:40 +01:00
Shadowtrance a4dc633063 Feature additions (#434)
Lots of things "ported" over from the "enhanced" fork. With some adjustments here and there.

KeyboardBacklight driver (for T-Deck only currently)
Trackball driver (for T-Deck only currently)
Keyboard backlight sleep/wake (for T-Deck only currently...also requires keyboard firmware update)
Display sleep/wake
Files - create file/folder
Keyboard settings (for T-Deck only currently)
Time & Date settings tweaks
Locale settings tweaks
Systeminfo additions
Espnow wifi coexist

initI2cDevices - moved to T-deck init.cpp / initBoot
KeyboardInitService - removed,  moved to T-deck init.cpp / initBoot
Adjusted TIMER_UPDATE_INTERVAL to 2 seconds.
Added lock to ActionCreateFolder

Maybe missed some things in the list.

Display wake could do with some kind of block on wake first touch to prevent UI elements being hit when waking device with touch. Same with encoder/trackball/keyboard press i guess.

The original code was written by @cscott0108 at https://github.com/cscott0108/tactility-enhanced-t-deck
2026-01-02 12:14:55 +01:00
Ken Van Hoeylandt 3fc2ff8bc6 Split off RecursiveMutex from Mutex (#437)
* Split off RecursiveMutex from Mutex

* Fix

* Code quality
2025-12-28 12:30:54 +01:00
Ken Van Hoeylandt f48654d3dc Various fixes and improvements (#435)
- Fix for `sdkconfig` generation: the keys that contained the MCU type in its name weren't properly upper-cased.
- Moved WiFi configuration property files to the user data path of the app instead of a fixed location.
- Moved more properties from `device.py` to `sdkconfig/default.properties`
- Fix for `device.cmake` device id parsing: separate basic property parsing from device id validation
- Created internal `tt::service::wifi::findServiceContext()`
- Changed Wi-Fi service id to lowercase (will change it for other services later)
2025-12-25 15:41:39 +01:00
Ken Van Hoeylandt 776e3cd4c0 Fix Wi-Fi provisioning from /data (#428)
- Import from `/data/settings` instead of `/data`
- Removed unnecessary functions
- Header syntax cleanup
2025-12-17 14:38:29 +01:00
NellowTCS 65d3d55cc4 Various fixes and improvements (#424)
- Read WiFi provisioning from /data
- Fix for finding apps at /data
- Expose more LVGL functions with TactilityC
2025-12-05 13:18:23 +01:00
Ken Van Hoeylandt b565d56029 Implement support for ESP32 C6 and P4 SOCs (#421)
- Implement generic ESP32 devices
- Updated GitHub Actions to first build the SDKs. These are now based on the generic device implementations and the build act as a filter before compiling the dozens of other devices. It should save on resources when boards fail to compile.
- Adapted code to C6 and P4 differences, heavily borrowed from from https://github.com/ByteWelder/Tactility/pull/394 written by @marciogranzotto, with some changes of my own
- Updated `device.py` to make the `[display]` section optional
2025-11-24 19:28:07 +01:00
Ken Van Hoeylandt eba1f8955a Merge develop into main (#418)
- WiFi code cleanup
- When WifiConnect opens and SSID is filled in, automatically focus on the password field
- When no touch screen is present, toolbar close buttons should be automatically selected
- When `device.py` selects a device, print it on screen
2025-11-14 23:29:20 +01:00
Ken Van Hoeylandt a4f4784ed9 Add low memory warning (#417) 2025-11-14 15:43:00 +01:00
Ken Van Hoeylandt e2ec39304c Fixes for enums in TactilityC (#404) 2025-11-01 09:38:32 +01:00
Ken Van Hoeylandt 09f8031bff Fix for open Wi-Fi (#387)
Don't encrypt password if there's no password set
2025-10-25 18:57:43 +02:00
Ken Van Hoeylandt c139300a58 Thread+locking improvements and more (#386) 2025-10-25 18:08:46 +02:00
Ken Van Hoeylandt f660550f86 App hub and more (#383)
- Added `AppHub` app
- Added `AppHubDetails` app
- Added `cJSON` dependency
- Renamed `AppSim` module to `FirmwareSim`
- Added extra `tt::app::alertdialg::start()`
- Renamed `addApp()`, `removeApp()`, `findAppById()` and `getApps()` to `addAppManifest()`, `removeAppManifest()`, `findAppManifestById()` and `getAppManifests()`
- Added `tt::lvgl::toolbar_clear_actions()`
- Added `tt::network::EspHttpClient` as a thread-safe wrapper around `esp_http_client`
- Added `tt::network::http::download()` to download files
- Added `tt::network::ntp::isSynced()`
- When time is synced, the timestamp is stored in NVS flash. On boot, it is restored. This helps SSL connections when doing a quick reset: when WiFi reconnects, the user doesn't have to wait for NTP sync before SSL works.
- Added `tt::json::Reader` as a `cJSON` wrapper
- Added `int64_t` support for `Preferences`
- Added `int64_t` support for `Bundle`
- Added dependencies: `cJSON`, `esp-tls`
- When time is synced via NTP, disable time sync.
- Added docs to 'tt::file::` functions
- Added `tt::string::join()` that works with `std::vector<const char*>`
- Fixed `tt::file::getLastPathSegment()` for the scenario when a path was passed with only a single segment
- Set `CONFIG_ESP_MAIN_TASK_STACK_SIZE=5120` (from about 3k) for all boards
- Set `CONFIG_MBEDTLS_SSL_PROTO_TLS1_3=y` for all boards
2025-10-25 00:20:48 +02:00
Ken Van Hoeylandt 9c5a427a34 Merge develop into main (#377)
- Extract web server from `DevelopmentService` into a separate class: `HttpServer`
- Export more functions in `tt_init.cpp`
2025-10-16 18:59:23 +02:00
Ken Van Hoeylandt 3802679de4 File locking and DevelopmentService improvements (#358)
- Moved `file::getlock(path)` from `Tactility` to `TactilityCore`
- Changed all existing `file::*` functions to implement locking by default
- Removed all manual locking where `file::*` functions were used
- When `DevelopmentService` receives a file, it doesn't try to allocate it all in memory. This fixes going out-of-memory on devices without PSRAM.
- Fix for TactilityC include
2025-10-05 16:16:55 +02:00