Problem loading GFX with latest versions #751
Replies: 5 comments 3 replies
-
|
Hi, Please try with the develop branch, I suspect it will produce the same error but need a confirmation before investigating. |
Beta Was this translation helpful? Give feedback.
-
|
Have the same error. Compilation error: exit status 1 |
Beta Was this translation helpful? Give feedback.
-
|
Have changed the code as above, but after compiling and running the application, now the screen stay black. //#define LGFX_USE_V1
#include <LovyanGFX.hpp>
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
#include <driver/i2c.h>
#define LGFX_MAKERFABS_MATOUCH_1024X768
class LGFX : public lgfx::LGFX_Device
{
public:
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_GT911 _touch_instance;
LGFX(void)
{
{
auto cfg = _panel_instance.config();
#if defined ( LGFX_MAKERFABS_MATOUCH_1024X768 )
cfg.memory_width = 1024;
cfg.panel_width = 1024;
cfg.memory_height = 600;
cfg.panel_height = 600;
#else
cfg.memory_width = 800;
cfg.panel_width = 800;
cfg.memory_height = 480;
cfg.panel_height = 480;
#endif
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
{
auto cfg = _panel_instance.config_detail();
cfg.use_psram = 1;
_panel_instance.config_detail(cfg);
}
{
auto cfg = _bus_instance.config();
cfg.panel = &_panel_instance;
cfg.pin_d0 = GPIO_NUM_8; // B0
cfg.pin_d1 = GPIO_NUM_3; // B1
cfg.pin_d2 = GPIO_NUM_46; // B2
cfg.pin_d3 = GPIO_NUM_9; // B3
cfg.pin_d4 = GPIO_NUM_1; // B4
cfg.pin_d5 = GPIO_NUM_5; // G0
cfg.pin_d6 = GPIO_NUM_6; // G1
cfg.pin_d7 = GPIO_NUM_7; // G2
cfg.pin_d8 = GPIO_NUM_15; // G3
cfg.pin_d9 = GPIO_NUM_16; // G4
cfg.pin_d10 = GPIO_NUM_4; // G5
cfg.pin_d11 = GPIO_NUM_45; // R0
cfg.pin_d12 = GPIO_NUM_48; // R1
cfg.pin_d13 = GPIO_NUM_47; // R2
cfg.pin_d14 = GPIO_NUM_21; // R3
cfg.pin_d15 = GPIO_NUM_14; // R4
cfg.pin_henable = GPIO_NUM_40;
cfg.pin_vsync = GPIO_NUM_41;
cfg.pin_hsync = GPIO_NUM_39;
cfg.pin_pclk = GPIO_NUM_42;
cfg.freq_write = 16000000;
cfg.hsync_polarity = 0;
cfg.hsync_front_porch = 80;
cfg.hsync_pulse_width = 4;
cfg.hsync_back_porch = 16;
cfg.vsync_polarity = 0;
cfg.vsync_front_porch = 22;
cfg.vsync_pulse_width = 4;
cfg.vsync_back_porch = 4;
cfg.pclk_idle_high = 1;
_bus_instance.config(cfg);
}
_panel_instance.setBus(&_bus_instance);
{
auto cfg = _light_instance.config();
cfg.pin_bl = GPIO_NUM_10;
cfg.invert = true;
_light_instance.config(cfg);
}
_panel_instance.light(&_light_instance);
{
auto cfg = _touch_instance.config();
cfg.x_min = 0;
cfg.y_min = 0;
cfg.bus_shared = false;
cfg.offset_rotation = 0;
// I2C接続
cfg.i2c_port = I2C_NUM_1;
cfg.pin_sda = GPIO_NUM_17;
cfg.pin_scl = GPIO_NUM_18;
cfg.pin_int = GPIO_NUM_NC;
cfg.pin_rst = GPIO_NUM_38;
cfg.x_max = 800;
cfg.y_max = 480;
cfg.freq = 400000;
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
setPanel(&_panel_instance);
}
};`
And my code to test 👍
`// esp 3.1.2
#include "Matouch7.h"
// https://lang-ship.com/blog/files/LovyanGFX/LovyanGFX_BASIC.pdf
// microSD card
#define PIN_SD_CMD 11
#define PIN_SD_CLK 12
#define PIN_SD_D0 13
// i2c_port
#define I2C_SDA_PIN 17
#define I2C_SCL_PIN 18
static LGFX lcd; // Create TFT object
static LGFX_Sprite sprite(&lcd);
void setup() {
Serial.begin(115200);
lcd.init();
lcd.setRotation(0); // Adjust according to your screen orientation
lcd.fillScreen( TFT_WHITE );
lcd.setTextSize(3.0);
lcd.setTextDatum(MC_DATUM);
lcd.setFont(&fonts::FreeSerifBold9pt7b);
lcd.setTextColor(TFT_BLACK);
sprite.setPsram(true);
sprite.createSprite(1024,600);
sprite.setTextSize(3.0);
sprite.setTextDatum(MC_DATUM);
sprite.setFont(&fonts::FreeSerifBold9pt7b);
sprite.setTextColor(TFT_BLACK);
Serial.println(millis());
sprite.fillSprite(TFT_BLACK);
sprite.drawCircle(512, 300, 300, TFT_WHITE);
sprite.pushSprite(0,0);
Serial.println(millis());
}
void loop() {
for (int i=0; i<300; i++) {
int t1 = millis();
sprite.fillSprite(TFT_WHITE);
sprite.fillCircle(512, 300, i, TFT_BLUE);
sprite.drawString(String(millis()-t1), 512, 300, 1);
sprite.pushSprite(0,0);
}
}
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the last code. It is now working. I'm very glad that is is solved. |
Beta Was this translation helpful? Give feedback.
-
|
I also confirm the above snippet code work. please do pull request! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have installed esp32 version 3.3.0 and LovyanGFX version 1.27.
When compiling get error in
static void _gpio_pin_sig(uint32_t pin, uint32_t sig) { gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[pin], PIN_FUNC_GPIO); // error gpio_set_direction((gpio_num_t)pin, GPIO_MODE_OUTPUT); esp_rom_gpio_connect_out_signal(pin, sig, false, false); }When I go back to an older version the problem with the line
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[pin], PIN_FUNC_GPIO);gives an error. Is there a solution to avoid this.
Beta Was this translation helpful? Give feedback.
All reactions