TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DSIBusESP32 Class Reference

IDSIBus backend for ESP32-P4, built on ESP-IDF's DBI (command channel) + DPI (video-timing channel) split - the interface ESP32-P4 exposes for DSI LCDs. A DPI panel has no address-window/RAMWR concept: esp_lcd_new_panel_dpi() allocates a screen-sized, DMA-scanned framebuffer up front, and esp_lcd_panel_draw_bitmap() writes straight into a rect of it - the continuously-running DPI bridge just scans whatever's currently there. More...

#include <DSIBusESP32.h>

Inheritance diagram for DSIBusESP32:
Inheritance graph
[legend]
Collaboration diagram for DSIBusESP32:
Collaboration graph
[legend]

Public Member Functions

 DSIBusESP32 (int8_t rst, size_t width, size_t height, uint8_t laneNum, uint32_t laneMbps, uint32_t dpiClockMhz, int8_t phyLdoChan, uint16_t phyLdoMv)
 
 ~DSIBusESP32 () override
 
void setVideoTiming (uint16_t hsyncPulseWidth, uint16_t hsyncBackPorch, uint16_t hsyncFrontPorch, uint16_t vsyncPulseWidth, uint16_t vsyncBackPorch, uint16_t vsyncFrontPorch)
 
bool begin () override
 
void end () override
 
bool writeCommand (uint8_t cmd, const uint8_t *param, size_t len) override
 
bool finishInit () override
 esp_lcd's DPI backend starts scanning out once this returns.
 
bool drawBitmap (size_t x0, size_t y0, size_t x1, size_t y1, const uint8_t *rgb565) override
 
- Public Member Functions inherited from IDSIBus
virtual ~IDSIBus ()=default
 
virtual bool begin ()=0
 
virtual void end ()=0
 
virtual bool writeCommand (uint8_t cmd, const uint8_t *param, size_t len)=0
 
virtual bool finishInit ()=0
 
virtual bool drawBitmap (size_t x0, size_t y0, size_t x1, size_t y1, const uint8_t *rgb565)=0
 

Detailed Description

IDSIBus backend for ESP32-P4, built on ESP-IDF's DBI (command channel) + DPI (video-timing channel) split - the interface ESP32-P4 exposes for DSI LCDs. A DPI panel has no address-window/RAMWR concept: esp_lcd_new_panel_dpi() allocates a screen-sized, DMA-scanned framebuffer up front, and esp_lcd_panel_draw_bitmap() writes straight into a rect of it - the continuously-running DPI bridge just scans whatever's currently there.

Only a single frame buffer (num_fbs = 1) is used, so a write landing while that region happens to be mid-scan can tear - this driver doesn't attempt the double-buffer-plus-dirty-rect scheme some vendor BSPs use to avoid that; same tradeoff DisplayDriverSPI/QSPI already accept for a torn/partial transfer landing mid-refresh.

This is a straight extraction of what used to live directly in DisplayDriverDSI before the IDSIBus split - behavior is unchanged.

Constructor & Destructor Documentation

◆ DSIBusESP32()

DSIBusESP32 ( int8_t  rst,
size_t  width,
size_t  height,
uint8_t  laneNum,
uint32_t  laneMbps,
uint32_t  dpiClockMhz,
int8_t  phyLdoChan,
uint16_t  phyLdoMv 
)
inline
Parameters
rstpanel reset GPIO, -1 if unused
width/heightpanel resolution in pixels
laneNumnumber of DSI data lanes
laneMbpsper-lane bit rate in Mbps
dpiClockMhzDPI (pixel) clock frequency in MHz
phyLdoChanon-chip LDO channel powering the DSI PHY, -1 if the board supplies that rail some other way (no LDO acquire is done)
phyLdoMvLDO output voltage in mV, only used if phyLdoChan >= 0

◆ ~DSIBusESP32()

~DSIBusESP32 ( )
inlineoverride

Member Function Documentation

◆ begin()

bool begin ( )
inlineoverridevirtual

Powers up and configures the DSI PHY/lanes and the command channel, and pulses panel reset if the concrete bus owns that pin. After this returns true, writeCommand() can be used to send the panel's init register sequence. Does not yet start active video scan-out - see finishInit().

Implements IDSIBus.

◆ drawBitmap()

bool drawBitmap ( size_t  x0,
size_t  y0,
size_t  x1,
size_t  y1,
const uint8_t *  rgb565 
)
inlineoverridevirtual

Writes rgb565 (native RGB565 byte order, width*height*2 bytes, tightly packed) into the rectangle [x0,y0)-[x1,y1) of the live framebuffer. Returns false on transport failure.

Implements IDSIBus.

◆ end()

void end ( )
inlineoverridevirtual

Releases peripheral/PHY resources. Safe to call even if begin() was never called or already failed.

Implements IDSIBus.

◆ finishInit()

bool finishInit ( )
inlineoverridevirtual

esp_lcd's DPI backend starts scanning out once this returns.

Implements IDSIBus.

◆ setVideoTiming()

void setVideoTiming ( uint16_t  hsyncPulseWidth,
uint16_t  hsyncBackPorch,
uint16_t  hsyncFrontPorch,
uint16_t  vsyncPulseWidth,
uint16_t  vsyncBackPorch,
uint16_t  vsyncFrontPorch 
)
inline

Sets the panel's DSI video timing (porches/sync widths, in pixels/ lines). Must be called before begin(); every panel documents its own values, there is no cross-panel default worth assuming.

◆ writeCommand()

bool writeCommand ( uint8_t  cmd,
const uint8_t *  param,
size_t  len 
)
inlineoverridevirtual

Sends one DCS/vendor register command with up to len parameter bytes over the DSI command channel. Returns false on transport failure.

Implements IDSIBus.


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