MT2523 API Reference  LinkIt SDK v4
hal_display_lcd.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __HAL_DISPLAY_LCD_H__
36 #define __HAL_DISPLAY_LCD_H__
37 
38 #include "hal_platform.h"
39 
40 #ifdef HAL_DISPLAY_LCD_MODULE_ENABLED
41 
165 #ifdef __cplusplus
166 extern "C" {
167 #endif
168 
170 typedef enum {
181 
183 typedef enum {
194 
196 typedef enum {
205 
207 typedef enum {
214 
216 typedef enum {
225 
227 typedef enum {
234 
236 typedef enum {
251 
253 typedef enum {
261 
263 typedef enum {
270 
272 typedef enum {
279 
281 typedef enum {
286 
288 typedef enum {
293 
294 
307 typedef struct {
308  uint8_t layer_enable;
309  uint8_t alpha;
310  bool alpha_flag;
311  hal_display_lcd_layer_rotate_t rotate;
315  bool dither_flag;
316  hal_display_lcd_layer_source_color_format_t color_format;
318  uint32_t color_key;
319  uint16_t window_x_offset;
320  uint16_t window_y_offset;
321  uint32_t buffer_address;
322  uint16_t row_size;
323  uint16_t column_size;
324  uint16_t pitch;
326 
333 typedef struct {
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;
341  uint32_t main_lcd_output;
343 
345 typedef struct {
346  hal_display_lcd_interface_port_t port_number;
347  uint32_t css;
348  uint32_t csh;
349  uint32_t rd_low;
350  uint32_t rd_high;
351  uint32_t wr_low;
352  uint32_t wr_high;
355 
357 typedef struct {
358  hal_display_lcd_interface_port_t port_number;
363  hal_display_lcd_interface_width_t width;
364  hal_display_lcd_driving_current_t driving_current;
365  bool hw_cs;
366  hal_display_lcd_power_domain_t power_domain;
369 
371 typedef struct {
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;
379 
381 typedef struct {
382  hal_display_lcd_interface_port_t port_number;
384  hal_display_lcd_interface_2pin_width_t two_data_width;
386 
401 typedef void (*hal_display_lcd_callback_t)(void *data);
402 
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);
430 
441 
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);
454 
465 
476 
487 
498 
509 
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);
525 
536 hal_display_lcd_status_t hal_display_lcd_calculate_te(uint32_t width, uint32_t height);
537 
548 hal_display_lcd_status_t hal_display_lcd_toggle_reset(uint32_t low_time, uint32_t high_time);
549 
560 
568 uint32_t hal_display_lcd_get_layer_address(hal_display_lcd_layer_t layer);
569 
576 
586 
595 
606 
616 
625 #ifdef __cplusplus
626 }
627 #endif
628 
634 #endif /* HAL_DISPLAY_LCD_MODULE_ENABLED */
635 #endif /* __HAL_DISPLAY_LCD_H__ */
8 bits per pixel index mode.
Definition: hal_display_lcd.h:237
uint32_t css
Set the width of chip select setup time.
Definition: hal_display_lcd.h:347
hal_display_lcd_interface_2pin_width_t two_data_width
The output pixel width in 2-data lane mode.
Definition: hal_display_lcd.h:384
hal_display_lcd_layer_rotate_t
The layer rotation degree.
Definition: hal_display_lcd.h:170
104MHz.
Definition: hal_display_lcd.h:229
hal_display_lcd_interface_width_t width
Serial interface width.
Definition: hal_display_lcd.h:363
uint16_t window_y_offset
The starting y coordinate of the layer buffer to update.
Definition: hal_display_lcd.h:320
The output port is serial 0.
Definition: hal_display_lcd.h:289
hal_display_lcd_power_domain_t power_domain
The output pin's power domain.
Definition: hal_display_lcd.h:366
1.8V.
Definition: hal_display_lcd.h:282
uint32_t wr_start_byte2
The second start byte setting in sending data/command to the LCM.
Definition: hal_display_lcd.h:376
uint16_t target_start_x
The starting x coordinate of the LCM to update.
Definition: hal_display_lcd.h:334
void hal_display_lcd_restore_callback(void)
This function executes the restore functions when exiting from deep sleep.
9 bits.
Definition: hal_display_lcd.h:198
Layer 0.
Definition: hal_display_lcd.h:264
90 degrees.
Definition: hal_display_lcd.h:172
uint16_t target_end_y
The ending y coordinate of the LCM to update.
Definition: hal_display_lcd.h:337
This event structure presents the 2-data lane mode parameters of the serial interface.
Definition: hal_display_lcd.h:381
hal_display_lcd_status_t hal_display_lcd_config_start_byte(hal_display_lcd_interface_start_byte_mode_t *start_byte_settings)
This function sets the start byte mode's settings to the LCD engine.
hal_display_lcd_status_t hal_display_lcd_set_layer_to_default(void)
This function resets the layer to default settings after updating the screen.
uint8_t layer_enable
The number of the layer to be updated.
Definition: hal_display_lcd.h:308
The number of driving current options (invalid driving current).
Definition: hal_display_lcd.h:277
uint32_t main_lcd_output
The output format of the LCD engine to use.
Definition: hal_display_lcd.h:341
uint16_t roi_offset_y
The ROI window offset y from main window.
Definition: hal_display_lcd.h:339
Successful.
Definition: hal_display_lcd.h:192
hal_display_lcd_output_color_format_t
The output color format to the LCM.
Definition: hal_display_lcd.h:253
8 bits.
Definition: hal_display_lcd.h:217
2.8V.
Definition: hal_display_lcd.h:283
RGB444.
Definition: hal_display_lcd.h:255
PARGB6666.
Definition: hal_display_lcd.h:245
Invalid DSI parameter.
Definition: hal_display_lcd.h:189
bool rgb_swap_flag
Enable or disable the RGB swap.
Definition: hal_display_lcd.h:313
ARGB6666.
Definition: hal_display_lcd.h:244
16 bits.
Definition: hal_display_lcd.h:219
The number of the width selections (invalid width).
Definition: hal_display_lcd.h:203
The number of layers (invalid layer).
Definition: hal_display_lcd.h:268
hal_display_lcd_power_domain_t
Power domain voltage options of the output pin.
Definition: hal_display_lcd.h:281
uint32_t roi_background_color
The background color of the ROI to update.
Definition: hal_display_lcd.h:340
bool cs_stay_low_mode
Enable or disable chip select stay low mode.
Definition: hal_display_lcd.h:361
The output port is serial 1.
Definition: hal_display_lcd.h:290
hal_display_lcd_layer_t
The layers.
Definition: hal_display_lcd.h:263
uint32_t rd_low
Set the low width of the output clock while receiving data.
Definition: hal_display_lcd.h:349
The number of output ports (invalid output ports).
Definition: hal_display_lcd.h:291
RGB888.
Definition: hal_display_lcd.h:258
bool single_a0_mode
Enable or disable single A0 mode.
Definition: hal_display_lcd.h:360
Failed to apply display power settings.
Definition: hal_display_lcd.h:190
uint32_t buffer_address
The start address of the layer to update.
Definition: hal_display_lcd.h:321
8 bits.
Definition: hal_display_lcd.h:197
270 degrees rotation and flip.
Definition: hal_display_lcd.h:178
Layer 2.
Definition: hal_display_lcd.h:266
ARGB8888.
Definition: hal_display_lcd.h:241
24 bits.
Definition: hal_display_lcd.h:201
bool two_data_flag
Enable or disable 2-data lane.
Definition: hal_display_lcd.h:383
24 bits.
Definition: hal_display_lcd.h:210
bool alpha_flag
Enable or disable the alpha blending.
Definition: hal_display_lcd.h:310
12mA.
Definition: hal_display_lcd.h:275
24 bits.
Definition: hal_display_lcd.h:221
The number of output color formats (invalid color format).
Definition: hal_display_lcd.h:259
hal_display_lcd_interface_port_t port_number
The port number of the serial interface.
Definition: hal_display_lcd.h:358
hal_display_lcd_status_t hal_display_lcd_set_index_color_table(uint32_t *index_table)
This function sets the index color table settings to the LCD engine.
uint32_t rd_start_byte
The start byte setting in receiving data from the LCM.
Definition: hal_display_lcd.h:377
uint32_t hal_display_lcd_get_layer_address(hal_display_lcd_layer_t layer)
This function gets the address to the layer buffer.
Invalid color parameter.
Definition: hal_display_lcd.h:188
18 bits.
Definition: hal_display_lcd.h:220
The color initialization failed.
Definition: hal_display_lcd.h:185
hal_display_lcd_interface_clock_t
The input clock speed options for the LCD engine.
Definition: hal_display_lcd.h:227
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)
This function initializes the LCD engine's hardware registers.
18 bits.
Definition: hal_display_lcd.h:200
The DSI initialization failed.
Definition: hal_display_lcd.h:186
uint16_t roi_offset_x
The ROI window offset x from main window.
Definition: hal_display_lcd.h:338
uint32_t rd_high
Set the high width of the output clock while receiving data.
Definition: hal_display_lcd.h:350
RGB888.
Definition: hal_display_lcd.h:240
hal_display_lcd_callback_t hal_display_lcd_register_callback(hal_display_lcd_callback_t lcd_callback)
This function sets the callback function when the LCD DMA transfer is complete.
hal_display_lcd_status_t hal_display_lcd_turn_off_mtcmos(void)
This function turns off the MTCMOS.
hal_display_lcd_status_t
The return status of display LCD API.
Definition: hal_display_lcd.h:183
YUV422.
Definition: hal_display_lcd.h:239
The number of power domains (invalid power domain).
Definition: hal_display_lcd.h:284
This event structure presents the start byte mode parameters of the serial interface.
Definition: hal_display_lcd.h:371
Layer 1.
Definition: hal_display_lcd.h:265
hal_display_lcd_interface_port_t port_number
The port number of the serial interface.
Definition: hal_display_lcd.h:372
hal_display_lcd_layer_source_color_format_t color_format
Set the color format in this layer.
Definition: hal_display_lcd.h:316
124MHz.
Definition: hal_display_lcd.h:228
RGB666.
Definition: hal_display_lcd.h:257
hal_display_lcd_status_t hal_display_lcd_set_interface_mode(hal_display_lcd_interface_mode_t mode_settings)
This function sets the serial interface mode configuration to the LCD engine.
hal_display_lcd_status_t hal_display_lcd_set_clock(hal_display_lcd_interface_clock_t clock)
This function sets the input clock of the LCD engine.
2 bits per pixel index mode.
Definition: hal_display_lcd.h:247
An error occurred; please check the LCD engine status.
Definition: hal_display_lcd.h:191
bool read_from_SDI
Read from the SDI or not.
Definition: hal_display_lcd.h:362
XRGB.
Definition: hal_display_lcd.h:243
bool destination_key_flag
Enable or disable the destination key.
Definition: hal_display_lcd.h:317
RGB332.
Definition: hal_display_lcd.h:254
32 bits.
Definition: hal_display_lcd.h:202
uint32_t wr_high
Set the high width of the output clock while sending data.
Definition: hal_display_lcd.h:352
bool three_wire_mode
Enable or disable 3 wire mode.
Definition: hal_display_lcd.h:359
uint32_t color_key
Set the color key in this layer.
Definition: hal_display_lcd.h:318
hal_display_lcd_interface_port_t
The output ports of serial interface.
Definition: hal_display_lcd.h:288
The number of the color formats (invalid color format).
Definition: hal_display_lcd.h:249
hal_display_lcd_status_t hal_display_lcd_start_dma(bool wait_te)
This function starts the LCD engine transfer in DMA mode.
hal_display_lcd_status_t hal_display_lcd_config_layer(hal_display_lcd_layer_input_t *layer_data)
This function sets the layer information to the LCD engine.
The number of layer rotation options (invalid layer rotation).
Definition: hal_display_lcd.h:179
hal_display_lcd_status_t hal_display_lcd_turn_on_mtcmos(void)
This function turns on the MTCMOS.
hal_display_lcd_layer_rotate_t rotate
Layer rotation degree.
Definition: hal_display_lcd.h:311
26MHz.
Definition: hal_display_lcd.h:231
uint32_t wr_start_byte
The first start byte setting in sending data/command to the LCM.
Definition: hal_display_lcd.h:375
This event structure presents the parameters of the serial interface.
Definition: hal_display_lcd.h:357
8mA.
Definition: hal_display_lcd.h:274
The LCD initialization failed.
Definition: hal_display_lcd.h:184
hal_display_lcd_interface_clock_t clock_freq
The frequency of input clock to the LCD engine to set.
Definition: hal_display_lcd.h:353
hal_display_lcd_status_t hal_display_lcd_set_interface_timing(hal_display_lcd_interface_timing_t timing_settings)
This function sets the timing configuration to the LCD engine.
hal_display_lcd_status_t hal_display_lcd_toggle_reset(uint32_t low_time, uint32_t high_time)
This function produces a reset waveform and reset the LCM.
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)
This function sets the serial interface 2-data lane mode configuration to the LCD engine...
bool source_key_flag
Enable or disable the source key.
Definition: hal_display_lcd.h:312
hal_display_lcd_interface_start_byte_width_t start_byte_width
The start byte width.
Definition: hal_display_lcd.h:373
0 degree rotation and flip.
Definition: hal_display_lcd.h:175
uint32_t csh
Set the width of chip select hold time.
Definition: hal_display_lcd.h:348
void(* hal_display_lcd_callback_t)(void *data)
This function defines the prototype of the callback function registered by hal_display_lcd_register_c...
Definition: hal_display_lcd.h:401
hal_display_lcd_driving_current_t
The driving current options.
Definition: hal_display_lcd.h:272
uint16_t row_size
The row size of output layer to update.
Definition: hal_display_lcd.h:322
uint32_t wr_low
Set the low width of the output clock while sending data.
Definition: hal_display_lcd.h:351
91MHz.
Definition: hal_display_lcd.h:230
PARGB8888.
Definition: hal_display_lcd.h:242
hal_display_lcd_status_t hal_display_lcd_config_roi(hal_display_lcd_roi_output_t *roi_settings)
This function sets the ROI settings to the LCD engine.
The number of the width selections (invalid width).
Definition: hal_display_lcd.h:223
uint16_t column_size
The column size of output layer to update.
Definition: hal_display_lcd.h:323
1 bit per pixel index mode.
Definition: hal_display_lcd.h:248
16 bits.
Definition: hal_display_lcd.h:199
hal_display_lcd_interface_port_t port_number
The port number of serial interface.
Definition: hal_display_lcd.h:346
4mA.
Definition: hal_display_lcd.h:273
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)
This function sets the TE settings to the LCD engine.
bool hw_cs
Enable or disable hardware(auto) chip select.
Definition: hal_display_lcd.h:365
hal_display_lcd_interface_width_t
The serial interface width options.
Definition: hal_display_lcd.h:196
uint8_t alpha
Configure alpha blending.
Definition: hal_display_lcd.h:309
bool byte_swap_flag
Enable or disable the byte swap.
Definition: hal_display_lcd.h:314
hal_display_lcd_layer_source_color_format_t
The color formats of the input layer.
Definition: hal_display_lcd.h:236
0 degree.
Definition: hal_display_lcd.h:171
18 bits.
Definition: hal_display_lcd.h:209
180 degrees.
Definition: hal_display_lcd.h:173
RGB565.
Definition: hal_display_lcd.h:238
uint16_t window_x_offset
The starting x coordinate of the layer buffer to update.
Definition: hal_display_lcd.h:319
90 degrees rotation and flip.
Definition: hal_display_lcd.h:176
hal_display_lcd_status_t hal_display_lcd_calculate_te(uint32_t width, uint32_t height)
This function calculates the delay lines and sets the delay lines to the LCD engine.
uint16_t pitch
The pitch of output layer to update.
Definition: hal_display_lcd.h:324
Invalid parameter.
Definition: hal_display_lcd.h:187
This event structure presents the output ROI parameters.
Definition: hal_display_lcd.h:333
16mA.
Definition: hal_display_lcd.h:276
This event structure presents the input layer parameters.
Definition: hal_display_lcd.h:307
hal_display_lcd_interface_2pin_width_t
The serial interface width options for the 2-data lane mode.
Definition: hal_display_lcd.h:207
hal_display_lcd_interface_start_byte_width_t
The starting byte width options.
Definition: hal_display_lcd.h:216
uint16_t target_end_x
The ending x coordinate of the LCM to update.
Definition: hal_display_lcd.h:336
hal_display_lcd_interface_port_t port_number
The port number of the serial interface.
Definition: hal_display_lcd.h:382
bool start_byte_mode
Enable or disable start byte mode.
Definition: hal_display_lcd.h:367
uint16_t target_start_y
The starting y coordinate of the LCM to update.
Definition: hal_display_lcd.h:335
uint32_t byte_switch
The start byte mode.
Definition: hal_display_lcd.h:374
270 degrees.
Definition: hal_display_lcd.h:174
hal_display_lcd_driving_current_t driving_current
The driving current.
Definition: hal_display_lcd.h:364
Reserved (invalid clock speed).
Definition: hal_display_lcd.h:232
4 bits per pixel index mode.
Definition: hal_display_lcd.h:246
12 bits.
Definition: hal_display_lcd.h:211
Layer 3.
Definition: hal_display_lcd.h:267
180 degrees rotation and flip.
Definition: hal_display_lcd.h:177
RGB565.
Definition: hal_display_lcd.h:256
32 bits.
Definition: hal_display_lcd.h:222
The number of width selections (invalid width).
Definition: hal_display_lcd.h:212
hal_display_lcd_status_t hal_display_lcd_apply_setting(void)
This function applies all settings to the LCD engine.
9 bits.
Definition: hal_display_lcd.h:218
16 bits.
Definition: hal_display_lcd.h:208
This event structure presents the timing parameters of the serial interface .
Definition: hal_display_lcd.h:345
bool dither_flag
Enable or disable the dithering function.
Definition: hal_display_lcd.h:315