Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32S3 RPI_DPI_RGB component should allow "serial" RGB displays #2973

Open
cocus opened this issue Dec 5, 2024 · 2 comments
Open

ESP32S3 RPI_DPI_RGB component should allow "serial" RGB displays #2973

cocus opened this issue Dec 5, 2024 · 2 comments

Comments

@cocus
Copy link

cocus commented Dec 5, 2024

Describe the problem you have/What new integration you would like
Current RPI_DPI_RGB component only makes use of parallel RGB displays, but there's also support from the IDF itself of the so-called "serial RGB" displays. Such displays use a parallel bus, but they require to latch the colors in separate clocks, for instance, an 8 bit bus that will provide the RED pixel data (8 bits), then the GREEN pixel data (another 8 bits), and finally the BLUE pixel data (another 8 bits), consuming 3 clocks per pixel. This works transparently for the user, since this is taken into account inside the IDF. In order to use this feature, when configuring the panel, the esp_lcd_rgb_panel_config_t structure should contain its member data_width set to a lower number than the bits_per_pixel member. For instance, data_width set to 8, while bits_per_pixel set to 24 (i.e. RGB888). This would mean you don't need to specify the red/green/blue pins separately, just the N pins used in the data_width.

Please describe your use case for this integration and alternatives you've tried:
A lot of LCD modules use this, and it's already implemented in IDF, so it's trivial to make use of.

Additional context
I'm using a A035QN05 display which is a 320*240, "serial RGB", with the following initialization code:

    esp_lcd_rgb_panel_config_t panel_config = {
        .data_width = 8, // RGB888
        .bits_per_pixel = 24,
        .num_fbs = 1,
        .dma_burst_size = 64,
        .clk_src = LCD_CLK_SRC_DEFAULT,
        .disp_gpio_num = -1,
        .pclk_gpio_num = GPIO_NUM_8,
        .vsync_gpio_num = GPIO_NUM_46,
        .hsync_gpio_num = GPIO_NUM_3,
        .de_gpio_num = -1,
        .data_gpio_nums = {
            GPIO_NUM_45,
            GPIO_NUM_21,
            GPIO_NUM_14,
            GPIO_NUM_13,
            GPIO_NUM_12,
            GPIO_NUM_11,
            GPIO_NUM_10,
            GPIO_NUM_9,
        },
        // The timing parameters should refer to your LCD spec
        .timings = {
            .pclk_hz = 27000000UL,
            .h_res = 320,
            .v_res = 240,

            .hsync_back_porch = 75,
            .hsync_front_porch = 686,
            .hsync_pulse_width = 1,

            .vsync_back_porch = 21,
            .vsync_front_porch = 2,
            .vsync_pulse_width = 1,
        },
        .flags.fb_in_psram = true,
    };

As you can see, there's not much deviation from a standard true "parallel" RGB display, just less pins declared, and the different values in data_width and bits_per_pixel

@cocus
Copy link
Author

cocus commented Dec 6, 2024

I figured that this would only apply when esp-idf v5.x is in use; this new parameter bits_per_pixel is not available on 4.x. For some reason, I can't make my ESP32S3 boot with esphome using 6.9.0 and idf 5.3.1; not sure why. I've tried a lot of things... In any case, I think it's beyond this point.

@cocus
Copy link
Author

cocus commented Dec 6, 2024

A concept can be found here: https://github.com/cocus/esphome/tree/cocus/rpi_rgb_serial. I think it might be improved greatly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant