Skip to content

Commit

Permalink
Add de_idle_high and pclk_idle_high parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
moononournation committed Mar 19, 2023
1 parent 96a9d71 commit 2dbe44f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/PDQgraphicstest/PDQgraphicstest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel(
8 /* B0 */, 3 /* B1 */, 46 /* B2 */, 9 /* B3 */, 1 /* B4 */,
0 /* hsync_polarity */, 8 /* hsync_front_porch */, 4 /* hsync_pulse_width */, 43 /* hsync_back_porch */,
0 /* vsync_polarity */, 8 /* vsync_front_porch */, 4 /* vsync_pulse_width */, 12 /* vsync_back_porch */,
1 /* pclk_active_neg */, 9000000 /* prefer_speed */);
1 /* pclk_active_neg */, 9000000 /* prefer_speed */,
1 /* de_idle_high */, 1 /* pclk_idle_high */);
Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
480 /* width */, 272 /* height */, rgbpanel);
// option 2:
Expand Down
10 changes: 6 additions & 4 deletions src/databus/Arduino_ESP32RGBPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ Arduino_ESP32RGBPanel::Arduino_ESP32RGBPanel(
int8_t b0, int8_t b1, int8_t b2, int8_t b3, int8_t b4,
uint16_t hsync_polarity, uint16_t hsync_front_porch, uint16_t hsync_pulse_width, uint16_t hsync_back_porch,
uint16_t vsync_polarity, uint16_t vsync_front_porch, uint16_t vsync_pulse_width, uint16_t vsync_back_porch,
uint16_t pclk_active_neg, int32_t prefer_speed, bool useBigEndian)
uint16_t pclk_active_neg, int32_t prefer_speed, bool useBigEndian,
uint16_t de_idle_high, uint16_t pclk_idle_high)
: _de(de), _vsync(vsync), _hsync(hsync), _pclk(pclk),
_r0(r0), _r1(r1), _r2(r2), _r3(r3), _r4(r4),
_g0(g0), _g1(g1), _g2(g2), _g3(g3), _g4(g4), _g5(g5),
_b0(b0), _b1(b1), _b2(b2), _b3(b3), _b4(b4),
_hsync_polarity(hsync_polarity), _hsync_front_porch(hsync_front_porch), _hsync_pulse_width(hsync_pulse_width), _hsync_back_porch(hsync_back_porch),
_vsync_polarity(vsync_polarity), _vsync_front_porch(vsync_front_porch), _vsync_pulse_width(vsync_pulse_width), _vsync_back_porch(vsync_back_porch),
_pclk_active_neg(pclk_active_neg), _prefer_speed(prefer_speed), _useBigEndian(useBigEndian)
_pclk_active_neg(pclk_active_neg), _prefer_speed(prefer_speed), _useBigEndian(useBigEndian),
_de_idle_high(de_idle_high), _pclk_idle_high(pclk_idle_high)
{
}

Expand Down Expand Up @@ -56,9 +58,9 @@ uint16_t *Arduino_ESP32RGBPanel::getFrameBuffer(int16_t w, int16_t h)
_panel_config->timings.vsync_front_porch = _vsync_front_porch;
_panel_config->timings.flags.hsync_idle_low = (_hsync_polarity == 0) ? 1 : 0;
_panel_config->timings.flags.vsync_idle_low = (_vsync_polarity == 0) ? 1 : 0;
_panel_config->timings.flags.de_idle_high = 1;
_panel_config->timings.flags.de_idle_high = _de_idle_high;
_panel_config->timings.flags.pclk_active_neg = _pclk_active_neg;
_panel_config->timings.flags.pclk_idle_high = 1;
_panel_config->timings.flags.pclk_idle_high = _pclk_idle_high;

_panel_config->data_width = 16; // RGB565 in parallel mode, thus 16bit in width
_panel_config->sram_trans_align = 8;
Expand Down
5 changes: 4 additions & 1 deletion src/databus/Arduino_ESP32RGBPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class Arduino_ESP32RGBPanel
int8_t b0, int8_t b1, int8_t b2, int8_t b3, int8_t b4,
uint16_t hsync_polarity, uint16_t hsync_front_porch, uint16_t hsync_pulse_width, uint16_t hsync_back_porch,
uint16_t vsync_polarity, uint16_t vsync_front_porch, uint16_t vsync_pulse_width, uint16_t vsync_back_porch,
uint16_t pclk_active_neg = 0, int32_t prefer_speed = GFX_NOT_DEFINED, bool useBigEndian = false);
uint16_t pclk_active_neg = 0, int32_t prefer_speed = GFX_NOT_DEFINED, bool useBigEndian = false,
uint16_t de_idle_high = 0, uint16_t pclk_idle_high = 0);

bool begin(int32_t speed = GFX_NOT_DEFINED);

Expand All @@ -87,6 +88,8 @@ class Arduino_ESP32RGBPanel
uint16_t _pclk_active_neg;
int32_t _prefer_speed;
bool _useBigEndian;
uint16_t _de_idle_high;
uint16_t _pclk_idle_high;

esp_lcd_panel_handle_t _panel_handle = NULL;
esp_rgb_panel_t *_rgb_panel;
Expand Down

0 comments on commit 2dbe44f

Please sign in to comment.