Hardware-SPI4 ST7735 driver for the WeAct MiniSTM32H7xx's bundled 0.96" 160x80 TFT.
More...
#include <LCDBoardsSTM32.h>
|
| | ST7735DriverHardwareSPI (SPIClass &spi, int8_t cs, int8_t dc, int8_t rst, size_t xOffset, size_t yOffset, size_t width, size_t height, uint8_t madctl, uint32_t frequencyHz=15000000) |
| |
| size_t | width () const override |
| |
| size_t | height () const override |
| |
| bool | begin () override |
| |
| bool | writeData (ISurface< RGB565 > &surface) override |
| |
| bool | writeData (ISurface< RGB565 > &surface, size_t x, size_t y) override |
| |
| virtual | ~DisplayDriver ()=default |
| |
| virtual bool | begin ()=0 |
| |
| virtual void | end () |
| |
| virtual bool | writeData (ISurface< RGB565 > &surface)=0 |
| |
| virtual bool | writeData (ISurface< RGB565 > &surface, size_t x, size_t y)=0 |
| |
| virtual void | setRotation (DisplayRotation rotation) |
| |
| virtual size_t | width () const=0 |
| |
| virtual size_t | height () const=0 |
| |
| void | writeColor (size_t width, size_t height, RGB565 color) |
| |
Hardware-SPI4 ST7735 driver for the WeAct MiniSTM32H7xx's bundled 0.96" 160x80 TFT.
Getting this panel working took a few rounds of hardware debugging:
- Passing NC as SPIClass's MISO pin hangs the STM32 core's spi_transfer() forever (TXP/RXP flag never sets) for SPI4 on this board's custom PeripheralPins variant - worked around by giving it a real but physically-unwired MISO pin instead (this panel has no MISO/SDO line).
- The backlight (see LCDBoardWeActMiniSTM32H750::begin()) needs analogWrite() PWM, not a plain digital HIGH.
- This panel needs CS held low continuously across a command byte and its data bytes (see writeCommand()'s comment) - closing and reopening CS between them makes it misparse the data as a new command instead of a parameter.
- It needs Adafruit_ST7735's INITR_MINI160x80_PLUGIN init parameters (colstart/rowstart/MADCTL/INVON - see begin() and LCDBoardWeActMiniSTM32H750's doc comment), not the plain INITR_MINI160x80 tab. With all of those fixed, hardware SPI4 works reliably and is much faster than a bit-banged fallback would be.
◆ ST7735DriverHardwareSPI()
| ST7735DriverHardwareSPI |
( |
SPIClass & |
spi, |
|
|
int8_t |
cs, |
|
|
int8_t |
dc, |
|
|
int8_t |
rst, |
|
|
size_t |
xOffset, |
|
|
size_t |
yOffset, |
|
|
size_t |
width, |
|
|
size_t |
height, |
|
|
uint8_t |
madctl, |
|
|
uint32_t |
frequencyHz = 15000000 |
|
) |
| |
|
inline |
- Parameters
-
| frequencyHz | SPI clock - 15MHz default matches WeAct's own factory firmware for this exact panel (SPI4 at APB1/8, ~120MHz/8), itself in line with the ST7735's typical 15-20MHz datasheet ceiling. |
◆ begin()
◆ height()
◆ setAddressWindow()
| bool setAddressWindow |
( |
size_t |
x, |
|
|
size_t |
y, |
|
|
size_t |
w, |
|
|
size_t |
h |
|
) |
| |
|
inlineoverrideprotectedvirtual |
◆ width()
Current addressable panel width/height in pixels - for a driver that supports setRotation(), these reflect the current rotation (landscape vs portrait swaps them; see isLandscapeFamily()), not necessarily the panel's native/physical orientation. Callers that need to lay out content (e.g. OutputTinyGPU's scale_to_fit target, or clearScreen()'s band loop) should read these fresh rather than caching their own copy, so a setRotation() call is picked up automatically without needing separate bookkeeping.
Implements DisplayDriver< RGB565 >.
◆ writeData() [1/2]
◆ writeData() [2/2]
The documentation for this class was generated from the following file: