Skip to content

Commit

Permalink
esp-idf v5.4 panel rgb test
Browse files Browse the repository at this point in the history
  • Loading branch information
tobozo committed Nov 14, 2024
1 parent 0409f8b commit 3fcfe80
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
13 changes: 5 additions & 8 deletions examples/Test/build_test/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
#define DUMMY_DISPLAY
#endif

#if defined ESP32S3
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
#endif


#if defined DUMMY_DISPLAY
// AUTODETECT will fail, so let's build a dummy object
Expand Down Expand Up @@ -45,14 +50,6 @@

#if !defined SKIP_I2C_TEST


#if defined ESP32S3
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
#endif



class LGFX_I2C : public lgfx::LGFX_Device
{
lgfx::Bus_I2C _bus_instance;
Expand Down
19 changes: 8 additions & 11 deletions src/lgfx/v1/platforms/esp32s3/Bus_RGB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ Original Source:
#endif

#if SOC_LCDCAM_RGB_LCD_SUPPORTED || CONFIG_SOC_LCDCAM_RGB_LCD_SUPPORTED || (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0))
#define LGFX_USE_LCD_PERIPH_RGB_SIGNALS
// lcd_periph_signals() function was renamed to lcd_periph_rgb_signals()
#define LGFX_LCD_PERIPH_RGB_SIGNALS lcd_periph_rgb_signals
#else
#define LGFX_LCD_PERIPH_RGB_SIGNALS lcd_periph_signals
#endif


Expand Down Expand Up @@ -161,11 +164,9 @@ namespace lgfx
static constexpr const uint8_t rgb332sig_tbl[] = { 1, 0, 1, 0, 1, 2, 3, 4, 2, 3, 4, 5, 6, 5, 6, 7 };
static constexpr const uint8_t rgb565sig_tbl[] = { 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7 };
auto tbl = (pixel_bytes == 2) ? rgb565sig_tbl : rgb332sig_tbl;
#if defined LGFX_USE_LCD_PERIPH_RGB_SIGNALS
auto sigs = &lcd_periph_rgb_signals.panels[_cfg.port];
#else
auto sigs = &lcd_periph_signals.panels[_cfg.port];
#endif

auto sigs = &LGFX_LCD_PERIPH_RGB_SIGNALS.panels[_cfg.port];

for (size_t i = 0; i < 16; i++) {
_gpio_pin_sig(_cfg.pin_data[i], sigs->data_sigs[tbl[i]]);
}
Expand Down Expand Up @@ -314,11 +315,7 @@ namespace lgfx

int isr_flags = ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_SHARED;

#if defined LGFX_USE_LCD_PERIPH_RGB_SIGNALS
auto sigs = &lcd_periph_rgb_signals.panels[_cfg.port];
#else
auto sigs = &lcd_periph_signals.panels[_cfg.port];
#endif
auto sigs = &LGFX_LCD_PERIPH_RGB_SIGNALS.panels[_cfg.port];

esp_intr_alloc_intrstatus(sigs->irq_id, isr_flags,
(uint32_t)&dev->lc_dma_int_st,
Expand Down

0 comments on commit 3fcfe80

Please sign in to comment.