tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8810 / lcdc_data_type.h
1 /***************************************************************************************
2 ** File Name:      lcdc_data_type.h                                                    *
3 ** DATE:           28/09/2005                                                          *
4 ** Copyright:      2005 Spreatrum, Incoporated. All Rights Reserved.                   *
5 ** Description:    this file defines macro and data type for LCM and LCDC              *
6 ****************************************************************************************
7
8 ****************************************************************************************
9 **                         Edit History                                                *
10 **-------------------------------------------------------------------------------------*
11 ** DATE                  NAME                 DESCRIPTION                              *
12 ** 28/09/2005            Jianping.wang        Create.                                  *
13 ****************************************************************************************/
14
15 #ifndef _LCDC_DATA_TYPE_H_
16 #define _LCDC_DATA_TYPE_H_
17
18 /**------------------------------------------------------------------------------------*
19  **                         Dependencies                                               *
20  **------------------------------------------------------------------------------------*/
21 #include "sci_types.h"
22 #include "lcd.h"
23 /**------------------------------------------------------------------------------------*
24  **                         Compiler Flag                                              *
25  **------------------------------------------------------------------------------------*/
26 #ifdef __plusplus
27 extern "C"
28 {
29 #endif
30
31 typedef void (* lcdc_func_t) (void);
32
33
34 typedef struct lcdc_config_tag
35 {
36     uint8  mode;
37     uint8  background_b;
38     uint8  background_g;
39     uint8  backgrounf_r;
40     uint16 frame_mode;
41     uint16 size_x;
42     uint16 size_y;
43     uint16 color_a1;
44     uint16 color_a2;
45     uint16 color_a3;
46     uint16 color_b1;
47     uint16 color_b2;
48     uint16 color_b3;
49     uint16 color_c1;
50     uint16 color_c2;
51     uint16 color_c3;
52     uint32 timing0;
53     uint32 timing1;
54     uint32 lcd_ctrl;
55     uint32 para0;
56     uint32 para1;
57     uint32 modesel;
58     uint32 rgb_mode;
59     uint32 selpin;
60 } LCDC_CONFIG_T;
61
62 typedef struct lcm_config_tag
63 {
64     uint32 para0;
65     uint32 para1;
66     uint32 modesel;
67     uint32 rgb_mode;
68     uint32 selpin;
69 } LCM_CONFIG_T;
70
71 typedef struct lcd_controller_cfg_tag
72 {
73     LCDC_CONFIG_T lcdc_cfg;
74     LCM_CONFIG_T  lcm_cfg;
75 } LCD_CONTROLLER_CFG_T;
76 /**********************************************************************************************************/
77 // LCDC TYPE STRUCTURE
78 /**********************************************************************************************************/
79 typedef struct _LCDC_T_tag
80 {
81     uint32 lcdc_mode;        //0:LCDC RGB mode,1:LCDC MCU mode
82     uint16 main_lcd_width;   //main lcd width
83     uint16 main_lcd_height;  //main lcd height
84     uint16 sub_lcd_width;    //sub lcd widht
85     uint16 sub_lcd_height;   //sub lcd height
86     uint16 main_lcd_cd;      //0 means that cd pin is 0 for command,cd pin is 1 for data
87     //1 means that cd pin is 1 for command,cd pin is 0 for data
88     uint16 sub_lcd_cd;       //0 means that cd pin is 0 for command,cd pin is 1 for data
89     //1 means that cd pin is 1 for command,cd pin is 0 for data
90     uint32 lcd_background;   //lcd background color
91     uint32 mcu_lcd_sum;      //when LCDC is MCU mode,lcd sum with lcdc
92     uint32 lcd_data_bits;
93     uint32 lcdc_refresh_mode;
94     uint16 main_lcd_cs_pin;
95     uint16 sub_lcd_cs_pin;
96     uint32 controller;
97 } LCDC_TYPE_T;
98
99 /**********************************************************************************************************/
100 // DISPLAY BLOCK DATA STRUCTURE
101 /**********************************************************************************************************/
102 typedef union _BLOCK_START_REG_U_tag
103 {
104     struct START_REG_map
105     {
106 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
107         volatile uint  start_x    :12;//block start horizontal coordinate to LCD left top point
108         volatile uint  res        :4; //reserved
109         volatile uint  start_y    :12;//block start vertical coordinate to LCD left top point
110         volatile uint  priority   :3; //0~7,high:7,low:0
111         volatile uint  enable     :1; //1:enable block;0:disable block;
112 #else
113         volatile uint  enable     :1; //1:enable block;0:disable block;
114         volatile uint  priority   :3; //0~7,high:7,low:0
115         volatile uint  start_y    :12;//block start vertical coordinate to LCD left top point
116         volatile uint  res        :4; //reserved
117         volatile uint  start_x    :12;//block start horizontal coordinate to LCD left top point
118 #endif
119     } mBits;
120     volatile uint32 value;
121 } BLOCK_START_REG_U;
122
123 typedef union _BLOCK_END_REG_U_tag
124 {
125     struct END_REG_map
126     {
127 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
128         volatile uint end_x       :12;//block end horizontal coordinate to LCD left top point
129         volatile uint end_y       :12;//block end vertical coordinate to LCD left top point
130         volatile uint width       :8; //block real data width in SDRAM should be sdram_blk_width*8
131 #else
132         volatile uint width       :8; //block real data width in SDRAM should be sdram_blk_width*8
133         volatile uint end_y       :12;//block end vertical coordinate to LCD left top point
134         volatile uint end_x       :12;//block end horizontal coordinate to LCD left top point
135 #endif
136     } mBits;
137     volatile uint32 value;
138 } BLOCK_END_REG_U;
139
140 typedef union _BLOCK_CONFIG_REG_U_tag
141 {
142     struct CONFIG_REG_map
143     {
144 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
145         volatile uint alpha             :8;
146         volatile uint colorkey          :16;
147         volatile uint resolution        :2;
148         volatile uint alpha_sel         :1;
149         volatile uint colorkey_en       :1;
150         volatile uint type              :1;
151         volatile uint res               :3;
152 #else
153         volatile uint res               :3;
154         volatile uint type              :1;
155         volatile uint colorkey_en       :1;
156         volatile uint alpha_sel         :1;
157         volatile uint resolution        :2;
158         volatile uint colorkey          :16;
159         volatile uint alpha             :8;
160 #endif
161     } mBits;
162     volatile uint32 value;
163 } BLOCK_CONFIG_REG_U;
164
165 typedef struct _BLOCK_T_tag
166 {
167     BLOCK_START_REG_U   blk_start;
168     BLOCK_END_REG_U     blk_end;
169     BLOCK_CONFIG_REG_U  blk_config;
170     uint32              sdram_addr; //start address of block pixel data
171     uint32              blk_num;    //0~5
172 } LCD_BLOCK_T;
173
174 typedef struct _BLOCK_ACCESS_T_tag
175 {
176     uint32   blk_num;   //0~5
177     uint32   blk_used;  //0:don't use this block;1:use this block
178     uint32   blk_mask;  //access the block mask.If mask is correct,can access block
179 } BLOCK_ACCESS_T;
180
181 /**********************************************************************************************************/
182 // LCD COMMAND STRUCTURE
183 /**********************************************************************************************************/
184 typedef struct _LCD_CMD_T_tag
185 {
186     volatile uint32 left_cmd;  //set LCD display window left position command
187     volatile uint32 top_cmd;   //set LCD display window top position command
188     volatile uint32 right_cmd; //set LCD display window right position command
189     volatile uint32 bottom_cmd;//set LCD display window bottom position command
190 } LCD_CMD_T;
191 /**********************************************************************************************************/
192 // LCDC COLOR STRUCTURE
193 /**********************************************************************************************************/
194 typedef union _COLOR_REG_U_tag
195 {
196     struct _COLOR_REG_map
197     {
198 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
199         volatile uint colorCoeff   :12;
200         volatile uint res          :20;//reserved
201 #else
202         volatile uint res          :20;//reserved
203         volatile uint colorCoeff   :12;
204 #endif
205     } mBits;
206     volatile uint32 value;
207 } COLOR_REG_U;
208
209 typedef struct _COLORMATRIX_T_tag
210 {
211     COLOR_REG_U coeffA1;
212     COLOR_REG_U coeffA2;
213     COLOR_REG_U coeffA3;
214     COLOR_REG_U coeffB1;
215     COLOR_REG_U coeffB2;
216     COLOR_REG_U coeffB3;
217     COLOR_REG_U coeffC1;
218     COLOR_REG_U coeffC2;
219     COLOR_REG_U coeffC3;
220 } COLORMATRIX_T;
221 /**********************************************************************************************************/
222 // LCDC RGB MODE DATA STRUCTURE
223 /**********************************************************************************************************/
224 typedef union _LCDC_RGB_LCD_TIMING0_U
225 {
226     struct RGB_TIMING0_map
227     {
228 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
229         volatile uint bfw :8;//bit7~bit0,beginning of frame horizontal sync clock wait count - 1
230         volatile uint efw :8;//bit15~bit8,end of frame horizontal sync clock wait count - 1
231         volatile uint vsw :8;//bit23~vit16,Vertical Sync Pulse Width - 1
232         volatile uint res :8;//bit31~bit24,reserved
233 #else
234         volatile uint res :8;//bit31~bit24,reserved
235         volatile uint vsw :8;//bit23~vit16,Vertical Sync Pulse Width - 1
236         volatile uint efw :8;//bit15~bit8,end of frame horizontal sync clock wait count - 1
237         volatile uint bfw :8;//bit7~bit0,beginning of frame horizontal sync clock wait count - 1
238 #endif
239     } mBits;
240     volatile uint32 value;
241 } LCDC_RGB_LCD_TIMING0_U;
242
243 typedef union _LCDC_RGB_LCD_TIMING1_U
244 {
245     struct RGB_TIMING1_map
246     {
247 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
248         volatile uint blw :8;//8bits,beginning of line pixel cloxk wait count - 1
249         volatile uint elw :8;//8bits,end of line pixel cloxk wait count - 1
250         volatile uint hsw :8;//8bits,Horizontal sync Pulse width - 1
251         volatile uint res :8;//bit31~bit24,reserved
252 #else
253         volatile uint res :8;//bit31~bit24,reserved
254         volatile uint hsw :8;//8bits,Horizontal sync Pulse width - 1
255         volatile uint elw :8;//8bits,end of line pixel cloxk wait count - 1
256         volatile uint blw :8;//8bits,beginning of line pixel cloxk wait count - 1
257
258 #endif
259     } mBits;
260     volatile uint32 value;
261 } LCDC_RGB_LCD_TIMING1_U;
262
263 typedef union _LCDC_RGB_LCD_CTRL_U
264 {
265     struct RGB_LCD_CTRL_map
266     {
267 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
268         volatile uint res_1       :1; //1bit,ScalingUp,for LCD,bypass scalingUP mode
269         volatile uint hsync_pol   :1; //1bit,0:LCD_HSYNC is valid when it is 1'b1;1:LCD_HSYNC is valid when it is 1'b0
270         volatile uint vsync_pol   :1; //1bit,0:LCD_VSYNC is valid when it is 1'b1;1:LCD_VSYNC is valid when it is 1'b0
271         volatile uint enable_pol  :1; //1bit,0:LCD_Enable is valid when it is 1'b1;1:LCD_Enable is valid when it is 1'b0
272         volatile uint lcd_bpp     :2; //2bits,Bit Per Pixel;00¡êo888 01¡êo666;10: 565  11: Rsved
273         volatile uint trans_cycle :1; //1bits,0: 1 cycle per Pixel;1: 3 cycle per Pixel
274         volatile uint rb_format   :1; //1bits,0: pixel output sequence is RGB  1: output sequence is BGR
275         volatile uint res         :24;//bit31~bit8
276 #else
277         volatile uint res         :24;//bit31~bit8
278         volatile uint rb_format   :1; //1bits,0: pixel output sequence is RGB  1: output sequence is BGR
279         volatile uint trans_cycle :1; //1bits,0: 1 cycle per Pixel;1: 3 cycle per Pixel
280         volatile uint lcd_bpp     :2; //2bits,Bit Per Pixel;00¡êo888 01¡êo666;10: 565  11: Rsved
281         volatile uint enable_pol  :1; //1bit,0:LCD_Enable is valid when it is 1'b1;1:LCD_Enable is valid when it is 1'b0
282         volatile uint vsync_pol   :1; //1bit,0:LCD_VSYNC is valid when it is 1'b1;1:LCD_VSYNC is valid when it is 1'b0
283         volatile uint hsync_pol   :1; //1bit,0:LCD_HSYNC is valid when it is 1'b1;1:LCD_HSYNC is valid when it is 1'b0
284         volatile uint res_1       :1; //1bit,ScalingUp,for LCD,bypass scalingUP mode
285 #endif
286     } mBits;
287     volatile uint32 value;
288 } LCDC_RGB_LCD_CTRL_U;
289
290 typedef struct _LCDC_RGB_INT_ENA_T_tag
291 {
292     uint16 end_of_frame;  //1bit:0:disable;1:enable
293     uint16 start_of_frame;//1bit:0:disable;1:enable
294 } LCDC_RGB_INT_ENA_T;
295
296 typedef struct _LCDC_RGB_SPEC_T_tag
297 {
298     //  LCDC_RGB_LCD_TIMING0_U  timing0;
299     //  LCDC_RGB_LCD_TIMING1_U  timing1;
300     LCDC_RGB_LCD_CTRL_U     lcd_ctrl;
301 } LCDC_RGB_SPEC_T;
302
303 typedef struct _LCDC_RGB_INFO_T_tag
304 {
305     LCDC_RGB_LCD_TIMING0_U  timing0;
306     LCDC_RGB_LCD_TIMING1_U  timing1;
307     LCDC_RGB_LCD_CTRL_U     lcd_ctrl;
308 } LCDC_RGB_INFO_T;
309 /**********************************************************************************************************/
310 // LCDC MCU MODE DATA STRUCTURE
311 /**********************************************************************************************************/
312 typedef union _LCDC_MCU_LCD_PARAMETER0_U
313 {
314     struct MCU_PARAMETER0_map
315     {
316 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
317         volatile uint whpw    :4; //Write High Pulse Width
318         volatile uint wlpw    :4; //Write Lower Pulse Width
319         volatile uint wcss    :2; //Write CS Status
320         volatile uint rhpw    :4; //Read High Pulse Width
321         volatile uint rlpw    :4; //Read Lower Pulse Width
322         volatile uint rcss    :2; //Read CS Status
323         volatile uint res     :12;//reserved
324 #else
325         volatile uint res     :12;//reserved
326         volatile uint rcss    :2; //Read CS Status
327         volatile uint rlpw    :4; //Read Lower Pulse Width
328         volatile uint rhpw    :4; //Read High Pulse Width
329         volatile uint wcss    :2; //Write CS Status
330         volatile uint wlpw    :4; //Write Lower Pulse Width
331         volatile uint whpw    :4; //Write High Pulse Width
332 #endif
333     } mBits;
334     volatile uint32 value;
335 } LCDC_MCU_LCD_PARAMETER0_U;
336
337 typedef union _LCDC_MCU_LCD_PARAMETER1_U
338 {
339     struct MCU_PARAMETER1_map
340     {
341 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
342         volatile uint whpw    :4; //Write High Pulse Width
343         volatile uint wlpw    :4; //Write Lower Pulse Width
344         volatile uint wcss    :2; //Write CS Status
345         volatile uint rhpw    :4; //Read High Pulse Width
346         volatile uint rlpw    :4; //Read Lower Pulse Width
347         volatile uint rcss    :2; //Read CS Status
348         volatile uint res     :12;//reserved
349 #else
350         volatile uint res     :12;//reserved
351         volatile uint rcss    :2; //Read CS Status
352         volatile uint rlpw    :4; //Read Lower Pulse Width
353         volatile uint rhpw    :4; //Read High Pulse Width
354         volatile uint wcss    :2; //Write CS Status
355         volatile uint wlpw    :4; //Write Lower Pulse Width
356         volatile uint whpw    :4; //Write High Pulse Width
357 #endif
358     } mBits;
359     volatile uint32 value;
360 } LCDC_MCU_LCD_PARAMETER1_U;
361
362 typedef union _LCDC_MCU_MODESEL_U
363 {
364     struct MCU_MODESEL_map
365     {
366 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
367         volatile uint modesel0    :1; //ModeSel0:0: 8080;1: 6800
368         volatile uint modesel1    :1; //ModeSel1:0: 8080;1: 6800
369         volatile uint res         :30;//reserved
370 #else
371         volatile uint res         :30;//reserved
372         volatile uint modesel1    :1; //ModeSel1:0: 8080;1: 6800
373         volatile uint modesel0    :1; //ModeSel0:0: 8080;1: 6800
374 #endif
375     } mBits;
376     volatile uint32 value;
377 } LCDC_MCU_LCD_MODESEL_U;
378
379 typedef union _LCDC_MCU_RGBMODE_U
380 {
381     struct MCU_RGBMODE_map
382     {
383 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
384         volatile uint cs0_rgb_mode    :2; //CS0 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
385         volatile uint cs1_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
386         volatile uint res             :28;//reserved
387 #else
388         volatile uint res             :28;//reserved
389         volatile uint cs1_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
390         volatile uint cs0_rgb_mode    :2; //CS0 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
391 #endif
392     } mBits;
393     volatile uint32 value;
394 } LCDC_MCU_LCD_RGBMODE_U;
395
396 typedef struct _LCDC_MCU_SPEC_T_tag
397 {
398     LCDC_MCU_LCD_PARAMETER0_U parameter0;
399     LCDC_MCU_LCD_PARAMETER1_U parameter1;
400     LCDC_MCU_LCD_MODESEL_U    modesel;
401     LCDC_MCU_LCD_RGBMODE_U    rgbmode;
402 } LCDC_MCU_SPEC_T;
403
404
405 typedef struct _LCDC_MCU_INFO_T_tag
406 {
407     LCDC_MCU_LCD_PARAMETER0_U parameter0;
408     LCDC_MCU_LCD_PARAMETER1_U parameter1;
409     LCDC_MCU_LCD_MODESEL_U    modesel;
410     LCDC_MCU_LCD_RGBMODE_U    rgbmode;
411     uint32                    lcd_cd[2];//0:command is 0,data is 1,1:command is 1,data is 0
412     uint32                    lcd_sum;  //lcd total number
413 } LCDC_MCU_INFO_T;
414
415 typedef struct _LCDC_MCU_CMD_DATA_ADDR_tag
416 {
417     uint32 cmd_addr;
418     uint32 data_addr;
419 } LCDC_MCU_ADDR_T;
420 /**********************************************************************************************************/
421 // LCD INTERRUPT STRUCTURE
422 /**********************************************************************************************************/
423 typedef struct _LCD_INT_ENA_T_tag
424 {
425     LCDC_RGB_INT_ENA_T rgb_int_enable;//is used only when lcdc rgb mode
426     uint32 mcu_endofosd_en;           //1:enable;0:disable,is used only when lcdc mcu mode
427 } LCD_INT_ENA_T;
428 /**********************************************************************************************************/
429 // LCDC SPEC STRUCTURE
430 /**********************************************************************************************************/
431 typedef struct _LCDC_SPEC_T_tag
432 {
433     LCDC_RGB_SPEC_T rgb_lcd_spec;
434     LCDC_MCU_SPEC_T mcu_lcd_spec;
435 } LCDC_SPEC_T;
436 /**********************************************************************************************************/
437 // LCD INFORMATION STRUCTURE
438 /**********************************************************************************************************/
439 typedef struct _LCDC_INFO_T_tag
440 {
441     LCDC_RGB_INFO_T rgb_info;
442     LCDC_MCU_INFO_T mcu_info;
443 } LCDC_INFO_T;
444
445 /**********************************************************************************************************/
446 // LCM TYPE STRUCTURE
447 /**********************************************************************************************************/
448 typedef struct _LCM_TYPE_T_tag
449 {
450     uint16 lcm_lcd_sum;          //when use LCM module,lcd sum
451     uint16 lcm_lcd_databits_max; //LCD linked to LCM data bits number maximum
452 } LCM_TYPE_T;
453 /**********************************************************************************************************/
454 // LCM CONFIGURE STRUCTURE
455 /**********************************************************************************************************/
456 typedef union _LCM_LCD_PARAMETER_U_tag
457 {
458     struct LCM_PARAMETER_map
459     {
460 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
461         volatile uint whpw    :4; //Write High Pulse Width
462         volatile uint wlpw    :4; //Write Lower Pulse Width
463         volatile uint wcss    :2; //Write CS Setup time
464         volatile uint rhpw    :4; //Read High Pulse Width
465         volatile uint rlpw    :4; //Read Lower Pulse Width
466         volatile uint rcss    :2; //Read CS Setup time
467         volatile uint res     :12;//reserved
468 #else
469         volatile uint res     :12;//reserved
470         volatile uint rcss    :2; //Read CS Setup time
471         volatile uint rlpw    :4; //Read Lower Pulse Width
472         volatile uint rhpw    :4; //Read High Pulse Width
473         volatile uint wcss    :2; //Write CS Setup time
474         volatile uint wlpw    :4; //Write Lower Pulse Width
475         volatile uint whpw    :4; //Write High Pulse Width
476 #endif
477     } mBits;
478     volatile uint32 value;
479 } LCM_LCD_PARAMETER_U;
480 typedef union _LCM_LCD_PARAMETER0_U_tag
481 {
482     struct LCM_PARAMETER0_map
483     {
484 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
485         volatile uint whpw    :4; //Write High Pulse Width
486         volatile uint wlpw    :4; //Write Lower Pulse Width
487         volatile uint wcss    :2; //Write CS Setup time
488         volatile uint rhpw    :4; //Read High Pulse Width
489         volatile uint rlpw    :4; //Read Lower Pulse Width
490         volatile uint rcss    :2; //Read CS Setup time
491         volatile uint res     :12;//reserved
492 #else
493         volatile uint res     :12;//reserved
494         volatile uint rcss    :2; //Read CS Status
495         volatile uint rlpw    :4; //Read Lower Pulse Width
496         volatile uint rhpw    :4; //Read High Pulse Width
497         volatile uint wcss    :2; //Write CS Status
498         volatile uint wlpw    :4; //Write Lower Pulse Width
499         volatile uint whpw    :4; //Write High Pulse Width
500 #endif
501     } mBits;
502     volatile uint32 value;
503 } LCM_LCD_PARAMETER0_U;
504
505 typedef union _LCM_LCD_PARAMETER1_U_tag
506 {
507     struct LCM_PARAMETER1_map
508     {
509 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
510         volatile uint whpw    :4; //Write High Pulse Width
511         volatile uint wlpw    :4; //Write Lower Pulse Width
512         volatile uint wcss    :2; //Write CS Setup time
513         volatile uint rhpw    :4; //Read High Pulse Width
514         volatile uint rlpw    :4; //Read Lower Pulse Width
515         volatile uint rcss    :2; //Read CS Setup time
516         volatile uint res     :12;//reserved
517 #else
518         volatile uint res     :12;//reserved
519         volatile uint rcss    :2; //Read CS Status
520         volatile uint rlpw    :4; //Read Lower Pulse Width
521         volatile uint rhpw    :4; //Read High Pulse Width
522         volatile uint wcss    :2; //Write CS Status
523         volatile uint wlpw    :4; //Write Lower Pulse Width
524         volatile uint whpw    :4; //Write High Pulse Width
525 #endif
526     } mBits;
527     volatile uint32 value;
528 } LCM_LCD_PARAMETER1_U;
529
530 typedef union _LCM_MODESEL_U
531 {
532     struct MODESEL_map
533     {
534 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
535         volatile uint modesel0    :1; //ModeSel0:0: 8080;1: 6800
536         volatile uint modesel1    :1; //ModeSel1:0: 8080;1: 6800
537         volatile uint modesel2    :1; //ModeSel1:0: 8080;1: 6800
538         volatile uint modesel3    :1; //ModeSel1:0: 8080;1: 6800
539         volatile uint modesel4    :1; //ModeSel1:0: 8080;1: 6800
540         volatile uint modesel5    :1; //ModeSel1:0: 8080;1: 6800
541         volatile uint res         :26;//reserved
542 #else
543         volatile uint res         :26;//reserved
544         volatile uint modesel5    :1; //ModeSel1:0: 8080;1: 6800
545         volatile uint modesel4    :1; //ModeSel1:0: 8080;1: 6800
546         volatile uint modesel3    :1; //ModeSel1:0: 8080;1: 6800
547         volatile uint modesel2    :1; //ModeSel1:0: 8080;1: 6800
548         volatile uint modesel1    :1; //ModeSel1:0: 8080;1: 6800
549         volatile uint modesel0    :1; //ModeSel0:0: 8080;1: 6800
550 #endif
551     } mBits;
552     volatile uint32 value;
553 } LCM_LCD_MODESEL_U;
554
555 typedef union _LCM_RGBMODE_U
556 {
557     struct RGBMODE_map
558     {
559 #if defined CHIP_ENDIAN_LITTLE && !defined _BIG_ENDIAN
560         volatile uint cs0_rgb_mode    :2; //CS0 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
561         volatile uint cs1_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
562         volatile uint cs2_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
563         volatile uint cs3_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
564         volatile uint cs4_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
565         volatile uint cs5_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
566         volatile uint res             :20;//reserved
567 #else
568         volatile uint res             :20;//reserved
569         volatile uint cs5_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
570         volatile uint cs4_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
571         volatile uint cs3_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
572         volatile uint cs2_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
573         volatile uint cs1_rgb_mode    :2; //CS1 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
574         volatile uint cs0_rgb_mode    :2; //CS0 device RGB mode:2'b00¡êo16bit (565);2'b01¡êo18bit (666);2'b10: 8bit;2'b11: 9bit
575 #endif
576     } mBits;
577     volatile uint32 value;
578 } LCM_LCD_RGBMODE_U;
579 typedef struct _LCM_LCDC_SPEC_T_tag
580 {
581     //  LCM_LCD_PARAMETER0_U    para0;
582     //  LCM_LCD_PARAMETER1_U    para1;
583     LCM_LCD_MODESEL_U       mode_sel;
584     LCM_LCD_RGBMODE_U       rgb_mode;
585 } LCM_LCD_SPEC_T;
586 /**********************************************************************************************************/
587 // LCM LCD INFORMATION STRUCTURE
588 /**********************************************************************************************************/
589 typedef struct _LCM_LCDC_INFO_T_tag
590 {
591     LCM_LCD_PARAMETER0_U    para0;
592     LCM_LCD_PARAMETER1_U    para1;
593     LCM_LCD_MODESEL_U       mode_sel;
594     LCM_LCD_RGBMODE_U       rgb_mode;
595     uint32                  lcd_sum;
596 } LCM_LCD_INFO_T;
597 /**********************************************************************************************************/
598 // LCM PIN USE STRUCTURE
599 /**********************************************************************************************************/
600 typedef struct _LCM_LCD_PIN_T_tag
601 {
602     uint8  cd_pin;  //0~5
603     uint8  cs_pin;  //0~5
604     uint8  lcd_used;//0:don't used;1:is used
605     uint8  cd_level;
606 } LCM_LCD_PIN_T;
607
608 typedef struct _LCM_PIN_USE_T_tag
609 {
610     LCM_LCD_PIN_T lcd0;
611     LCM_LCD_PIN_T lcd1;
612     LCM_LCD_PIN_T lcd2;
613     LCM_LCD_PIN_T lcd3;
614     LCM_LCD_PIN_T lcd4;
615     LCM_LCD_PIN_T lcd5;
616 } LCM_PIN_USE_T;
617
618 /**********************************************************************************************************/
619 // OPERATION RETURN RESULT
620 /**********************************************************************************************************/
621 #define LCD_ERROR_BASE              0
622 #define LCD_OK                      (LCD_ERROR_BASE - 0) //operation success
623 #define LCD_ERROR_RGB_BPP           (LCD_ERROR_BASE - 1) //RGB mode,LCD pixel bit sum is wrong  
624 #define LCD_ERROR_MALLOC_BLOCK      (LCD_ERROR_BASE - 2) //malloc block fail
625 #define LCD_ERROR_DISPLAYWINDOW     (LCD_ERROR_BASE - 3) //lcd display window is wrong
626 #define LCD_ERROR_POINTER_NULL      (LCD_ERROR_BASE - 4) //pointer is null
627 #define LCD_ERROR_LCD_ID            (LCD_ERROR_BASE - 5) //lcd id is wrong
628 #define LCD_ERROR_LCD_DISPLAY_SIZE  (LCD_ERROR_BASE - 6) //lcd display size is wrong
629 #define LCD_ERROR_MODE              (LCD_ERROR_BASE - 7) //lcdc mode is wrong
630 #define LCD_ERROR_MODE_OPERATION    (LCD_ERROR_BASE - 8) //mode and operation are mismatches
631 #define LCD_ERROR_BLOCK_NUMBER      (LCD_ERROR_BASE - 9) //display block num is wrong
632 #define LCD_ERROR_ACCESS_MASK       (LCD_ERROR_BASE - 10)//can't access display block 
633 #define LCD_ERROR_RESOLUTION        (LCD_ERROR_BASE - 11)//display data resolution is wrong
634 #define LCD_ERROR_BLOCK_POSITION    (LCD_ERROR_BASE - 12)//block position is wrong
635 #define LCD_ERROR_TV_MODE           (LCD_ERROR_BASE - 13)//tv mode is wrong
636 #define LCD_ERROR_LCM_PIN_USE       (LCD_ERROR_BASE - 14)//LCM pin reuse is wrong
637 #define LCD_ERROR_LCM_RGBMODE       (LCD_ERROR_BASE - 15)//LCM RGB mode is wrong
638 #define LCD_ERROR_LCM_LCD_SUM       (LCD_ERROR_BASE - 16)//LCD sum is mismatch with LCD rgb mode for LCM
639 #define LCD_ERROR_CD_LEVEL          (LCD_ERROR_BASE - 17)//LCD cd level is wrong
640 #define LCD_ERROR_NO_SUPPORT        (LCD_ERROR_BASE - 18)//not support interface
641 #define LCD_ERROR_LCD_BITS          (LCD_ERROR_BASE - 19)//LCD bits error
642 #define LCD_ERROR_LCD_PIXEL_NUM     (LCD_ERROR_BASE - 20)//refresh pixels number is wrong
643 #define LCD_ERROR_NO_FOUND          (LCD_ERROR_BASE - 100)
644 /**********************************************************************************************************/
645
646 /**-----------------------------------------------------------------------------------------*
647  **                         Compiler Flag                                                   *
648  **-----------------------------------------------------------------------------------------*/
649 #ifdef __plusplus
650 {
651 #endif
652
653
654 #endif//end of _LCDC_DATA_TYPE_H
655
656     //end of lcdc_data_type.h