Runtime eink driver selection for pico to support GDEY042T81#11
Open
tahnok wants to merge 5 commits intojoeycastillo:mainfrom
Open
Runtime eink driver selection for pico to support GDEY042T81#11tahnok wants to merge 5 commits intojoeycastillo:mainfrom
tahnok wants to merge 5 commits intojoeycastillo:mainfrom
Conversation
This commit adds support for both IL0398 and SSD1683 e-paper displays
on the Raspberry Pi Pico platform, with automatic display detection via
an SD card configuration file.
Key changes:
- Created OpenBook_EPD base class to provide common interface for both
display drivers (IL0398 and SSD1683)
- Modified OpenBookDevice to support runtime display driver selection
instead of compile-time selection
- Added configuration file loader that reads /openbook.cfg from SD card
- Config file format: "display=IL0398" or "display=SSD1683"
- Falls back to platform defaults if config file not found:
* Pico defaults to IL0398 (original display)
* ESP32 defaults to SSD1683 (new display)
- Both display drivers now compile for all platforms
- Updated all references from compile-time OPEN_BOOK_EPD macro to
runtime OpenBook_EPD* pointer
- Added openbook.cfg.example with documentation
Benefits:
- Users can now use the newer SSD1683 display on Pico hardware
- No firmware recompilation needed to switch displays
- Maintains backward compatibility with existing hardware
- Simple, user-friendly configuration via SD card
Files modified:
- src/components/display/OpenBook_EPD.h: Added base class
- src/components/display/OpenBook_IL0398.h: Inherit from OpenBook_EPD
- src/components/display/OpenBook_SSD1683.h: Inherit from OpenBook_EPD
- src/components/hardware/OpenBookDevice.{h,cpp}: Runtime driver selection
- src/app/OpenBookTasks.cpp: Updated display type references
- src/main.cpp: Updated display type reference
- openbook.cfg.example: Configuration file documentation
The previous commit introduced OpenBook_EPD as a base class, but the constructors in OpenBook_IL0398 and OpenBook_SSD1683 were still trying to initialize Adafruit_EPD directly instead of OpenBook_EPD. This caused compilation errors because Adafruit_EPD is no longer a direct base class - it's now inherited through OpenBook_EPD. Changes: - Updated both constructors in OpenBook_IL0398.cpp to call OpenBook_EPD - Updated both constructors in OpenBook_SSD1683.cpp to call OpenBook_EPD This fixes the CI build errors.
Added missing getDisplayMode() implementation for OpenBook_IL0398 and OpenBook_SSD1683. These methods were declared in the headers and marked as pure virtual in the OpenBook_EPD base class, but were not implemented in the .cpp files, causing linker errors. Both implementations return the currentDisplayMode member variable that tracks the current display refresh mode. This fixes the CI linker errors: - undefined reference to `OpenBook_IL0398::getDisplayMode()' - undefined reference to `OpenBook_SSD1683::getDisplayMode()'
The previous approach of reading display type from an SD card config file had a timing issue on Pico: the display was initialized before the SD card was ready. This commit replaces the config file approach with automatic hardware detection based on busy pin polarity differences between the two displays: - IL0398: busy pin is HIGH when ready (LOW = busy) - SSD1683: busy pin is LOW when ready (HIGH = busy) After a hardware reset, the detection code reads the busy pin state to determine which display is connected. This eliminates the need for any user configuration. Changes: - Replace loadDisplayConfig() with detectDisplayType() - Remove openbook.cfg.example (no longer needed) - Detection falls back to platform defaults if no busy pin 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds support for both old IL0398 and new GDEY042T81/SSD1683 e-paper displays on the Raspberry Pi Pico platform, with automatic hardware-based display detection.
A substantial amount of this code was written using Claude Code
Display Detection
The firmware automatically detects which display is connected by exploiting a key difference in busy pin polarity:
After a hardware reset, the
detectDisplayType()function reads the busy pin state to determine which display is connected. No user configuration is required.Key Changes
OpenBook_EPDbase class to provide common interface for both display driversOpenBookDeviceto support runtime display driver selectiondetectDisplayType()function that probes the hardware via busy pin polarityOPEN_BOOK_EPDmacro to runtimeOpenBook_EPD*pointerBenefits
Fallback Behavior
If no busy pin is connected, the code falls back to platform defaults: