A feature-rich QR code generation application for the T-Deck ESP32-based device with a touchscreen interface and graphical UI powered by LVGL.
This project allows you to generate QR codes on the T-Deck device with an intuitive graphical interface. Users can input text through the built-in keyboard or serial connection, customize QR code appearance (colors, size), and view the generated codes on the device's display.
- QR Code Generation: Convert text input into scannable QR codes
- GUI Interface: LVGL-based graphical user interface for easy interaction
- Touch Support: Full touchscreen support for input and navigation
- Multiple Input Methods:
- Physical keyboard/buttons on T-Deck
- Touchscreen interface
- Serial console input
- Customizable Colors: Configure foreground and background colors for QR codes
- Adjustable Size: Dynamic QR code sizing (up to 200x200 pixels)
- Multi-device Support: Support for T-Keyboard and T-Deck variants
- T-Deck ESP32-S3 Development Board
- 3.4" TFT LCD Display
- GT911 Touchscreen controller
- Integrated Physical Keyboard
- 16MB of PSRAM
- Micro SD Card slot
- PlatformIO IDE (with ESP32 support)
- Framework: Arduino ESP32 v6.3.0
- Python 3.x (for PlatformIO)
- LVGL v8+: Lightweight GUI library
- TFT_eSPI: SPI TFT LCD driver library
- TouchLib: GT911 touchscreen driver
- AceButton: Button event handling library
- SD/SPIFFS: File system support
├── src/
│ ├── main.cpp # Main application and QR code generation logic
│ └── utilities.h # Board pin definitions and hardware configuration
├── lib/
│ ├── lvgl/ # LVGL GUI library
│ ├── TFT_eSPI/ # Display driver
│ ├── TouchLib/ # Touchscreen controller
│ └── AceButton/ # Button handling
├── boards/
│ └── T-Deck.json # Custom T-Deck board configuration
├── platformio.ini # PlatformIO configuration
└── README.md # This file
Ensure you have PlatformIO installed in VS Code:
pip install platformio
code --install-extension platformio.platformio-idecd /path/to/projectplatformio run --environment T-DeckConnect your T-Deck via USB and run:
platformio run --target upload --environment T-DeckTo monitor serial output:
platformio device monitor --environment T-Deck- Start the Application: Power on the T-Deck device
- Input Text:
- Use the physical keyboard on the device
- Or type via serial console (at 115200 baud)
- Generate QR Code: Press the input button or equivalent key
- View Result: The QR code will be displayed on the screen
- Customize: Adjust colors and size as desired
- Physical Keys: Row of directional buttons on T-Deck for navigation and selection
- Touchscreen: Direct touch input on the display
- Serial Console: Send text commands via the USB serial interface
- Keyboard Module: If using T-Keyboard variant with PS/2 keyboard
Key build settings in platformio.ini:
- Upload Speed: 921600 baud
- Monitor Speed: 115200 baud
- Partition Table: 16MB default configuration
- Flash Mode: DIO (Dual I/O)
- PSRAM: Enabled for larger buffer allocations
- USB CDC: Enabled for serial console access
Key GPIO pins (defined in utilities.h):
- Display: TFT_DC (11), TFT_CS (12), TFT_BL (42)
- SPI Bus: MOSI (41), MISO (38), SCK (40)
- Touch: INT (16), I2C (SDA: 18, SCL: 8)
- Keyboard: INT (46)
- SD Card: CS (39)
- Control Buttons: GPIO 1-3, 15
- Boot Button: GPIO 0
- Ensure USB CDC is enabled:
-DARDUINO_USB_CDC_ON_BOOT=1 - Try baud rate: 115200
- Check USB cable connection
- Verify backlight pin configuration (GPIO 42)
- Check TFT_eSPI User Setup configuration
- Ensure SPI pins are correctly defined
- Verify GT911 I2C address and pins
- Check TouchLib initialization in
setupLvgl() - Test I2C communication to touch controller
The project uses LVGL v8 with partial rendering mode for optimal memory usage on ESP32.
- Uses PSRAM when available for large display buffers
- Implements semaphores for thread-safe SPI access
- Dynamic memory allocation for QR code generation
QR codes use LVGL's color format:
- Foreground: Dark color (typically black)
- Background: Light color (typically white)
To contribute improvements:
- Create a feature branch
- Make your changes
- Test on T-Deck hardware
- Submit a pull request
This project is provided as-is for development and educational purposes.
Mohamad Mouaayed