AD100 LVGL_Demo
一 软件配置
以RD_AD100_EVB_V1.0开发板为例 , 屏幕为FW050, 触摸屏为gt9xx, 使用ad100_evb_v10_lvgl_nor_defconfig配置 , 实际根据硬件需要配置
1.1 LCD相关配置
打开iconfigtool配置页面

lcd设备配置

1.2 设备电源管理配置
因为lcd和tp电源共用一个io, 需要配置下电源管理

1.3 背光配置

pwm相关

1.4 触摸屏配置

i2c配置


1.5 framebuffer 配置

1.6 lvgl配置

保存配置

二 测试程序
2.1 编写测试程序
lvgl demo位于freertos/example/third_party/lvgl_example.c
#include "third_party/lvgl/lvgl_ingenic.h"
#include <devices/gt9xx_touch.h>
#include <driver/backlight.h>
#include "third_party/lvgl/lvgl/lvgl.h"
#include "third_party/lvgl/lvgl/examples/lv_examples.h"
#include "third_party/lvgl/lvgl/demos/lv_demos.h"
void backlight_use(void)
{
struct backlight *lcd_pwm;
#if defined(CONFIG_PWM_BACKLIGHT0_NAME)
lcd_pwm = backlight_open(CONFIG_PWM_BACKLIGHT0_NAME);
#elif defined(CONFIG_GPIO_BACKLIGHT0_NAME)
lcd_pwm = backlight_open(CONFIG_GPIO_BACKLIGHT0_NAME);
#else
lcd_pwm = backlight_open("lcd_pwm");
#endif
if (lcd_pwm != NULL)
backlight_set_brightness(lcd_pwm, backlight_get_maxbrightness(lcd_pwm));
}
void lvgl_test(void)
{
const char *fb_path = "fb0";
char *device_name = "gt9xx";
/*该demo以gt9xx触摸屏作为lvgl input*/
struct goodix_ts_data gt9xx;
goodix_touch_init(>9xx);
backlight_use();
lv_init();
int ret = lvgl_init_fb_display(fb_path);
assert(!ret);
ret = lvgl_init_tp_input(device_name);
assert(!ret);
lv_demo_widgets();
lvgl_start(5*1000);
}
2.2 编译和使用测试程序
修改 vendor/vendor.c ,测试lvgl, 内容如下:
#include <stdio.h>
#include <../example/third_party/lvgl_example.c>
#include <common.h>
void vendor_init(void *arg)
{
lvgl_test();
printf("vendor init...\n");
}