TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DisplayDriverDSI< RGB_T > Class Template Reference

Base driver for MIPI-DSI panels. All of the DSI PHY/lane bring-up, command-channel writes and video-timing/framebuffer scan-out are handled by an IDSIBus (dependency-injected, see the constructor below), not by this class - this class only turns ISurface writes into drawBitmap() calls and byte-swaps into the bus's expected native RGB565 order (see writeData()). That split is what makes this family portable: adding a platform means implementing IDSIBus once (see DSIBusESP32.h, the ESP32-P4 DBI+DPI path; DSIBusSTM32.h, STM32's HAL_DSI+LTDC path), while every panel subclass (ST7701Driver, ...) keeps working unchanged on every platform that has a bus. More...

#include <DisplayDriverDSI.h>

Inheritance diagram for DisplayDriverDSI< RGB_T >:
Inheritance graph
[legend]
Collaboration diagram for DisplayDriverDSI< RGB_T >:
Collaboration graph
[legend]

Public Member Functions

 DisplayDriverDSI (IDSIBus &bus, size_t width, size_t height)
 
size_t width () const override
 
size_t height () const override
 
void end () override
 
 ~DisplayDriverDSI () override
 
bool writeData (ISurface< RGB_T > &surface) override
 
bool writeData (ISurface< RGB_T > &surface, size_t x, size_t y) override
 
- 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

bool beginBus ()
 
bool writeCommand (uint8_t cmd, const uint8_t *param=nullptr, size_t len=0)
 Sends one command + parameter bytes over the DSI command channel.
 
bool finishInit ()
 
void setBacklight (bool on)
 
void setBacklightPin (int8_t backlight)
 
bool setAddressWindow (size_t, size_t, size_t, size_t) override
 
virtual bool setAddressWindow (size_t x, size_t y, size_t w, size_t h)=0
 

Protected Attributes

IDSIBus * bus_
 
size_t width_
 
size_t height_
 
int8_t backlight_ = -1
 
- Protected Attributes inherited from DisplayDriver< RGB_T >
Font5x7< RGB_T > defaultFont
 

Detailed Description

template<typename RGB_T = RGB565>
class tinygpu::DisplayDriverDSI< RGB_T >

Base driver for MIPI-DSI panels. All of the DSI PHY/lane bring-up, command-channel writes and video-timing/framebuffer scan-out are handled by an IDSIBus (dependency-injected, see the constructor below), not by this class - this class only turns ISurface writes into drawBitmap() calls and byte-swaps into the bus's expected native RGB565 order (see writeData()). That split is what makes this family portable: adding a platform means implementing IDSIBus once (see DSIBusESP32.h, the ESP32-P4 DBI+DPI path; DSIBusSTM32.h, STM32's HAL_DSI+LTDC path), while every panel subclass (ST7701Driver, ...) keeps working unchanged on every platform that has a bus.

RP2040 has no MIPI-DSI peripheral on any variant, so there is no RP2040 IDSIBus backend - QSPI/SPI panels (DisplayDriverQSPI.h/ DisplayDriverSPI.h) are the only display option on that platform.

Constructor & Destructor Documentation

◆ DisplayDriverDSI()

DisplayDriverDSI ( IDSIBus &  bus,
size_t  width,
size_t  height 
)
inline

◆ ~DisplayDriverDSI()

~DisplayDriverDSI ( )
inlineoverride

Member Function Documentation

◆ beginBus()

bool beginBus ( )
inlineprotected

Sets up the bus (PHY/lanes/command channel). Subclasses call this first thing in their begin(), then send their panel's init register sequence via writeCommand(), then finishInit() - the same beginBus()-then-init-sequence-then-finishInit() division of labor DisplayDriverQSPI's subclasses use for beginBus()/writeCommand().

◆ end()

void end ( )
inlineoverridevirtual

Reimplemented from DisplayDriver< RGB_T >.

◆ finishInit()

bool finishInit ( )
inlineprotected

Finalizes the panel after the init register sequence has been sent - active video scan-out starts once this returns true.

◆ height()

size_t height ( ) const
inlineoverridevirtual

◆ setAddressWindow()

bool setAddressWindow ( size_t  ,
size_t  ,
size_t  ,
size_t   
)
inlineoverrideprotectedvirtual

◆ setBacklight()

void setBacklight ( bool  on)
inlineprotected

◆ setBacklightPin()

void setBacklightPin ( int8_t  backlight)
inlineprotected

◆ width()

size_t width ( ) const
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 >.

◆ writeCommand()

bool writeCommand ( uint8_t  cmd,
const uint8_t *  param = nullptr,
size_t  len = 0 
)
inlineprotected

Sends one command + parameter bytes over the DSI command channel.

◆ writeData() [1/2]

bool writeData ( ISurface< RGB_T > &  surface)
inlineoverridevirtual

◆ writeData() [2/2]

bool writeData ( ISurface< RGB_T > &  surface,
size_t  x,
size_t  y 
)
inlineoverridevirtual

Member Data Documentation

◆ backlight_

int8_t backlight_ = -1
protected

◆ bus_

IDSIBus* bus_
protected

◆ height_

size_t height_
protected

◆ width_

size_t width_
protected

The documentation for this class was generated from the following file: