-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add GC9A01 Round TFT Display UsermodFeature/gc9a01 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
51
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 44 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
14e46c2
Update .gitignore
srg74 bf5e5cc
Merge branch 'wled:main' into main
srg74 f91f5f3
Merge branch 'wled:main' into main
srg74 4e9978d
Merge branch 'wled:main' into main
srg74 e88b5fc
Merge branch 'wled:main' into main
srg74 101cea1
Merge branch 'wled:main' into main
srg74 359d5f1
Merge branch 'wled:main' into main
srg74 9236650
Merge branch 'wled:main' into main
srg74 1bc0fb0
Merge branch 'wled:main' into main
srg74 12dfa64
Merge branch 'wled:main' into main
srg74 4d803fc
Merge branch 'wled:main' into main
srg74 52a1468
Merge branch 'wled:main' into main
srg74 f242f21
Merge branch 'wled:main' into main
srg74 ff095c3
Merge branch 'wled:main' into main
srg74 5dd2332
Merge branch 'wled:main' into main
srg74 5d7793c
Merge branch 'wled:main' into main
srg74 6d3da55
Merge branch 'wled:main' into main
srg74 b0fe8a5
Merge branch 'wled:main' into main
srg74 9ed02f7
Merge branch 'wled:main' into main
srg74 9dc4472
Merge branch 'wled:main' into main
srg74 768d6c0
Merge branch 'wled:main' into main
srg74 5dd861b
Merge branch 'wled:main' into main
srg74 6f133f0
Merge branch 'wled:main' into main
srg74 fcf2797
Merge branch 'wled:main' into main
srg74 bb47ab7
Merge branch 'wled:main' into main
srg74 20df3d3
Merge branch 'wled:main' into main
srg74 35c8b02
Merge branch 'wled:main' into main
srg74 131728d
Merge branch 'wled:main' into main
srg74 7c29480
Merge branch 'wled:main' into main
srg74 4d469f2
Merge branch 'wled:main' into main
srg74 5266dbe
Merge branch 'wled:main' into main
srg74 f76422a
Merge branch 'wled:main' into main
srg74 aeea906
Merge branch 'wled:main' into main
srg74 c849310
Merge branch 'wled:main' into main
srg74 27a2f82
Merge branch 'wled:main' into main
srg74 6f57c60
Merge branch 'wled:main' into main
srg74 4946882
Merge branch 'wled:main' into main
srg74 b099eda
Update .gitignore
srg74 795e84c
Merge branch 'wled:main' into main
srg74 fff67c0
Merge branch 'wled:main' into main
srg74 bc939c9
Merge branch 'wled:main' into main
srg74 adbf826
Merge branch 'wled:main' into main
srg74 719fe49
Add GC9A01 round TFT display usermod
srg74 8d5a6cc
Fix palette navigation wraparound in rotary encoder ALT
srg74 fd0e9df
Address PR feedback: fix documentation and palette handling
srg74 406d281
Remove Wire library dependency from library.json
srg74 2d7d57f
Address PR feedback for GC9A01 usermod
srg74 7170b40
Address PR feedback for GC9A01 usermod
srg74 cafa73e
Use DEBUG_PRINTF/DEBUG_PRINTLN macros for consistency
srg74 dbdbcf5
Remove redundant Serial.println calls in rotary encoder usermod
srg74 c3bc3f0
Add null pointer checks for gc9a01Display->updateRedrawTime() 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,8 @@ | ||
| { | ||
| "name": "gc9a01_display", | ||
| "build": { "libArchive": false }, | ||
| "dependencies": { | ||
| "bodmer/TFT_eSPI": "^2.5.43", | ||
| "Wire": "" | ||
| } | ||
| } |
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,123 @@ | ||
| # GC9A01 Display Usermod | ||
|
|
||
| A fully-featured WLED usermod providing comprehensive visual interface on GC9A01 240x240 round TFT displays with complete rotary encoder integration. | ||
|
|
||
| Written by copilot AI with user interaction. | ||
|
|
||
| ## 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 | GPIO16 | Data/Command| Data/Command control | | ||
| | CS | GPIO5 | Chip Select | SPI chip select | | ||
| | BL | GPIO4 | 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 FLD_SPI_DEFAULT | ||
| -D HW_PIN_SCLKSPI=18 | ||
| -D HW_PIN_MOSISPI=23 | ||
| -D FLD_PIN_DC=5 | ||
| -D FLD_PIN_CS=15 | ||
| -D FLD_PIN_RESET=17 | ||
| -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.