tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / include / asm / arch-sc8825 / dal_lcd.h
1 /******************************************************************************
2  ** File Name:      dal_lcd.h                                                 *
3  ** Author:         Jim zhang                                                 *
4  ** DATE:           06/03/2004                                                *
5  ** Copyright:      2004 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:    This file define the color LCD API function for up layer  *
7  **                 1. LCD driver support a LCD buffer according to lcd size  *
8  **                    to hold the pixel color. Up layer can get the buffer   *
9  **                    pointer and operate on the LCD buffer.                 *
10  **                 2. LCD driver is only responsible of copying the pixel    *
11  **                    color in LCD buffer to LCD (hardware).                 *
12  ******************************************************************************
13
14  ******************************************************************************
15  **                        Edit History                                       *
16  ** ------------------------------------------------------------------------- *
17  ** DATE           NAME             DESCRIPTION                               *
18  ** 06/03/2004     Jim.zhang        Update file used for lcd api for up layer *
19  ** 10/22/2004     Jim.zhang        Delete some api.                          *
20  ******************************************************************************/
21
22 #ifndef _DAL_LCD_H_
23 #define _DAL_LCD_H_
24
25 /**---------------------------------------------------------------------------*
26  **                         Dependencies                                      *
27  **---------------------------------------------------------------------------*/
28
29 /**---------------------------------------------------------------------------*
30  **                         Compiler Flag                                     *
31  **---------------------------------------------------------------------------*/
32 #ifdef __cplusplus
33 extern   "C"
34 {
35 #endif
36
37 #include "sci_types.h"
38 #include "os_api.h"
39 #include "lcd.h"
40 #include "lcd_controller.h"
41 #include "lcdc_types.h"
42
43 /**---------------------------------------------------------------------------*
44  **                         Macro defines.
45  **---------------------------------------------------------------------------*/
46
47 #define LCD_VERSION_1       1
48
49 //LCD id enum struct
50 #define MAIN_LCD_ID         0
51 #define SUB_LCD_ID          1
52
53 #define LCD_SUM                 8
54 #define BLOCK_SUM                   6
55
56 #define LCD_SUPPORT_MAX 6
57
58 #define MAX_LCM_PARAM_VALUE ((0x3ee << 10)|(0x3ee))
59
60 #define  LCD_BACKGROUND    0x0
61
62 //Priority field configures the time ratio of LCM operation to NAND operation.
63 #define LCD_BUSRATIO            1  // Configure the bus priority.
64
65 #define BLOCK_ID_WITH_SINGLE_PIXEL_ALPHA 1
66 #define BLOCK_IMAGE_ID                      0
67
68 //resolution of lcd data
69 //0:RGB888; 1:RGB666; 2:RGB565;3:RGB555;4:GREY,5:YUV422;6:YUV420;7:YUV400
70 #define  LCD_RESOLUTION_RGB888          0
71 #define  LCD_RESOLUTION_RGB666          1
72 #define  LCD_RESOLUTION_RGB565          2
73 #define  LCD_RESOLUTION_RGB555          3
74 #define  LCD_RESOLUTION_GREY              4
75 #define  LCD_RESOLUTION_YUV422          5
76 #define  LCD_RESOLUTION_YUV420          6
77 #define  LCD_RESOLUTION_YUV400          7
78
79 #define LCD_USE_PIXEL_ALPHA        0
80 #define LCD_USE_BLOCK_ALPHA               1
81
82
83 // LCD operation fashion
84 typedef enum
85 {
86     BLOCK_OPERATION = 0   ,
87     AHB_COMMAND_OPERATION
88 }
89 LCD_OPERATION_E;
90
91
92
93 //Brush LCD mode
94 typedef enum
95 {
96     LCD_BRUSH_MODE_SYNC = 0,
97     LCD_BRUSH_MODE_ASYNC
98 } LCD_BRUSH_MODE_E;
99
100 //LCD status
101 typedef enum
102 {
103     LCD_STATUS_IDLE   = 0,
104     LCD_STATUS_BUSY
105 } LCD_STATUS_E;
106
107
108 typedef enum
109 {
110     DATA_SIZE_BYTE = 0,             //0:DATA_SIZE_BYTE
111     DATA_SIZE_HALFWORD,             //1:DATA_SIZE_HALFWORD
112     DATA_SIZE_WORD                  //2:DATA_SIZE_WORD
113 } LCD_DATA_SIZE_E;
114 typedef enum
115 {
116     MEMORY_IDLE = 0,
117     MEMORY_READY   ,
118     MEMORY_BUSY    ,
119     MEMORY_ERROR
120 } LCD_MEMORY_STATE_E;
121
122 typedef enum
123 {
124     LCD_IDLE = 0,
125     LCD_READY   ,
126     LCD_BUSY    ,
127     LCD_ERROR
128 } LCD_STATE_E;
129
130
131 typedef enum
132 {
133     SYS_STATE_ASSERT = 0,           // Assert state
134     SYS_STATE_NORMAL    ,           // Normal Run
135     SYS_STATE_INT                   // Interrupt state
136 } SYS_STATE_E;
137
138
139 /**---------------------------------------------------------------------------*
140  **                         Struct defines.
141  **---------------------------------------------------------------------------*/
142
143 typedef struct _osd_rect_tag //rectangle
144 {
145     uint16  x;
146     uint16  y;
147     uint16  w;
148     uint16  h;
149 } OSD_RECT_T;
150
151 typedef struct _osd_size_tag
152 {
153     uint16 w;
154     uint16 h;
155 } OSD_SIZE_T;
156
157 typedef struct _osd_info_tag
158 {
159     OSD_RECT_T rect;
160     uint32 addr;
161     uint16 colorkey;
162     uint16  alpha;
163     struct _osd_info_tag *next_ptr;
164 } OSD_INFO_T;
165
166 typedef struct _isp_osd_info_tag
167 {
168     uint32 enable;
169     OSD_SIZE_T background_size;
170     OSD_INFO_T *inf_ptr;
171 } ISP_OSD_PARAM_T;
172
173 //Block Configuration
174 typedef struct blockcfg_tag
175 {
176     uint16 start_x;
177     uint16 start_y;
178     uint16 end_x;
179     uint16 end_y;
180     uint16 colorkey;
181     uint16 width;                //real data width in SDRAM
182     uint8  resolution;           //0:RGB888; 1:RGB666; 2:RGB565(RGB555 if OSD)
183     uint8  type;                 //0:OSD; 1:image
184     uint8  priority;             //0~7, high:7,low:0
185     uint8  alpha;
186     uint8  colorkey_en;
187     uint8  alpha_sel;          //0-pixel alpha;1-block alpha
188     uint8  is_little_endian;   //support for 6800H
189     uint8  reserved;
190     uint32 grey_rgb;//RGB888 value  //support for 6800H
191 } BLOCKCFG_T;
192
193
194
195 typedef struct block_tag
196 {
197     uint16      is_enable;  //1: enable this block;0: disable this block
198     uint32      *mem_ptr;
199     //#ifdef PLATFORM_SC6800H
200     uint32      *alpha_addr;
201     uint32      *uv_addr;
202     //#endif
203     LCD_STATE_E state;      //{idle,ready,busy,error}
204     BLOCKCFG_T  cfg;
205 } BLOCK_T;
206
207 typedef struct block_group_tag
208 {
209     uint32    lcd_id;
210     BLOCK_T   block[BLOCK_SUM];
211 } BLOCK_GROUP_T;
212
213 typedef struct lcd_property_tag
214 {
215     SCI_SEMAPHORE_PTR   semaphore;
216     LCD_BRUSH_MODE_E    brush_mode;// 1 if brush lcd with synchronistic mean, or else 0
217     LCD_OPERATION_E         operation;  //block operation or AHB command operation
218     LCD_STATE_E             state ;     //{idle, ready,busy, error};
219     uint32                      blk_group_num;
220     uint32                      sleep_state;
221     uint32               *buffer;
222     LCD_SPEC_INFO_T     lcd_spec;
223 } LCD_PROPERTY_T;
224
225
226
227 typedef struct lcd_info_tag
228 {
229     uint32  r_bitmask;              // R(Red color) bit mask
230     uint32  g_bitmask;              // G(Green color) bit mask
231     uint32  b_bitmask;              // B(Black color) bit mask
232     uint16  bits_per_pixel;         // bit number of one pixel
233     uint16  lcd_width;              // lcd width
234     uint16  lcd_height;             // lcd height.
235     uint16  contrast_min;           // min value of contrast
236     uint16  contrast_max;           // max value of contrast
237     uint16  contrast_defaut;        // default value of contrast
238     void    *lcdbuff_ptr;           // lcd buffer pointer
239 } LCD_INFO_T;
240
241 typedef struct _lcd_out_position_tag
242 {
243     LCD_ID_E lcd_id;   //lcd id
244     uint16   start_x;  //output start x at lcd
245     uint16   start_y;  //output start y at lcd
246     uint16   width;    //output data width
247     uint16   height;   //output data height
248     uint32   *data_buf;//memory address which lcd output data to
249 } LCD_OUT_POSITION_T;
250
251
252
253 typedef struct _lcd_size_tag
254 {
255     uint16 w;
256     uint16 h;
257 } LCD_SIZE_T;
258 typedef struct _lcd_rect_t_tag
259 {
260     uint16 left;  //LCD display window left position
261     uint16 top;   //LCD display window top position
262     uint16 right; //LCD display window right position
263     uint16 bottom;//LCD display window bottom position
264 } LCD_RECT_T;
265
266 typedef LCDC_CAP_PARAM_T LCD_CAP_PARAM_T;
267 typedef struct _lcd_memory_info_tag
268 {
269     uint32 buf_addr;
270     LCD_RECT_T cap_rect;
271     LCD_SIZE_T dst_size;
272     LCD_RECT_T dst_trim_rect;
273     LCD_DATA_FORMAT_E data_type;
274     uint32 data_endian_mode;
275 } LCD_MEMORY_INFO_T;
276 #if 0
277 typedef struct _lcd_block_info_tag
278 {
279     uint32             block_id;
280     BLOCKCFG_T  cfg;
281     BOOLEAN        is_enable;
282     uint32             buf_addr;
283     struct _lcd_block_info_tag   *next_block_info_ptr;
284 } LCD_BLOCK_INFO_T;
285
286 typedef struct _lcd_invalidate_param_tag
287 {
288     LCD_RECT_T rect;
289     LCD_ANGLE_E rot_angle;
290     LCD_BLOCK_INFO_T blk_info;
291 } LCD_INVALIDATE_PARAM_T;
292
293 typedef struct _lcd_convert_input_tag
294 {
295     uint16 logic_lcd_width;
296     uint16 logic_lcd_height;
297     LCD_RECT_T  logic_coordinate;
298     LCD_ANGLE_E logic_angle;
299 } LCD_CONVERT_INPUT_T;
300
301 typedef struct _lcd_convert_output_tag
302 {
303     LCD_RECT_T  physical_coordinate;
304     LCD_ANGLE_E rotation_angle;
305 } LCD_CONVERT_OUTPUT_T;
306 #endif
307 //#ifdef PLATFORM_SC8800H
308 typedef void (* lcd_invalidate_done_func_t) (uint32 param); //callback when invalidate end
309 //#endif
310 /**---------------------------------------------------------------------------*
311  **                         Function Prototypes
312  **---------------------------------------------------------------------------*/
313
314 /*****************************************************************************/
315 //  Description:    The function used to initlize the lcd. If have dual lcd,
316 //                  sub lcd will also  be initlized by this function.
317 //  Global resource dependence:
318 //  Author:         Jim.zhang
319 //  Note:           If have many lcd, this function will init all lcd.
320
321 /*****************************************************************************/
322 PUBLIC ERR_LCD_E LCD_Init (void);
323
324 /*****************************************************************************/
325 //  Description:  reset lcd module.
326 //  Global resource dependence:
327 //  Author: Jim.zhang
328 //  Note:
329 /*****************************************************************************/
330 PUBLIC void LCD_Reset (void);
331
332 /*****************************************************************************/
333 //  Description:    The function is used to close lcd when power off.
334 //  Global resource dependence:
335 //  Author:         Jim.zhang
336 //  Note:           When power off , call this function. If have many lcd,
337 //                  this function will close all lcd.
338 /*****************************************************************************/
339 PUBLIC void LCD_Close (void);
340
341 /*****************************************************************************/
342 //  Description:    Get the lcd basic information..
343 //  Global resource dependence:
344 //  Author:         Jim.zhang
345 //  Note:
346 /*****************************************************************************/
347 PUBLIC  ERR_LCD_E  LCD_GetInfo (//Return the operate status
348     LCD_ID_E  lcd_id,           //id of lcd to operate
349     LCD_INFO_T *lcd_info_ptr    //lcd information struct pointer
350 );
351
352 /*****************************************************************************/
353 //  Description:    Invalidate a rectangle of LCD--Refresh it.
354 //  Global resource dependence:
355 //  Author:         Jim.zhang
356 //  Return:         error code.
357 //  Note:1. the left up point is (0,0)
358 //       2. Before call InvalidateRect()£¬write LCD buffer with color,
359 //          and then InvalidateRect() the spefic area.
360 /*****************************************************************************/
361 PUBLIC ERR_LCD_E LCD_InvalidateRect ( //Return the operate status
362     LCD_ID_E lcd_id,                //id of lcd to operate
363     uint16 left,                    //left of the windows to be refreshed.
364     uint16 top,                     //top of the widonws to be refreshed.
365     uint16 right,                   //right of the windows to be refreshed.
366     uint16 bottom                   //bottom of the windows to be refreshed.
367 );
368
369 /*****************************************************************************/
370 //  Description:   invalidate a pixel(called by mmi special effect)
371 //    Global resource dependence:
372 //  Author: bin.ji
373 //    Note:
374 /*****************************************************************************/
375 PUBLIC void LCD_InvalidatePixel (
376     LCD_ID_E lcd_id,
377     uint16 x,
378     uint16 y,
379     uint16 color
380 );
381
382 /*****************************************************************************/
383 //  Description:    Invalidate a rectangle of LCD--Refresh it with angle.
384 //  Global resource dependence:
385 //  Author:         Jianping.wang
386 //  Return:         error code.
387 //  Note:1. the left up point is (0,0)
388 //       2. Before call InvalidateRect()£¬write LCD buffer with color,
389 //          and then InvalidateRect() the spefic area.
390 /*****************************************************************************/
391 PUBLIC ERR_LCD_E LCD_RotateInvalidateRect ( //Return the operate status
392     LCD_ID_E    lcd_id,                 //id of lcd to operate
393     uint16      left,                   //left of the windows to be refreshed.
394     uint16      top,                    //top of the widonws to be refreshed.
395     uint16      right,                  //right of the windows to be refreshed.
396     uint16      bottom,                 //bottom of the windows to be refreshed.
397     LCD_ANGLE_E angle                   //rotation angle
398 );
399 /*****************************************************************************/
400 //  Description:    Invalidate a rectangle of LCD--Refresh it by vertical scan mode.
401 //  Global resource dependence:
402 //  Author:         Jianping.wang
403 //  Return:         error code.
404 //  Note:1. the left up point is (0,0)
405 //       2. Before call InvalidateRect()£¬write LCD buffer with color,
406 //          and then InvalidateRect() the spefic area.
407 /*****************************************************************************/
408 PUBLIC ERR_LCD_E LCD_VerticalInvalidateRect ( //Return the operate status
409     LCD_ID_E lcd_id,                //id of lcd to operate
410     uint16 left,                    //left of the windows to be refreshed.
411     uint16 top,                     //top of the widonws to be refreshed.
412     uint16 right,                   //right of the windows to be refreshed.
413     uint16 bottom                   //bottom of the windows to be refreshed.
414 );
415 /*****************************************************************************/
416 //  Description:    Invalidate the whole lcd.
417 //  Global resource dependence:
418 //  Author:         Jim.zhang
419 //  Note:
420 /*****************************************************************************/
421 PUBLIC ERR_LCD_E LCD_Invalidate ( //Retrurn the operate status
422     LCD_ID_E  lcd_id            //id of lcd to operate
423 );
424
425 /*****************************************************************************/
426 //  Description:    Enter/Exit sleep mode to control power consume.
427 //  Global resource dependence:
428 //  Author:         Jim.zhang
429 //  Return:         error code.
430 //  Note:
431 /*****************************************************************************/
432 PUBLIC ERR_LCD_E   LCD_EnterSleep ( //Retrun the operate status
433     LCD_ID_E  lcd_id,             //id of lcd to operate
434     BOOLEAN is_sleep              //SCI_TRUE:enter sleep: SCI_FALSE:exit sleep mode
435 );
436
437
438 /*****************************************************************************/
439 //  Description:    Set the contrast value of lcd.
440 //  Global resource dependence:
441 //  Author:         Jim.zhang
442 //  Return:         return the operate status.
443 //  Note:
444 /*****************************************************************************/
445 PUBLIC ERR_LCD_E LCD_SetContrast ( //return the operate status
446     LCD_ID_E  lcd_id,           //id of lcd to operate
447     uint16  contrast            //contrast value to set to lcd.
448 );
449
450 /*****************************************************************************/
451 //  Description:    Set the brightness of LCD.
452 //  Global resource dependence:
453 //  Author:         Jim.zhang
454 //  Note:
455 /*****************************************************************************/
456 PUBLIC ERR_LCD_E LCD_SetBrightness (
457     LCD_ID_E lcd_id,    //ID of lcd to operate.
458     uint16 brightness   //brightness value to set.
459 );
460
461
462 /*****************************************************************************/
463 //  Description:    Enable lcd to partial display mode, so can save power.
464 //  Global resource dependence:
465 //  Author:         Jim.zhang
466 //  Return:         SCI_TRUE:SUCCESS ,SCI_FALSE:failed.
467 //  Note:           If all input parameters are 0, exit partial display mode.
468 /*****************************************************************************/
469 PUBLIC ERR_LCD_E  LCD_SetDisplayWindow (
470     LCD_ID_E lcd_id,//ID of lcd to operate
471     uint16 left,  //left of the display window
472     uint16 top,   //top of the display window
473     uint16 right,     //right of the display window
474     uint16 bottom //bottom of the display window
475 );
476
477
478
479
480 /*****************************************************************************/
481 //  Description: get lcd controller type
482 //  Global resource dependence:
483 //  Author: Jianping.wang
484 //  Note:
485 /*****************************************************************************/
486 PUBLIC LCD_CTRL_MODULE_E LCD_GetCtrlModule (LCD_ID_E lcd_id);
487 /*****************************************************************************/
488 //  Description: set brush lcd fashion
489 //  Global resource dependence:
490 //  Author: Jianping.wang
491 //  Note:
492 /*****************************************************************************/
493 PUBLIC ERR_LCD_E LCD_SetBrushMode (LCD_ID_E lcd_id, LCD_BRUSH_MODE_E mode);
494 /*****************************************************************************/
495 //  Description: get brush lcd fashion
496 //  Global resource dependence:
497 //  Author: Jianping.wang
498 //  Note:
499 //      input:
500 //          lcd_id - specify LCD
501 //      output:
502 //          none
503 //      return:
504 //          brush LCD mode
505 /*****************************************************************************/
506 PUBLIC LCD_BRUSH_MODE_E LCD_GetBrushMode (LCD_ID_E lcd_id);
507 /*****************************************************************************/
508 //  Description:get memory status
509 //  Global resource dependence:
510 //  Author: Jianping.wang
511 //  Note:
512 //      input:
513 //          lcd_id  - specify LCD
514 //      output:
515 //          none
516 //      return:
517 //          lcd status: LCD_IDLE  - don't use LCD ID
518 //                      LCD_BUSY  - is brushing this LCD
519 //                      LCD_READY - finish brushing this LCD
520 //                      LCD_ERROR - error
521 /*****************************************************************************/
522 PUBLIC LCD_STATE_E LCD_GetLCDState (LCD_ID_E lcd_id);
523 /*****************************************************************************/
524 //  Description: configure block parameters
525 //  Global resource dependence:
526 //  Author: Jianping.wang
527 //  Note:
528 /*****************************************************************************/
529 PUBLIC ERR_LCD_E LCD_ConfigBlock (
530     LCD_ID_E lcd_id,
531     uint32 blk_num,
532     BLOCKCFG_T config
533 );
534
535 /*****************************************************************************/
536 //  Description: get block parameters
537 //  Global resource dependence:
538 //  Author: Jianping.wang
539 //  Note:
540 /*****************************************************************************/
541 PUBLIC ERR_LCD_E LCD_GetConfigBlock (
542     LCD_ID_E lcd_id,
543     uint32 blk_num,
544     BLOCKCFG_T *cfg_ptr
545 );
546 /*****************************************************************************/
547 //  Description: Enable Block
548 //  Global resource dependence:
549 //  Author: Jianping.wang
550 //  Note:
551 /*****************************************************************************/
552 PUBLIC ERR_LCD_E LCD_EnableBlock (LCD_ID_E lcd_id, uint32 blk_num);
553 /*****************************************************************************/
554 //  Description:disable block
555 //  Global resource dependence:
556 //  Author: Jianping.wang
557 //  Note:
558 /*****************************************************************************/
559 PUBLIC ERR_LCD_E LCD_DisableBlock (LCD_ID_E lcd_id, uint32 blk_num);
560 /*****************************************************************************/
561 //  Description: Malloc memory
562 //  Global resource dependence:
563 //  Author: Jianping.wang
564 //  Note:
565 /*****************************************************************************/
566 PUBLIC uint32 *LCD_Malloc (uint32 size);
567 /*****************************************************************************/
568 //  Description:  free memory
569 //  Global resource dependence:
570 //  Author: Jianping.wang
571 //  Note:
572 /*****************************************************************************/
573 PUBLIC void LCD_Free (uint32 *addr_ptr);
574 /*****************************************************************************/
575 //  Description: set display memory
576 //  Global resource dependence:
577 //  Author: Jianping.wang
578 //  Note:
579 /*****************************************************************************/
580 PUBLIC ERR_LCD_E LCD_SetBlockBuffer (
581     LCD_ID_E lcd_id,
582     uint32 blk_num ,
583     uint32 *buf_ptr
584 );
585 /*****************************************************************************/
586 //  Description:
587 //  Global resource dependence:
588 //  Author: Jianping.wang
589 //  Note:
590 /*****************************************************************************/
591 PUBLIC LCD_MEMORY_STATE_E LCD_GetMemoryStatus (LCD_ID_E lcd_id, uint32 *mem_ptr);
592 /*****************************************************************************/
593 //  Description: Update LCD Timing
594 //  Global resource dependence:
595 //  Author: Jianping.wang
596 //  Note:
597 /*****************************************************************************/
598 PUBLIC ERR_LCD_E LCD_UpdateTiming (uint32 ahb_clk);
599 /*****************************************************************************/
600 //  Description:
601 //  Global resource dependence:
602 //  Author: Jianping.wang
603 //  Note:
604 /*****************************************************************************/
605 PUBLIC void TV_Open (TV_MODE_E mode);
606 /*****************************************************************************/
607 //  Description:
608 //  Global resource dependence:
609 //  Author: Jianping.wang
610 //  Note:
611 /*****************************************************************************/
612 PUBLIC void TV_Refresh (void);
613 /*****************************************************************************/
614 //  Description:
615 //  Global resource dependence:
616 //  Author: Jianping.wang
617 //  Note:
618 /*****************************************************************************/
619 PUBLIC void TV_Close (void);
620 /*****************************************************************************/
621 // Description: set LCDC Clock
622 // Global resource dependence:
623 // Author: Jianping.wang
624 // Note: this interface isn't called in interrupt handle function
625 /****************************************************************************/
626 PUBLIC int32 LCDC_SetClock (uint32 lcdc_clk);
627 /**********************************************************************************************************/
628 // Description: restore LCDC Clock
629 // Global resource dependence:
630 // Author: Jianping.wang
631 // Note: this interface isn't called in interrupt handle function
632 /**********************************************************************************************************/
633 PUBLIC int32 LCDC_RestoreClock (void);
634 /*****************************************************************************/
635 //  Description:Get Block is enabled or not
636 //  Global resource dependence:
637 //  Author: Jianping.wang
638 //  Note:
639 //      input:
640 //          lcd_id  - specify LCD
641 //          blk_num - LCDC Block number ,0~5
642 //      output:
643 //          none
644 //      return:
645 //          result
646 /*****************************************************************************/
647 PUBLIC BOOLEAN LCD_GetBlockIsEnable (LCD_ID_E lcd_id, uint32 blk_num);
648 /*****************************************************************************/
649 //  Description: get display memory
650 //  Global resource dependence:
651 //  Author: Jianping.wang
652 //  Note:
653 //      input:
654 //          lcd_id  - specify LCD
655 //          blk_num - LCDC Block number ,0~5
656 //      output:
657 //          none
658 //      return:
659 //          result
660 /*****************************************************************************/
661 PUBLIC uint32 *LCD_GetBlockBuffer (LCD_ID_E lcd_id, uint32 blk_num);
662 /*****************************************************************************/
663 //  Description: get maximum block number
664 //  Global resource dependence:
665 //  Author: Jianping.wang
666 //  Note:
667 //      input:
668 //          lcd_id  - specify LCD
669 //      output:
670 //          none
671 //      return:
672 //          maximum block number
673 /*****************************************************************************/
674 PUBLIC uint32 LCD_GetMaxBlockNum (LCD_ID_E lcd_id);
675
676 /*****************************************************************************/
677 //  Description:
678 //  Global resource dependence:
679 //  Author: Jianping.wang
680 //  Note:
681 //      input:
682 //          is_used - SCI_TRUE:use scaling down; SCI_FALSE:don't use scaling down
683 //      output:
684 //          none
685 //      return:
686 //          none
687 /*****************************************************************************/
688 PUBLIC void LCD_IsSelectScalingDown (BOOLEAN is_used);
689
690
691
692 /*****************************************************************************/
693 //  Description:  set dest LCD's RGB mode to host
694 //  Global resource dependence:
695 //  Author: Younger.Yang
696 //  Note:
697 /*****************************************************************************/
698
699 PUBLIC void LCD_SetRGBMode (LCD_ID_E lcd_id);
700
701 /*****************************************************************************/
702 //  Description:  set the number of pixes in the next frame from OSD
703 //  Global resource dependence:
704 //  Author: Younger.Yang
705 //  Note:
706 /*****************************************************************************/
707 PUBLIC void LCD_SetDataNumber (LCD_ID_E lcd_id, uint32 number);
708
709 /*****************************************************************************/
710 //  Description:  change lcd set timing when ahb clk changed
711 //  Global resource dependence:
712 //  Author: Younger.Yang
713 //  Note:
714 /*****************************************************************************/
715
716 PUBLIC ERR_LCD_E LCD_SetParam (uint32 ahb_clk);
717
718
719 PUBLIC void LCD_SetBackground (uint32 color);
720
721 /*****************************************************************************/
722 //  Description:    get the main lcd 's important parameter for Digital cammera
723 //  Global resource dependence:
724 //  Author:         Zhemin.lin
725 //  Note:
726 /*****************************************************************************/
727 PUBLIC LCD_SPEC_INFO_T_PTR LCD_GetLcdSpec (
728     LCD_ID_E lcd_id  //id of lcd to operate.
729 );
730
731
732 /*****************************************************************************/
733 //  Description:  disable/enable lcd invalidate rect
734 /*****************************************************************************/
735 PUBLIC void LCD_InvalidateRect_Enable (BOOLEAN is_enable);
736
737 /*****************************************************************************/
738 //  Description:  set rotation mode
739 /*****************************************************************************/
740 PUBLIC void LCD_SetRotateMode (LCD_ROT_MODE_E mode);
741
742 /*****************************************************************************/
743 //  Description: get rotation mode
744 /*****************************************************************************/
745 PUBLIC LCD_ROT_MODE_E _LCD_GetRotateMode (void);
746
747
748 /*****************************************************************************/
749 //  Description: free semaphore when use LCDC by asyn fashion
750 //  Global resource dependence:
751 //  Author: Jianping.wang
752 //  Note:
753 /*****************************************************************************/
754 PUBLIC void LCD_FreeSemaphore (void);
755 /*****************************************************************************/
756 //  Description: set brush lcd fashion
757 //  Global resource dependence:
758 //  Author: Jianping.wang
759 //  Note:
760 //      input:
761 //          lcd_id - specify LCD
762 //          mode   - sync or async
763 //      output:
764 //          none
765 //      return:
766 //          result
767 /*****************************************************************************/
768 PUBLIC ERR_LCD_E LCD_SetBrushMode (LCD_ID_E lcd_id, LCD_BRUSH_MODE_E mode);
769 /*****************************************************************************/
770 //  Description: get brush lcd fashion
771 //  Global resource dependence:
772 //  Author: Jianping.wang
773 //  Note:
774 //      input:
775 //          lcd_id - specify LCD
776 //      output:
777 //          none
778 //      return:
779 //          brush LCD mode
780 /*****************************************************************************/
781 PUBLIC LCD_BRUSH_MODE_E LCD_GetBrushMode (LCD_ID_E lcd_id);
782 /*****************************************************************************/
783 //  Description: set lcd status
784 //  Global resource dependence: s_lcd_status
785 //  Author: Younger yang
786 //  Note:
787 /*****************************************************************************/
788
789 PUBLIC void LCD_SetLCDStatus (LCD_STATUS_E lcd_status);
790
791 /*****************************************************************************/
792 //  Description: get lcd status
793 //  Global resource dependence: s_lcd_status
794 //  Author: Younger yang
795 //  Note:
796 /*****************************************************************************/
797 PUBLIC LCD_STATUS_E LCD_GetLCDStatus (void);
798
799 /*****************************************************************************/
800 //  Description: set alpha buffer address when use pixel alpha ,data format of block is RGB565
801 //  Global resource dependence:
802 //  Author: Jianping.wang
803 //  Note:
804 /*****************************************************************************/
805 PUBLIC ERR_LCD_E LCD_SetPixelAlphaBuffer (
806     LCD_ID_E lcd_id,
807     uint32 blk_num,
808     uint32 *buf_ptr
809 );
810 /*****************************************************************************/
811 //  Description: get alpha buffer address when use pixel alpha ,data format of block is RGB565
812 //  Global resource dependence:
813 //  Author: Jianping.wang
814 //  Note:
815 /*****************************************************************************/
816 PUBLIC uint32 *LCD_GetPixelAlphaBuffer (LCD_ID_E lcd_id, uint32 blk_num);
817 /*****************************************************************************/
818 //  Description: set UV buffer for block 0
819 //  Global resource dependence:
820 //  Author: Jianping.wang
821 //  Note:
822 /*****************************************************************************/
823 PUBLIC ERR_LCD_E LCD_SetUVBuffer (
824     LCD_ID_E lcd_id,
825     uint32 blk_num,
826     uint32 *buf_ptr
827 );
828 /*****************************************************************************/
829 //  Description: config capture parameters of 6800h
830 //  Global resource dependence:
831 //  Author: Jianping.wang
832 //  Note:
833 /*****************************************************************************/
834 PUBLIC ERR_LCD_E LCD_ConfigCapture (LCD_ID_E lcd_id, LCD_CAP_PARAM_T *param_ptr);
835 /*****************************************************************************/
836 //  Description: set fmark mode
837 //  Global resource dependence:
838 //  Author: Jianping.wang
839 //  Note:
840 /*****************************************************************************/
841 PUBLIC ERR_LCD_E LCD_SetFmarkMode (
842     LCD_FMARK_MODE_E fmark_mode,
843     LCD_FMARK_POL_E fmark_pol
844 );
845
846 //#ifdef PLATFORM_SC8800H
847 /*****************************************************************************/
848 // Description:register callback when invalidate done
849 // Author: Jianping.Wang
850 /*****************************************************************************/
851 PUBLIC void LCD_RegisterCallBack (lcd_invalidate_done_func_t func);
852 /*****************************************************************************/
853 // Description:register callback when invalidate done
854 // Author: Jianping.Wang
855 /*****************************************************************************/
856 PUBLIC void LCD_UnRegisterCallBack (void);
857 //#endif
858 /**********************************************************************************************************/
859 // Description: get block information
860 // Global resource dependence:
861 // Author: Jianping.wang
862 // Note:
863 /**********************************************************************************************************/
864 PUBLIC ERR_LCD_E LCD_GetBlockInfo (LCD_ID_E lcd_id,BLOCK_T *blk_info_ptr);
865 /*****************************************************************************/
866 //  Description: LCD out data to memory
867 //  Global resource dependence:
868 //  Author: Jianping.wang
869 //  Note:
870 //      input:
871 //          pos_param - out position parameter
872 //      output:
873 //          none
874 //      return:
875 //          result
876 /*****************************************************************************/
877 PUBLIC ERR_LCD_E LCD_InvalidateRectToMemory (LCD_ID_E lcd_id,LCD_MEMORY_INFO_T *param_ptr);
878 /*****************************************************************************/
879 //  Description: set UV buffer for block 0
880 //  Global resource dependence:
881 //  Author: Jianping.wang
882 //  Note:
883 /*****************************************************************************/
884 PUBLIC ERR_LCD_E LCD_SetUVBuffer (
885     LCD_ID_E lcd_id,
886     uint32 blk_num,
887     uint32 *buf_ptr
888 );
889 /*****************************************************************************/
890 //  Description: get UV memory
891 //  Global resource dependence:
892 //  Author: Jianping.wang
893 //  Note:
894 //      input:
895 //          lcd_id  - specify LCD
896 //          blk_num - LCDC Block number ,0~5
897 //      output:
898 //          none
899 //      return:
900 //          result
901 /*****************************************************************************/
902 PUBLIC uint32 *LCD_GetBlockUVBuffer (LCD_ID_E lcd_id, uint32 blk_num);
903 PUBLIC void LCD_DisplayText (uint16 x, uint16 y, char *text, uint16 len);
904 /**---------------------------------------------------------------------------*
905  **                         Compiler Flag                                     *
906  **---------------------------------------------------------------------------*/
907 #ifdef __cplusplus
908 }
909 #endif
910
911 #endif //_DAL_LCD_H