Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions boards/_boards_json/lilygo-t-deck-pro-epaper.json
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"
}
207 changes: 207 additions & 0 deletions boards/lilygo-t-deck-pro-epaper/README.md
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 ] , . /
```
Comment on lines +69 to +91
Copy link

Copilot AI Jan 11, 2026

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.

Copilot uses AI. Check for mistakes.

**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!**
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README states on line 161 "Add Battery Management ✅ Keyboard Driver Complete!" which appears to be a copy-paste error. The line is in a section about required changes for E-Paper support and specifically lists battery management implementation as needed, but then has a checkmark saying "Keyboard Driver Complete" which is unrelated to battery management. This creates confusion about what has actually been completed.

Suggested change
3. **Add Battery Management****Keyboard Driver Complete!**
3. **Add Battery Management**

Copilot uses AI. Check for mistakes.
- Implement BQ27220 fuel gauge reading
- Implement BQ25896 charger status
- Proper battery percentage calculation

## Building

```bash
pio run -e lilygo-t-deck-pro-epaper
```

## Flashing

```bash
pio run -e lilygo-t-deck-pro-epaper -t upload
```

## Recommendations

**For Production Use:**
- Consider using the regular T-Deck or T-Deck Plus with TFT display
- Bruce is optimized for fast TFT displays, not E-Paper
- E-Paper support would require significant UI redesign

**For Testing:**
- This configuration can be used to test non-display features
- Keyboard, LoRa, GPS, and other peripherals should work
- Display will be slow but functional for basic menu navigation

## References

- [LilyGo T-Deck Pro GitHub](https://github.com/Xinyuan-LilyGO/T-Deck-Pro)
- [LilyGo T-Deck Pro Wiki](https://wiki.lilygo.cc/get_started/en/Wearable/T-Deck-Pro/T-Deck-Pro.html)
- [GxEPD2 Library](https://github.com/ZinggJM/GxEPD2)
- [Bruce Firmware](https://github.com/pr3y/Bruce)

## Contributing

If you want to improve E-Paper support:
1. Implement GxEPD2 wrapper layer
2. Add TCA8418 keyboard library
Copy link

Copilot AI Jan 11, 2026

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.

Suggested change
2. Add TCA8418 keyboard library
2. Integrate TCA8418 keyboard support (use the existing library, implement key handling, and test)

Copilot uses AI. Check for mistakes.
3. Optimize UI for E-Paper refresh rates
4. Test and submit pull request

---

**Note**: This is an experimental configuration. Use at your own risk.
Loading