Description
Good Day at all. I’m trying to get LVGL to work on an Arduino Mega 2560 with a 3.2 ITDB02 shield. On an ESP8266 I managed to do this with another LDC display and the TFT_eSPI library. On the Mega where I use the UTFT library for the display, this doesn’t work.
The following error message appears:
libraries\URTouch/URTouch.h:64:3: error: ‘regtype’ does not name a type
regtype *P_CLK, *P_CS, *P_DIN, *P_DOUT, *P_IRQ;
libraries\URTouch/URTouch.h:65:3: error: ‘regsize’ does not name a type
regsize B_CLK, B_CS, B_DIN, B_DOUT, B_IRQ;
libraries\UTFT/UTFT.h:210:49: error: ‘bitmapdatatype’ has not been declared
void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
libraries\UTFT/UTFT.h:211:49: error: ‘bitmapdatatype’ has not been declared
void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
libraries\UTFT/UTFT.h:233:3: error: ‘regtype’ does not name a type
regtype *P_RS, *P_WR, *P_CS, *P_RST, *P_SDA, *P_SCL, *P_ALE;
libraries\UTFT/UTFT.h:234:3: error: ‘regsize’ does not name a type
regsize B_RS, B_WR, B_CS, B_RST, B_SDA, B_SCL, B_ALE;
Desktop\Test_Porting\Test_Porting.ino: In function ‘void ex_disp_flush(int32_t, int32_t, int32_t, int32_t, const lv_color_t*)’:
Test_Porting:27:18: error: ‘disp’ was not declared in this scope
lv_flush_ready(disp);
Test_Porting:27:22: error: ‘lv_flush_ready’ was not declared in this scope
lv_flush_ready(disp);
Desktop\Test_Porting\Test_Porting.ino: In function ‘void setup()’:
Test_Porting:62:23: error: ‘my_disp_flush’ was not declared in this scope
disp_drv.flush_cb = my_disp_flush;
I don’t know where that comes from.
The code works fine on the ESP8266 with other graphics libraries. Does anyone have experience with an Arduino Mega and LVGL?
Thanks in advance for answers.
best regards
David
What MCU/Processor/Board and compiler are you using?
Arduino Mega 2560 with Arduino IDE
What LVGL version are you using?
V7 latest
What do you want to achieve?
Get the LVGL running on the Arduino Mega 2560 and the 3.2 ITDB02 shield
What have you tried so far?
Description
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
#include <URTouch.h>
#include <URTouchCD.h>
#include <memorysaver.h>
#include <UTFT.h>
#include <lvgl.h>
static lv_disp_buf_t disp_buf;
static lv_color_t buf[LV_HOR_RES_MAX * 10];
UTFT myGLCD(ITDB32S, 38, 39, 40, 41);
URTouch myTouch( 6, 5, 4, 3, 2);
static void ex_disp_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
{
int32_t x;
int32_t y;
for (y = y1; y <= y2; y++) {
for (x = x1; x <= x2; x++)
{
LCD_WritePixel(x, y, color_p->full);
color_p++;
}
}
lv_flush_ready(disp);
}
void timer_1(void)
{
if (millis() % 1000 > 1)
{
lv_tick_inc(1);
}
}
void LCD_WritePixel(int x, int y, int color)
{
myGLCD.setColor(color);
myGLCD.drawPixel(x, y);
}
void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
/*Initialize the display*/
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = 320;
disp_drv.ver_res = 240;
disp_drv.flush_cb = my_disp_flush;
disp_drv.buffer = &disp_buf;
lv_disp_drv_register(&disp_drv); /*Register the driver and save the created display objects*/
}
void loop()
{
timer_1();
//No Realtime
if (millis() % 1000 > 5)
{
lv_task_handler();
}
}