11/*
2- * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
1212#include "soc/mipi_dsi_bridge_struct.h"
1313#include "hal/mipi_dsi_types.h"
1414#include "hal/lcd_types.h"
15+ #include "hal/config.h"
1516
1617#define MIPI_DSI_LL_GET_BRG (bus_id ) (bus_id == 0 ? &MIPI_DSI_BRIDGE : NULL)
1718#define MIPI_DSI_LL_EVENT_UNDERRUN (1 << 0)
@@ -173,17 +174,21 @@ static inline void mipi_dsi_brg_ll_credit_reset(dsi_brg_dev_t *dev)
173174 * @param color_coding Color coding value
174175 * @param sub_config Sub configuration
175176 */
177+ #if HAL_CONFIG (CHIP_SUPPORT_MIN_REV ) >= 300
176178static inline void mipi_dsi_brg_ll_set_pixel_format (dsi_brg_dev_t * dev , lcd_color_format_t color_coding , uint32_t sub_config )
177179{
178180 switch (color_coding ) {
179181 case LCD_COLOR_FMT_RGB565 :
180182 dev -> pixel_type .raw_type = 2 ;
183+ dev -> pixel_type .dpi_type = 2 ;
181184 break ;
182185 case LCD_COLOR_FMT_RGB666 :
183186 dev -> pixel_type .raw_type = 1 ;
187+ dev -> pixel_type .dpi_type = 1 ;
184188 break ;
185189 case LCD_COLOR_FMT_RGB888 :
186190 dev -> pixel_type .raw_type = 0 ;
191+ dev -> pixel_type .dpi_type = 0 ;
187192 break ;
188193 default :
189194 // MIPI DSI host can only accept RGB data, no YUV data
@@ -192,6 +197,27 @@ static inline void mipi_dsi_brg_ll_set_pixel_format(dsi_brg_dev_t *dev, lcd_colo
192197 }
193198 dev -> pixel_type .dpi_config = sub_config ;
194199}
200+ #else
201+ static inline void mipi_dsi_brg_ll_set_pixel_format (dsi_brg_dev_t * dev , lcd_color_format_t color_coding , uint32_t sub_config )
202+ {
203+ switch (color_coding ) {
204+ case LCD_COLOR_FMT_RGB565 :
205+ dev -> pixel_type .raw_type = 2 ;
206+ break ;
207+ case LCD_COLOR_FMT_RGB666 :
208+ dev -> pixel_type .raw_type = 1 ;
209+ break ;
210+ case LCD_COLOR_FMT_RGB888 :
211+ dev -> pixel_type .raw_type = 0 ;
212+ break ;
213+ default :
214+ // MIPI DSI host can only accept RGB data, no YUV data
215+ HAL_ASSERT (false);
216+ break ;
217+ }
218+ dev -> pixel_type .dpi_config = sub_config ;
219+ }
220+ #endif
195221
196222/**
197223 * @brief Set the color space for input color data
0 commit comments