Skip to content

Fix ST7735 128×128 display: correct color order and add UI scaling#341

Draft
Copilot wants to merge 5 commits intodevfrom
copilot/add-display-hat-support
Draft

Fix ST7735 128×128 display: correct color order and add UI scaling#341
Copilot wants to merge 5 commits intodevfrom
copilot/add-display-hat-support

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 20, 2026

Description

The ST7735S 128×128 display (Waveshare 1.44" LCD HAT) has two issues: colors are wrong (orange renders as blue) and UI elements are unscaled (designed for 240×240, drawn raw into 128×128).

Color fix (ST7735.py): MADCTL 0x600x68. The ST7735S panel has BGR sub-pixel order; without the BGR bit (0x08), red and blue channels are swapped.

Scaling fix (renderer.py): The ST7735 canvas is now 240×240 (the UI's native design resolution) instead of 128×128. A new _resize_for_display() helper downscales via LANCZOS before sending to the physical display. This is a no-op for displays where canvas == physical size.

# renderer.py — ST7735 gets a virtual canvas at the UI design resolution elif self.display_type == DISPLAY_TYPE__ST7735: self.canvas_width = 240 self.canvas_height = 240 # All show_image paths downscale when canvas != display self.disp.show_image(self._resize_for_display(self.canvas), 0, 0)

No screenshots from physical hardware — this requires an ST7735 HAT to verify. The before state is the photo in the issue.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

  • I've run pytest and made sure all unit tests pass before sumbitting the PR

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I'm a fool
  • Yes
  • N/A

I have tested this PR on the following platforms/os:


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 3 commits March 20, 2026 13:29
- New ST7735.py driver with full init sequence, offsets, lazy init, SPI_NO_CS - Updated display_driver.py factory with ST7735 type - Added st7735_128x128 and desktop_128x128 display configurations - Updated renderer.py to handle ST7735 (same canvas orientation as ST7789) - 7 new tests for ST7735 driver (dimensions, SPI, lazy init, SLPOUT timing) - Updated docs/io_config.md with 1.44" HAT documentation Co-authored-by: 3rdIteration <2230318+3rdIteration@users.noreply.github.com>
…lution independence - QRDisplayScreen now uses renderer.canvas_width/height instead of 240, 240 - Keyboard default rect now computed from Renderer dimensions instead of hardcoded (0,40,240,240) Co-authored-by: 3rdIteration <2230318+3rdIteration@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for 1.44 inch LCD HAT display driver Add Waveshare 1.44" LCD HAT support (ST7735S, 128×128) Mar 20, 2026
Copilot AI requested a review from 3rdIteration March 20, 2026 13:39
@3rdIteration
Copy link
Copy Markdown
Owner

- ST7735.py: Change MADCTL from 0x60 to 0x68 (add BGR bit) to fix red/blue channel swap that caused orange buttons to appear blue - renderer.py: Render UI at 240x240 (native design resolution) and downscale to 128x128 for the ST7735 display, so all UI elements are properly scaled instead of being clipped Agent-Logs-Url: https://github.com/3rdIteration/seedsigner/sessions/570ee10b-35d2-41d6-a050-f7000f5a7992 Co-authored-by: 3rdIteration <2230318+3rdIteration@users.noreply.github.com>
Copilot AI changed the title Add Waveshare 1.44" LCD HAT support (ST7735S, 128×128) Fix ST7735 128×128 display: correct color order and add UI scaling Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants