Page 1 of 1

landscape mode with MIPI-DSI on DSI display

Posted: Sun May 03, 2026 10:59 pm
by andromeda92
Hi,
I'm trying to get the WaveShare monitor to work in landscape mode with MIPI-DSI,
but it's not working. I've tried about fifty different draw_pixels, and it's still not working. I'm using `mirror` in the initialization,
but it's not doing anything. The screen resolution is 800x1280 for screen default, but I want 1280x800 in landscape mode.

Code: Select all

static void test_init_lcd(void) {
    // 1. Alimentation PHY MIPI
    esp_ldo_channel_handle_t ldo_mipi_phy = NULL;
    esp_ldo_channel_config_t ldo_mipi_phy_config = {
        .chan_id = 3,
        .voltage_mv = 2500,
    };
    ESP_ERROR_CHECK(esp_ldo_acquire_channel(&ldo_mipi_phy_config, &ldo_mipi_phy));

    // 2. Bus DSI
    esp_lcd_dsi_bus_config_t bus_config = JD9365_PANEL_BUS_DSI_2CH_CONFIG();
    ESP_ERROR_CHECK(esp_lcd_new_dsi_bus(&bus_config, &mipi_dsi_bus));

    // 3. IO DBI (Commandes)
    esp_lcd_dbi_io_config_t dbi_config = JD9365_PANEL_IO_DBI_CONFIG();
    ESP_ERROR_CHECK(esp_lcd_new_panel_io_dbi(mipi_dsi_bus, &dbi_config, &mipi_dbi_io));

    // 4. DPI (Flux vidéo)
    esp_lcd_dpi_panel_config_t dpi_config = {
        .virtual_channel = 0,
        .dpi_clk_src = LCD_CLK_SRC_DEFAULT,
        .dpi_clock_freq_mhz = 70, 
        .in_color_format = TEST_MIPI_DPI_PX_FORMAT, 
        .video_timing = {
            .h_size = TEST_LCD_H_RES, 
            .v_size = TEST_LCD_V_RES,
            .hsync_back_porch = 80, .hsync_pulse_width = 10, .hsync_front_porch = 80,
            .vsync_back_porch = 20, .vsync_pulse_width = 2, .vsync_front_porch = 12,
        },
    };

    jd9365_vendor_config_t vendor_config = {
        .flags.use_mipi_interface = 1,
        .mipi_config = {
            .dsi_bus = mipi_dsi_bus,
            .dpi_config = &dpi_config,
            .lane_num = TEST_MIPI_DSI_LANE_NUM,
        },
    };

    const esp_lcd_panel_dev_config_t panel_config = {
        .reset_gpio_num = -1,
        .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
        .bits_per_pixel = TEST_LCD_BIT_PER_PIXEL,
        .vendor_config = &vendor_config,
    };

    // 5. Création du Panel
    ESP_ERROR_CHECK(esp_lcd_new_panel_jd9365(mipi_dbi_io, &panel_config, &panel_handle));
    ESP_ERROR_CHECK(esp_lcd_dpi_panel_enable_dma2d(panel_handle));
    
    ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle));
    ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle));
    
    // Mirror Y pour compenser l'orientation physique si nécessaire       
    ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, false, true));    
    ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true));

    // 6. Sémaphore de synchro
    refresh_finish = xSemaphoreCreateBinary();
    esp_lcd_dpi_panel_event_callbacks_t cbs = { 
        .on_color_trans_done = test_notify_refresh_ready 
    };
    ESP_ERROR_CHECK(esp_lcd_dpi_panel_register_event_callbacks(panel_handle, &cbs, refresh_finish));
}
The swapxy doesn't work because it makes the Waveshare ESP32-P4 DEv Kit module reboot.

Thanks for your help