Compare commits

...

86 Commits

Author SHA1 Message Date
Adolfo Reyna 310b955652 Migrate ES3C35P to latest main firmware 2026-09-10 13:31:10 -04:00
Ken Van Hoeylandt 8556103eb1 Implemented multi-binary app packaging (#648) 2026-09-09 20:05:04 +02:00
Shadowtrance 2496dea5c2 M5Stack PaperS3 display driver improved (#647) 2026-09-08 21:57:41 +02:00
Ken Van Hoeylandt 1b16184a72 Multi-platform http server (#646)
- Add server support to `http-module`
- Ensure `DevelopmentService` works on all platforms (including posix)
- Ensure the built-in web server with dashboard works on all platforms (inluding posix). It still has some issues with certain featuers, but the basics work.
2026-09-06 14:16:23 +02:00
Ken Van Hoeylandt a0b2ee7ebc Run executables directly (#645)
- Apps can be launched directly from file paths (including Files app support)
- Added executable detection to identify unsupported or invalid binaries before launch.
- App startup is now streamlined through separate registered-app and direct-execution interfaces.
- Existing app launch points were migrated to the updated startup APIs.
2026-09-04 21:23:08 +02:00
Ken Van Hoeylandt 643cbc3806 Implement posix app loading (#643)
- Added POSIX desktop support for SDK builds, application packaging, and integration testing.
- Added POSIX filesystem partitions and improved application path handling.
- Added simulator support for loading and running applications dynamically.
- Improved simulator task stack handling and display startup reliability.
- Improved simulator display scaling, resizing, high-DPI support, and pointer accuracy.
- Fixed LVGL timers and input polling on POSIX. (fixes simulator with Linux on some Intel graphics platforms)
- Standardized data paths across platforms.
- Logging now works via separate task: this allows apps to write to log without it affecting their stdout (for apps that output text as relevant date for other apps, like the File Selection app)
- Fixes for app stdio
2026-08-31 22:09:04 +02:00
Shadowtrance d3656bcd3d Fixes and improvements (#642) 2026-08-30 23:10:52 +02:00
Ken Van Hoeylandt 7a81b525ed elf_loader update and fix for remote install (#641) 2026-08-30 12:58:48 +02:00
Ken Van Hoeylandt 6e5e35610b Implement app streams: stdio for apps (#640)
Implement file IO for applications to facilitate text input/output capturing.

Apps can now launch apps and:
- Read their stdio output
- Write to their stdio input
2026-08-30 12:07:40 +02:00
Ken Van Hoeylandt 64fb1a9f52 display backlight and bluetooth reference counting (#639) 2026-08-29 23:37:31 +02:00
Ken Van Hoeylandt 19b11eb9a8 Remove TactilityC and Firmware subprojects (#638)
- Removed TactilityC, moved its symbols to existing modules and several new ones (pthread-module, c-symbols-module, cpp-symbols-module, posix-symbols-module, freertos-module).
- Removed Firmware subproject and moved main() into Tactility subproject.
- Strengthened application archive, path, version, stack-size, and device validation.
- Moved symbol resolution for elf_loader to app-esp32-module.
- Improved `struct Module` declarations and made module and symbol definitions in modules more consistent.
- Removed old http download code from Tactility subproject.
- Rename app-module's source files for consistency.
- Add missing pthread symbols.
- Kernel module symbols are now resolvable on all platforms.
2026-08-29 21:06:43 +02:00
Crazypedia d3556fb536 feat(lilygo-tdeck-max): wire up the DRV2605 haptic driver (#635) 2026-08-29 17:53:45 +02:00
Crazypedia e466b183cc feat(lilygo-tdeck-max): wire up the MIA-M10Q GPS (#634) 2026-08-29 17:51:35 +02:00
Ken Van Hoeylandt bcbf18e363 Implement http-module (#637)
Create http-module and implement it in App Hub and App Hub Details apps.
2026-08-28 23:09:59 +02:00
Ken Van Hoeylandt d2442bedb4 LoraApi callbacks refactored to events (#632) 2026-08-28 18:56:12 +02:00
Crazypedia b7577f2328 feat(gdeq031t10): support an optional frontlight (#633) 2026-08-28 08:59:46 +02:00
Ken Van Hoeylandt 020aa471e2 File locking refactored (#631)
Remove FileMutex and wire locking into driver subsystems.
2026-08-28 01:06:53 +02:00
Ken Van Hoeylandt 92ca046681 app-module events & callstack config, crash diagnostics (#630)
- Apps can specify task stack depth and preferred memory placement in their manifests.
- App identifiers are validated against length and character requirements.
- Crash diagnostics now show the crash cause, reason, fault address, call stack, and program-counter details, with logs saved for review.
- App closing is more consistent across built-in screens. There's now a dedicated function, and the old _emit() function is made private.
- Crash diagnostics no longer display a QR code without a call stack.
- Improved memory allocation for unrestricted requests.
2026-08-27 21:50:12 +02:00
Crazypedia c656ee9ffd fix(gdeq031t10): skip the panel refresh when the frame is unchanged (#624) 2026-08-27 17:03:34 +02:00
Ken Van Hoeylandt 0ee2415f3b Bluetooth and Wi-Fi improvements (#622)
- Enable BT by default in DTS, and create separate radio on/of functionality (like recent Wi-Fi changes)
- Bluetooth event handling now uses queued subscriptions, improving event delivery and application responsiveness.
- Improved synchronization of Bluetooth advertising, connections, HID, MIDI, and SPP operations.
- Enhanced cleanup during Bluetooth shutdown and subscription removal.
- Clarified Bluetooth start and stop behavior.
- Improved wifi driver subscription stability to prevent endless loops
2026-08-26 00:30:03 +02:00
Ken Van Hoeylandt ab75d2022d Refactored events (#621)
Event handling:

- Added unified event handling for application, system, and Wi‑Fi events.
- Updated all apps to reflect event handling changes

Wi-Fi:

- Refactored event handling from listener interface to task & event group.
- Added direct Wi‑Fi radio controls and improved event subscriptions.
- Wi‑Fi screens now refresh asynchronously and handle unavailable devices more gracefully.
- Enabled Wi‑Fi by default on in dts files, but radio on/off is still done by code. The main reason was reliable event subscription and consistent devicetree states.
- Improved Wi‑Fi shutdown cleanup and radio-state handling.

Other:
- Renamed the Kernel Display app to Display.
2026-08-25 17:44:20 +02:00
Ken Van Hoeylandt db48dfe812 Fixes and improvements (#620)
- Standardized keyboard input using Unicode-based key codes across supported devices and the simulator. Keyboards don't emit `LV_KEY_*` anymore.
- Refactored lilygo encoder driver into a reusable GPIO rotary encoder driver (see `Drivers/gpio-encoder-module/`). Added more features to the config file.
- Improved LVGL keyboard device management, including duplicate prevention and reliable reconnects.
- LVGL file mutex now registers with lvgl start/stop
- Improved LVGL startup/shutdown stability and memory allocation reliability.
- Increased simulator LVGL memory capacity and improved USB device-class handling.
2026-08-23 17:21:16 +02:00
Ken Van Hoeylandt 4fea48f433 Remove explicit app closing function (#618) 2026-08-21 08:59:52 +02:00
Ken Van Hoeylandt 0ff1627385 Fixes and improvements (#617) 2026-08-20 17:22:01 +02:00
Ken Van Hoeylandt b03759a111 Fixes and improvements (#616) 2026-08-18 20:43:07 +02:00
Ken Van Hoeylandt f943c4dd69 Move tests to relevant subprojects (#615)
- Moved test projects to the parent project they belong to
- Improved test stability/corectness
- Improved recursive directory deletion by safely ignoring current- and parent-directory entries.
- Update docs
2026-08-13 23:01:12 +02:00
Ken Van Hoeylandt d6b1d15e56 Various improvements (#614)
- Auto-select widgets in Launcher and apps with toolbars on devices without touch.
- Improved USB HID input reliability, cleanup
- Updated PSRAM settings to improve boot stability on supported devices.
- Prevented duplicate Wi-Fi event subscriptions during screen rebuilds.
- Updated docs
- Fixes in WifiManage and WifiConnect
- Reduced main task stack size
- Moved USB HID stack size to PSRAM when available
- app_manager_find_manifest() now returns a copy instead of a pointer
2026-08-13 20:30:47 +02:00
Shadowtrance cc8be3faef USB device-mode support (#613) 2026-08-12 21:29:35 +02:00
Ken Van Hoeylandt 37c507544b Refactor app loading and window management (#609) 2026-08-11 23:40:59 +02:00
Shadowtrance dc3f6104b8 Papers3 improvements (#611)
- And Tab5 keyboard improvements
- Usb host keyboard improvements
- Symbols
- Requires the device.py change from CL-32 PR but that only affects visuals and not build breaking
2026-08-08 15:02:49 +02:00
NellowTCS 564d8af64c Implement Tulip Creative Computer 4r11 (#608) 2026-08-08 14:52:34 +02:00
NellowTCS c6373b79e9 Implement CL-32 Support (#610) 2026-08-07 19:30:22 +02:00
Ken Van Hoeylandt d2c69ee7e8 Move service API from TactilityKernel to service-module (#604)
Extracted the service API from TactilityKernel and put it in a new module at `Modules/service-module`
2026-08-01 20:51:43 +02:00
Shadowtrance 85fe1a319a Tab5 ST7121 variant + fixes (#605)
Added the newest variant to the tab5, St7121.
Fixed variant detection reliability
Fixed tab5 camera WHO_AM_I failing sometimes
Fixed tab5 keyboard live rotation on boot and after stopping/starting lvgl
2026-08-01 20:50:55 +02:00
Crazypedia d72d5a0ef2 fix(gdeq031t10): only commit the shadow after the panel confirms (#607)
shadow_framebuffer records what the panel is currently showing, but both
refresh paths updated it before the refresh was confirmed, so a failed
trigger or a BUSY timeout left it describing content that was never
displayed.

That misdescription compounds: the shadow is sent to the controller as
CMD_DATA_START_OLD, so the per-pixel transitions get computed from an
image the panel never held, and draw_bitmap() diffs against it, so a
region matching a wrong shadow is treated as clean and never repainted.

Both paths now commit only after wait_while_busy() confirms. refresh_full()
also sends new data straight from the render buffer, which drops a
full-framebuffer copy from the path.
2026-07-31 22:09:45 +02:00
Crazypedia 94deee8875 fix(gdeq031t10): reset the panel at the start of a full init (#603) 2026-07-30 23:07:25 +02:00
Crazypedia f13c18f398 LoRa device type + SX1262 kernel driver (first checkpoint) (#565)
Adds sub-GHz radio support to Tactility as a first-class kernel device type, plus a
driver for the Semtech SX1262. Continues the radio work discussed in #342, brought up to
the current kernel driver model (rather than the deprecated tt::hal layer the earlier
prototype targeted).
2026-07-30 19:32:23 +02:00
Ken Van Hoeylandt 606b918f9c Device license changes (#596)
See https://github.com/TactilityProject/Tactility/pull/596 for author consent.
2026-07-30 17:19:11 +02:00
Ken Van Hoeylandt 1cb661469d GPS refactor & license text updates (#601)
- Split up `gps-generic-module` into:
  - `gps-generic-module` that contains only interfaces/configs/bindings (Apache license)
  - `gps-meshtastic-module` that contains an implementation (GPL license)
- Update `LICENSE.md` for changes, but also added clarifications
- Added licenses to directories where they were missing
- Changed license of some test projects from GPL to Apache.
2026-07-30 16:28:41 +02:00
Ken Van Hoeylandt c729e8340f Trackball rewrite (#600)
- Implement generic trackball settings
- Refactor T-Deck trackball driver into generic driver at `Drivers/gpio-trackball-module`
- Automatically bind/unbind trackball devices with LVGL
- Automatically load settings for trackball devices on boot
2026-07-30 13:38:19 +02:00
Ken Van Hoeylandt de6fc3b346 Update dependencies in Devices/ and remove "useDeprecatedHal" (#599)
- Updated dependencies in `Devices/`: remove unused ones, update incorrect ones
- Removed `dependencies.useDeprecatedHal` from device properties (and related scripting/code)
2026-07-29 18:47:19 +02:00
Ken Van Hoeylandt acb2f1d4c7 Replace Tactility SystemEvents with new kernel implementation (#598)
TactilityKernel now has a system event API to replace the one from the Tactility subproject. It also implements several tests for it.
2026-07-29 17:31:20 +02:00
Ken Van Hoeylandt 6e55e71e67 Export atof symbol (#597) 2026-07-29 00:09:58 +02:00
Ken Van Hoeylandt bd108cc3c4 Improvements and fixes (#595)
- Fix BluetoothSettings app not updating when toggling on Bluetooth on
- Fix BluetoothSettings app crash when closing while scanning
- Fix BluetoothSettings app crash when turning BT off while scanning
- WebServer doesn't save config anymore as a side-effect of reading the config
- Add missing license headers
- Use TactilityKernel's time and delay functions instead of TactilityFreeRtos ones
2026-07-28 18:38:23 +02:00
Ken Van Hoeylandt e6e1dcd0ca Software keyboard refactored (#594)
Removed software keyboard in Tactility subproject (GuiService, Lvgl.cpp) and re-implemented it in TactilityKernel.
2026-07-28 00:04:09 +02:00
Ken Van Hoeylandt 58a529cc44 File locking deprecation replacements (#593) 2026-07-27 23:48:02 +02:00
Ken Van Hoeylandt d1f06cb774 Device cleanup (#592)
- Replaced device_find_\* usage by device_get_\* variants.
- Removed deprecated device_find_\* functions.
- Improved reliability of Bluetooth scanning, pairing, connection, and HID host lifecycle behavior, including peer auto-connect handling.
- Improved Bluetooth/USB status indicators and clarified “Eject failed” alerts with the affected mount path.
2026-07-27 17:29:12 +02:00
Ken Van Hoeylandt 3354924359 LvglSync removed (#591)
Replaced all usages with lvgl-module functions.
2026-07-26 23:56:07 +02:00
Ken Van Hoeylandt 03a6285328 Add kernel memory functions & other memory-related changes (#590)
New Features

- Added policy-based memory allocation APIs with capability flags and optional alignment: `memory_alloc_with_policy`, `memory_realloc_with_policy`, `memory_calloc_with_policy`, and `memory_free`.
- Switched heap memory reporting to `memory_print_stats`.

Bug Fixes

- Improved allocation robustness with capability fallback behavior.
- Added overflow-safe handling for aligned zero-initialized allocations.
- Tightened const-correctness for generated device-tree device arrays.

Tests

- Added unit tests for default policy, alignment, zero-initialization, realloc preservation, freeing, and memory stats reporting.
2026-07-26 22:59:18 +02:00
Ken Van Hoeylandt f21c0df6fe Improvements & fixes (#589) 2026-07-26 21:26:52 +02:00
Ken Van Hoeylandt b98a813f3c Migrate TactilityC and LVGL functionality (#588)
lvgl-module

- Move and rename source and include files
- Fix bug with missing lvgl unlock
- New widgets: spinner, toolbar, sliderbox

TactilityC

- Removed tt_lock, tt_lvgl_\*
2026-07-26 15:58:35 +02:00
Ken Van Hoeylandt cd2d9d6158 Fixes and improvements: LVGL, services and kernel symbols (#587) 2026-07-26 13:21:13 +02:00
Ken Van Hoeylandt d4ef83e316 Add LVGL symbols (#586) 2026-07-26 00:21:56 +02:00
Ken Van Hoeylandt db7468d0c8 Module improvements: lvgl, gps, crypt (#585) 2026-07-25 23:04:39 +02:00
Ken Van Hoeylandt ca5b071859 Fix module logic, updated tests, add tests (#584) 2026-07-25 18:05:19 +02:00
Ken Van Hoeylandt 2a2558b29a Remove old HAL components and refactored GPS-related code (#583)
- Added generic GPS/GNSS support with device detection, configuration, and persistent settings.
- Improved device and module lifecycle management.
- Added flexible filesystem locking support for displays and storage.
- Improved display-idle and keyboard backlight handling.
- Updated architecture, driver, module, testing, and licensing documentation.
- Removed old HAL device and related code.
2026-07-25 17:20:17 +02:00
Ken Van Hoeylandt 29e80cfd65 T-Deck Max & Pro support updates (#582)
- Created kernel driver for T-Deck Max & Pro display (needs work, doesn't refresh reliably on T-Deck Pro)
- Created T-Deck Pro device implementation (incubating)
2026-07-24 00:17:48 +02:00
Ken Van Hoeylandt 429125734a Add drivers to module and make start/stop optional (#580) 2026-07-23 23:28:09 +02:00
Shadowtrance 08eac48e64 Fix Tab5 Display Issues (#579)
And add PPA rotation to lvgl_display
2026-07-22 23:58:34 +02:00
Ken Van Hoeylandt 8b92aa8e5a GPIO descriptor fixes (#578) 2026-07-22 22:43:34 +02:00
Ken Van Hoeylandt a3fda9ad8f Device migrations and driver improvements (#576) 2026-07-22 21:11:12 +02:00
Ken Van Hoeylandt 2fbc44466a Device migrations, driver migrations and more (#575) 2026-07-20 23:43:17 +02:00
Shadowtrance 2d768ef3a1 ESP-NOW bridge for P4 (#573) 2026-07-19 09:23:20 +02:00
reyna-b bd30aa046a Add ES3C28P device (#569) 2026-07-19 09:17:19 +02:00
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 5f54f7ca3d Fix for SDMMC driver on ESP32-P4 (#572)
The driver was using the incorrect (read: old) if-defs for a capability check.
2026-07-18 15:58:48 +02:00
Ken Van Hoeylandt d896657bf9 Device migrations, drivers and fixes (#571)
Device migrations:

- cyd-4848S040c
- guition-jc1060p470ciwy
- guition-jc2432w328c
- guition-jc3248w535c (known issue with display and touch, Shadowtrance will look into it)
- guition-jc8048w550c
- heltec-wifi-lora-32-v3
- lilygo-tdeck-max (excluding graphics)
- lilygo-tdisplay
- lilygo-tdisplay-s3
- lilygo-tdongle-s3
- lilygo-tlora-pager

Driver migrations:

- Implemented haptic driver interface in kernel
- AXS15231b
- BQ25896
- BQ27220
- CST328
- CST6xx
- DRV2605
- JD9165
- Custom LilyGO driver for T-Lora Pager
- SSD1306
- ST7701
- ST7735
- SY6970
- TCA8418

Fixes/improvements:

- Boot app: support for multiple power devices, improved UI
- lvgl_devices and related code: fixes for mapping
- Support for arrays in dts parser
2026-07-18 15:01:42 +02:00
Ken Van Hoeylandt 3b5a401594 Device migrations, new drivers, cleanup (#567)
* **New Features**
  * Added native display support for ST7796, ILI9341, and ST7789 panels across supported boards.
  * Added FT5x06 and FT6x36 touchscreen support.
  * Generic PWM driver
  * ESP32 PWM driver
  * Generic RGB LED driver
  * RGB PWM LED driver
  * RGB GPIO LED driver
  * Implementation of RGB LED for various boards

* **Improvements**
  * Updated board hardware descriptions to use explicit display/touch/backlight device-tree bindings and disabled deprecated HAL usage.
  * Improved display and touch-driver cleanup to prevent stale resources and improve shutdown reliability.
  * Pinned esp-hosted library to a fixed version
 
* **Deletions**
  * Obsolete placeholder display
  * Legacy ILI9488 support.
  * ESP32-specific LEDC PWM implementation
2026-07-16 22:47:26 +02:00
Ken Van Hoeylandt 6fb2bb736c Drivers, device migrations and other improvements (#566)
- RGB display driver added
- display_driver API:
  - Added software-based display rotation for screens without hardware rotation support.
  - Improved display capability detection across supported display drivers.
- lvgl_display driver:
  - Improved framebuffer handling for smoother, more reliable display updates.
  - Display gap and rotation behavior now adapts more accurately to hardware capabilities.
- Migration Crowpanel 5" basic & advance to kernel drivers
- Improve KernelDisplay app: brightness controls are hidden for displays that only support on/off operation
- device.py now allows for (non-ambiguous) partial device IDs
- TactilityKernel: Implement more tests
2026-07-15 22:56:21 +02:00
Ken Van Hoeylandt bd8fdfd858 Device migrations and driver implementations (#564) 2026-07-15 12:46:24 +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 fa4a6e255c New kernel drivers and device implementation updates (#561)
- Added modular device support and devicetree bindings for ILI9341, ILI9488, CST816S, XPT2046, and GPIO button input, updating several board configurations for display/touch/backlight/keyboard/battery.
- Added a setting to control deprecated HAL usage (device property + Kconfig).
2026-07-12 23:54:55 +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
Ken Van Hoeylandt c4406b24ba Fixes and improvements (#559)
- **Fixes**
  - Added missing Wi-Fi hardware configuration support for P4 devices.
  - Fixed build warning
  - Fixed build wrt Tab5

- **Changes**
  - M5Stack StickS3: Switched default storage location from SD to Internal
  - M5Stack StickS3: Removed DIY SD card support over SPI
  - M5Stack StickC Plus2: Removed the automatic startup of the web server
2026-07-10 18:19:11 +02:00
Crazypedia 0922c4d55b Show a confirmed shutdown screen before cutting power (#555) 2026-07-10 08:49:46 +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
Crazypedia 16a61a087c Add power device (battery + power-off) to lilygo-tdeck-max (#553) 2026-07-09 22:55:14 +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 dbb96a891c Generate device matrix and add missing symbol (#556) 2026-07-08 08:58:45 +02:00
Crazypedia d6ac070e30 Add LilyGO T-Deck Max (e-paper) base board support (#552) 2026-07-08 08:40:09 +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
Crazypedia cca7224252 fix(tests): repair stale TestFile.h includes and stop hardcoding g++ in test CMakeLists (#551)
PR #550 moved TestFile.h from Tests/TactilityCore to Tests/Tactility, but
AppManifestParsingTest.cpp and PropertiesFileTest.cpp still include the old
path, so the test build fails on main.
2026-07-05 22:05:54 +02:00
Ken Van Hoeylandt 66a4eb66d6 Remove TactilityCore (#550) 2026-07-05 12:47:37 +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
2654 changed files with 129333 additions and 169532 deletions
+65
View File
@@ -0,0 +1,65 @@
# CLAUDE.md
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
## 1. Think Before Coding
**Don't assume. Don't hide confusion. Surface tradeoffs.**
Before implementing:
- State your assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.
## 2. Simplicity First
**Minimum code that solves the problem. Nothing speculative.**
- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- No error handling for impossible scenarios.
- If you write 200 lines and it could be 50, rewrite it.
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
## 3. Surgical Changes
**Touch only what you must. Clean up only your own mess.**
When editing existing code:
- Don't "improve" adjacent code, comments, or formatting.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code, mention it - don't delete it.
When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused.
- Don't remove pre-existing dead code unless asked.
The test: Every changed line should trace directly to the user's request.
## 4. Goal-Driven Execution
**Define success criteria. Loop until verified.**
Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"
For multi-step tasks, state a brief plan:
```
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]
```
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
---
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
+18
View File
@@ -0,0 +1,18 @@
# Architecture: App Framework
Apps are event-driven, C API (`app-module`, `<app/*.h>`), not a C++ class. Each app has an `AppManifest` (`id`, `name`, `category`, `location`, `flags`) and a `main(argc, argv)` entry point (`AppMainFn`), modelled on a C program's `main()`. Every app instance gets its own dedicated task for its whole lifetime, and blocks in that task until it returns. Use `app_scheduler_current_app_id()` (`app/scheduler.h`) to identify the running instance - it's not passed as a parameter.
Lifecycle and inter-app communication go through `app_manager_*()` (`app/manager.h`) and `app_event_*()` (`app/event.h`):
- `app_manager_start()`/`app_manager_start_with_parameters()` launch a plain instance; `app_manager_start_for_result()` launches a modal child that reports back to a parent instance.
- An app subscribes with `app_event_subscribe()` (registers for its own instance's events, no id argument needed), blocks via `task_event_group_wait()`/`task_event_group_wait_any()`, and drains with `app_event_poll()`, reacting to `APP_EVENT_CLOSE` (terminate now) and `APP_EVENT_RESULT` (a child it started reported back).
- An app closes itself by calling `app_manager_finish()` right before returning from `main()`; another instance is closed via `app_manager_stop()`.
Apps are registered at startup via `app_manager_add()`. External apps can be loaded from SD card via `manifest.properties` files, or side-loaded as ELF binaries on ESP32 (see `app/loader.h`'s `AppLoaderApi`).
Apps can be loaded from:
- memory (`APP_LOCATION_MEMORY`)
- a path pointing to an install folder where an `.app` file was installed (`APP_LOCATION_PATH`)
- a path pointing to an `.elf` file (`APP_LOCATION_PATH`)
An app can build an optional UI via the LVGL window-manager module (see `lvgl.md`).
@@ -0,0 +1,10 @@
# Architecture: Device/Driver/Module System (kernel layer, C API)
The kernel uses a Linux-inspired device model:
- **Module** (`struct Module`): loadable unit that registers drivers, hardware and symbols. Lifecycle: `module_construct` → `module_add` → `module_start`. Each device board and platform is a module.
- **Driver** (`struct Driver`): binds to devices via `compatible` strings (like devicetree). Has `start_device`/`stop_device` callbacks and an `api` pointer for type-specific operations.
- **Device** (`struct Device`): represents hardware. Lifecycle: `device_construct` → `device_add` → `device_start`. Has a parent-child tree, driver binding, and locking.
- **DeviceType** (`struct DeviceType`): enables discovering devices by category (e.g. `DISPLAY_TYPE`, `TOUCH_TYPE`, `UART_CONTROLLER_TYPE`).
Devices are defined via **devicetree** `.dts` files in each `Devices/<id>/` folder. A custom devicetree compiler (`Buildscripts/DevicetreeCompiler/compile.py`) generates C code from these files. Each device folder also has a `devicetree.yaml` specifying dependencies and the `.dts` file.
+7
View File
@@ -0,0 +1,7 @@
# Architecture: Layer Stack (bottom to top)
- **TactilityKernel** — C API kernel: device/driver/module lifecycle, concurrency primitives (thread, mutex, timer, dispatcher), filesystem, logging. Header convention: `<tactility/*.h>` (lowercase snake_case).
- **TactilityFreeRtos** — Thin C++ wrappers around FreeRTOS primitives.
- **Tactility** — Main OS layer: app framework, service framework, LVGL integration, networking and services (Wi-Fi, BLE, NTP, ESP-NOW), settings, i18n.
- **TactilityC** — C bindings (`tt_*.h`) for Tactility, used by side-loaded ELF apps on ESP32. Deprecated, replaced by TactilityKernel.
- **Firmware** — Entry point (`app_main`).
+5
View File
@@ -0,0 +1,5 @@
# Architecture: Build System
The `tactility_add_module()` CMake macro (in `Buildscripts/module.cmake`) wraps ESP-IDF's `idf_component_register` on ESP32 and standard `add_library` on POSIX, allowing the same source to build for both targets.
`device.py` reads `Devices/<id>/device.properties` and generates the `sdkconfig` file with all necessary ESP-IDF config (target chip, flash size, SPIRAM, LVGL fonts, Bluetooth, USB, etc.).
+62
View File
@@ -0,0 +1,62 @@
# Building
## Git
The repository uses git submodules. Make sure to use `--recurse-submodules` on relevant git commands.
## Simulator (Linux/macOS, no ESP-IDF needed)
> [!IMPORTANT]
> The simulator does **NOT** build or run on native Windows (Win32/PowerShell/cmd). This is
> a hard platform limitation, not a missing tool or PATH issue — do not attempt `cmake -B
> buildsim` on Windows, it will not work. WSL is a separate, Linux environment and is fine.
```bash
cmake -B buildsim -G Ninja
ninja -C buildsim # build firmware + tests
./buildsim/Firmware/Tactility # run simulator
```
## ESP32 firmware
```bash
python device.py <device-id> # generate sdkconfig for device (e.g. lilygo-tdeck)
python device.py <device-id> --dev # dev mode: force 4MB partition table
idf.py build # build firmware
idf.py flash monitor # flash and monitor
```
Device IDs are the folder names under `Devices/` (e.g. `lilygo-tdeck`, `m5stack-cores3`, `cyd-2432s028r`).
### Windows: activating the ESP-IDF environment
On native Windows, `idf.py` is not on PATH by default — it must be activated per-shell first.
The install script places a PowerShell profile activator per IDF version at
`%IDF_TOOLS_PATH%\Microsoft.v<version>.PowerShell_profile.ps1` (path controlled by the
`IDF_TOOLS_PATH` environment variable, set to wherever ESP-IDF's tools were installed, e.g.
`C:\Espressif\tools`). Source it before running any `idf.py` command:
```powershell
. "$env:IDF_TOOLS_PATH\Microsoft.v5.5.2.PowerShell_profile.ps1" # match the installed IDF version
Set-Location "<repo-root>"
idf.py build 2>&1 | Select-Object -Last 250
```
This is Windows-specific setup (the main dev works on Linux, where `idf.py` is normally
already on PATH via `export.sh`/`. ./export.sh` or a shell profile).
## Devicetree
A device implementation has a `.dts` file.
The parser at `Buildscripts/DevicetreeCompiler/` converts DTS into C code.
It's called from the `Firmware/` build process.
## Tests
Tests use Doctest and run on simulator (POSIX) target only:
```bash
cmake -B buildsim -G Ninja
ninja -C buildsim build-tests
cd buildsim && ctest --test-dir Tests
```
+34
View File
@@ -0,0 +1,34 @@
# Coding Style
Two conventions coexist; which one to use depends on the project layer:
- **C code** (TactilityKernel, drivers): `lower_snake_case` for files, functions, variables. `UpperCamelCase` for types. Files in `source/`, `include/`, `private/` directories.
- **C++ code** (Tactility, apps, services): `UpperCamelCase` for files and types. `lowerCamelCase` for functions. Files in `Source/`, `Include/`, `Private/` directories.
For projects that emit C headers and have a C++ implementation file: the internal C++ function naming should be snake_case.
Formatting is enforced by `.clang-format` (LLVM-based, 4-space indent, no column limit).
Never throw exceptions — use return types for error handling. Use `enum class` over plain `enum` when writing C++ code.
Do not add redundant null checks for parameters with an explicit non-null precondition.
Code Comments:
- Should be as short as possible, leaving only important context.
- Should avoid explaining what the code does, unless the code complexity is high enough to warrant an explanation.
- Must avoid explaining how the code was before, or how it was changed.
- Should explain why code is implemented.
- Should be as brief as possible without losing critical information.
- Should avoid explaining what was not implemented.
- Should avoid referring to designs of other subsystems.
- Must avoid interjections: avoid hyphens or braces to interject. If interjections provide crucial info, use Doxygen entity/anchor references like:
/**
* A dedicated completion \signal for one app instance's task.
* Whichever \side finishes with it last is the one that deletes `semaphore` and frees this struct.
*
* \signal Not the task's shared default FreeRTOS notification, which app_event.cpp's AppEventSubscription also uses.
* An unrelated event delivered to the same task could otherwise unblock a waiter early.
* \side The exiting task or a concurrent app_scheduler_stop() that found the entry in time and is waiting on `semaphore`.
*/
```
@@ -0,0 +1,38 @@
# Architecture: Hardware Abstraction Layer
## Driver
A driver generally consists of:
- Registration of driver in parent module (optional, but desirable)
- YAML bindings in the `bindings/` folder
- An `#include` that is used in the `.dts` file. The include is in `[projectname]/bindings/[drivername].h`
- The driver implementation: a `.cpp` and `.h` file. The implementation is C++, but the header exposes pure C functions. C implementations are allowed, but C++ is preferred.
Drivers are part of a kernel module.
A driver whose device sits on a shared SPI controller (parent device type `SPI_CONTROLLER_TYPE`)
must bracket its own bus access with `spi_controller_lock()`/`spi_controller_unlock()`
(`spi_controller_lock_bus_of()`/`spi_controller_unlock_bus_of()` for the common case of a direct
child), at the logical-operation level rather than per primitive. This is not done for you by the
kernel's generic device-type wrappers (`display.cpp`, `pointer.cpp`, etc.) - only the driver knows
for certain which of its calls touch the bus.
Modules with drivers can be stored in:
- TactilityKernel
- A subproject in `Platforms` folder
- A subproject in `Devices` folder
- A subproject in `Drivers` folder
## Kernel Modules
Kernel module names are lower case and postfixed with `-module`.
Projects that are kernel modules:
1. Declare a `struct Module`
2. Contain a `devicetree.yaml` file that declares a list of dependencies (for parsing the devicetree) and specifies the bindings folder that contains the drivers' YAML definitions. For example:
```yaml
dependencies:
- TactilityKernel
bindings: bindings
```
+8
View File
@@ -0,0 +1,8 @@
# Key Conventions
- Shared cross-platform code uses `#ifdef ESP_PLATFORM` for ESP32-specific paths.
Code in `Platforms/PlatformEsp32/` is already ESP-only and does not need guards around ESP-IDF includes.
- The `Drivers/` directory contains hardware drivers (display controllers, touch controllers, PMICs, etc.) — each is its own CMake component.
- `Modules/` contains cross-cutting modules. e.g.`lvgl-module` (LVGL task management).
- `Data/system/` and `Data/data/` are flashed as FAT filesystem images on ESP32.
- Translations are in `Translations/` as CSV files, generated via `generate.py`.
+8
View File
@@ -0,0 +1,8 @@
# Architecture: LVGL
User interfaces should scale well for everything between very large (e.g. 1280x720) and small (e.g. 135x240) displays. Vertical and horizontal layouts are supported.
Two kernel modules cover LVGL:
- **`lvgl-module`** (`Modules/lvgl-module/`, `<lvgl/*.h>`) owns LVGL's lifecycle: init/deinit, the LVGL task loop, and `lvgl_lock()`/`lvgl_try_lock()`/`lvgl_unlock()` mutex-based locking that any task must hold before touching LVGL objects. It bridges Tactility's device model to LVGL indevs (`lvgl/devices/*.h`: `display`, `pointer`, `keyboard`, `trackball`), and provides shared fonts (`lvgl/fonts.h`: Montserrat text sizes, Material Symbols icon sets for statusbar/launcher/shared use) and a few shared widgets (`lvgl/widgets/*.h`: `toolbar`, `spinner`, `sliderbox`).
- **`lvgl-window-manager-module`** (`Modules/lvgl-window-manager-module/`, `<lvgl_window_manager/*.h>`) manages a single stacked window per app instance on top of `lvgl-module`. `window_manager_start()`/`window_manager_stop()` create/tear down the root widget (plus optional chrome from a configured `WindowManagerScreenInitFn`); `window_manager_create()`/`window_manager_remove()` push/pop an app's window and (re)populate it via a `WindowCreateWidgetsFn`. Only the topmost window ever has live widgets - burying and resurfacing a window deletes and rebuilds its widget tree rather than hiding/showing it. That rebuild-on-remove path can run `create_widgets` on a *different* app's thread (whichever app's `window_manager_remove()` call caused this window to resurface), so `create_widgets` must only rebuild already-committed state, never decide what happens next - state transitions belong in the app's own `main()` event loop, driven by real `APP_EVENT_RESULT`s.
+4
View File
@@ -0,0 +1,4 @@
# Architecture: Platform Abstraction
- `Platforms/platform-esp32/` — ESP-IDF specific implementations
- `Platforms/platform-posix/` — POSIX simulator implementations (SDL for display)
+3
View File
@@ -0,0 +1,3 @@
# Project Overview
Tactility is an operating system for the ESP32 microcontroller family. It runs on 40+ supported devices (CYD boards, LilyGO, M5Stack, Elecrow, etc.) and includes a desktop simulator. Built with C++23, ESP-IDF, LVGL, and FreeRTOS.
+3
View File
@@ -0,0 +1,3 @@
# Architecture: Service Framework
Services are a C API (`service-module`, `<service/*.h>`), not a C++ class. Each service has a `ServiceManifest` (`id`, `create_service`/`destroy_service` for its custom data, `on_start`/`on_stop` callbacks) registered via `service_manager_add()`, and is started/stopped via `service_manager_start()`/`service_manager_stop()`. Services are long-running background processes (GUI, Wi-Fi, loader, statusbar, GPS, etc.).
+1
View File
@@ -0,0 +1 @@
Tests for projects should be placed in the `Tests/` or `tests/` subfolder of that project.
+1 -1
View File
@@ -11,7 +11,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: recursive
- name: 'Board select'
@@ -0,0 +1,41 @@
name: Build
runs:
using: "composite"
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
persist-credentials: false
- name: 'Detect architecture'
id: arch
shell: bash
run: echo "value=$(uname -m)" >> "$GITHUB_OUTPUT"
- name: 'Configure'
shell: bash
run: cmake -S ./ -B buildsim
- name: 'Build'
shell: bash
run: cmake --build buildsim --target TactilityKernel lvgl minitar minmea $(cat Buildscripts/release-sdk-modules.txt)
- name: 'Release'
shell: bash
run: python Buildscripts/release-sdk-posix.py release/TactilitySDK
- name: 'Test Integration Prep'
shell: bash
env:
TACTILITY_ARCH: ${{ steps.arch.outputs.value }}
run: |
TACTILITY_SDK_NAME="$(cat version.txt)-posix-$TACTILITY_ARCH"
mkdir -p test_sdk/$TACTILITY_SDK_NAME
cp -r release/TactilitySDK test_sdk/$TACTILITY_SDK_NAME
- name: 'Test Integration'
shell: bash
env:
TACTILITY_ARCH: ${{ steps.arch.outputs.value }}
run: cd Tests/SdkIntegration && TACTILITY_SDK_PATH=../../test_sdk python tactility.py build -a posix-$TACTILITY_ARCH --local-sdk
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: TactilitySDK-posix-${{ steps.arch.outputs.value }}
path: release/TactilitySDK
retention-days: 30
+4 -4
View File
@@ -11,7 +11,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: recursive
- name: 'Board select'
@@ -29,13 +29,13 @@ runs:
env:
# NOTE: Update with ESP-IDF!
ESP_IDF_VERSION: '5.5.2'
run: python Buildscripts/release-sdk.py release/TactilitySDK
run: python Buildscripts/release-sdk-esp32.py release/TactilitySDK
- name: 'Test Integration Prep'
shell: bash
# The manifest.properties of our integration test uses version 0.0.0 to indicate that it is not using a normal SDK
# This way, it only works with our custom build. That means we have to create a copy of the SDK with the correct folder structure:
run: |
TACTILITY_SDK_NAME="0.0.0-${{ inputs.arch }}"
TACTILITY_SDK_NAME="$(cat version.txt)-${{ inputs.arch }}"
mkdir -p test_sdk/$TACTILITY_SDK_NAME
cp -r release/TactilitySDK test_sdk/$TACTILITY_SDK_NAME
- name: 'Test Integration'
@@ -43,7 +43,7 @@ runs:
with:
esp_idf_version: v5.5.2
target: ${{ inputs.arch }}
command: export TACTILITY_SDK_PATH=../../test_sdk && cd Tests/SdkIntegration && python tactility.py build ${{ inputs.arch }} --local-sdk
command: export TACTILITY_SDK_PATH=../../test_sdk && cd Tests/SdkIntegration && python tactility.py build -a ${{ inputs.arch }} --local-sdk
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
+2 -2
View File
@@ -15,7 +15,7 @@ runs:
using: "composite"
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Linux Dependencies for SDL
@@ -45,7 +45,7 @@ runs:
run: cmake -S ./ -B buildsim
- name: "Build Tests"
shell: bash
run: cmake --build buildsim --target FirmwareSim
run: cmake --build buildsim --target Tactility
- name: 'Release'
shell: bash
run: Buildscripts/release-simulator.sh buildsim release/Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
Linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Build"
@@ -22,7 +22,7 @@ jobs:
macOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Build"
+33 -58
View File
@@ -11,7 +11,7 @@ on:
permissions: read-all
jobs:
BuildSdk:
BuildSdkEsp32:
strategy:
matrix:
board: [
@@ -22,7 +22,7 @@ jobs:
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Build SDK"
@@ -30,59 +30,32 @@ jobs:
with:
board_id: ${{ matrix.board.id }}
arch: ${{ matrix.board.arch }}
BuildFirmware:
strategy:
matrix:
board: [
{ id: btt-panda-touch, arch: esp32s3 },
{ id: cyd-2432s024c, arch: esp32 },
{ id: cyd-2432s024r, arch: esp32 },
{ id: cyd-2432s028r, arch: esp32 },
{ id: cyd-2432s028rv3, arch: esp32 },
{ id: cyd-e32r28t, arch: esp32 },
{ id: cyd-e32r32p, arch: esp32 },
{ id: cyd-2432s032c, arch: esp32 },
{ id: cyd-3248s035c, arch: esp32 },
{ id: cyd-8048s043c, arch: esp32s3 },
{ id: cyd-4848s040c, arch: esp32s3 },
{ id: elecrow-crowpanel-advance-28, arch: esp32s3 },
{ id: elecrow-crowpanel-advance-35, arch: esp32s3 },
{ id: elecrow-crowpanel-advance-50, arch: esp32s3 },
{ id: elecrow-crowpanel-basic-28, arch: esp32 },
{ id: elecrow-crowpanel-basic-35, arch: esp32 },
{ id: elecrow-crowpanel-basic-50, arch: esp32s3 },
{ id: guition-jc1060p470ciwy, arch: esp32p4 },
{ id: guition-jc2432w328c, arch: esp32 },
{ id: guition-jc3248w535c, arch: esp32s3 },
{ id: guition-jc8048w550c, arch: esp32s3 },
{ id: heltec-wifi-lora-32-v3, arch: esp32s3 },
{ id: lilygo-tdeck, arch: esp32s3 },
{ id: lilygo-thmi, arch: esp32s3 },
{ id: lilygo-tdongle-s3, arch: esp32s3 },
{ id: lilygo-tdisplay-s3, arch: esp32s3 },
{ id: lilygo-tlora-pager, arch: esp32s3 },
{ id: lilygo-tdisplay, arch: esp32 },
{ id: m5stack-cardputer, arch: esp32s3 },
{ id: m5stack-cardputer-adv, arch: esp32s3 },
{ id: m5stack-core2, arch: esp32 },
{ id: m5stack-cores3, arch: esp32s3 },
{ id: m5stack-papers3, arch: esp32s3 },
{ id: m5stack-stackchan, arch: esp32s3 },
{ id: m5stack-stickc-plus2, arch: esp32 },
{ id: m5stack-sticks3, arch: esp32s3 },
{ id: m5stack-tab5, arch: esp32p4 },
{ id: unphone, arch: esp32s3 },
{ id: waveshare-esp32-s3-geek, arch: esp32s3 },
{ id: waveshare-s3-lcd-13, arch: esp32s3 },
{ id: waveshare-s3-touch-lcd-128, arch: esp32s3 },
{ id: waveshare-s3-touch-lcd-147, arch: esp32s3 },
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 },
{ id: wireless-tag-wt32-sc01-plus, arch: esp32s3 }
]
BuildSdkPosix:
runs-on: ubuntu-latest
needs: [ BuildSdk ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Build SDK"
uses: ./.github/actions/build-sdk-posix
GenerateDeviceMatrix:
runs-on: ubuntu-latest
needs: [ BuildSdkEsp32 ]
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- id: set-matrix
run: python3 Buildscripts/gh-generate-device-matrix.py
BuildFirmware:
runs-on: ubuntu-latest
needs: GenerateDeviceMatrix
strategy:
matrix: ${{ fromJSON(needs.GenerateDeviceMatrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Build Firmware"
@@ -92,12 +65,14 @@ jobs:
arch: ${{ matrix.board.arch }}
BundleArtifacts:
runs-on: ubuntu-latest
needs: [ BuildFirmware ]
needs: [ BuildFirmware, BuildSdkPosix ]
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Bundle Artifacts"
uses: ./.github/actions/bundle-artifacts
PublishFirmwareSnapshot:
@@ -105,7 +80,7 @@ jobs:
needs: [ BundleArtifacts ]
if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: "Publish Firmware Snapshot"
env:
CDN_ID: ${{ secrets.CDN_ID }}
@@ -119,7 +94,7 @@ jobs:
needs: [ BundleArtifacts ]
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: "Publish Firmware Stable"
env:
CDN_ID: ${{ secrets.CDN_ID }}
@@ -133,7 +108,7 @@ jobs:
needs: [ BundleArtifacts ]
if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')))
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: "Publish SDKs"
env:
CDN_ID: ${{ secrets.CDN_ID }}
+4 -11
View File
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
submodules: recursive
- name: "Configure Project"
@@ -19,19 +19,12 @@ jobs:
run: cmake -S ./ -B build
- name: "Build Tests"
run: cmake --build build --target build-tests
- name: "Run TactilityCore Tests"
run: build/Tests/TactilityCore/TactilityCoreTests
- name: "Run TactilityFreeRtos Tests"
run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests
- name: "Run TactilityHeadless Tests"
run: build/Tests/Tactility/TactilityTests
- name: "Run TactilityKernel Tests"
run: build/Tests/TactilityKernel/TactilityKernelTests
- name: "Run Tests"
run: ctest --test-dir build/Tests
DevicetreeTests:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
submodules: recursive
+5 -3
View File
@@ -1,9 +1,9 @@
.idea/
.DS_Store
build/
buildsim/
cmake-*/
build*/
!.github/actions/build*/
cmake*/
CMakeCache.txt
*.cbp
CMakeFiles
@@ -26,3 +26,5 @@ sdkconfig.board.*.dev
.caveman.json
.ai/mcp
__pycache__
+3
View File
@@ -16,3 +16,6 @@
[submodule "Libraries/cJSON/cJSON"]
path = Libraries/cJSON/cJSON
url = https://github.com/DaveGamble/cJSON.git
[submodule "Libraries/esp_epaper"]
path = Libraries/esp_epaper
url = https://github.com/NellowTCS/esp_epaper.git
@@ -46,6 +46,8 @@ def parse_binding(file_path: str, binding_dirs: list[str]) -> Binding:
description=details.get('description', '').strip(),
default=details.get('default', None),
element_type=details.get('element-type', None),
min=details.get('min', None),
max=details.get('max', None),
)
properties_dict[name] = prop
filename = os.path.basename(file_path)
@@ -26,7 +26,7 @@ def get_device_node_name_safe(device: Device):
def get_device_type_name(device: Device, bindings: list[Binding]):
device_binding = find_device_binding(device, bindings)
if device_binding is None:
raise DevicetreeException(f"Binding not found for {device.node_name}")
raise DevicetreeException(f"Binding not found for {device.node_name}. Make sure that the driver name in the driver's yaml and driver code declarations matches with the device dts file.")
if device_binding.compatible is None:
raise DevicetreeException(f"Couldn't find compatible binding for {device.node_name}")
compatible_safe = device_binding.compatible.split(",")[-1]
@@ -79,6 +79,11 @@ def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
value_list.append(str(item))
return "{ " + ",".join(value_list) + " }"
elif type == "phandle":
# Mirrors the string-passthrough convention "phandles" already uses for sentinel defaults
# like GPIO_PIN_SPEC_NONE: a binding default of "NULL" represents "no device referenced",
# not an actual node name to resolve.
if isinstance(property.value, str) and property.value == "NULL":
return "NULL"
return find_phandle(devices, property.value)
elif type == "phandles":
value_list = list()
@@ -113,6 +118,25 @@ def resolve_phandle_array_entries(device_property, devices):
entries.append(str(item))
return entries
def validate_property_range(device: Device, binding_property, value) -> None:
"""Enforces a binding's optional min/max on int-typed properties. Silently skips
values that aren't parseable as a plain integer literal (e.g. a passed-through
symbolic #define) - those can't be range-checked at compile time."""
if binding_property.min is None and binding_property.max is None:
return
try:
numeric_value = int(value, 0) if isinstance(value, str) else int(value)
except (TypeError, ValueError):
return
if binding_property.min is not None and numeric_value < binding_property.min:
raise DevicetreeException(
f"Device '{device.node_name}' property '{binding_property.name}' value {numeric_value} is below minimum {binding_property.min}"
)
if binding_property.max is not None and numeric_value > binding_property.max:
raise DevicetreeException(
f"Device '{device.node_name}' property '{binding_property.name}' value {numeric_value} is above maximum {binding_property.max}"
)
def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], devices: list[Device]) -> list:
compatible_property = find_device_property(device, "compatible")
if compatible_property is None:
@@ -137,7 +161,7 @@ def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], de
node_name = get_device_node_name_safe(device)
result = []
phandle_arrays = []
array_decls = []
for binding_property in binding_properties:
device_property = find_device_property(device, binding_property.name)
@@ -148,7 +172,35 @@ def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], de
array_var = f"{node_name}_{prop_safe}"
if device_property is not None:
entries = resolve_phandle_array_entries(device_property, devices)
phandle_arrays.append((array_var, binding_property.element_type, entries))
array_decls.append((array_var, binding_property.element_type, entries))
result.append(f"({binding_property.element_type}*){array_var}")
result.append(str(len(entries)))
elif binding_property.default is not None:
result.append("NULL")
result.append("0")
elif binding_property.required:
raise DevicetreeException(f"device {device.node_name} doesn't have property '{binding_property.name}'")
else:
result.append("NULL")
result.append("0")
continue
if binding_property.type == "array":
# A flat literal array (DTS `[ ... ]` syntax, e.g. a byte blob), as opposed to
# phandle-array's list of resolved device references. Emits the same
# (pointer, length) parameter pair, backed by a plain data array instead of one
# holding phandle-derived initializers.
if binding_property.element_type is None:
raise DevicetreeException(f"array property '{binding_property.name}' requires 'element-type' in binding")
prop_safe = binding_property.name.replace("-", "_")
array_var = f"{node_name}_{prop_safe}"
if device_property is not None:
if device_property.type != "array":
raise DevicetreeException(
f"Device '{device.node_name}' property '{binding_property.name}' must use '[ ... ]' array syntax"
)
entries = [str(value) for value in device_property.value]
array_decls.append((array_var, binding_property.element_type, entries))
result.append(f"({binding_property.element_type}*){array_var}")
result.append(str(len(entries)))
elif binding_property.default is not None:
@@ -163,6 +215,7 @@ def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], de
if device_property is None:
if binding_property.default is not None:
validate_property_range(device, binding_property, binding_property.default)
temp_prop = DeviceProperty(
name=binding_property.name,
type=binding_property.type,
@@ -179,19 +232,20 @@ def resolve_parameters_from_bindings(device: Device, bindings: list[Binding], de
else:
raise DevicetreeException(f"Device {device.node_name} doesn't have property '{binding_property.name}' and no default value is set")
else:
validate_property_range(device, binding_property, device_property.value)
result.append(property_to_string(device_property, devices))
return result, phandle_arrays
return result, array_decls
def write_config(file, device: Device, bindings: list[Binding], devices: list[Device], type_name: str):
node_name = get_device_node_name_safe(device)
config_type = f"{type_name}_config_dt"
config_variable_name = f"{node_name}_config"
config_params, phandle_arrays = resolve_parameters_from_bindings(device, bindings, devices)
config_params, array_decls = resolve_parameters_from_bindings(device, bindings, devices)
# Write phandle-array variables before the config struct
for array_var, element_type, entries in phandle_arrays:
# Write phandle-array/array variables before the config struct
for array_var, element_type, entries in array_decls:
entries_str = ", ".join(entries)
file.write(f"static {element_type} {array_var}[] = {{ {entries_str} }};\n")
@@ -228,6 +282,7 @@ def write_device_structs(file, device: Device, parent_device: Device, bindings:
file.write(f"\t.address = {address_value},\n")
file.write(f"\t.name = \"{device.node_name}\",\n") # Use original name
file.write(f"\t.config = &{config_variable_name},\n")
file.write("\t.flags = DEVICE_FLAG_DTS,\n")
file.write(f"\t.parent = {parent_value},\n")
file.write("\t.internal = NULL\n")
file.write("};\n\n")
@@ -295,7 +350,7 @@ def generate_devicetree_c(filename: str, items: list[object], bindings: list[Bin
for item in items:
if type(item) is Device:
write_device_structs(file, item, None, bindings, devices, verbose)
file.write("struct DtsDevice dts_devices[] = {\n")
file.write("const struct DtsDevice dts_devices[] = {\n")
for item in items:
if type(item) is Device:
write_device_list_entry(file, item, bindings, verbose)
@@ -324,7 +379,7 @@ def generate_devicetree_c(filename: str, items: list[object], bindings: list[Bin
file.write(f"extern struct Module {symbol};\n")
file.write("\n")
# Create array of symbol variables
file.write("struct Module* dts_modules[] = {\n")
file.write("struct Module* const dts_modules[] = {\n")
for symbol in module_symbol_names:
file.write(f"\t&{symbol},\n")
file.write("\tNULL\n")
@@ -342,10 +397,10 @@ def generate_devicetree_h(filename: str):
#endif
// Array of device tree modules terminated with DTS_MODULE_TERMINATOR
extern struct DtsDevice dts_devices[];
extern const struct DtsDevice dts_devices[];
// Array of module symbols terminated with NULL
extern struct Module* dts_modules[];
extern struct Module* const dts_modules[];
#ifdef __cplusplus
}
@@ -40,6 +40,8 @@ class BindingProperty:
description: str
default: object = None
element_type: str = None
min: object = None
max: object = None
@dataclass
class Binding:
@@ -13,6 +13,7 @@ static struct Device root = {
.address = 0,
.name = "/",
.config = &root_config,
.flags = DEVICE_FLAG_DTS,
.parent = NULL,
.internal = NULL
};
@@ -27,6 +28,7 @@ static struct Device test_device = {
.address = 0,
.name = "test-device",
.config = &test_device_config,
.flags = DEVICE_FLAG_DTS,
.parent = &root,
.internal = NULL
};
@@ -43,11 +45,12 @@ static struct Device bool_test_device = {
.address = 0,
.name = "bool-test-device",
.config = &bool_test_device_config,
.flags = DEVICE_FLAG_DTS,
.parent = &root,
.internal = NULL
};
struct DtsDevice dts_devices[] = {
const struct DtsDevice dts_devices[] = {
{ &root, "test,root", DTS_DEVICE_STATUS_OKAY },
{ &test_device, "test,generic-device", DTS_DEVICE_STATUS_OKAY },
{ &bool_test_device, "test,bool-device", DTS_DEVICE_STATUS_OKAY },
@@ -56,7 +59,7 @@ struct DtsDevice dts_devices[] = {
extern struct Module data_module;
struct Module* dts_modules[] = {
struct Module* const dts_modules[] = {
&data_module,
NULL
};
@@ -7,10 +7,10 @@ extern "C" {
#endif
// Array of device tree modules terminated with DTS_MODULE_TERMINATOR
extern struct DtsDevice dts_devices[];
extern const struct DtsDevice dts_devices[];
// Array of module symbols terminated with NULL
extern struct Module* dts_modules[];
extern struct Module* const dts_modules[];
#ifdef __cplusplus
}
@@ -76,6 +76,225 @@ def test_compile_invalid_dts():
print("PASSED")
return True
def write_minmax_config(tmp_dir, device_property_line, binding_min=0, binding_max=3, binding_default=1):
config_dir = os.path.join(tmp_dir, "minmax_data")
bindings_dir = os.path.join(config_dir, "bindings")
os.makedirs(bindings_dir)
with open(os.path.join(config_dir, "devicetree.yaml"), "w") as f:
f.write("dts: test.dts\nbindings: bindings")
with open(os.path.join(config_dir, "test.dts"), "w") as f:
f.write(f"""/dts-v1/;
/ {{
compatible = "test,root";
model = "Test Model";
test-device@0 {{
compatible = "test,minmax-device";
{device_property_line}
}};
}};
""")
with open(os.path.join(bindings_dir, "test,root.yaml"), "w") as f:
f.write("description: Test root binding\ncompatible: \"test,root\"\nproperties:\n model:\n type: string\n")
with open(os.path.join(bindings_dir, "test,minmax-device.yaml"), "w") as f:
f.write(f"""description: Test min/max binding
compatible: "test,minmax-device"
properties:
ranged-prop:
type: int
default: {binding_default}
min: {binding_min}
max: {binding_max}
""")
return config_dir
def test_minmax_within_range_succeeds():
print("Running test_minmax_within_range_succeeds...")
with tempfile.TemporaryDirectory() as tmp_dir:
config_dir = write_minmax_config(tmp_dir, "ranged-prop = <2>;")
output_dir = os.path.join(tmp_dir, "output")
os.makedirs(output_dir)
result = run_compiler(config_dir, output_dir)
if result.returncode != 0:
print(f"FAILED: Compilation should have succeeded: {result.stderr} {result.stdout}")
return False
print("PASSED")
return True
def test_minmax_below_minimum_fails():
print("Running test_minmax_below_minimum_fails...")
with tempfile.TemporaryDirectory() as tmp_dir:
config_dir = write_minmax_config(tmp_dir, "ranged-prop = <-1>;")
output_dir = os.path.join(tmp_dir, "output")
os.makedirs(output_dir)
result = run_compiler(config_dir, output_dir)
if result.returncode == 0:
print("FAILED: Compilation should have failed for a below-minimum value")
return False
if "below minimum" not in result.stdout:
print(f"FAILED: Expected 'below minimum' error message, got: {result.stdout}")
return False
print("PASSED")
return True
def test_minmax_above_maximum_fails():
print("Running test_minmax_above_maximum_fails...")
with tempfile.TemporaryDirectory() as tmp_dir:
config_dir = write_minmax_config(tmp_dir, "ranged-prop = <7>;")
output_dir = os.path.join(tmp_dir, "output")
os.makedirs(output_dir)
result = run_compiler(config_dir, output_dir)
if result.returncode == 0:
print("FAILED: Compilation should have failed for an above-maximum value")
return False
if "above maximum" not in result.stdout:
print(f"FAILED: Expected 'above maximum' error message, got: {result.stdout}")
return False
print("PASSED")
return True
def test_minmax_out_of_range_default_fails():
print("Running test_minmax_out_of_range_default_fails...")
with tempfile.TemporaryDirectory() as tmp_dir:
# Property omitted from the .dts entirely, so the (invalid) binding default is used.
config_dir = write_minmax_config(tmp_dir, "", binding_default=9)
output_dir = os.path.join(tmp_dir, "output")
os.makedirs(output_dir)
result = run_compiler(config_dir, output_dir)
if result.returncode == 0:
print("FAILED: Compilation should have failed for an out-of-range default value")
return False
if "above maximum" not in result.stdout:
print(f"FAILED: Expected 'above maximum' error message, got: {result.stdout}")
return False
print("PASSED")
return True
def test_minmax_symbolic_value_skips_validation():
print("Running test_minmax_symbolic_value_skips_validation...")
with tempfile.TemporaryDirectory() as tmp_dir:
# A passed-through symbolic constant can't be range-checked at compile time and must
# not be rejected just because a min/max is declared.
config_dir = write_minmax_config(tmp_dir, "ranged-prop = <SOME_DEFINE>;")
output_dir = os.path.join(tmp_dir, "output")
os.makedirs(output_dir)
result = run_compiler(config_dir, output_dir)
if result.returncode != 0:
print(f"FAILED: Compilation should have succeeded for a symbolic value: {result.stderr} {result.stdout}")
return False
print("PASSED")
return True
def write_array_config(tmp_dir, device_property_line):
config_dir = os.path.join(tmp_dir, "array_data")
bindings_dir = os.path.join(config_dir, "bindings")
os.makedirs(bindings_dir)
with open(os.path.join(config_dir, "devicetree.yaml"), "w") as f:
f.write("dts: test.dts\nbindings: bindings")
with open(os.path.join(config_dir, "test.dts"), "w") as f:
f.write(f"""/dts-v1/;
/ {{
compatible = "test,root";
model = "Test Model";
test-device@0 {{
compatible = "test,array-device";
{device_property_line}
}};
}};
""")
with open(os.path.join(bindings_dir, "test,root.yaml"), "w") as f:
f.write("description: Test root binding\ncompatible: \"test,root\"\nproperties:\n model:\n type: string\n")
with open(os.path.join(bindings_dir, "test,array-device.yaml"), "w") as f:
f.write("""description: Test array binding
compatible: "test,array-device"
properties:
init-sequence:
type: array
element-type: uint8_t
""")
return config_dir
def test_array_property_generates_static_array_and_length():
print("Running test_array_property_generates_static_array_and_length...")
with tempfile.TemporaryDirectory() as tmp_dir:
config_dir = write_array_config(tmp_dir, "init-sequence = [0xFF 0x01 0x00 0x00 0x10 5 0];")
output_dir = os.path.join(tmp_dir, "output")
os.makedirs(output_dir)
result = run_compiler(config_dir, output_dir)
if result.returncode != 0:
print(f"FAILED: Compilation should have succeeded: {result.stderr} {result.stdout}")
return False
with open(os.path.join(output_dir, "devicetree.c")) as f:
generated = f.read()
if "static uint8_t test_device_init_sequence[] = { 0xFF, 0x01, 0x00, 0x00, 0x10, 5, 0 };" not in generated:
print(f"FAILED: Expected static array declaration not found:\n{generated}")
return False
if "(uint8_t*)test_device_init_sequence" not in generated or "\t7\n" not in generated:
print(f"FAILED: Expected (pointer, length) config params not found:\n{generated}")
return False
print("PASSED")
return True
def test_array_property_defaults_to_null_when_absent():
print("Running test_array_property_defaults_to_null_when_absent...")
with tempfile.TemporaryDirectory() as tmp_dir:
config_dir = write_array_config(tmp_dir, "")
output_dir = os.path.join(tmp_dir, "output")
os.makedirs(output_dir)
result = run_compiler(config_dir, output_dir)
if result.returncode != 0:
print(f"FAILED: Compilation should have succeeded: {result.stderr} {result.stdout}")
return False
with open(os.path.join(output_dir, "devicetree.c")) as f:
generated = f.read()
if "NULL,\n\t0" not in generated:
print(f"FAILED: Expected NULL/0 defaults not found:\n{generated}")
return False
print("PASSED")
return True
def test_compile_missing_config():
print("Running test_compile_missing_config...")
with tempfile.TemporaryDirectory() as output_dir:
@@ -92,11 +311,46 @@ def test_compile_missing_config():
print("PASSED")
return True
def test_es3c35p_uses_current_runtime_contract():
print("Running test_es3c35p_uses_current_runtime_contract...")
repository_root = os.path.abspath(os.path.join(SCRIPT_DIR, "..", "..", ".."))
device_dir = os.path.join(repository_root, "Devices", "es3c35p")
with open(os.path.join(device_dir, "device.properties")) as f:
properties = f.read()
with open(os.path.join(device_dir, "es3c35p.dts")) as f:
devicetree = f.read()
requirements = [
("apps.launcherAppId=tactility.launcher" in properties, "current launcher app id"),
("hardware.tinyUsb=" not in properties, "no obsolete hardware.tinyUsb property"),
('wifi0 {\n\t\tcompatible = "espressif,esp32-wifi-pinned";\n\t};' in devicetree,
"Wi-Fi enabled for web server and MCP"),
('ble0 {\n\t\tcompatible = "espressif,esp32-ble";\n\t};' in devicetree,
"BLE node matches hardware.bluetooth=true"),
]
missing = [description for condition, description in requirements if not condition]
if missing:
print("FAILED: " + ", ".join(missing))
return False
print("PASSED")
return True
if __name__ == "__main__":
tests = [
test_compile_success,
test_compile_invalid_dts,
test_compile_missing_config
test_compile_missing_config,
test_es3c35p_uses_current_runtime_contract,
test_minmax_within_range_succeeds,
test_minmax_below_minimum_fails,
test_minmax_above_maximum_fails,
test_minmax_out_of_range_default_fails,
test_minmax_symbolic_value_skips_validation,
test_array_property_generates_static_array_and_length,
test_array_property_defaults_to_null_when_absent
]
failed = 0
+2 -2
View File
@@ -13,9 +13,9 @@ $jsonClean = $json.flash_files -replace '[\{\}\@\;]', ''
$jsonClean = $jsonClean -replace '[\=]', ' '
cd Binaries
$command = "esptool --port $port erase_flash"
$command = "esptool --port $port erase-flash"
Invoke-Expression $command
$command = "esptool --port $port write_flash $jsonClean"
$command = "esptool --port $port write-flash $jsonClean"
Invoke-Expression $command
cd ..
+2 -2
View File
@@ -49,7 +49,7 @@ fi
# Take the flash_arg file contents and join each line in the file into a single line
flash_args=`grep \n Binaries/flash_args | awk '{print}' ORS=' '`
cd Binaries
$esptoolPath --port $1 erase_flash
$esptoolPath --port $1 write_flash $flash_args
$esptoolPath --port $1 erase-flash
$esptoolPath --port $1 write-flash $flash_args
cd -
+8 -11
View File
@@ -1,24 +1,21 @@
idf_component_register(
INCLUDE_DIRS
"Libraries/TactilityC/include"
"Libraries/TactilityKernel/include"
"Libraries/TactilityFreeRtos/include"
"Libraries/TactilityFreeRtos/Include"
"Libraries/lvgl/include"
"Libraries/minmea/include"
"Libraries/minitar/include"
"Modules/lvgl-module/include"
"Drivers/bm8563-module/include"
"Drivers/bmi270-module/include"
"Drivers/mpu6886-module/include"
"Drivers/pi4ioe5v6408-module/include"
"Drivers/qmi8658-module/include"
"Drivers/rx8130ce-module/include"
REQUIRES esp_timer
REQUIRES esp_timer app-module crypt-module gps-module lvgl-module lvgl-window-manager-module service-module
)
# Regular and core features
add_prebuilt_library(TactilityC Libraries/TactilityC/binary/libTactilityC.a)
add_prebuilt_library(TactilityKernel Libraries/TactilityKernel/binary/libTactilityKernel.a)
add_prebuilt_library(lvgl Libraries/lvgl/binary/liblvgl.a)
add_prebuilt_library(minmea Libraries/minmea/binary/libminmea.a)
add_prebuilt_library(minitar Libraries/minitar/binary/libminitar.a)
target_link_libraries(${COMPONENT_LIB} INTERFACE TactilityC)
target_link_libraries(${COMPONENT_LIB} INTERFACE TactilityKernel)
target_link_libraries(${COMPONENT_LIB} INTERFACE lvgl)
target_link_libraries(${COMPONENT_LIB} INTERFACE minmea)
target_link_libraries(${COMPONENT_LIB} INTERFACE minitar)
@@ -1,36 +0,0 @@
function(tactility_project)
endfunction()
function(_tactility_project)
endfunction()
macro(tactility_project project_name)
set(TACTILITY_SKIP_SPIFFS 1)
include("${TACTILITY_SDK_PATH}/Libraries/elf_loader/elf_loader.cmake")
project_elf($project_name)
file(READ ${TACTILITY_SDK_PATH}/idf-version.txt TACTILITY_SDK_IDF_VERSION)
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" TACTILITY_SDK_IDF_MAJOR_MINOR "${TACTILITY_SDK_IDF_VERSION}")
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" CURRENT_IDF_MAJOR_MINOR "$ENV{ESP_IDF_VERSION}")
if (NOT "${CURRENT_IDF_MAJOR_MINOR}" STREQUAL "${TACTILITY_SDK_IDF_MAJOR_MINOR}")
message(FATAL_ERROR "ESP-IDF version of Tactility SDK (${TACTILITY_SDK_IDF_VERSION}) does not match current ESP-IDF version ($ENV{ESP_IDF_VERSION})")
endif()
set(EXTRA_COMPONENT_DIRS
"Libraries/TactilityFreeRtos"
"Modules"
"Drivers"
)
set(COMPONENTS
TactilityFreeRtos
bm8563-module
bmi270-module
mpu6886-module
pi4ioe5v6408-module
qmi8658-module
rx8130ce-module
)
endmacro()
@@ -0,0 +1,62 @@
function(tactility_project)
endfunction()
function(_tactility_project)
endfunction()
macro(tactility_project_pre project_name)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS ${TACTILITY_SDK_PATH} ${TACTILITY_SDK_PATH}/Modules)
endmacro()
macro(tactility_project_post project_name)
set(TACTILITY_SKIP_SPIFFS 1)
# Tactility's PanicHandler.cpp needs s0 to stay a frame pointer to capture a callstack for
# a RISC-V app's crashes, which GCC does not guarantee without this flag. The firmware sets the
# same flag for its own code, but a crash usually happens in app code, built separately here.
# Gated to RISC-V since Xtensa never reads s0 this way. idf_build_set_property(), not
# add_compile_options(): the app's code compiles as an idf_component_register() component
# (Apps/*/main/CMakeLists.txt), which reads ESP-IDF's own COMPILE_OPTIONS build property rather
# than plain directory-scoped flags. project_elf() below uses the same property for its own
# flags for the same reason.
if(CONFIG_IDF_TARGET_ARCH_RISCV)
idf_build_set_property(COMPILE_OPTIONS "-fno-omit-frame-pointer" APPEND)
endif()
include("${TACTILITY_SDK_PATH}/Libraries/elf_loader/elf_loader.cmake")
project_elf($project_name)
file(READ ${TACTILITY_SDK_PATH}/idf-version.txt TACTILITY_SDK_IDF_VERSION)
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" TACTILITY_SDK_IDF_MAJOR_MINOR "${TACTILITY_SDK_IDF_VERSION}")
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" CURRENT_IDF_MAJOR_MINOR "$ENV{ESP_IDF_VERSION}")
if (NOT "${CURRENT_IDF_MAJOR_MINOR}" STREQUAL "${TACTILITY_SDK_IDF_MAJOR_MINOR}")
message(FATAL_ERROR "ESP-IDF version of Tactility SDK (${TACTILITY_SDK_IDF_VERSION}) does not match current ESP-IDF version ($ENV{ESP_IDF_VERSION})")
endif()
set(EXTRA_COMPONENT_DIRS
"${TACTILITY_SDK_PATH}/Libraries/TactilityFreeRtos"
"${TACTILITY_SDK_PATH}/Modules"
)
set(COMPONENTS
TactilityFreeRtos
app-module
crypt-module
gps-module
lvgl-module
lvgl-window-manager-module
service-module
)
endmacro()
macro(tactility_component_register)
cmake_parse_arguments(TT_COMPONENT "" "" "SRCS;INCLUDE_DIRS;REQUIRES;PRIV_REQUIRES" ${ARGN})
idf_component_register(
SRCS ${TT_COMPONENT_SRCS}
INCLUDE_DIRS ${TT_COMPONENT_INCLUDE_DIRS}
REQUIRES TactilitySDK ${TT_COMPONENT_REQUIRES}
PRIV_REQUIRES ${TT_COMPONENT_PRIV_REQUIRES}
)
endmacro()
@@ -0,0 +1,51 @@
function(tactility_project)
endfunction()
function(_tactility_project)
endfunction()
macro(tactility_project_pre project_name)
endmacro()
macro(tactility_project_post project_name)
# The app's own library target is defined in a subdirectory (e.g. "main"); without this it
# would land nested under that subdirectory instead of directly in the build dir.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Mirrors the ESP-IDF "TactilitySDK" component (Buildscripts/TactilitySDK/CMakeLists.txt):
# apps link against this single target instead of listing SDK include dirs themselves.
# Posix apps are dlopen()ed into a running Tactility process (see app-posix-module) and
# resolve symbols against Tactility's own copies at load time, so headers are all they need
# at compile time - no libraries to link.
add_library(TactilitySDK INTERFACE)
target_include_directories(TactilitySDK INTERFACE
${TACTILITY_SDK_PATH}/Modules/app-module/include
${TACTILITY_SDK_PATH}/Modules/crypt-module/include
${TACTILITY_SDK_PATH}/Modules/gps-module/include
${TACTILITY_SDK_PATH}/Modules/lvgl-module/include
${TACTILITY_SDK_PATH}/Modules/lvgl-window-manager-module/include
${TACTILITY_SDK_PATH}/Modules/service-module/include
${TACTILITY_SDK_PATH}/Libraries/TactilityKernel/include
${TACTILITY_SDK_PATH}/Libraries/lvgl/include
${TACTILITY_SDK_PATH}/Libraries/FreeRTOS-Kernel/include
${TACTILITY_SDK_PATH}/Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix
${TACTILITY_SDK_PATH}/Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix/utils
)
target_compile_definitions(TactilitySDK INTERFACE LV_LVGL_H_INCLUDE_SIMPLE)
# ESP-IDF's project() auto-discovers the "main" component; plain CMake doesn't.
add_subdirectory(main)
endmacro()
macro(tactility_component_register)
cmake_parse_arguments(TT_COMPONENT "" "" "SRCS;INCLUDE_DIRS;REQUIRES;PRIV_REQUIRES" ${ARGN})
# Must be a SHARED object, not a -pie executable: glibc's dlopen() unconditionally refuses
# any ET_DYN carrying the DF_1_PIE flag ("cannot dynamically load position-independent
# executable"), regardless of whether it has a dynamic-linker segment - verified empirically.
add_library(${PROJECT_NAME} SHARED ${TT_COMPONENT_SRCS})
target_link_libraries(${PROJECT_NAME} PRIVATE TactilitySDK)
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
if (TT_COMPONENT_INCLUDE_DIRS)
target_include_directories(${PROJECT_NAME} PRIVATE ${TT_COMPONENT_INCLUDE_DIRS})
endif ()
endmacro()
-1
View File
@@ -5,7 +5,6 @@ import time
def build(device: str) -> bool:
print(f"Building {device}...")
shutil.rmtree(os.path.join('Firmware', 'Generated'), ignore_errors=True)
result = subprocess.run(['python', 'device.py', device], capture_output=True, text=True)
if result.returncode != 0:
print(f"Failed to select device {device}")
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/env python3
"""Convert an image to an uncompressed LVGL RGB565 launcher background."""
import argparse
import shutil
import struct
import subprocess
from pathlib import Path
LV_IMAGE_HEADER_MAGIC = 0x19
LV_COLOR_FORMAT_RGB565 = 0x12
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description=(
"Create an uncompressed LVGL .bin image for "
"/sdcard/tactility/launcher/background.bin. Use a square image sized "
"to the display's longest edge to support both orientations without scaling "
"(for example, 320x320 for a 320x240 display)."
)
)
parser.add_argument("input", type=Path, help="Source image")
parser.add_argument("output", type=Path, help="Destination .bin file")
parser.add_argument("--width", type=int, required=True, help="Output width")
parser.add_argument("--height", type=int, required=True, help="Output height")
return parser.parse_args()
def main() -> None:
args = parse_args()
if args.width <= 0 or args.width > 65535 or args.height <= 0 or args.height > 65535:
raise SystemExit("width and height must be between 1 and 65535")
magick = shutil.which("magick")
if magick is None:
raise SystemExit("ImageMagick is required (the 'magick' command was not found)")
command = [
magick,
str(args.input),
"-resize",
f"{args.width}x{args.height}^",
"-gravity",
"center",
"-extent",
f"{args.width}x{args.height}",
"-depth",
"8",
"rgb:-",
]
rgb888 = subprocess.run(command, check=True, stdout=subprocess.PIPE).stdout
expected_size = args.width * args.height * 3
if len(rgb888) != expected_size:
raise SystemExit(f"unexpected ImageMagick output: {len(rgb888)} bytes, expected {expected_size}")
rgb565 = bytearray(args.width * args.height * 2)
for source_offset in range(0, len(rgb888), 3):
r, g, b = rgb888[source_offset : source_offset + 3]
pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3)
destination_offset = (source_offset // 3) * 2
struct.pack_into("<H", rgb565, destination_offset, pixel)
stride = args.width * 2
header = struct.pack(
"<BBHHHHH",
LV_IMAGE_HEADER_MAGIC,
LV_COLOR_FORMAT_RGB565,
0,
args.width,
args.height,
stride,
0,
)
args.output.parent.mkdir(parents=True, exist_ok=True)
args.output.write_bytes(header + rgb565)
print(
f"Wrote {args.output} ({args.width}x{args.height}, "
f"{len(header) + len(rgb565)} bytes, uncompressed RGB565)"
)
if __name__ == "__main__":
main()
+57
View File
@@ -0,0 +1,57 @@
import fnmatch
import json
import os
import sys
DEVICES_DIRECTORY = os.path.join(os.path.dirname(__file__), "..", "Devices")
IGNORE_LIST = {
"simulator",
"generic-*",
}
def is_ignored(device_id):
return any(fnmatch.fnmatch(device_id, pattern) for pattern in IGNORE_LIST)
def read_properties_file(path):
properties = {}
with open(path, "r") as file:
for line in file:
stripped = line.strip()
if not stripped or stripped.startswith("#"):
continue
key, sep, value = line.partition("=")
if not sep:
continue
properties[key.strip()] = value.strip()
return properties
def get_board_entries():
boards = []
for device_id in sorted(os.listdir(DEVICES_DIRECTORY)):
if is_ignored(device_id):
continue
device_dir = os.path.join(DEVICES_DIRECTORY, device_id)
properties_path = os.path.join(device_dir, "device.properties")
if not os.path.isdir(device_dir) or not os.path.isfile(properties_path):
continue
properties = read_properties_file(properties_path)
target = properties.get("hardware.target")
if not target:
sys.exit(f"ERROR: {properties_path} has no hardware.target property")
boards.append({"id": device_id, "arch": target.lower()})
return boards
def main():
matrix_json = json.dumps({"board": get_board_entries()})
github_output = os.environ.get("GITHUB_OUTPUT")
if github_output:
with open(github_output, "a") as file:
file.write(f"matrix={matrix_json}\n")
else:
print(matrix_json)
if __name__ == "__main__":
main()
+25 -2
View File
@@ -2,6 +2,8 @@ if (COMMAND tactility_add_module)
return()
endif()
cmake_minimum_required(VERSION 3.24)
macro(tactility_get_module_name NAME OUT_NAME)
if (DEFINED ENV{ESP_IDF_VERSION})
set(${OUT_NAME} ${COMPONENT_LIB})
@@ -11,21 +13,35 @@ macro(tactility_get_module_name NAME OUT_NAME)
endmacro()
macro(tactility_add_module NAME)
set(options)
# WHOLE_ARCHIVE: force every object file in this module into the final link unconditionally,
# instead of only the ones some other already-scanned archive currently has a pending
# undefined reference to. Needed when this module provides symbols a component it depends on
# (e.g. lvgl__lvgl's custom-allocator hooks) calls back into - a reverse reference a normal
# single-pass static-archive link can't resolve, since that component is scanned after this
# one's archive has already been passed once.
set(options WHOLE_ARCHIVE)
set(oneValueArgs)
set(multiValueArgs SRCS INCLUDE_DIRS PRIV_INCLUDE_DIRS REQUIRES PRIV_REQUIRES)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (DEFINED ENV{ESP_IDF_VERSION})
# idf_component_register's WHOLE_ARCHIVE is a presence-based flag (no value) - only pass
# the token at all when requested, rather than passing ARG_WHOLE_ARCHIVE's TRUE/FALSE as
# a value, which idf_component_register doesn't expect.
set(whole_archive_arg)
if (ARG_WHOLE_ARCHIVE)
set(whole_archive_arg WHOLE_ARCHIVE)
endif()
idf_component_register(
SRCS ${ARG_SRCS}
INCLUDE_DIRS ${ARG_INCLUDE_DIRS}
PRIV_INCLUDE_DIRS ${ARG_PRIV_INCLUDE_DIRS}
REQUIRES ${ARG_REQUIRES}
PRIV_REQUIRES ${ARG_PRIV_REQUIRES}
${whole_archive_arg}
)
else()
add_library(${NAME} OBJECT)
add_library(${NAME} STATIC)
target_sources(${NAME} PRIVATE ${ARG_SRCS})
target_include_directories(${NAME}
PRIVATE ${ARG_PRIV_INCLUDE_DIRS}
@@ -33,5 +49,12 @@ macro(tactility_add_module NAME)
)
target_link_libraries(${NAME} PUBLIC ${ARG_REQUIRES})
target_link_libraries(${NAME} PRIVATE ${ARG_PRIV_REQUIRES})
if (ARG_WHOLE_ARCHIVE)
# A static archive only pulls in object files that already have a pending undefined
# reference at the point the archive is scanned, so a plain link drops ${NAME}'s
# reverse dependencies (see WHOLE_ARCHIVE comment above). Make whoever links ${NAME}
# whole-archive it instead of just archive-pruning it.
set_property(TARGET ${NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_LIBRARY:WHOLE_ARCHIVE,${NAME}>)
endif()
endif()
endmacro()
+9
View File
@@ -1,4 +1,11 @@
function(GET_PROPERTY_VALUE PROPERTIES_CONTENT_VAR KEY_NAME RESULT_VAR)
# Optional 4th arg: default value returned when key is missing, instead of erroring.
set(has_default FALSE)
if (${ARGC} GREATER 3)
set(has_default TRUE)
set(default_value "${ARGV3}")
endif ()
# Search for the key and its value in the properties content
# Supports KEY=VALUE, KEY="VALUE", and optional spaces around =
# Use parentheses to capture the value
@@ -6,6 +13,8 @@ function(GET_PROPERTY_VALUE PROPERTIES_CONTENT_VAR KEY_NAME RESULT_VAR)
# So we look for the key at the beginning of the string or after a newline.
if ("${${PROPERTIES_CONTENT_VAR}}" MATCHES "(^|\n)${KEY_NAME}[ \t]*=[ \t]*\"?([^\n\"]*)\"?")
set(${RESULT_VAR} "${CMAKE_MATCH_2}" PARENT_SCOPE)
elseif (has_default)
set(${RESULT_VAR} "${default_value}" PARENT_SCOPE)
else ()
message(FATAL_ERROR "Property '${KEY_NAME}' not found in the properties content.")
endif ()
+28 -16
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import os
import platform
import shutil
import subprocess
import sys
@@ -17,35 +18,24 @@ def get_idf_target():
return None
return None
def main():
# 1. Get idf_target
idf_target = get_idf_target()
if not idf_target:
print("Could not determine IDF target from sdkconfig")
sys.exit(1)
# 2. Get version
def get_version():
try:
with open("version.txt", "r") as f:
version = f.read().strip()
return f.read().strip()
except FileNotFoundError:
print("version.txt not found")
sys.exit(1)
# 3. Construct sdk_path
# release/TactilitySDK/${version}-${idf_target}/TactilitySDK
sdk_path = os.path.join("release", "TactilitySDK", f"{version}-{idf_target}", "TactilitySDK")
# 4. Cleanup sdk_path
def run_release_script(script_name, sdk_path):
# Cleanup sdk_path
if os.path.exists(sdk_path):
print(f"Cleaning up {sdk_path}")
shutil.rmtree(sdk_path)
os.makedirs(sdk_path, exist_ok=True)
# 5. Call release-sdk.py
# Note: Using sys.executable to ensure we use the same python interpreter
script_path = os.path.join("Buildscripts", "release-sdk.py")
script_path = os.path.join("Buildscripts", script_name)
print(f"Running {script_path} {sdk_path}")
result = subprocess.run([sys.executable, script_path, sdk_path])
@@ -54,5 +44,27 @@ def main():
print(f"Error: {script_path} failed with return code {result.returncode}")
sys.exit(result.returncode)
def main():
version = get_version()
# ESP_IDF_VERSION is only set once an ESP-IDF environment has been activated (export.sh /
# the Windows PowerShell profile - see building.md); same check release-sdk-esp32.py and
# release-sdk-posix.py themselves use to tell the two builds apart.
esp_idf_version = os.environ.get("ESP_IDF_VERSION", "")
if esp_idf_version:
idf_target = get_idf_target()
if not idf_target:
print("Could not determine IDF target from sdkconfig")
sys.exit(1)
# release/TactilitySDK/${version}-${idf_target}/TactilitySDK
sdk_path = os.path.join("release", "TactilitySDK", f"{version}-{idf_target}", "TactilitySDK")
run_release_script("release-sdk-esp32.py", sdk_path)
else:
# release/TactilitySDK/${version}-posix-${arch}/TactilitySDK
arch = platform.machine()
sdk_path = os.path.join("release", "TactilitySDK", f"{version}-posix-{arch}", "TactilitySDK")
run_release_script("release-sdk-posix.py", sdk_path)
if __name__ == "__main__":
main()
+126
View File
@@ -0,0 +1,126 @@
#!/usr/bin/env python3
import os
import glob
import subprocess
import sys
import importlib.util
from textwrap import dedent
_shared_spec = importlib.util.spec_from_file_location("release_sdk_shared", os.path.join("Buildscripts", "release-sdk-shared.py"))
shared = importlib.util.module_from_spec(_shared_spec)
_shared_spec.loader.exec_module(shared)
def get_driver_mappings(driver_name):
return [
{'src': f'Drivers/{driver_name}/include/**', 'dst': f'Drivers/{driver_name}/include/'},
{'src': f'Drivers/{driver_name}/*.md', 'dst': f'Drivers/{driver_name}/'},
{'src': f'build/esp-idf/{driver_name}/lib{driver_name}.a', 'dst': f'Drivers/{driver_name}/binary/lib{driver_name}.a'},
]
def get_module_mappings(module_name):
return [
{'src': f'Modules/{module_name}/include/**', 'dst': f'Modules/{module_name}/include/'},
{'src': f'Modules/{module_name}/*.md', 'dst': f'Modules/{module_name}/'},
{'src': f'build/esp-idf/{module_name}/lib{module_name}.a', 'dst': f'Modules/{module_name}/binary/lib{module_name}.a'},
]
def create_module_cmakelists(module_name):
return dedent(f'''
cmake_minimum_required(VERSION 3.20)
idf_component_register(
INCLUDE_DIRS "include"
)
add_prebuilt_library({module_name} "binary/lib{module_name}.a")
''')
def driver_is_available(driver_name):
"""
Some drivers only build for certain chip targets (e.g. sc2356-module is ESP32-P4 only,
since it depends on esp_video/esp_cam_sensor/PPA which are themselves chip-restricted).
Build output presence is the single source of truth for "does this driver support the
current target" - no separate manifest to keep in sync with the real CMakeLists.txt
REQUIRES/Kconfig guards.
"""
binary_pattern = f'build/esp-idf/{driver_name}/lib{driver_name}.a'
return bool(glob.glob(binary_pattern))
def add_driver(target_path, driver_name):
mappings = get_driver_mappings(driver_name)
shared.map_copy(mappings, target_path)
cmakelists_content = create_module_cmakelists(driver_name)
shared.write_module_cmakelists(os.path.join(target_path, f"Drivers/{driver_name}/CMakeLists.txt"), cmakelists_content)
def add_module(target_path, module_name):
mappings = get_module_mappings(module_name)
shared.map_copy(mappings, target_path)
cmakelists_content = create_module_cmakelists(module_name)
shared.write_module_cmakelists(os.path.join(target_path, f"Modules/{module_name}/CMakeLists.txt"), cmakelists_content)
def main():
if len(sys.argv) < 2:
print("Usage: release-sdk-esp32.py [target_path]")
print("Example: release-sdk-esp32.py release/TactilitySDK")
sys.exit(1)
esp_idf_version = os.environ.get("ESP_IDF_VERSION", "")
if not esp_idf_version:
print("Error: ESP_IDF_VERSION environment variable is not set")
sys.exit(1)
target_path = os.path.abspath(sys.argv[1])
os.makedirs(target_path, exist_ok=True)
# Mapping logic
mappings = [
{'src': 'version.txt', 'dst': ''},
# TactilityFreeRtos
{'src': 'TactilityFreeRtos/Include/**', 'dst': 'Libraries/TactilityFreeRtos/Include/'},
{'src': 'TactilityFreeRtos/CMakeLists.txt', 'dst': 'Libraries/TactilityFreeRtos/'},
{'src': 'TactilityFreeRtos/LICENSE*.*', 'dst': 'Libraries/TactilityFreeRtos/'},
# TactilityKernel
{'src': 'build/esp-idf/TactilityKernel/libTactilityKernel.a', 'dst': 'Libraries/TactilityKernel/binary/'},
{'src': 'TactilityKernel/include/**', 'dst': 'Libraries/TactilityKernel/include/'},
{'src': 'TactilityKernel/CMakeLists.txt', 'dst': 'Libraries/TactilityKernel/'},
{'src': 'TactilityKernel/*.md', 'dst': 'Libraries/TactilityKernel/'},
# lvgl (basics)
{'src': 'build/esp-idf/lvgl__lvgl/liblvgl__lvgl.a', 'dst': 'Libraries/lvgl/binary/liblvgl.a'},
{'src': 'Libraries/lvgl/lvgl.h', 'dst': 'Libraries/lvgl/include/'},
{'src': 'Libraries/lvgl/lv_version.h', 'dst': 'Libraries/lvgl/include/'},
{'src': 'Libraries/lvgl/LICENCE*.*', 'dst': 'Libraries/lvgl/'},
{'src': 'Libraries/lvgl/src/lv_conf_kconfig.h', 'dst': 'Libraries/lvgl/include/lv_conf.h'},
{'src': 'Libraries/lvgl/src/**/*.h', 'dst': 'Libraries/lvgl/include/src/'},
# elf_loader
{'src': 'managed_components/espressif__elf_loader/*.cmake', 'dst': 'Libraries/elf_loader/'},
{'src': 'managed_components/espressif__elf_loader/*.lf', 'dst': 'Libraries/elf_loader/'},
{'src': 'managed_components/espressif__elf_loader/license.txt', 'dst': 'Libraries/elf_loader/'},
# minitar
{'src': 'build/esp-idf/minitar/libminitar.a', 'dst': 'Libraries/minitar/binary/'},
{'src': 'Libraries/minitar/minitar/minitar.h', 'dst': 'Libraries/minitar/include/'},
{'src': 'Libraries/minitar/minitar/LICENSE*', 'dst': 'Libraries/minitar/'},
# minmea
{'src': 'build/esp-idf/minmea/libminmea.a', 'dst': 'Libraries/minmea/binary/'},
{'src': 'Libraries/minmea/Include/**', 'dst': 'Libraries/minmea/include/'},
{'src': 'Libraries/minmea/CMakeLists.txt', 'dst': 'Libraries/minmea/'},
{'src': 'Libraries/minmea/README.md', 'dst': 'Libraries/minmea/'},
{'src': 'Libraries/minmea/LICENSE*.*', 'dst': 'Libraries/minmea/'},
{'src': 'Libraries/minmea/COPYING', 'dst': 'Libraries/minmea/'},
]
shared.map_copy(mappings, target_path)
# Modules
module_names = shared.read_module_list(os.path.join('Buildscripts', 'release-sdk-modules.txt'))
for module_name in module_names:
add_module(target_path, module_name)
# Final scripts - copied verbatim
shared.generate_tactility_sdk_cmake(target_path, 'esp32')
shared.generate_tactility_sdk_top_cmakelists(target_path)
# Output ESP-IDF SDK version to file
with open(os.path.join(target_path, "idf-version.txt"), "a") as f:
f.write(esp_idf_version)
if __name__ == "__main__":
main()
+7
View File
@@ -0,0 +1,7 @@
app-module
crypt-module
gps-module
http-module
lvgl-module
lvgl-window-manager-module
service-module
+101
View File
@@ -0,0 +1,101 @@
#!/usr/bin/env python3
import os
import sys
import importlib.util
from textwrap import dedent
_shared_spec = importlib.util.spec_from_file_location("release_sdk_shared", os.path.join("Buildscripts", "release-sdk-shared.py"))
shared = importlib.util.module_from_spec(_shared_spec)
_shared_spec.loader.exec_module(shared)
def get_module_mappings(module_name):
return [
{'src': f'Modules/{module_name}/include/**', 'dst': f'Modules/{module_name}/include/'},
{'src': f'Modules/{module_name}/*.md', 'dst': f'Modules/{module_name}/'},
{'src': f'buildsim/Modules/{module_name}/lib{module_name}.a', 'dst': f'Modules/{module_name}/binary/lib{module_name}.a'},
]
def create_module_cmakelists(module_name):
return dedent(f'''
cmake_minimum_required(VERSION 3.20)
add_library({module_name} STATIC IMPORTED)
set_target_properties({module_name} PROPERTIES
IMPORTED_LOCATION "${{CMAKE_CURRENT_LIST_DIR}}/binary/lib{module_name}.a"
INTERFACE_INCLUDE_DIRECTORIES "${{CMAKE_CURRENT_LIST_DIR}}/include"
)
''')
def add_module(target_path, module_name):
mappings = get_module_mappings(module_name)
shared.map_copy(mappings, target_path)
cmakelists_content = create_module_cmakelists(module_name)
shared.write_module_cmakelists(os.path.join(target_path, f"Modules/{module_name}/CMakeLists.txt"), cmakelists_content)
def main():
if len(sys.argv) < 2:
print("Usage: release-sdk-posix.py [target_path]")
print("Example: release-sdk-posix.py release/TactilitySDK")
sys.exit(1)
esp_idf_version = os.environ.get("ESP_IDF_VERSION", "")
if esp_idf_version:
print("Error: ESP_IDF_VERSION environment variable is set - this script packages the POSIX/simulator build, run it outside an ESP-IDF environment")
sys.exit(1)
target_path = os.path.abspath(sys.argv[1])
os.makedirs(target_path, exist_ok=True)
# Mapping logic
mappings = [
{'src': 'version.txt', 'dst': ''},
# TactilityFreeRtos
{'src': 'TactilityFreeRtos/Include/**', 'dst': 'Libraries/TactilityFreeRtos/Include/'},
{'src': 'TactilityFreeRtos/CMakeLists.txt', 'dst': 'Libraries/TactilityFreeRtos/'},
{'src': 'TactilityFreeRtos/LICENSE*.*', 'dst': 'Libraries/TactilityFreeRtos/'},
# TactilityKernel
{'src': 'buildsim/TactilityKernel/libTactilityKernel.a', 'dst': 'Libraries/TactilityKernel/binary/'},
{'src': 'TactilityKernel/include/**', 'dst': 'Libraries/TactilityKernel/include/'},
{'src': 'TactilityKernel/CMakeLists.txt', 'dst': 'Libraries/TactilityKernel/'},
{'src': 'TactilityKernel/*.md', 'dst': 'Libraries/TactilityKernel/'},
# FreeRTOS-Kernel - TactilityKernel's public headers (tactility/freertos/*.h) include the
# real FreeRTOS.h/task.h/etc directly, unlike ESP32 where ESP-IDF's own "freertos"
# component and Kconfig-generated FreeRTOSConfig.h are already part of every project.
{'src': 'Libraries/FreeRTOS-Kernel/include/**', 'dst': 'Libraries/FreeRTOS-Kernel/include/'},
{'src': 'Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix/*.h', 'dst': 'Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix/'},
{'src': 'Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix/utils/*.h', 'dst': 'Libraries/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix/utils/'},
{'src': 'Libraries/FreeRTOS-Kernel/LICENSE*.*', 'dst': 'Libraries/FreeRTOS-Kernel/'},
{'src': 'Devices/simulator/Source/FreeRTOSConfig.h', 'dst': 'Libraries/FreeRTOS-Kernel/include/'},
# lvgl (basics)
{'src': 'buildsim/Libraries/lvgl/lib/liblvgl.a', 'dst': 'Libraries/lvgl/binary/liblvgl.a'},
{'src': 'Libraries/lvgl/lvgl.h', 'dst': 'Libraries/lvgl/include/'},
{'src': 'Libraries/lvgl/lv_version.h', 'dst': 'Libraries/lvgl/include/'},
{'src': 'Libraries/lvgl/LICENCE*.*', 'dst': 'Libraries/lvgl/'},
{'src': 'lv_conf.h', 'dst': 'Libraries/lvgl/include/'},
{'src': 'Libraries/lvgl/src/**/*.h', 'dst': 'Libraries/lvgl/include/src/'},
# minitar
{'src': 'buildsim/Libraries/minitar/libminitar.a', 'dst': 'Libraries/minitar/binary/'},
{'src': 'Libraries/minitar/minitar/minitar.h', 'dst': 'Libraries/minitar/include/'},
{'src': 'Libraries/minitar/minitar/LICENSE*', 'dst': 'Libraries/minitar/'},
# minmea
{'src': 'buildsim/Libraries/minmea/libminmea.a', 'dst': 'Libraries/minmea/binary/'},
{'src': 'Libraries/minmea/Include/**', 'dst': 'Libraries/minmea/include/'},
{'src': 'Libraries/minmea/CMakeLists.txt', 'dst': 'Libraries/minmea/'},
{'src': 'Libraries/minmea/README.md', 'dst': 'Libraries/minmea/'},
{'src': 'Libraries/minmea/LICENSE*.*', 'dst': 'Libraries/minmea/'},
{'src': 'Libraries/minmea/COPYING', 'dst': 'Libraries/minmea/'},
]
shared.map_copy(mappings, target_path)
# Modules
module_names = shared.read_module_list(os.path.join('Buildscripts', 'release-sdk-modules.txt'))
for module_name in module_names:
add_module(target_path, module_name)
# Final scripts - copied verbatim
shared.generate_tactility_sdk_cmake(target_path, 'posix')
shared.generate_tactility_sdk_top_cmakelists(target_path)
if __name__ == "__main__":
main()
+91
View File
@@ -0,0 +1,91 @@
#!/usr/bin/env python3
# Functions shared between release-sdk-esp32.py and release-sdk-posix.py. Not runnable on its
# own; loaded by those scripts via importlib (its hyphenated filename isn't a valid Python
# module name for a plain "import").
import os
import shutil
import glob
import sys
def map_copy(mappings, target_base):
"""
Helper function to map input files/directories to output files/directories.
mappings: list of dicts with 'src' (glob pattern) and 'dst' (relative to target_base or absolute)
'src' can be a single file or a directory (if it ends with /).
"""
for mapping in mappings:
src_pattern = mapping['src']
dst_rel = mapping['dst']
dst_path = os.path.join(target_base, dst_rel)
# To preserve directory structure, we need to know where the wildcard starts
# or have a way to determine the "base" of the search.
# We'll split the pattern into a fixed base and a pattern part.
# Simple heuristic: find the first occurrence of '*' or '?'
wildcard_idx = -1
for i, char in enumerate(src_pattern):
if char in '*?':
wildcard_idx = i
break
if wildcard_idx != -1:
# Found a wildcard. The base is the directory containing it.
pattern_base = os.path.dirname(src_pattern[:wildcard_idx])
else:
# No wildcard. If it's a directory, we might want to preserve its name?
# For now, let's treat no-wildcard as no relative structure needed.
pattern_base = None
src_files = glob.glob(src_pattern, recursive=True)
if not src_files:
continue
for src in src_files:
if os.path.isdir(src):
continue
if pattern_base and src.startswith(pattern_base):
# Calculate relative path from the base of the glob pattern
rel_src = os.path.relpath(src, pattern_base)
# If dst_rel ends with /, it's a target directory
if dst_rel.endswith('/') or os.path.isdir(dst_path):
final_dst = os.path.join(dst_path, rel_src)
else:
# If dst_rel is a file, we can't really preserve structure
# unless we join it. But usually it's a dir if structure is preserved.
final_dst = dst_path
else:
final_dst = dst_path if not (dst_rel.endswith('/') or os.path.isdir(dst_path)) else os.path.join(dst_path, os.path.basename(src))
os.makedirs(os.path.dirname(final_dst), exist_ok=True)
shutil.copy2(src, final_dst)
def write_module_cmakelists(path, content):
with open(path, 'w') as f:
f.write(content)
def read_module_list(path):
"""Reads a newline-separated module name list, skipping empty lines, and checks that each
named module actually exists under Modules/ - exits the process with an error if not."""
with open(path, 'r') as f:
module_names = [line.strip() for line in f if line.strip()]
for module_name in module_names:
if not os.path.isdir(os.path.join('Modules', module_name)):
print(f"Error: Modules/{module_name} does not exist (listed in {path})")
sys.exit(1)
return module_names
def generate_tactility_sdk_cmake(target_path, variant):
"""variant selects Buildscripts/TactilitySDK/TactilitySDK.{variant}.cmake (e.g. "esp32" or
"posix") - always copied into the SDK as the platform-neutral name TactilitySDK.cmake."""
src = os.path.join('Buildscripts', 'TactilitySDK', f'TactilitySDK.{variant}.cmake')
shutil.copy2(src, os.path.join(target_path, 'TactilitySDK.cmake'))
def generate_tactility_sdk_top_cmakelists(target_path):
src = os.path.join('Buildscripts', 'TactilitySDK', 'CMakeLists.txt')
shutil.copy2(src, os.path.join(target_path, 'CMakeLists.txt'))
-163
View File
@@ -1,163 +0,0 @@
#!/usr/bin/env python3
import os
import shutil
import glob
import subprocess
import sys
from textwrap import dedent
def map_copy(mappings, target_base):
"""
Helper function to map input files/directories to output files/directories.
mappings: list of dicts with 'src' (glob pattern) and 'dst' (relative to target_base or absolute)
'src' can be a single file or a directory (if it ends with /).
"""
for mapping in mappings:
src_pattern = mapping['src']
dst_rel = mapping['dst']
dst_path = os.path.join(target_base, dst_rel)
# To preserve directory structure, we need to know where the wildcard starts
# or have a way to determine the "base" of the search.
# We'll split the pattern into a fixed base and a pattern part.
# Simple heuristic: find the first occurrence of '*' or '?'
wildcard_idx = -1
for i, char in enumerate(src_pattern):
if char in '*?':
wildcard_idx = i
break
if wildcard_idx != -1:
# Found a wildcard. The base is the directory containing it.
pattern_base = os.path.dirname(src_pattern[:wildcard_idx])
else:
# No wildcard. If it's a directory, we might want to preserve its name?
# For now, let's treat no-wildcard as no relative structure needed.
pattern_base = None
src_files = glob.glob(src_pattern, recursive=True)
if not src_files:
continue
for src in src_files:
if os.path.isdir(src):
continue
if pattern_base and src.startswith(pattern_base):
# Calculate relative path from the base of the glob pattern
rel_src = os.path.relpath(src, pattern_base)
# If dst_rel ends with /, it's a target directory
if dst_rel.endswith('/') or os.path.isdir(dst_path):
final_dst = os.path.join(dst_path, rel_src)
else:
# If dst_rel is a file, we can't really preserve structure
# unless we join it. But usually it's a dir if structure is preserved.
final_dst = dst_path
else:
final_dst = dst_path if not (dst_rel.endswith('/') or os.path.isdir(dst_path)) else os.path.join(dst_path, os.path.basename(src))
os.makedirs(os.path.dirname(final_dst), exist_ok=True)
shutil.copy2(src, final_dst)
def get_driver_mappings(driver_name):
return [
{'src': f'Drivers/{driver_name}/include/**', 'dst': f'Drivers/{driver_name}/include/'},
{'src': f'Drivers/{driver_name}/*.md', 'dst': f'Drivers/{driver_name}/'},
{'src': f'build/esp-idf/{driver_name}/lib{driver_name}.a', 'dst': f'Drivers/{driver_name}/binary/lib{driver_name}.a'},
]
def get_module_mappings(module_name):
return [
{'src': f'Modules/{module_name}/include/**', 'dst': f'Modules/{module_name}/include/'},
{'src': f'Modules/{module_name}/*.md', 'dst': f'Modules/{module_name}/'},
{'src': f'build/esp-idf/{module_name}/lib{module_name}.a', 'dst': f'Modules/{module_name}/binary/lib{module_name}.a'},
]
def create_module_cmakelists(module_name):
return dedent(f'''
cmake_minimum_required(VERSION 3.20)
idf_component_register(
INCLUDE_DIRS "include"
)
add_prebuilt_library({module_name} "binary/lib{module_name}.a")
'''.format(module_name=module_name))
def write_module_cmakelists(path, content):
with open(path, 'w') as f:
f.write(content)
def add_driver(target_path, driver_name):
mappings = get_driver_mappings(driver_name)
map_copy(mappings, target_path)
cmakelists_content = create_module_cmakelists(driver_name)
write_module_cmakelists(os.path.join(target_path, f"Drivers/{driver_name}/CMakeLists.txt"), cmakelists_content)
def add_module(target_path, module_name):
mappings = get_module_mappings(module_name)
map_copy(mappings, target_path)
cmakelists_content = create_module_cmakelists(module_name)
write_module_cmakelists(os.path.join(target_path, f"Modules/{module_name}/CMakeLists.txt"), cmakelists_content)
def main():
if len(sys.argv) < 2:
print("Usage: release-sdk.py [target_path]")
print("Example: release-sdk.py release/TactilitySDK")
sys.exit(1)
target_path = os.path.abspath(sys.argv[1])
os.makedirs(target_path, exist_ok=True)
# Mapping logic
mappings = [
{'src': 'version.txt', 'dst': ''},
# TactilityC
{'src': 'build/esp-idf/TactilityC/libTactilityC.a', 'dst': 'Libraries/TactilityC/binary/'},
{'src': 'TactilityC/Include/*', 'dst': 'Libraries/TactilityC/include/'},
{'src': 'TactilityC/CMakeLists.txt', 'dst': 'Libraries/TactilityC/'},
{'src': 'TactilityC/LICENSE*.*', 'dst': 'Libraries/TactilityC/'},
# TactilityFreeRtos
{'src': 'TactilityFreeRtos/Include/**', 'dst': 'Libraries/TactilityFreeRtos/include/'},
{'src': 'TactilityFreeRtos/CMakeLists.txt', 'dst': 'Libraries/TactilityFreeRtos/'},
{'src': 'TactilityFreeRtos/LICENSE*.*', 'dst': 'Libraries/TactilityFreeRtos/'},
# TactilityKernel
{'src': 'build/esp-idf/TactilityKernel/libTactilityKernel.a', 'dst': 'Libraries/TactilityKernel/binary/'},
{'src': 'TactilityKernel/include/**', 'dst': 'Libraries/TactilityKernel/include/'},
{'src': 'TactilityKernel/CMakeLists.txt', 'dst': 'Libraries/TactilityKernel/'},
{'src': 'TactilityKernel/*.md', 'dst': 'Libraries/TactilityKernel/'},
# lvgl (basics)
{'src': 'build/esp-idf/lvgl__lvgl/liblvgl__lvgl.a', 'dst': 'Libraries/lvgl/binary/liblvgl.a'},
{'src': 'Libraries/lvgl/lvgl.h', 'dst': 'Libraries/lvgl/include/'},
{'src': 'Libraries/lvgl/lv_version.h', 'dst': 'Libraries/lvgl/include/'},
{'src': 'Libraries/lvgl/LICENCE*.*', 'dst': 'Libraries/lvgl/'},
{'src': 'Libraries/lvgl/src/lv_conf_kconfig.h', 'dst': 'Libraries/lvgl/include/lv_conf.h'},
{'src': 'Libraries/lvgl/src/**/*.h', 'dst': 'Libraries/lvgl/include/src/'},
# elf_loader
{'src': 'Libraries/elf_loader/elf_loader.cmake', 'dst': 'Libraries/elf_loader/'},
{'src': 'Libraries/elf_loader/license.txt', 'dst': 'Libraries/elf_loader/'},
# Final scripts
{'src': 'Buildscripts/TactilitySDK/TactilitySDK.cmake', 'dst': ''},
{'src': 'Buildscripts/TactilitySDK/CMakeLists.txt', 'dst': ''},
]
map_copy(mappings, target_path)
# Modules
add_module(target_path, "lvgl-module")
# Drivers
add_driver(target_path, "bm8563-module")
add_driver(target_path, "bmi270-module")
add_driver(target_path, "mpu6886-module")
add_driver(target_path, "pi4ioe5v6408-module")
add_driver(target_path, "qmi8658-module")
add_driver(target_path, "rx8130ce-module")
# Output ESP-IDF SDK version to file
esp_idf_version = os.environ.get("ESP_IDF_VERSION", "")
with open(os.path.join(target_path, "idf-version.txt"), "a") as f:
f.write(esp_idf_version)
if __name__ == "__main__":
main()
+5 -5
View File
@@ -9,9 +9,9 @@
build_path=$1
target_path=$2
mkdir -p $target_path
mkdir -p "$target_path"
cp version.txt $target_path
cp $build_path/Firmware/FirmwareSim $target_path/
cp -r Data/data $target_path/
cp -r Data/system $target_path/
cp version.txt "$target_path"
cp "$build_path/Tactility/Tactility" "$target_path/"
cp -r Data/data "$target_path/"
cp -r Data/system "$target_path/"
+18 -2
View File
@@ -1,6 +1,6 @@
# Increase stack size for Wi-Fi (fixes crash after scan)
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072
# Ensure large enough stack for network operations
# Ensure large enough stack for network operations (e.g. AppHub)
CONFIG_ESP_MAIN_TASK_STACK_SIZE=6144
# Fixes static assertion: FLASH and PSRAM Mode configuration are not supported
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
@@ -11,6 +11,12 @@ CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y
# EmbedTLS
# Use TLS 1.2 because 1.3 conflicts with MbedTLS dynamic buffer
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
# Frees TLS IN/OUT buffers between reads/writes instead of holding them for the whole session.
# Internal-RAM-only devices need this: mbedtls_ssl_setup() otherwise fails with ALLOC_FAILED
# (-0x7F00).
# Keep MBEDTLS_SSL_IN_CONTENT_LEN at its 16384 default: servers may send TLS records up to that
# size, and a smaller buffer fails mid-transfer with MBEDTLS_ERR_SSL_INVALID_RECORD (-0x7200).
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y
# LVGL
CONFIG_LV_USE_USER_DATA=y
CONFIG_LV_USE_FS_STDIO=y
@@ -19,13 +25,18 @@ CONFIG_LV_FS_STDIO_PATH=""
CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_USE_BUILTIN_MALLOC=n
CONFIG_LV_USE_CLIB_MALLOC=y
# Routes lv_malloc/realloc/free through Modules/lvgl-module/source/lv_mem_custom.c, which prefers
# PSRAM (falls back to internal RAM automatically) instead of a fixed-size pool or plain malloc.
CONFIG_LV_USE_CUSTOM_MALLOC=y
CONFIG_LV_USE_MSGBOX=n
CONFIG_LV_USE_SPINNER=n
CONFIG_LV_USE_WIN=n
CONFIG_LV_USE_SNAPSHOT=y
CONFIG_LV_BUILD_EXAMPLES=n
CONFIG_LV_BUILD_DEMOS=n
# Slot 0 is reserved by ESP-IDF's pthread API (see esp_wifi/lwip pthread_getspecific usage).
# Tactility's Thread wrappers use slot 1 for their own self-pointer.
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=2
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_SMP=n
@@ -41,6 +52,11 @@ CONFIG_WL_SECTOR_MODE_SAFE=y
CONFIG_WL_SECTOR_MODE=1
# Allow new i2c_master API (used by Tab5Keyboard for LP_I2C_NUM_0) to coexist with legacy i2c driver
CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK=y
# Allow new adc_oneshot API (esp32_adc_oneshot kernel driver, linked into every device via
# platform-esp32) to coexist with boards still reading battery voltage via the legacy ADC driver
# (e.g. m5stack-cardputer, m5stack-cardputer-adv, lilygo-thmi). Only one API is ever actually used
# per board at runtime, so this just bypasses ESP-IDF's link-time-only conflict abort.
CONFIG_ADC_SKIP_LEGACY_CONFLICT_CHECK=y
# Wi-Fi memory optimizations
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=3
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=5
-1
View File
@@ -1 +0,0 @@
Documentation/README.md
+49 -15
View File
@@ -33,19 +33,23 @@ if (DEFINED ENV{ESP_IDF_VERSION})
message("Using ESP-IDF ${Cyan}v$ENV{ESP_IDF_VERSION}${ColorReset}")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(COMPONENTS Firmware)
set(COMPONENTS Tactility)
set(EXTRA_COMPONENT_DIRS
"Firmware"
# Tactility must be discovered first: its CMakeLists.txt calls init_tactility_globals(),
# which other components' CMakeLists.txt (e.g. lvgl-module) rely on having already run to
# read back TACTILITY_DEVICE_ID/TACTILITY_DEVICE_PROJECT via get_property(). ESP-IDF's
# requirements-discovery pass processes EXTRA_COMPONENT_DIRS in an isolated sub-process, in
# the order listed here, so this must stay first now that Firmware no longer exists as a
# separate component.
"Tactility"
"Devices/${TACTILITY_DEVICE_PROJECT}"
"Drivers"
"Modules"
"Platforms/platform-esp32"
"TactilityKernel"
"Tactility"
"TactilityC"
"TactilityCore"
"TactilityKernelCpp"
"TactilityFreeRtos"
"Libraries/elf_loader"
"Libraries/esp_epaper"
"Libraries/lv_screenshot"
"Libraries/minitar"
"Libraries/minmea"
@@ -54,10 +58,13 @@ if (DEFINED ENV{ESP_IDF_VERSION})
set(EXCLUDE_COMPONENTS "Simulator")
# Panic handler wrapping is only available on Xtensa architecture
if (CONFIG_IDF_TARGET_ARCH_XTENSA)
# panic_info_t is architecture-independent (esp_private/panic_internal.h) so this wrap applies
# to every target; PanicHandler.cpp branches internally per architecture.
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=esp_panic_handler" APPEND)
endif ()
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=read" APPEND)
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=write" APPEND)
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=close" APPEND)
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=lv_button_create" APPEND)
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=lv_dropdown_create" APPEND)
@@ -70,23 +77,39 @@ if (DEFINED ENV{ESP_IDF_VERSION})
else ()
message("Building for sim target")
# eps-idf generates these from Kconfig, but posix build isn't set up with Kconfig.
add_compile_definitions(CONFIG_TT_DEVICE_ID="simulator")
add_compile_definitions(CONFIG_TT_DEVICE_NAME="Simulator")
add_compile_definitions(CONFIG_TT_DEVICE_VENDOR="")
add_compile_definitions(CONFIG_TT_DEVICE_NAME_SIMPLE="Simulator")
add_compile_definitions(CONFIG_TT_LAUNCHER_APP_ID="Launcher")
add_compile_definitions(CONFIG_TT_LAUNCHER_APP_ID="tactility.launcher")
add_compile_definitions(CONFIG_TT_AUTO_START_APP_ID="")
add_compile_definitions(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
endif ()
project(Tactility)
if (DEFINED ENV{ESP_IDF_VERSION})
# PanicHandler.cpp's RISC-V callstack walker requires s0 to stay a frame pointer, which GCC
# does not guarantee without this flag. CONFIG_ESP_SYSTEM_USE_FRAME_POINTER does not add it
# (it only selects which ESP-IDF backtrace-printing function gets compiled), and can't be used
# instead: the bootloader shares this project's sdkconfig with no per-subproject override, and
# enabling it there overflows the bootloader's fixed partition budget. Setting the flag here via
# idf_build_set_property() only affects this project's own configure, not the bootloader's
# separate one, so it's naturally excluded. Gated to RISC-V since Xtensa never reads s0 this way.
# Must run after project(Tactility) above - project() initializes default build specifications
# that would otherwise overwrite this.
if(CONFIG_IDF_TARGET_ARCH_RISCV)
idf_build_set_property(COMPILE_OPTIONS "-fno-omit-frame-pointer" APPEND)
endif()
endif ()
# Defined as regular project for PC and component for ESP
if (NOT DEFINED ENV{ESP_IDF_VERSION})
add_subdirectory(Tactility)
add_subdirectory(TactilityCore)
add_subdirectory(TactilityFreeRtos)
add_subdirectory(TactilityKernel)
add_subdirectory(TactilityKernelCpp)
add_subdirectory(Platforms/platform-posix)
add_subdirectory(Devices/simulator)
add_subdirectory(Libraries/cJSON)
@@ -94,8 +117,22 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
add_subdirectory(Libraries/QRCode)
add_subdirectory(Libraries/minitar)
add_subdirectory(Libraries/minmea)
add_subdirectory(Modules/hal-device-module)
add_subdirectory(Modules/lvgl-module)
add_subdirectory(Modules/c-symbols-module)
add_subdirectory(Modules/cpp-symbols-module)
add_subdirectory(Modules/crypt-module)
add_subdirectory(Modules/freertos-module)
add_subdirectory(Modules/gps-module)
add_subdirectory(Modules/http-module)
add_subdirectory(Modules/mbedtls-module)
add_subdirectory(Modules/posix-symbols-module)
add_subdirectory(Modules/pthread-module)
add_subdirectory(Modules/service-module)
add_subdirectory(Modules/app-module)
add_subdirectory(Modules/app-posix-module)
add_subdirectory(Modules/lvgl-window-manager-module)
add_subdirectory(Drivers/gps-generic-module)
add_subdirectory(Drivers/gps-meshtastic-module)
# FreeRTOS
set(FREERTOS_CONFIG_FILE_DIRECTORY ${PROJECT_SOURCE_DIR}/Devices/simulator/Source CACHE STRING "")
@@ -119,9 +156,6 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
add_subdirectory(Libraries/lvgl) # Added as idf component for ESP and as library for other targets
target_link_libraries(lvgl PRIVATE SDL2-static)
# Sim app
add_subdirectory(Firmware)
# Tests
add_subdirectory(Tests)
Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

+3 -3
View File
@@ -1,7 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port esp_lcd RgbDisplay GT911 PwmBacklight driver vfs fatfs
INCLUDE_DIRS "source"
REQUIRES TactilityKernel
)
@@ -1,31 +0,0 @@
#include <PwmBacklight.h>
#include "devices/Display.h"
#include <Tactility/hal/Configuration.h>
#include <driver/gpio.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
using namespace tt::hal;
static bool initBoot() {
//Display Reset
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_46, GPIO_MODE_OUTPUT));
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_46, 0));
vTaskDelay(pdMS_TO_TICKS(100));
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_46, 1));
vTaskDelay(pdMS_TO_TICKS(10));
return driver::pwmbacklight::init(GPIO_NUM_21);
}
static DeviceVector createDevices() {
return {
createDisplay()
};
}
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
@@ -1,107 +0,0 @@
#include "Display.h"
#include <Gt911Touch.h>
#include <PwmBacklight.h>
#include <RgbDisplay.h>
#include <tactility/check.h>
#include <tactility/device.h>
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note for future changes: Reset pin is 41 and interrupt pin is 40
auto* i2c = device_find_by_name("i2c0");
check(i2c);
auto configuration = std::make_unique<Gt911Touch::Configuration>(
i2c,
800,
480
);
return std::make_shared<Gt911Touch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto touch = createTouch();
constexpr uint32_t bufferPixels = 800 * 10;
esp_lcd_rgb_panel_config_t rgb_panel_config = {
.clk_src = LCD_CLK_SRC_DEFAULT,
.timings = {
.pclk_hz = 14000000,
.h_res = 800,
.v_res = 480,
.hsync_pulse_width = 4,
.hsync_back_porch = 8,
.hsync_front_porch = 8,
.vsync_pulse_width = 4,
.vsync_back_porch = 16,
.vsync_front_porch = 16,
.flags = {
.hsync_idle_low = false,
.vsync_idle_low = false,
.de_idle_high = false,
.pclk_active_neg = true,
.pclk_idle_high = true
}
},
.data_width = 16,
.bits_per_pixel = 0,
.num_fbs = 2,
.bounce_buffer_size_px = bufferPixels,
.sram_trans_align = 8,
.psram_trans_align = 64,
.hsync_gpio_num = GPIO_NUM_NC,
.vsync_gpio_num = GPIO_NUM_NC,
.de_gpio_num = GPIO_NUM_38,
.pclk_gpio_num = GPIO_NUM_5,
.disp_gpio_num = GPIO_NUM_NC,
.data_gpio_nums = {
GPIO_NUM_17, // B
GPIO_NUM_18, // B
GPIO_NUM_48, // B
GPIO_NUM_47, // B
GPIO_NUM_39, // B
GPIO_NUM_11, // G
GPIO_NUM_12, // G
GPIO_NUM_13, // G
GPIO_NUM_14, // G
GPIO_NUM_15, // G
GPIO_NUM_16, // G
GPIO_NUM_6, // R
GPIO_NUM_7, // R
GPIO_NUM_8, // R
GPIO_NUM_9, // R
GPIO_NUM_10, // R
},
.flags = {
.disp_active_low = false,
.refresh_on_demand = false,
.fb_in_psram = true,
.double_fb = true,
.no_fb = false,
.bb_invalidate_cache = false
}
};
RgbDisplay::BufferConfiguration buffer_config = {
.size = (800 * 480),
.useSpi = true,
.doubleBuffer = true,
.bounceBufferMode = true,
.avoidTearing = false
};
auto configuration = std::make_unique<RgbDisplay::Configuration>(
rgb_panel_config,
buffer_config,
touch,
LV_COLOR_FORMAT_RGB565,
false,
false,
false,
false,
driver::pwmbacklight::setBacklightDuty
);
return std::make_shared<RgbDisplay>(std::move(configuration));
}
@@ -1,5 +0,0 @@
#pragma once
#include <Tactility/hal/display/DisplayDevice.h>
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
-23
View File
@@ -1,23 +0,0 @@
#include <tactility/module.h>
extern "C" {
static error_t start() {
// Empty for now
return ERROR_NONE;
}
static error_t stop() {
// Empty for now
return ERROR_NONE;
}
struct Module btt_panda_touch_module = {
.name = "btt-panda-touch",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
};
}
@@ -2,18 +2,26 @@
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_ble.h>
#include <tactility/bindings/esp32_wifi_pinned.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_usbhost.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <bindings/rgb_display.h>
#include <bindings/gt911.h>
// Reference: https://github.com/bigtreetech/PandaTouch_PlatformIO/blob/master/docs/PINOUT.md
/ {
compatible = "root";
model = "BigTreeTech Panda Touch";
wifi0 {
compatible = "espressif,esp32-wifi-pinned";
};
ble0 {
compatible = "espressif,esp32-ble";
status = "disabled";
};
gpio0 {
@@ -27,6 +35,15 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 2 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 1 GPIO_FLAG_NONE>;
touch0 {
// Reset pin 41 and interrupt pin 40 exist on the board but are not wired up here
// (unverified - left disconnected like the original deprecated-HAL config).
compatible = "goodix,gt911";
reg = <0x5D>;
x-max = <800>;
y-max = <480>;
};
};
i2c_external: i2c1 {
@@ -37,6 +54,57 @@
pin-scl = <&gpio0 3 GPIO_FLAG_NONE>;
};
display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 21 GPIO_FLAG_NONE>;
period-ns = <33333>;
ledc-timer = <0>;
ledc-channel = <0>;
};
display_backlight {
compatible = "pwm-backlight";
pwm = <&display_backlight_pwm>;
};
display0 {
compatible = "espressif,esp32-rgb-display";
horizontal-resolution = <800>;
vertical-resolution = <480>;
pixel-clock-hz = <14000000>;
hsync-pulse-width = <4>;
hsync-back-porch = <8>;
hsync-front-porch = <8>;
vsync-pulse-width = <4>;
vsync-back-porch = <16>;
vsync-front-porch = <16>;
pclk-active-neg;
pclk-idle-high;
num-fbs = <2>;
double-fb;
bounce-buffer-size-px = <8000>;
pin-de = <&gpio0 38 GPIO_FLAG_NONE>;
pin-pclk = <&gpio0 5 GPIO_FLAG_NONE>;
pin-reset = <&gpio0 46 GPIO_FLAG_NONE>;
pin-data0 = <&gpio0 17 GPIO_FLAG_NONE>; // B
pin-data1 = <&gpio0 18 GPIO_FLAG_NONE>; // B
pin-data2 = <&gpio0 48 GPIO_FLAG_NONE>; // B
pin-data3 = <&gpio0 47 GPIO_FLAG_NONE>; // B
pin-data4 = <&gpio0 39 GPIO_FLAG_NONE>; // B
pin-data5 = <&gpio0 11 GPIO_FLAG_NONE>; // G
pin-data6 = <&gpio0 12 GPIO_FLAG_NONE>; // G
pin-data7 = <&gpio0 13 GPIO_FLAG_NONE>; // G
pin-data8 = <&gpio0 14 GPIO_FLAG_NONE>; // G
pin-data9 = <&gpio0 15 GPIO_FLAG_NONE>; // G
pin-data10 = <&gpio0 16 GPIO_FLAG_NONE>; // G
pin-data11 = <&gpio0 6 GPIO_FLAG_NONE>; // R
pin-data12 = <&gpio0 7 GPIO_FLAG_NONE>; // R
pin-data13 = <&gpio0 8 GPIO_FLAG_NONE>; // R
pin-data14 = <&gpio0 9 GPIO_FLAG_NONE>; // R
pin-data15 = <&gpio0 10 GPIO_FLAG_NONE>; // R
backlight = <&display_backlight>;
};
usbhost0 {
compatible = "espressif,esp32-usbhost";
+1 -1
View File
@@ -1,7 +1,7 @@
general.vendor=BigTreeTech
general.name=Panda Touch,K Touch
apps.launcherAppId=Launcher
apps.launcherAppId=tactility.launcher
hardware.target=ESP32S3
hardware.flashSize=16MB
+2
View File
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Drivers/rgb-display-module
- Drivers/gt911-module
dts: bigtreetech,panda-touch.dts
@@ -0,0 +1,9 @@
#include <tactility/module.h>
extern "C" {
Module btt_panda_touch_module = {
.name = "btt-panda-touch"
};
}
+7
View File
@@ -0,0 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "source"
REQUIRES TactilityKernel
)
+121
View File
@@ -0,0 +1,121 @@
/dts-v1/;
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_grove.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/esp32_wifi.h>
#include <bindings/tca8418.h>
#include <bindings/bm8563.h>
#include <bindings/esp_epaper.h>
/ {
compatible = "root";
model = "CL-32";
gpio0 {
compatible = "espressif,esp32-gpio";
gpio-count = <49>;
};
wifi0 {
compatible = "espressif,esp32-wifi";
status = "disabled";
};
// Top Stemma/Qwiic port 1 shares this bus with the keyboard and RTC (SDA: pin 1 <-> SCL: pin 2).
// External I2C devices on that port are reachable via i2c0.
i2c0 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
clock-frequency = <100000>;
pin-sda = <&gpio0 1 GPIO_FLAG_PULL_UP>;
pin-scl = <&gpio0 2 GPIO_FLAG_PULL_UP>;
keyboard {
compatible = "ti,tca8418";
reg = <0x34>;
rows = <8>;
columns = <10>;
keymap-lc = [
37 49 50 51 52 53 54 55 56 0 // % 1 2 3 4 5 6 7 8
57 48 8 91 93 43 34 39 27 0 // 9 0 BKSP [ ] + " ' EXIT
9 113 119 101 114 116 121 117 105 0 // TAB q w e r t y u i
111 112 13 40 41 45 59 58 3 0 // o p ENTER ( ) - ; : STOP
0 97 115 100 102 103 104 106 107 0 // a s d f g h j k
108 17 35 123 125 42 44 46 2 0 // l UP # { } * , . MENU
122 120 99 118 98 32 32 110 109 0 // z x c v b n m
20 18 19 60 62 47 92 61 13 0 // LEFT DOWN RIGHT < > / \ = RUN
];
keymap-uc = [
37 49 50 51 52 53 54 55 56 0 // % 1 2 3 4 5 6 7 8
57 48 8 91 93 43 34 39 27 0 // 9 0 BKSP [ ] + " ' EXIT
9 81 87 69 82 84 89 85 73 0 // TAB Q W E R T Y U I
79 80 13 40 41 45 59 58 3 0 // O P ENTER ( ) - ; : STOP
0 65 83 68 70 71 72 74 75 0 // A S D F G H J K
76 17 35 123 125 42 44 46 2 0 // L UP # { } * , . MENU
90 88 67 86 66 32 32 78 77 0 // Z X C V B N M
20 18 19 60 62 47 92 61 13 0 // LEFT DOWN RIGHT < > / \ = RUN
];
keymap-sy = [
37 49 50 51 52 53 54 55 56 0 // % 1 2 3 4 5 6 7 8
57 48 8 91 93 43 34 39 27 0 // 9 0 BKSP [ ] + " ' EXIT
9 113 119 101 114 116 121 117 105 0 // TAB q w e r t y u i
111 112 13 40 41 45 59 58 3 0 // o p ENTER ( ) - ; : STOP
0 97 115 100 102 103 104 106 107 0 // a s d f g h j k
108 17 35 123 125 42 44 46 2 0 // l UP # { } * , . MENU
122 120 99 118 98 32 32 110 109 0 // z x c v b n m
20 18 19 60 62 47 92 61 13 0 // LEFT DOWN RIGHT < > / \ = RUN
];
shift-row = <4>;
shift-col = <0>;
sym-row = <5>;
sym-col = <8>;
};
rtc: bm8563 {
compatible = "belling,bm8563";
reg = <0x51>;
};
};
port_b: grove1 {
compatible = "espressif,esp32-grove";
defaultMode = <GROVE_MODE_I2C>;
pinSdaTx = <&gpio0 47 GPIO_FLAG_NONE>;
pinSclRx = <&gpio0 48 GPIO_FLAG_NONE>;
uartPort = <UART_NUM_1>;
i2cPort = <I2C_NUM_1>;
i2cClockFrequency = <100000>;
};
spi1 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 7 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 10 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 11 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 9 GPIO_FLAG_NONE>;
max-transfer-size = <4096>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
};
epd@1 {
compatible = "tuanpmt,esp-epaper";
pin-dc = <&gpio0 13 GPIO_FLAG_NONE>;
pin-reset = <&gpio0 12 GPIO_FLAG_NONE>;
pin-busy = <&gpio0 14 GPIO_FLAG_NONE>;
pin-cs = <&gpio0 6 GPIO_FLAG_NONE>;
clock-speed-hz = <4000000>;
panel-type = "gdey029t71h";
update-mode = <2>;
rotation = <1>;
};
};
};
+22
View File
@@ -0,0 +1,22 @@
general.vendor=CL-32
general.name=CL-32
apps.launcherAppId=tactility.launcher
hardware.target=ESP32S3
hardware.flashSize=8MB
hardware.spiRam=true
hardware.spiRamMode=QUAD
hardware.spiRamSpeed=80M
hardware.spiRamXipDisabled=true
hardware.esptoolFlashFreq=80M
hardware.bluetooth=true
storage.userDataLocation=SD
display.size=2.9"
display.shape=rectangle
display.dpi=139
lvgl.colorDepth=8
lvgl.theme=Mono
+6
View File
@@ -0,0 +1,6 @@
dependencies:
- Platforms/platform-esp32
- Drivers/tca8418-module
- Drivers/esp-epaper-module
- Drivers/bm8563-module
dts: cl32.dts
+9
View File
@@ -0,0 +1,9 @@
#include <tactility/module.h>
extern "C" {
struct Module cl32_module = {
.name = "cl32"
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port ILI934x CST816S PwmBacklight driver vfs fatfs
REQUIRES TactilityKernel
)
+195
View File
@@ -0,0 +1,195 @@
Apache License
==============
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_
### Terms and Conditions for use, reproduction, and distribution
#### 1. Definitions
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
#### 2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
#### 3. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
#### 4. Redistribution
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
#### 5. Submission of Contributions
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
#### 6. Trademarks
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
#### 7. Disclaimer of Warranty
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
#### 8. Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
#### 9. Accepting Warranty or Additional Liability
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,30 +0,0 @@
#include "devices/Display.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
static bool initBoot() {
// Set the RGB LED Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
// 0 on, 1 off
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static tt::hal::DeviceVector createDevices() {
return {
createDisplay(),
};
}
extern const tt::hal::Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
@@ -1,45 +0,0 @@
#include "Display.h"
#include "Cst816Touch.h"
#include <Ili934xDisplay.h>
#include <PwmBacklight.h>
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
// Note: GPIO 25 for reset and GPIO 21 for interrupt?
auto configuration = std::make_unique<Cst816sTouch::Configuration>(
I2C_NUM_0,
240,
320
);
return std::make_shared<Cst816sTouch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
Ili934xDisplay::Configuration panel_configuration = {
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
.verticalResolution = LCD_VERTICAL_RESOLUTION,
.gapX = 0,
.gapY = 0,
.swapXY = false,
.mirrorX = true,
.mirrorY = false,
.invertColor = false,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
};
auto spi_configuration = std::make_shared<Ili934xDisplay::SpiConfiguration>(Ili934xDisplay::SpiConfiguration {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 40'000'000,
.transactionQueueDepth = 10
});
return std::make_shared<Ili934xDisplay>(panel_configuration, spi_configuration, true);
}
@@ -1,18 +0,0 @@
#pragma once
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
// Display
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_27;
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 10;
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
-23
View File
@@ -1,23 +0,0 @@
#include <tactility/module.h>
extern "C" {
static error_t start() {
// Empty for now
return ERROR_NONE;
}
static error_t stop() {
// Empty for now
return ERROR_NONE;
}
struct Module cyd_2432s024c_module = {
.name = "cyd-2432s024c",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
};
}
+80 -3
View File
@@ -1,16 +1,25 @@
/dts-v1/;
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_wifi_pinned.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <tactility/bindings/rgb_led_pwm.h>
#include <bindings/ili9341.h>
#include <bindings/cst816s.h>
/ {
compatible = "root";
model = "CYD 2432S024C";
wifi0 {
compatible = "espressif,esp32-wifi-pinned";
};
gpio0 {
compatible = "espressif,esp32-gpio";
gpio-count = <40>;
@@ -22,6 +31,66 @@
clock-frequency = <400000>;
pin-sda = <&gpio0 33 GPIO_FLAG_NONE>;
pin-scl = <&gpio0 32 GPIO_FLAG_NONE>;
touch {
compatible = "hynitron,cst816s";
reg = <0x15>;
x-max = <240>;
y-max = <320>;
};
};
rgb_led_channel_red {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 4 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <0>;
inverted;
};
rgb_led_channel_green {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 16 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <1>;
inverted;
};
rgb_led_channel_blue {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 17 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <2>;
inverted;
};
rgb_led_pwm {
compatible = "rgb-led-pwm";
pwm-red = <&rgb_led_channel_red>;
pwm-green = <&rgb_led_channel_green>;
pwm-blue = <&rgb_led_channel_blue>;
// Default is red, and we want to reset it to off by default
default-color = <0 0 0>;
enabled;
};
display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 27 GPIO_FLAG_NONE>;
period-ns = <1953125>;
ledc-timer = <1>;
ledc-channel = <3>;
};
display_backlight {
compatible = "pwm-backlight";
// Off by default so display power-on won't show the screen from before the last power loss.
// The display backlight is turned on during the boot process.
status = "disabled";
pwm = <&display_backlight_pwm>;
};
spi0 {
@@ -31,8 +100,15 @@
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display {
compatible = "display-placeholder";
display@0 {
compatible = "ilitek,ili9341";
horizontal-resolution = <240>;
vertical-resolution = <320>;
mirror-x;
bgr-order;
pixel-clock-hz = <40000000>;
pin-dc = <&gpio0 2 GPIO_FLAG_NONE>;
backlight = <&display_backlight>;
};
};
@@ -43,6 +119,7 @@
pin-mosi = <&gpio0 23 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 19 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 18 GPIO_FLAG_NONE>;
miso-pull-up;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
+1 -1
View File
@@ -1,7 +1,7 @@
general.vendor=CYD
general.name=2432S024C
apps.launcherAppId=Launcher
apps.launcherAppId=tactility.launcher
hardware.target=ESP32
hardware.flashSize=4MB
+2
View File
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Drivers/ili9341-module
- Drivers/cst816s-module
dts: cyd,2432s024c.dts
+9
View File
@@ -0,0 +1,9 @@
#include <tactility/module.h>
extern "C" {
Module cyd_2432s024c_module = {
.name = "cyd-2432s024c",
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port ILI934x XPT2046 PwmBacklight driver vfs fatfs
REQUIRES TactilityKernel
)
+195
View File
@@ -0,0 +1,195 @@
Apache License
==============
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_
### Terms and Conditions for use, reproduction, and distribution
#### 1. Definitions
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
#### 2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
#### 3. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
#### 4. Redistribution
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
#### 5. Submission of Contributions
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
#### 6. Trademarks
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
#### 7. Disclaimer of Warranty
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
#### 8. Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
#### 9. Accepting Warranty or Additional Liability
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,21 +0,0 @@
#include "devices/Display.h"
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
using namespace tt::hal;
static bool initBoot() {
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static DeviceVector createDevices() {
return {
createDisplay()
};
}
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
@@ -1,46 +0,0 @@
#include "Display.h"
#include "Xpt2046Touch.h"
#include <Ili934xDisplay.h>
#include <PwmBacklight.h>
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch(esp_lcd_spi_bus_handle_t spiDevice) {
auto configuration = std::make_unique<Xpt2046Touch::Configuration>(
spiDevice,
TOUCH_CS_PIN,
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION,
true, // swapXY
false, // mirrorX
true // mirrorY
);
return std::make_shared<Xpt2046Touch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto spi_configuration = std::make_shared<Ili934xDisplay::SpiConfiguration>(Ili934xDisplay::SpiConfiguration {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 40'000'000,
.transactionQueueDepth = 10
});
Ili934xDisplay::Configuration panel_configuration = {
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
.verticalResolution = LCD_VERTICAL_RESOLUTION,
.gapX = 0,
.gapY = 0,
.swapXY = true,
.mirrorX = true,
.mirrorY = true,
.invertColor = false,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(spi_configuration->spiHostDevice),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = LCD_PIN_RST,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_RGB
};
return std::make_shared<Ili934xDisplay>(panel_configuration, spi_configuration, true);
}
@@ -1,28 +0,0 @@
#pragma once
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
// Display
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
constexpr auto LCD_PIN_RST = GPIO_NUM_NC; // tied to ESP32 RST
constexpr auto LCD_PIN_CLK = GPIO_NUM_14;
constexpr auto LCD_PIN_MOSI = GPIO_NUM_13;
constexpr auto LCD_PIN_MISO = GPIO_NUM_12;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 10;
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
// Backlight
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_27;
// Touch
constexpr auto TOUCH_CS_PIN = GPIO_NUM_33;
constexpr auto TOUCH_IRQ_PIN = GPIO_NUM_36;
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
-23
View File
@@ -1,23 +0,0 @@
#include <tactility/module.h>
extern "C" {
static error_t start() {
// Empty for now
return ERROR_NONE;
}
static error_t stop() {
// Empty for now
return ERROR_NONE;
}
struct Module cyd_2432s024r_module = {
.name = "cyd-2432s024r",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
};
}
+77 -4
View File
@@ -1,22 +1,83 @@
/dts-v1/;
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_wifi_pinned.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <tactility/bindings/rgb_led_pwm.h>
#include <bindings/ili9341.h>
#include <bindings/xpt2046.h>
/ {
compatible = "root";
model = "CYD 2432S024R";
wifi0 {
compatible = "espressif,esp32-wifi-pinned";
};
gpio0 {
compatible = "espressif,esp32-gpio";
gpio-count = <40>;
};
rgb_led_channel_red {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 4 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <0>;
inverted;
};
rgb_led_channel_green {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 16 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <1>;
inverted;
};
rgb_led_channel_blue {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 17 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <2>;
inverted;
};
rgb_led_pwm {
compatible = "rgb-led-pwm";
pwm-red = <&rgb_led_channel_red>;
pwm-green = <&rgb_led_channel_green>;
pwm-blue = <&rgb_led_channel_blue>;
// Default is red, and we want to reset it to off by default
default-color = <0 0 0>;
enabled;
};
display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 27 GPIO_FLAG_NONE>;
period-ns = <1953125>;
ledc-timer = <1>;
ledc-channel = <3>;
};
display_backlight {
compatible = "pwm-backlight";
// Off by default so display power-on won't show the screen from before the last power loss.
// The display backlight is turned on during the boot process.
status = "disabled";
pwm = <&display_backlight_pwm>;
};
spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
@@ -27,11 +88,23 @@
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
display@0 {
compatible = "display-placeholder";
compatible = "ilitek,ili9341";
horizontal-resolution = <240>;
vertical-resolution = <320>;
swap-xy;
mirror-x;
mirror-y;
pixel-clock-hz = <40000000>;
pin-dc = <&gpio0 2 GPIO_FLAG_NONE>;
backlight = <&display_backlight>;
};
touch@1 {
compatible = "touch-placeholder";
compatible = "xptek,xpt2046";
x-max = <240>;
y-max = <320>;
swap-xy;
mirror-y;
};
};
+1 -1
View File
@@ -1,7 +1,7 @@
general.vendor=CYD
general.name=2432S024R
apps.launcherAppId=Launcher
apps.launcherAppId=tactility.launcher
hardware.target=ESP32
hardware.flashSize=4MB
+2
View File
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Drivers/ili9341-module
- Drivers/xpt2046-module
dts: cyd,2432s024r.dts
+9
View File
@@ -0,0 +1,9 @@
#include <tactility/module.h>
extern "C" {
Module cyd_2432s024r_module = {
.name = "cyd-2432s024r"
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port ILI934x XPT2046SoftSPI PwmBacklight driver vfs fatfs
REQUIRES TactilityKernel
)
+195
View File
@@ -0,0 +1,195 @@
Apache License
==============
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_
### Terms and Conditions for use, reproduction, and distribution
#### 1. Definitions
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
#### 2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
#### 3. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
#### 4. Redistribution
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
#### 5. Submission of Contributions
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
#### 6. Trademarks
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
#### 7. Disclaimer of Warranty
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
#### 8. Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
#### 9. Accepting Warranty or Additional Liability
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,32 +0,0 @@
#include "devices/Display.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
using namespace tt::hal;
static bool initBoot() {
// Set the RGB LED Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
// 0 on, 1 off
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static DeviceVector createDevices() {
return {
createDisplay(),
};
}
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
@@ -1,49 +0,0 @@
#include "Display.h"
#include "Xpt2046SoftSpi.h"
#include <Ili934xDisplay.h>
#include <PwmBacklight.h>
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto configuration = std::make_unique<Xpt2046SoftSpi::Configuration>(
TOUCH_MOSI_PIN,
TOUCH_MISO_PIN,
TOUCH_SCK_PIN,
TOUCH_CS_PIN,
LCD_HORIZONTAL_RESOLUTION,
LCD_VERTICAL_RESOLUTION,
false, // swapXY
true, // mirrorX
false // mirrorY
);
return std::make_shared<Xpt2046SoftSpi>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
Ili934xDisplay::Configuration panel_configuration = {
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
.verticalResolution = LCD_VERTICAL_RESOLUTION,
.gapX = 0,
.gapY = 0,
.swapXY = false,
.mirrorX = true,
.mirrorY = false,
.invertColor = false,
.swapBytes = true,
.bufferSize = LCD_BUFFER_SIZE,
.touch = createTouch(),
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
.resetPin = GPIO_NUM_NC,
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
};
auto spi_configuration = std::make_shared<Ili934xDisplay::SpiConfiguration>(Ili934xDisplay::SpiConfiguration {
.spiHostDevice = LCD_SPI_HOST,
.csPin = LCD_PIN_CS,
.dcPin = LCD_PIN_DC,
.pixelClockFrequency = 40'000'000,
.transactionQueueDepth = 10
});
return std::make_shared<Ili934xDisplay>(panel_configuration, spi_configuration, true);
}
@@ -1,27 +0,0 @@
#pragma once
#include <Tactility/hal/display/DisplayDevice.h>
#include <driver/gpio.h>
#include <driver/spi_common.h>
#include <memory>
// Display
constexpr auto LCD_SPI_HOST = SPI2_HOST;
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 10;
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
// Display backlight (PWM)
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_21;
// Touch (Software SPI)
constexpr auto TOUCH_MISO_PIN = GPIO_NUM_39;
constexpr auto TOUCH_MOSI_PIN = GPIO_NUM_32;
constexpr auto TOUCH_SCK_PIN = GPIO_NUM_25;
constexpr auto TOUCH_CS_PIN = GPIO_NUM_33;
constexpr auto TOUCH_IRQ_PIN = GPIO_NUM_36;
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
-23
View File
@@ -1,23 +0,0 @@
#include <tactility/module.h>
extern "C" {
static error_t start() {
// Empty for now
return ERROR_NONE;
}
static error_t stop() {
// Empty for now
return ERROR_NONE;
}
struct Module cyd_2432s028r_module = {
.name = "cyd-2432s028r",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
};
}
+83 -9
View File
@@ -1,18 +1,26 @@
/dts-v1/;
#include <tactility/bindings/root.h>
#include <tactility/bindings/esp32_wifi_pinned.h>
#include <tactility/bindings/esp32_gpio.h>
#include <tactility/bindings/esp32_i2c.h>
#include <tactility/bindings/esp32_spi.h>
#include <tactility/bindings/esp32_uart.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/touch_placeholder.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <tactility/bindings/rgb_led_pwm.h>
#include <bindings/ili9341.h>
#include <bindings/xpt2046_softspi.h>
/ {
compatible = "root";
model = "CYD 2432S028R";
wifi0 {
compatible = "espressif,esp32-wifi-pinned";
};
gpio0 {
compatible = "espressif,esp32-gpio";
gpio-count = <40>;
@@ -26,21 +34,87 @@
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
};
rgb_led_channel_red {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 4 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <0>;
inverted;
};
rgb_led_channel_green {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 16 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <1>;
inverted;
};
rgb_led_channel_blue {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 17 GPIO_FLAG_NONE>;
period-ns = <500000>;
ledc-timer = <0>;
ledc-channel = <2>;
inverted;
};
display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 21 GPIO_FLAG_NONE>;
period-ns = <1953125>;
ledc-timer = <1>;
ledc-channel = <3>;
};
rgb_led_pwm {
compatible = "rgb-led-pwm";
pwm-red = <&rgb_led_channel_red>;
pwm-green = <&rgb_led_channel_green>;
pwm-blue = <&rgb_led_channel_blue>;
// Default is red, and we want to reset it to off by default
default-color = <0 0 0>;
enabled;
};
display_backlight {
compatible = "pwm-backlight";
// Off by default so display power-on won't show the screen from before the last power loss.
// The display backlight is turned on during the boot process.
status = "disabled";
pwm = <&display_backlight_pwm>;
};
touch {
compatible = "xptek,xpt2046-softspi";
pin-mosi = <&gpio0 32 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 39 GPIO_FLAG_NONE>;
pin-sck = <&gpio0 25 GPIO_FLAG_NONE>;
pin-cs = <&gpio0 33 GPIO_FLAG_NONE>;
x-max = <240>;
y-max = <320>;
mirror-x;
};
spi0 {
compatible = "espressif,esp32-spi";
host = <SPI2_HOST>;
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>, // Display
<&gpio0 33 GPIO_FLAG_NONE>; // Touch
cs-gpios = <&gpio0 15 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
display@0 {
compatible = "display-placeholder";
};
touch@1 {
compatible = "touch-placeholder";
compatible = "ilitek,ili9341";
horizontal-resolution = <240>;
vertical-resolution = <320>;
mirror-x;
bgr-order;
pixel-clock-hz = <40000000>;
pin-dc = <&gpio0 2 GPIO_FLAG_NONE>;
backlight = <&display_backlight>;
};
};
+4 -1
View File
@@ -1,7 +1,7 @@
general.vendor=CYD
general.name=2432S028R
apps.launcherAppId=Launcher
apps.launcherAppId=tactility.launcher
hardware.target=ESP32
hardware.flashSize=4MB
@@ -13,6 +13,9 @@ display.size=2.8"
display.shape=rectangle
display.dpi=143
touch.calibrationSupported=true
touch.calibrationRequired=false
cdn.warningMessage=There are 3 hardware variants of this board. This build works on the original variant only ("v1").
lvgl.colorDepth=16
+2
View File
@@ -1,3 +1,5 @@
dependencies:
- Platforms/platform-esp32
- Drivers/ili9341-module
- Drivers/xpt2046-softspi-module
dts: cyd,2432s028r.dts
+9
View File
@@ -0,0 +1,9 @@
#include <tactility/module.h>
extern "C" {
Module cyd_2432s028r_module = {
.name = "cyd-2432s028r"
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port ST7789 XPT2046SoftSPI PwmBacklight driver vfs fatfs
REQUIRES TactilityKernel
)
@@ -0,0 +1,195 @@
Apache License
==============
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_
### Terms and Conditions for use, reproduction, and distribution
#### 1. Definitions
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
#### 2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
#### 3. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
#### 4. Redistribution
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
#### 5. Submission of Contributions
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
#### 6. Trademarks
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
#### 7. Disclaimer of Warranty
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
#### 8. Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
#### 9. Accepting Warranty or Additional Liability
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,32 +0,0 @@
#include "devices/Display.h"
#include <driver/gpio.h>
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
using namespace tt::hal;
static bool initBoot() {
// Set the RGB LED Pins to output and turn them off
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
// 0 on, 1 off
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
}
static DeviceVector createDevices() {
return {
createDisplay(),
};
}
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};

Some files were not shown because too many files have changed in this diff Show More