Repository navigation
Board configs: nine ESP32 SPI panels use the bus's swap_bytes - #714
Merged
Merged
Conversation
T-Watch S3, T-Embed, FunHouse, ESP32 Audio Kit, P4X-EYE and the P4 Pico's 1.8 inch panel build their SPIBus with swap_bytes=True and tell the display driver not to swap (reverse_bytes_in_word=False). Firmware without swap_bytes raises TypeError for the keyword, and the config then builds the bus as before and lets the driver swap, as the P4X-EYE config already did for the dma keyword.
…o fallback The T-Watch S3, T-Embed, FunHouse, ESP32 Audio Kit, P4X-EYE, the P4 Pico's 1.8 inch panel and the three QT Py configs (ILI9341 EyeSPI on the ESP32 Pico and on the ESP32-S3, the Seeed round display on the ESP32-S3) pass swap_bytes=True and reverse_bytes_in_word=False. The QT Py configs lose their miso pin: touch is I2C and nothing reads the bus, and a bus with a miso pin is the machine.SPI one, which refuses the flag. Firmware without swap_bytes now stops with TypeError instead of quietly letting the driver swap.
bdbarnett
force-pushed
the
board-configs-swap-bytes
branch
from
November 18, 2026 21:45
1377a66 to
1b595d3
Compare
The panel stays dark until the camera enable (GPIO 12) is high, so a program that opened the display without the camera showed only the backlight. The config now raises it first, after board_peripherals has released the deep-sleep hold. The panel's colour order is BGR: with bgr=False, red and blue were exchanged.
Contributor
Author
|
ESP32-P4X-EYE, on a release-recipe build of omnipython-builds main ( |
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.
On ESP32 firmware that has
SPIBus(swap_bytes=True)(PyDevices/omnipython-builds#566), the bus swaps each colour as it copies the pixels into its DMA buffer, which saves a separate pass over every frame (a full 240 x 240 blit on the T-Watch S3 went from 28.8 to 24.0 ms). These configs now passswap_bytes=Trueto the bus andreverse_bytes_in_word=Falseto the display driver: T-Watch S3, T-Embed, FunHouse, ESP32 Audio Kit, ESP32-P4X-EYE, the ESP32-P4's 1.8 inch panel on the Pico, and the three QT Py configs (ILI9341 EyeSPI on the ESP32 Pico and on the ESP32-S3, the round display on the ESP32-S3). The P4X-EYE config also switches on the screen's power line (GPIO 12, the camera enable) before it builds the display, and uses BGR colour order.The configs need firmware with #566. On older firmware the bus raises
TypeError: extra keyword arguments givenwhen the config loads, and there is no fallback: update the firmware.The three QT Py configs lose their
misopin. A bus with amisopin is the blockingmachine.SPIone, which has nosend_color(), so it refuses the flag. Touch on those boards is I2C (an I2C scan finds the touch chip: 0x51 on the round display, 0x38 on the EyeSPI screen; no tap was done) and nothing else reads the bus. On the no-PSRAM QT Py ESP32-S3 the DMA bus needs a free block of internal RAM, so build it before Wi-Fi starts: after Wi-Fi was up the same constructor failed withESP_ERR_NO_MEM.The two configs for the 3.5" HX8357 FeatherWing (on the Feather ESP32 V2 and on the FeatherS3) are not changed. Their STMPE610 touch controller shares the SPI host through
machine.SPI, which can't share a host that the DMA bus owns, so they keep the blocking bus until the DMA bus can share its host.Seen on the panels with fills, blits and
pixel()writes (with #713): the T-Watch S3 and the T-Embed show red, green, blue, white from left to right as four unbroken vertical stripes; the QT Py ESP32-S3's round display and the QT Py ESP32 Pico's 2.8" screen, drawn in the order blue, white, red, green, show that order left to right.libbuild.py checkandinstallers --checkare clean.