-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add GC9A01 round TFT display usermod #4989
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
Open
srg74
wants to merge
12
commits into
wled:main
Choose a base branch
from
srg74:feature/gc9a01-display-usermod
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8a74eb6
Update .gitignore
srg74 4689375
Update .gitignore
srg74 4d52ebd
Add GC9A01 round TFT display usermod
srg74 9e9cc47
Fix palette navigation wraparound in rotary encoder ALT
srg74 3fe5866
Address PR feedback: fix documentation and palette handling
srg74 012f5ef
Remove Wire library dependency from library.json
srg74 ef22813
Address PR feedback for GC9A01 usermod
srg74 4521b22
Address PR feedback for GC9A01 usermod
srg74 7d6a2c6
Use DEBUG_PRINTF/DEBUG_PRINTLN macros for consistency
srg74 0c9c80f
Remove redundant Serial.println calls in rotary encoder usermod
srg74 49c6099
Add null pointer checks for gc9a01Display->updateRedrawTime() calls
srg74 b927bae
Fix null pointer dereference in rotary encoder ui usermod display calls
srg74 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "gc9a01_display", | ||
| "build": { "libArchive": false }, | ||
| "dependencies": { | ||
| "bodmer/TFT_eSPI": "^2.5.43" | ||
| } | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| # GC9A01 Display Usermod | ||
|
|
||
| A fully-featured WLED usermod providing comprehensive visual interface on GC9A01 240x240 round TFT displays with complete rotary encoder integration. | ||
|
|
||
| ## Features | ||
|
|
||
| ### Visual Interface | ||
|
|
||
| - **Circular Design**: Optimized for 240x240 round displays with blue bezel theming | ||
| - **Real-time Clock**: Large digital clock display (12/24-hour formats) | ||
| - **WiFi Signal Strength**: Visual signal strength indicator with 4-level bars (25%, 50%, 75%, 100%) | ||
| - **Power Status**: Dynamic "OFF [switch] ON" layout with contextual text | ||
| - **Brightness Arc**: Semicircular brightness visualization | ||
| - **Color Controls**: Three color buttons (FX, BG, CS) with live color preview and automatic updates | ||
| - **Effect Display**: Current effect name | ||
| - **Palette Display**: Current palette name | ||
| - **Startup Logo**: WLED logo display during initialization | ||
|
|
||
| ### Modes | ||
|
|
||
| - **Sleep Mode**: Automatic display sleep after configurable timeout (5-300 seconds) | ||
| - **Clock Mode**: Alternative to sleep - shows clock instead of turning off display | ||
| - **Wake on Interaction**: Automatic wake on rotary encoder use or button press | ||
| - **Unified Timeout**: Single configurable timeout controls both sleep and clock modes | ||
| - **Backlight Control**: PWM-based brightness control (0-100%) | ||
|
|
||
| ### Performance Features | ||
|
|
||
| - **State Caching**: Minimal redraws using comprehensive change detection | ||
| - **Smart Updates**: Automatic color button updates when colors change from any source (web UI, API, etc.) | ||
| - **Non-blocking Updates**: Asynchronous display updates following Four Line Display ALT pattern | ||
| - **Memory Optimized**: Efficient memory usage with proper cleanup | ||
| - **Debug Support**: Comprehensive debug logging with WLED macros | ||
|
|
||
| ## Hardware Requirements | ||
|
|
||
| - ESP32 development board | ||
| - GC9A01 240x240 TFT display (round) | ||
| - Optional: Rotary encoder (usermod_v2_rotary_encoder_ui_ALT) | ||
|
|
||
| ## Wiring | ||
|
|
||
| ### GC9A01 Display | ||
|
|
||
| | GC9A01 Pin | ESP32 Pin | Function | Description | | ||
| |------------|-----------|-------------|-------------| | ||
| | VCC | 3.3V | Power | 3.3V power supply | | ||
| | GND | GND | Ground | Common ground | | ||
| | SCL/SCLK | GPIO18 | SPI Clock | SPI clock signal | | ||
| | SDA/MOSI | GPIO23 | SPI MOSI | SPI data out | | ||
| | RES/RST | GPIO17 | Reset | Display reset | | ||
| | DC | GPIO15 | Data/Command| Data/Command control | | ||
| | CS | GPIO5 | Chip Select | SPI chip select | | ||
| | BL | GPIO26 | Backlight | Backlight control | | ||
|
|
||
| **Note**: Pin assignments can be customized via build flags (see Configuration section). | ||
|
|
||
| ### Basic Setup | ||
|
|
||
| Add to your `platformio_override.ini`: | ||
|
|
||
| ```ini | ||
| [env:esp32_gc9a01] | ||
| extends = env:esp32dev | ||
| upload_speed = 460800 | ||
| monitor_speed = 115200 | ||
| custom_usermods = | ||
| usermod_v2_gc9a01_display | ||
| usermod_v2_rotary_encoder_ui_ALT | ||
| build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} | ||
| -D WLED_DEBUG | ||
| -D WLED_DISABLE_BROWNOUT_DET | ||
| -D USERMOD_GC9A01_DISPLAY | ||
| -DUSER_SETUP_LOADED=1 | ||
| -DGC9A01_DRIVER=1 | ||
| -DTFT_WIDTH=240 | ||
| -DTFT_HEIGHT=240 | ||
| -DTFT_MOSI=23 | ||
| -DTFT_SCLK=18 | ||
| -DTFT_CS=5 | ||
| -DTFT_DC=15 | ||
| -DTFT_RST=17 | ||
| -DTFT_BL=26 | ||
| -DTOUCH_CS=-1 | ||
| -DLOAD_GLCD=1 | ||
| -DLOAD_FONT2=1 | ||
| -DLOAD_FONT4=1 | ||
| -DLOAD_FONT6=1 | ||
| -DLOAD_FONT7=1 | ||
| -DLOAD_FONT8=1 | ||
| -DLOAD_GFXFF=1 | ||
| -DSMOOTH_FONT=1 | ||
| -DSPI_FREQUENCY=27000000 | ||
| # Rotary encoder settings | ||
| -D ENCODER_DT_PIN=25 | ||
| -D ENCODER_CLK_PIN=32 | ||
| -D ENCODER_SW_PIN=27 | ||
| ``` | ||
|
|
||
| ### Debug Information | ||
|
|
||
| Enable debug output with `-D WLED_DEBUG` to see detailed logging: | ||
|
|
||
| - Display initialization status and TFT_eSPI configuration | ||
| - Update timing information and redraw triggers | ||
| - State change detection (brightness, effect, colors, etc.) | ||
| - Sleep/wake events and timeout tracking | ||
| - Error conditions and recovery attempts | ||
|
|
||
| Debug output appears in Serial Monitor at 115200 baud. | ||
|
|
||
| ## Change log | ||
|
|
||
| - **v1** (2025-10-06): | ||
| - First public release | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.