-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Claude/esp32 liliygo adaptation i44 uq #2030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| { | ||
| "build": { | ||
| "arduino": { | ||
| "ldscript": "esp32s3_out.ld", | ||
| "partitions": "default_16MB.csv", | ||
| "memory_type": "qio_opi" | ||
| }, | ||
| "core": "esp32", | ||
| "extra_flags": [ | ||
| "-DT_DECK_PRO_EPAPER", | ||
| "-DBOARD_HAS_PSRAM", | ||
| "-DARDUINO_USB_MODE=1", | ||
| "-DARDUINO_RUNNING_CORE=1", | ||
| "-DARDUINO_EVENT_RUNNING_CORE=1", | ||
| "-DARDUINO_USB_CDC_ON_BOOT" | ||
| ], | ||
| "f_cpu": "240000000L", | ||
| "f_flash": "80000000L", | ||
| "flash_mode": "qio", | ||
| "hwids": [ | ||
| [ | ||
| "0x303A", | ||
| "0x1001" | ||
| ] | ||
| ], | ||
| "mcu": "esp32s3", | ||
| "variant": "lilygo-t-deck-pro-epaper" | ||
| }, | ||
| "connectivity": [ | ||
| "wifi", | ||
| "bluetooth", | ||
| "lora", | ||
| "cellular" | ||
| ], | ||
| "debug": { | ||
| "default_tool": "esp-builtin", | ||
| "onboard_tools": [ | ||
| "esp-builtin" | ||
| ], | ||
| "openocd_target": "esp32s3.cfg" | ||
| }, | ||
| "frameworks": [ | ||
| "arduino", | ||
| "espidf" | ||
| ], | ||
| "name": "LilyGo T-Deck Pro E-Paper (16M Flash 8M PSRAM)", | ||
| "upload": { | ||
| "flash_size": "16MB", | ||
| "maximum_ram_size": 327680, | ||
| "maximum_size": 16777216, | ||
| "require_upload_port": true, | ||
| "speed": 921600 | ||
| }, | ||
| "url": "https://www.lilygo.cc", | ||
| "vendor": "LilyGo" | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,207 @@ | ||||||
| # LilyGo T-Deck Pro E-Paper - Bruce Firmware | ||||||
|
|
||||||
| ⚠️ **EXPERIMENTAL SUPPORT** ⚠️ | ||||||
|
|
||||||
| This board configuration is experimental and has significant limitations due to the E-Paper display. | ||||||
|
|
||||||
| ## Hardware Specifications | ||||||
|
|
||||||
| - **MCU**: ESP32-S3FN16R8 (16MB Flash, 8MB PSRAM) | ||||||
| - **Display**: GDEQ031T10 (3.1" E-Paper, 320x240, UC8253 controller) | ||||||
| - **Touch**: CST328 capacitive touch controller (I2C 0x1A) | ||||||
| - **Keyboard**: TCA8418 QWERTY keyboard controller (I2C 0x34) | ||||||
| - **LoRa**: SX1262 (915/868 MHz) | ||||||
| - **GPS**: MIA-M10Q (UART) | ||||||
| - **4G Modem**: A7682E LTE Cat 1 (optional) | ||||||
| - **Battery**: 1400mAh LiPo with BQ25896 charger and BQ27220 fuel gauge | ||||||
| - **Gyroscope**: BHI260AP (I2C 0x28) | ||||||
| - **SD Card**: MicroSD slot (SPI) | ||||||
|
|
||||||
| ## Pin Configuration | ||||||
|
|
||||||
| ### Display (E-Paper) | ||||||
| - **MOSI**: GPIO 33 | ||||||
| - **SCK**: GPIO 36 | ||||||
| - **CS**: GPIO 34 | ||||||
| - **DC**: GPIO 35 | ||||||
| - **BUSY**: GPIO 37 | ||||||
| - **RST**: Not connected (-1) | ||||||
|
|
||||||
| ### Touch (CST328) | ||||||
| - **SDA**: GPIO 13 | ||||||
| - **SCL**: GPIO 14 | ||||||
| - **INT**: GPIO 12 | ||||||
| - **RST**: GPIO 45 | ||||||
|
|
||||||
| ### Keyboard (TCA8418) | ||||||
| - **SDA**: GPIO 13 | ||||||
| - **SCL**: GPIO 14 | ||||||
| - **INT**: GPIO 15 | ||||||
| - **LED**: GPIO 42 | ||||||
|
|
||||||
| ### LoRa (SX1262) | ||||||
| - **MOSI**: GPIO 33 | ||||||
| - **MISO**: Not used | ||||||
| - **SCK**: GPIO 36 | ||||||
| - **CS**: GPIO 3 | ||||||
| - **RST**: GPIO 4 | ||||||
| - **DIO1**: GPIO 5 | ||||||
| - **BUSY**: GPIO 6 | ||||||
|
|
||||||
| ### SD Card | ||||||
| - **MOSI**: GPIO 33 | ||||||
| - **SCK**: GPIO 36 | ||||||
| - **CS**: GPIO 48 | ||||||
|
|
||||||
| ### GPS (MIA-M10Q) | ||||||
| - **TX**: GPIO 16 | ||||||
| - **RX**: GPIO 17 | ||||||
| - **Baud Rate**: 9600 | ||||||
|
|
||||||
| ### Power | ||||||
| - **Power Control**: GPIO 10 | ||||||
| - **Battery ADC**: GPIO 4 | ||||||
|
|
||||||
| ## Keyboard Layout | ||||||
|
|
||||||
| The T-Deck Pro features a 40-key QWERTY keyboard (4 rows × 10 columns) with three layers: | ||||||
|
|
||||||
| ### Normal Layer (Default) | ||||||
| ``` | ||||||
| Row 0: q w e r t y u i o p | ||||||
| Row 1: a s d f g h j k l ↵ | ||||||
| Row 2: Fn z x c v b n m ⇧ ⌫ | ||||||
| Row 3: [ Space Bar ] , . / | ||||||
| ``` | ||||||
|
|
||||||
| ### Shift Layer (Hold Shift) | ||||||
| ``` | ||||||
| Row 0: Q W E R T Y U I O P | ||||||
| Row 1: A S D F G H J K L ↵ | ||||||
| Row 2: Fn Z X C V B N M ⇧ ⌫ | ||||||
| Row 3: [ Space Bar ] < > ? | ||||||
| ``` | ||||||
|
|
||||||
| ### Fn Layer (Hold Fn) | ||||||
| ``` | ||||||
| Row 0: 1 2 3 4 5 6 7 8 9 0 | ||||||
| Row 1: ! @ # $ % ^ & * ( ) | ||||||
| Row 2: Fn - _ = + [ ] ; ⇪ ⌫ | ||||||
| Row 3: [ Space Bar ] , . / | ||||||
| ``` | ||||||
|
|
||||||
| **Special Key Combinations:** | ||||||
| - **Fn + Shift** = Toggle Caps Lock (⇪) | ||||||
| - **Caps Lock** affects letter keys only (numbers/symbols unaffected) | ||||||
| - **Keyboard LED** provides visual feedback on key presses | ||||||
|
|
||||||
| ## Known Limitations | ||||||
|
|
||||||
| ### E-Paper Display Limitations | ||||||
|
|
||||||
| 1. **Slow Refresh Rate**: E-Paper displays take 1-2 seconds to fully refresh | ||||||
| - Bruce's UI expects fast TFT refresh rates | ||||||
| - Menus and animations will be very slow and choppy | ||||||
| - Not suitable for real-time operations | ||||||
|
|
||||||
| 2. **Ghosting**: E-Paper displays show ghosting effects | ||||||
| - Previous images may remain faintly visible | ||||||
| - Full screen refreshes needed periodically | ||||||
|
|
||||||
| 3. **Monochrome Only**: E-Paper is black and white | ||||||
| - No color support (Bruce UI uses colors extensively) | ||||||
| - Reduced visual feedback | ||||||
|
|
||||||
| 4. **No Backlight**: E-Paper has no backlight | ||||||
| - Needs external light to be readable | ||||||
| - Brightness controls do nothing | ||||||
|
|
||||||
| ### Current Implementation Status | ||||||
|
|
||||||
| ✅ **Working:** | ||||||
| - Touch input (CST328 capacitive touchscreen) | ||||||
| - **Keyboard input (TCA8418 QWERTY keyboard) - NEW!** | ||||||
| - Full QWERTY layout with 40 keys | ||||||
| - Fn, Shift, and Caps Lock support | ||||||
| - Key event handling with LED feedback | ||||||
| - Debouncing and proper key press/release detection | ||||||
| - Basic GPIO setup | ||||||
| - Power management | ||||||
| - SD Card support | ||||||
| - LoRa module support (SX1262) | ||||||
|
|
||||||
| ⚠️ **Partially Working:** | ||||||
| - Display output (using TFT_eSPI with ST7789 driver as placeholder) | ||||||
| - **CRITICAL**: E-Paper requires GxEPD2 library, not TFT_eSPI | ||||||
| - Current config will NOT work correctly with E-Paper | ||||||
| - This is a temporary workaround for compilation | ||||||
| - Battery monitoring (basic ADC reading, needs BQ27220 integration) | ||||||
|
|
||||||
| ❌ **Not Implemented:** | ||||||
| - 4G Modem (A7682E not supported in Bruce) | ||||||
| - Gyroscope (BHI260AP not used in Bruce) | ||||||
| - Battery fuel gauge (BQ27220 precise reading) | ||||||
| - Charger status (BQ25896 reading) | ||||||
|
|
||||||
| ## Required Changes for Full E-Paper Support | ||||||
|
|
||||||
| To properly support the E-Paper display, the following major changes are needed: | ||||||
|
|
||||||
| 1. **Replace TFT_eSPI with GxEPD2** | ||||||
| - Add `zinggjm/GxEPD2` library dependency | ||||||
| - Create wrapper layer to adapt GxEPD2 API to Bruce's display API | ||||||
| - Implement partial refresh strategies to improve performance | ||||||
|
|
||||||
| 2. **Optimize UI for E-Paper** | ||||||
| - Reduce refresh frequency | ||||||
| - Simplify animations | ||||||
| - Use partial refreshes where possible | ||||||
| - Convert color schemes to high-contrast B&W | ||||||
|
|
||||||
| 3. **Add Battery Management** ✅ **Keyboard Driver Complete!** | ||||||
|
||||||
| 3. **Add Battery Management** ✅ **Keyboard Driver Complete!** | |
| 3. **Add Battery Management** |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the README, line 201 states "Add TCA8418 keyboard library" as a contributing task. However, the .ini file already includes the library dependency on line 176: "adafruit/Adafruit TCA8418 @ ^1.0.2". This is inconsistent - either the library is already added (making the documentation outdated), or it needs to be clarified what additional work is needed beyond adding the dependency.
| 2. Add TCA8418 keyboard library | |
| 2. Integrate TCA8418 keyboard support (use the existing library, implement key handling, and test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting inconsistency: The keyboard layout diagrams use different symbols for special keys. Row 0-2 use '↵' for Enter, '⇧' for Shift, '⌫' for Backspace, and '⇪' for Caps Lock. However, in row 3, these symbols are not used consistently. Consider using consistent symbols or text labels throughout all layout diagrams for clarity.