|
TinyGPU
|
Common base class for SPI-based display drivers. More...
#include <DisplayDriverSPI.h>


Public Member Functions | |
| DisplayDriverSPI (SPIClass &spi, int8_t cs, int8_t dc, int8_t rst=-1, size_t xOffset=0, size_t yOffset=0, uint32_t frequencyHz=40000000, uint32_t readFrequencyHz=15000000, size_t width=240, size_t height=320) | |
| size_t | width () const override |
| size_t | height () const override |
| bool | writeData (ISurface< RGB_T > &surface) override |
| void | setSwapOutputBytes (bool swap) |
| bool | writeData (ISurface< RGB_T > &surface, size_t x, size_t y) override |
| bool | readData (ISurface< RGB_T > &surface, size_t x, size_t y) |
Public Member Functions inherited from DisplayDriver< RGB_T > | |
| virtual | ~DisplayDriver ()=default |
| virtual bool | begin ()=0 |
| virtual void | end () |
| virtual bool | writeData (ISurface< RGB_T > &surface)=0 |
| virtual bool | writeData (ISurface< RGB_T > &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, RGB_T color) |
Protected Member Functions | |
| void | setColumnRowAddress (size_t x, size_t y, size_t w, size_t h) |
| bool | setAddressWindow (size_t x, size_t y, size_t w, size_t h) override |
| void | setupPinsAndReset () |
| void | writeCommand (uint8_t cmd) |
| void | writeData16 (uint16_t d1, uint16_t d2) |
| void | writeData8 (uint8_t data) |
| void | writeDataN (std::initializer_list< uint8_t > bytes) |
| virtual bool | setAddressWindow (size_t x, size_t y, size_t w, size_t h)=0 |
Protected Attributes | |
| SPIClass & | spi_ |
| int8_t | cs_ |
| int8_t | dc_ |
| int8_t | rst_ |
| size_t | xOffset_ |
| size_t | yOffset_ |
| uint32_t | frequencyHz_ |
| uint32_t | readFrequencyHz_ |
| size_t | width_ |
| size_t | height_ |
| bool | swapOutputBytes_ = false |
Protected Attributes inherited from DisplayDriver< RGB_T > | |
| Font5x7< RGB_T > | defaultFont |
Common base class for SPI-based display drivers.
|
inline |
| width/height | the panel's addressable resolution, as reported by width()/height() - subclasses with a rotation concept (e.g. ILI9341Driver) override width()/height() themselves instead and can ignore these. |
|
inlineoverridevirtual |
Implements DisplayDriver< RGB_T >.
Reimplemented in ILI9341Driver< RGB_T >, ILI9341Driver< tinygpu::RGB565 >, and ILI9342Driver< RGB_T >.
|
inline |
|
inlineoverrideprotectedvirtual |
Implements DisplayDriver< RGB_T >.
|
inlineprotected |
|
inline |
Swaps each pixel's two bytes right before they go out over SPI (see writeData()) - off by default, since RGB_T (RGB565) already stores values pre-swapped to the wire order most panels expect (see RGB565.h). Some panels/wiring combinations expect the opposite of that default (symptom: colors come out scrambled/inverted-looking - e.g. a purple app bar rendering green, a light background rendering black - across everything drawn, not just images); this is the one place all pixel data funnels through before hitting the wire, so flipping it here fixes fills/text/images uniformly instead of needing a per-source fix (contrast JPEGParser::setSwapBytes(), which only affects decoded images).
|
inlineprotected |
|
inlineoverridevirtual |
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< RGB_T >.
Reimplemented in ILI9341Driver< RGB_T >, ILI9341Driver< tinygpu::RGB565 >, and ILI9342Driver< RGB_T >.
|
inlineprotected |
|
inlineoverridevirtual |
Implements DisplayDriver< RGB_T >.
|
inlineoverridevirtual |
Implements DisplayDriver< RGB_T >.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Writes each byte as a separate writeData8() call - a convenience for sending a command's multi-byte parameter list during init sequences.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |