Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f316c91
backported QSPI from PR #388
tobozo Aug 20, 2024
104ab4c
disable QSPI for arduino core 1.x.x
tobozo Aug 20, 2024
b343c84
limit QSPI to esp32 + idf version >= 5.x.x
tobozo Aug 20, 2024
8530917
Created Panel_NV3041A + user config
tobozo Aug 21, 2024
adb3b44
added amoled panels
tobozo Jan 12, 2025
f44a6f5
Merge branch 'master' of https://github.com/lovyan03/LovyanGFX into QSPI
tobozo Jan 12, 2025
8d3aa86
Merge branch 'develop' of https://github.com/lovyan03/LovyanGFX into …
tobozo Apr 20, 2025
332f288
tweaked bus config init
tobozo Apr 23, 2025
43c2fc5
added panel RM690B0 for Lilygo T4-S3
tobozo Apr 23, 2025
b7795b9
Added LGFX Config for Lilygo T4-S3 AMOLED/QSPI
tobozo Apr 23, 2025
eb920fe
remove test code
tobozo Apr 23, 2025
523502b
disabled QSPI for ESP32-P4
tobozo Apr 23, 2025
1e57e3b
Added Touch_CST226 (Lilygo T4-S3), grouped CSTxxx touch devices
tobozo Apr 24, 2025
abc2d86
Added touch support to Lilygo T4-S3 config example
tobozo Apr 24, 2025
a20b40f
commented out esp-specific debug statements
tobozo Apr 24, 2025
590b479
fix rotation when in framebuffer mode
tobozo Apr 24, 2025
f90a3d3
removed esp-idf version requirement when enabling Bus_QSPI
tobozo Apr 25, 2025
738b538
tweaked T4-S3 config, preload display
tobozo Apr 25, 2025
93feed6
re-enabled esp-idf version requirement (>=4.3.x) for Bus_QSPI
tobozo Apr 25, 2025
4744049
adjusted esp-idf version requirement (>=4.4.x) for Bus_QSPI
tobozo Apr 25, 2025
1b57e60
Added Panel_RM67162 and config sample for T-Display-S3-AMOLED
tobozo Apr 25, 2025
6c9fc7a
disabled setWindow memoizing
tobozo Apr 26, 2025
0913451
tweaked init
tobozo Apr 26, 2025
4ba4147
code cleanup
tobozo Apr 26, 2025
e94f7cb
Merge branch 'develop' of https://github.com/lovyan03/LovyanGFX into …
tobozo May 1, 2025
242ec9b
sync upstream + tweaks
tobozo May 1, 2025
589f014
added QSPI support to lgfx::Bus_SPI, deleted Bus_QSPI
tobozo May 1, 2025
8c8da76
updated bus type
tobozo May 1, 2025
8da5fac
code cleanup
tobozo May 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
737 changes: 737 additions & 0 deletions src/lgfx/v1/panel/Panel_AMOLED.cpp

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions src/lgfx/v1/panel/Panel_AMOLED.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/*----------------------------------------------------------------------------/
* Lovyan GFX - Graphics library for embedded devices.
*
* Original Source:
* https://github.com/lovyan03/LovyanGFX/
*
* Licence:
* [FreeBSD](https://github.com/lovyan03/LovyanGFX/blob/master/license.txt)
*
* Author:
* [lovyan03](https://twitter.com/lovyan03)
*
* Contributors:
* [ciniml](https://github.com/ciniml)
* [mongonta0716](https://github.com/mongonta0716)
* [tobozo](https://github.com/tobozo)
* /----------------------------------------------------------------------------*/
#pragma once

#if defined (ESP_PLATFORM)

#include "Panel_Device.hpp"
#include "Panel_FrameBufferBase.hpp"
#include "../platforms/common.hpp"
#include "../platforms/device.hpp"

#if defined LGFX_USE_QSPI

namespace lgfx
{
inline namespace v1
{
//----------------------------------------------------------------------------

struct Panel_AMOLED;

struct Panel_AMOLED_Framebuffer : Panel_FrameBufferBase
{
public:
Panel_AMOLED_Framebuffer(Panel_AMOLED* panel) : _panel(panel) { assert(_panel); }
~Panel_AMOLED_Framebuffer(void) { deinitFramebuffer(); }
bool init(bool use_reset) override;
bool initFramebuffer(uint_fast16_t w, uint_fast16_t h);
void deinitFramebuffer(void);

// TODO: reinit frame buffer when one of those functions is called
//color_depth_t setColorDepth(color_depth_t depth) override;
//void setRotation(uint_fast8_t r) override;
//void setInvert(bool invert) override;

void display(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h) override;

protected:
uint8_t* _frame_buffer = nullptr;
Panel_AMOLED* _panel = nullptr;
};


//----------------------------------------------------------------------------


struct Panel_AMOLED : public Panel_Device
{
protected:
bool _in_transaction = false;

Panel_AMOLED_Framebuffer* _panel_fb = nullptr;

uint16_t _colstart = 0;
uint16_t _rowstart = 0;

public:
Panel_AMOLED(void) { }

~Panel_AMOLED(void)
{
deinitPanelFb();
}

bool init(bool use_reset) override;
void beginTransaction(void) override;
void endTransaction(void) override;


bool initPanelFb()
{
if(_panel_fb)
return true;
_panel_fb = new Panel_AMOLED_Framebuffer(this);
_panel_fb->config(_cfg);
_panel_fb->setColorDepth(_write_depth);
_panel_fb->setRotation(getRotation());
return _panel_fb->init(false);
}

void deinitPanelFb()
{
if(_panel_fb) {
delete _panel_fb;
_panel_fb = nullptr;
}
}

Panel_AMOLED_Framebuffer* getPanelFb()
{
return _panel_fb;
}

void display(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h) override
{
if(_panel_fb)
_panel_fb->display(x, y, w, h);
}

void command_list(const uint8_t *addr);

void update_madctl();

void write_cmd(uint8_t cmd);
void start_qspi();
void end_qspi();
void write_bytes(const uint8_t* data, uint32_t len, bool use_dma);

color_depth_t setColorDepth(color_depth_t depth) override;
void setRotation(uint_fast8_t r) override;
void setInvert(bool invert) override;
void setSleep(bool flg) override;
void setPowerSave(bool flg) override;
void setBrightness(uint8_t brightness) override;

void waitDisplay(void) override;
bool displayBusy(void) override;

void writePixels(pixelcopy_t* param, uint32_t len, bool use_dma) override;
void writeBlock(uint32_t rawcolor, uint32_t len) override;

// not sure what these display commands are for, more testing needed
void setVerticalPartialArea(uint_fast16_t xs, uint_fast16_t xe);
void setPartialArea(uint_fast16_t ys, uint_fast16_t ye);

void setWindow(uint_fast16_t xs, uint_fast16_t ys, uint_fast16_t xe, uint_fast16_t ye) override;
void drawPixelPreclipped(uint_fast16_t x, uint_fast16_t y, uint32_t rawcolor) override;
void writeFillRectPreclipped(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h, uint32_t rawcolor) override;
void writeImage(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h, pixelcopy_t* param, bool use_dma) override;

// TODO: implement those
uint32_t readCommand(uint_fast16_t cmd, uint_fast8_t index, uint_fast8_t len) override { return 0;}
uint32_t readData(uint_fast8_t index, uint_fast8_t len) override { return 0;}
void readRect(uint_fast16_t x, uint_fast16_t y, uint_fast16_t w, uint_fast16_t h, void* dst, pixelcopy_t* param) override { };
};


//----------------------------------------------------------------------------
}

}


#endif
#endif
Loading