使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

fan183579
Posts: 81
Joined: Thu Nov 25, 2021 6:37 am

使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

Postby fan183579 » Sat Nov 27, 2021 3:41 am

用的是ESP32-S3-DevKitC-1开发板
代码如下
#include <stdio.h>
#include <string.h>
#include "unity.h"
#include "test_utils.h"
#include "esp_rgb_lcd_panel.h"
#include "esp_lcd_panel_ops.h"
#include "soc/soc_caps.h"

#define TEST_LCD_H_RES (480)
#define TEST_LCD_V_RES (272)

#define TEST_LCD_VSYNC_GPIO (42)
#define TEST_LCD_HSYNC_GPIO (4)
#define TEST_LCD_DE_GPIO (2)
#define TEST_LCD_PCLK_GPIO (5)
#define TEST_LCD_DATA0_GPIO (37) // B0
#define TEST_LCD_DATA1_GPIO (16) // B1
#define TEST_LCD_DATA2_GPIO (38) // B2
#define TEST_LCD_DATA3_GPIO (15) // B3
#define TEST_LCD_DATA4_GPIO (39) // B4
#define TEST_LCD_DATA5_GPIO (45) // G0
#define TEST_LCD_DATA6_GPIO (3) // G1
#define TEST_LCD_DATA7_GPIO (0) // G2
#define TEST_LCD_DATA8_GPIO (8) // G3
#define TEST_LCD_DATA9_GPIO (35) // G4
#define TEST_LCD_DATA10_GPIO (18) // G5
#define TEST_LCD_DATA11_GPIO (20) // R0
#define TEST_LCD_DATA12_GPIO (14) // R1
#define TEST_LCD_DATA13_GPIO (21) // R2
#define TEST_LCD_DATA14_GPIO (13) // R3
#define TEST_LCD_DATA15_GPIO (47) // R4
#define TEST_LCD_DISP_EN_GPIO (41)

void app_main()
{
#define TEST_IMG_SIZE (100 * 100 * sizeof(uint16_t))
uint8_t *img = malloc(TEST_IMG_SIZE);
TEST_ASSERT_NOT_NULL(img);

esp_lcd_panel_handle_t panel_handle = NULL;
esp_lcd_rgb_panel_config_t panel_config = {
.data_width = 16,
.disp_gpio_num = TEST_LCD_DISP_EN_GPIO,
.pclk_gpio_num = TEST_LCD_PCLK_GPIO,
.vsync_gpio_num = TEST_LCD_VSYNC_GPIO,
.hsync_gpio_num = TEST_LCD_HSYNC_GPIO,
.de_gpio_num = TEST_LCD_DE_GPIO,
.data_gpio_nums = {
TEST_LCD_DATA0_GPIO,
TEST_LCD_DATA1_GPIO,
TEST_LCD_DATA2_GPIO,
TEST_LCD_DATA3_GPIO,
TEST_LCD_DATA4_GPIO,
TEST_LCD_DATA5_GPIO,
TEST_LCD_DATA6_GPIO,
TEST_LCD_DATA7_GPIO,
TEST_LCD_DATA8_GPIO,
TEST_LCD_DATA9_GPIO,
TEST_LCD_DATA10_GPIO,
TEST_LCD_DATA11_GPIO,
TEST_LCD_DATA12_GPIO,
TEST_LCD_DATA13_GPIO,
TEST_LCD_DATA14_GPIO,
TEST_LCD_DATA15_GPIO,
},
.timings = {
.pclk_hz = 25000000,
.h_res = TEST_LCD_H_RES,
.v_res = TEST_LCD_V_RES,
.hsync_back_porch = 43,
.hsync_front_porch = 4,
.hsync_pulse_width = 3,
.vsync_back_porch = 12,
.vsync_front_porch = 4,
.vsync_pulse_width = 2,
.flags.de_idle_high = 0,
.flags.pclk_idle_low = 1,
},
.flags.fb_in_psram = 1,
.flags.disp_active_low = 0,
};
// Test stream mode and one-off mode
for (int i = 0; i < 2; i++) {
panel_config.flags.relax_on_idle = i;
TEST_ESP_OK(esp_lcd_new_rgb_panel(&panel_config, &panel_handle));
TEST_ESP_OK(esp_lcd_panel_reset(panel_handle));
TEST_ESP_OK(esp_lcd_panel_init(panel_handle));

for (int i = 0; i < 200; i++) {
uint8_t color_byte = esp_random() & 0xff;
int x_start = esp_random() % (TEST_LCD_H_RES - 100);
int y_start = esp_random() % (TEST_LCD_V_RES - 100);
memset(img, color_byte, TEST_IMG_SIZE);
esp_lcd_panel_draw_bitmap(panel_handle, x_start, y_start, x_start + 100, y_start + 100, img);
}
TEST_ESP_OK(esp_lcd_panel_del(panel_handle));
}
free(img);
#undef TEST_IMG_SIZE
}

然后是显示器驱动IC的调试文档
用的是IDF4.4,目前显示屏没有任何显示,查了两天没有查出原因,特来请教
Attachments
ILI6485_DTS_V001_20180403(1)(2).pdf
(2.6 MiB) Downloaded 827 times

fan183579
Posts: 81
Joined: Thu Nov 25, 2021 6:37 am

Re: 使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

Postby fan183579 » Sat Nov 27, 2021 3:42 am

屏幕分辨率是480*272

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: 使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

Postby ESP_morris » Mon Nov 29, 2021 2:13 am

这种RGB屏幕是需要先用SPI发送初始化序列,让屏幕进入RGB模式,然后才是RGB数据流刷新的吧. 没有实际用过这个屏幕,仅提供参考意见.

fan183579
Posts: 81
Joined: Thu Nov 25, 2021 6:37 am

Re: 使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

Postby fan183579 » Mon Nov 29, 2021 7:11 am

ESP_morris wrote:
Mon Nov 29, 2021 2:13 am
这种RGB屏幕是需要先用SPI发送初始化序列,让屏幕进入RGB模式,然后才是RGB数据流刷新的吧. 没有实际用过这个屏幕,仅提供参考意见.
能否推荐一块480*272的RGB屏幕

fan183579
Posts: 81
Joined: Thu Nov 25, 2021 6:37 am

Re: 使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

Postby fan183579 » Mon Nov 29, 2021 7:11 am

ESP_morris wrote:
Mon Nov 29, 2021 2:13 am
这种RGB屏幕是需要先用SPI发送初始化序列,让屏幕进入RGB模式,然后才是RGB数据流刷新的吧. 没有实际用过这个屏幕,仅提供参考意见.
或者驱动IC

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: 使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

Postby ESP_morris » Mon Nov 29, 2021 8:35 am

就是常见的那种RGB 裸屏, https://item.taobao.com/item.htm?spm=a1 ... 4201515464 类似这种

fan183579
Posts: 81
Joined: Thu Nov 25, 2021 6:37 am

Re: 使用ESP32-S3应用RGB接口测试程序点屏的时候没有任何效果

Postby fan183579 » Tue Dec 07, 2021 1:10 am

ESP_morris wrote:
Mon Nov 29, 2021 8:35 am
就是常见的那种RGB 裸屏, https://item.taobao.com/item.htm?spm=a1 ... 4201515464 类似这种
我更换屏幕后尝试成功点亮了,但是因为颜色不正确,所以我决定对颜色进行取反,结果使用rgb_panel_invert_color(esp_lcd_panel_t *panel, bool invert_color_data) 并没有任何效果

for (int i = 0; i < 2; i++) {
panel_config.flags.relax_on_idle = i;
TEST_ESP_OK(esp_lcd_new_rgb_panel(&panel_config, &panel_handle));
TEST_ESP_OK(esp_lcd_panel_reset(panel_handle));
TEST_ESP_OK(esp_lcd_panel_invert_color(panel_handle, true));
TEST_ESP_OK(esp_lcd_panel_init(panel_handle));

for (int i = 0; i < 200; i++) {
uint8_t color_byte = esp_random() & 0xFF;
int x_start = esp_random() % (TEST_LCD_H_RES - 100);
int y_start = esp_random() % (TEST_LCD_V_RES - 100);
memset(img, color_byte, TEST_IMG_SIZE);
esp_lcd_panel_draw_bitmap(panel_handle, x_start, y_start, x_start + 100, y_start + 100, img);
}
TEST_ESP_OK(esp_lcd_panel_del(panel_handle));
}
free(img);

Who is online

Users browsing this forum: No registered users and 95 guests