35 #ifndef __HAL_DISPLAY_LCD_H__ 36 #define __HAL_DISPLAY_LCD_H__ 38 #include "hal_platform.h" 40 #ifdef HAL_DISPLAY_LCD_MODULE_ENABLED 171 HAL_DISPLAY_LCD_LAYER_ROTATE_0 = 0x0,
172 HAL_DISPLAY_LCD_LAYER_ROTATE_90 = 0x1,
173 HAL_DISPLAY_LCD_LAYER_ROTATE_180 = 0x2,
174 HAL_DISPLAY_LCD_LAYER_ROTATE_270 = 0x3,
175 HAL_DISPLAY_LCD_LAYER_ROTATE_0_FLIP = 0x4,
176 HAL_DISPLAY_LCD_LAYER_ROTATE_90_FLIP = 0x5,
177 HAL_DISPLAY_LCD_LAYER_ROTATE_180_FLIP = 0x6,
178 HAL_DISPLAY_LCD_LAYER_ROTATE_270_FLIP = 0x7,
179 HAL_DISPLAY_LCD_LAYER_ROTATE_NUM
180 } hal_display_lcd_layer_rotate_t;
184 HAL_DISPLAY_LCD_STATUS_INITIALIZATION_FAILED = -8,
185 HAL_DISPLAY_LCD_STATUS_COLOR_INITIALIZATION_FAILED = -7,
186 HAL_DISPLAY_LCD_STATUS_DSI_INITIALIZATION_FAILED = -6,
187 HAL_DISPLAY_LCD_STATUS_INVALID_PARAMETER = -5,
188 HAL_DISPLAY_LCD_STATUS_COLOR_INVALID_PARAMETER = -4,
189 HAL_DISPLAY_LCD_STATUS_DSI_INVALID_PARAMETER = -3,
190 HAL_DISPLAY_LCD_STATUS_POWER_FAILED = -2,
191 HAL_DISPLAY_LCD_STATUS_ERROR = -1,
192 HAL_DISPLAY_LCD_STATUS_OK = 0,
193 } hal_display_lcd_status_t;
197 HAL_DISPLAY_LCD_INTERFACE_WIDTH_8 = 0,
198 HAL_DISPLAY_LCD_INTERFACE_WIDTH_9,
199 HAL_DISPLAY_LCD_INTERFACE_WIDTH_16,
200 HAL_DISPLAY_LCD_INTERFACE_WIDTH_18,
201 HAL_DISPLAY_LCD_INTERFACE_WIDTH_24,
202 HAL_DISPLAY_LCD_INTERFACE_WIDTH_32,
203 HAL_DISPLAY_LCD_INTERFACE_WIDTH_NUM
204 } hal_display_lcd_interface_width_t;
208 HAL_DISPLAY_LCD_INTERFACE_2PIN_WIDTH_16 = 2,
209 HAL_DISPLAY_LCD_INTERFACE_2PIN_WIDTH_18 = 3,
210 HAL_DISPLAY_LCD_INTERFACE_2PIN_WIDTH_24 = 4,
211 HAL_DISPLAY_LCD_INTERFACE_2PIN_WIDTH_12 = 6,
212 HAL_DISPLAY_LCD_INTERFACE_2PIN_WIDTH_NUM
213 } hal_display_lcd_interface_2pin_width_t;
217 HAL_DISPLAY_LCD_INTERFACE_START_BYTE_WIDTH_8 = 0,
218 HAL_DISPLAY_LCD_INTERFACE_START_BYTE_WIDTH_9,
219 HAL_DISPLAY_LCD_INTERFACE_START_BYTE_WIDTH_16,
220 HAL_DISPLAY_LCD_INTERFACE_START_BYTE_WIDTH_18,
221 HAL_DISPLAY_LCD_INTERFACE_START_BYTE_WIDTH_24,
222 HAL_DISPLAY_LCD_INTERFACE_START_BYTE_WIDTH_32,
223 HAL_DISPLAY_LCD_INTERFACE_START_BYTE_WIDTH_NUM
224 } hal_display_lcd_interface_start_byte_width_t;
228 HAL_DISPLAY_LCD_INTERFACE_CLOCK_124MHZ = 0,
229 HAL_DISPLAY_LCD_INTERFACE_CLOCK_104MHZ = 1,
230 HAL_DISPLAY_LCD_INTERFACE_CLOCK_91MHZ = 2,
231 HAL_DISPLAY_LCD_INTERFACE_CLOCK_26MHZ = 3,
232 HAL_DISPLAY_LCD_INTERFACE_CLOCK_RSVD = 4
233 } hal_display_lcd_interface_clock_t;
237 HAL_DISPLAY_LCD_LAYER_COLOR_8BPP_INDEX = 0,
238 HAL_DISPLAY_LCD_LAYER_COLOR_RGB565,
239 HAL_DISPLAY_LCD_LAYER_COLOR_UYVY422,
240 HAL_DISPLAY_LCD_LAYER_COLOR_RGB888,
241 HAL_DISPLAY_LCD_LAYER_COLOR_ARGB8888,
242 HAL_DISPLAY_LCD_LAYER_COLOR_PARGB8888,
243 HAL_DISPLAY_LCD_LAYER_COLOR_XRGB,
244 HAL_DISPLAY_LCD_LAYER_COLOR_ARGB6666,
245 HAL_DISPLAY_LCD_LAYER_COLOR_PARGB6666,
246 HAL_DISPLAY_LCD_LAYER_COLOR_4BIT_INDEX,
247 HAL_DISPLAY_LCD_LAYER_COLOR_2BIT_INDEX,
248 HAL_DISPLAY_LCD_LAYER_COLOR_1BIT_INDEX,
249 HAL_DISPLAY_LCD_LAYER_COLOR_NUM
250 } hal_display_lcd_layer_source_color_format_t;
254 HAL_DISPLAY_LCD_ROI_OUTPUT_RGB332 = 0,
255 HAL_DISPLAY_LCD_ROI_OUTPUT_RGB444,
256 HAL_DISPLAY_LCD_ROI_OUTPUT_RGB565,
257 HAL_DISPLAY_LCD_ROI_OUTPUT_RGB666,
258 HAL_DISPLAY_LCD_ROI_OUTPUT_RGB888,
259 HAL_DISPLAY_LCD_ROI_OUTPUT_NUM
260 } hal_display_lcd_output_color_format_t;
264 HAL_DISPLAY_LCD_LAYER0 = 0,
265 HAL_DISPLAY_LCD_LAYER1,
266 HAL_DISPLAY_LCD_LAYER2,
267 HAL_DISPLAY_LCD_LAYER3,
268 HAL_DISPLAY_LCD_LAYER_NUM
269 } hal_display_lcd_layer_t;
273 HAL_DISPLAY_LCD_DRIVING_CURRENT_4MA = 0,
274 HAL_DISPLAY_LCD_DRIVING_CURRENT_8MA,
275 HAL_DISPLAY_LCD_DRIVING_CURRENT_12MA,
276 HAL_DISPLAY_LCD_DRIVING_CURRENT_16MA,
277 HAL_DISPLAY_LCD_DRIVING_CURRENT_NUM
278 } hal_display_lcd_driving_current_t;
282 HAL_DISPLAY_LCD_POWER_DOMAIN_1V8 = 0,
283 HAL_DISPLAY_LCD_POWER_DOMAIN_2V8,
284 HAL_DISPLAY_LCD_POWER_DOMAIN_NUM
285 } hal_display_lcd_power_domain_t;
289 HAL_DISPLAY_LCD_INTERFACE_SERIAL_0 = 0,
290 HAL_DISPLAY_LCD_INTERFACE_SERIAL_1,
291 HAL_DISPLAY_LCD_INTERFACE_NUM
292 } hal_display_lcd_interface_port_t;
308 uint8_t layer_enable;
311 hal_display_lcd_layer_rotate_t rotate;
312 bool source_key_flag;
316 hal_display_lcd_layer_source_color_format_t color_format;
317 bool destination_key_flag;
319 uint16_t window_x_offset;
320 uint16_t window_y_offset;
321 uint32_t buffer_address;
323 uint16_t column_size;
325 } hal_display_lcd_layer_input_t;
334 uint16_t target_start_x;
335 uint16_t target_start_y;
336 uint16_t target_end_x;
337 uint16_t target_end_y;
338 uint16_t roi_offset_x;
339 uint16_t roi_offset_y;
340 uint32_t roi_background_color;
341 uint32_t main_lcd_output;
342 } hal_display_lcd_roi_output_t;
346 hal_display_lcd_interface_port_t port_number;
353 hal_display_lcd_interface_clock_t clock_freq;
354 } hal_display_lcd_interface_timing_t;
358 hal_display_lcd_interface_port_t port_number;
359 bool three_wire_mode;
361 bool cs_stay_low_mode;
363 hal_display_lcd_interface_width_t width;
364 hal_display_lcd_driving_current_t driving_current;
366 hal_display_lcd_power_domain_t power_domain;
367 bool start_byte_mode;
368 } hal_display_lcd_interface_mode_t;
372 hal_display_lcd_interface_port_t port_number;
373 hal_display_lcd_interface_start_byte_width_t start_byte_width;
374 uint32_t byte_switch;
375 uint32_t wr_start_byte;
376 uint32_t wr_start_byte2;
377 uint32_t rd_start_byte;
378 } hal_display_lcd_interface_start_byte_mode_t;
382 hal_display_lcd_interface_port_t port_number;
384 hal_display_lcd_interface_2pin_width_t two_data_width;
385 } hal_display_lcd_interface_2_data_lane_t;
401 typedef void (*hal_display_lcd_callback_t)(
void *data);
419 hal_display_lcd_status_t hal_display_lcd_init(uint32_t main_command_address, uint32_t main_data_address, uint32_t main_lcd_output_format);
429 hal_display_lcd_status_t hal_display_lcd_set_interface_timing(hal_display_lcd_interface_timing_t timing_settings);
440 hal_display_lcd_status_t hal_display_lcd_set_interface_mode(hal_display_lcd_interface_mode_t mode_settings);
453 hal_display_lcd_status_t hal_display_lcd_set_interface_2data_lane_mode(hal_display_lcd_interface_port_t port,
bool flag, hal_display_lcd_interface_2pin_width_t two_data_width);
464 hal_display_lcd_status_t hal_display_lcd_config_layer(hal_display_lcd_layer_input_t *layer_data);
475 hal_display_lcd_status_t hal_display_lcd_config_roi(hal_display_lcd_roi_output_t *roi_settings);
486 hal_display_lcd_status_t hal_display_lcd_config_start_byte(hal_display_lcd_interface_start_byte_mode_t *start_byte_settings);
497 hal_display_lcd_status_t hal_display_lcd_set_index_color_table(uint32_t *index_table);
508 hal_display_lcd_callback_t hal_display_lcd_register_callback(hal_display_lcd_callback_t lcd_callback);
524 hal_display_lcd_status_t hal_display_lcd_init_te(uint32_t frame_rate, uint32_t back_porch, uint32_t front_porch, uint32_t width, uint32_t height, uint32_t main_lcd_output);
536 hal_display_lcd_status_t hal_display_lcd_calculate_te(uint32_t width, uint32_t height);
548 hal_display_lcd_status_t hal_display_lcd_toggle_reset(uint32_t low_time, uint32_t high_time);
559 hal_display_lcd_status_t hal_display_lcd_start_dma(
bool wait_te);
568 uint32_t hal_display_lcd_get_layer_address(hal_display_lcd_layer_t layer);
575 void hal_display_lcd_restore_callback(
void);
585 hal_display_lcd_status_t hal_display_lcd_turn_on_mtcmos(
void);
594 hal_display_lcd_status_t hal_display_lcd_turn_off_mtcmos(
void);
605 hal_display_lcd_status_t hal_display_lcd_set_clock(hal_display_lcd_interface_clock_t clock);
615 hal_display_lcd_status_t hal_display_lcd_apply_setting(
void);
624 hal_display_lcd_status_t hal_display_lcd_set_layer_to_default(
void);