eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4dlcdhw_dragonfire_lcdc.c
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #include "d4d.h" // include of all public items (types, function etc) of D4D driver
47 #include "common_files/d4d_lldapi.h" // include non public low level driver interface header file (types, function prototypes, enums etc. )
48 #include "common_files/d4d_private.h" // include the private header file that contains perprocessor macros as D4D_MK_STR
49 
50 
51 // identification string of driver - must be same as name D4DTCH_FUNCTIONS structure + "_ID"
52 // it is used for enable the code for compilation
53 #define d4dlcdhw_dragonfire_lcdc_ID 1
54 
55 
56 // copilation enable preprocessor condition
57 // the string d4dtch_dragonfire_lcdc_ID must be replaced by define created one line up
58 #if (D4D_MK_STR(D4D_LLD_LCD_HW) == d4dlcdhw_dragonfire_lcdc_ID)
59 
60  // include of low level driver heaser file
61  // it will be included into wole project only in case that this driver is selected in main D4D configuration file
63  /******************************************************************************
64  * Macros
65  ******************************************************************************/
66 
67  #if D4D_COLOR_SYSTEM != D4D_COLOR_SYSTEM_RGB565
68  #error The eGUI low level driver "d4dlcdhw_dragonfire_lcdc" not supported selected type of D4D_COLOR_SYSTEM. To run this driver just select D4D_COLOR_SYSTEM_RGB565.
69  #endif
70 
71  /******************************************************************************
72  * Internal function prototypes
73  ******************************************************************************/
74 
75  static unsigned char D4DLCDHW_Init_DragonFireLCDC(void);
76  static unsigned char D4DLCDHW_DeInit_DragonFireLCDC(void);
77  static void D4DLCDHW_WriteData_DragonFireLCDC(unsigned long addr, D4D_COLOR value);
78  static D4D_COLOR D4DLCDHW_ReadData_DragonFireLCDC(unsigned long addr);
79  static D4DLCD_FRAMEBUFF_DESC* D4DLCDHW_GetFbDescriptor_DragonFireLCDC(void);
80  static unsigned char D4DLCDHW_PinCtl_DragonFireLCDC(D4DLCDHW_PINS pinId, D4DHW_PIN_STATE setState);
81  static void D4DLCD_FlushBuffer_DragonFireLCDC(D4DLCD_FLUSH_MODE mode);
82 
83  static void Configure_VEEEN_ON(void);
84  static void Configure_LCD_Ports(void);
85  static void Configure_Bursting(void);
86  static void LCDC_Init(LCDC_PANEL_TYPE p_type, Panel_Size panel, BPP_TYPE BPP, unsigned char ACD_DIV, unsigned char PixClkDiv);
87  static void LCDC_Enable(void);
88  static void LCDC_Disable(void);
89 
90  extern void mcf5227_cache_invalidate(void);
91 
92  /**************************************************************/
98  // the main structure that contains low level driver api functions
99  // the name fo this structure is used for recognizing of configured low level driver of whole D4D
100  // so this name has to be used in main configuration header file of D4D driver to enable this driver
101  const D4DLCDHWFB_FUNCTIONS d4dlcdhw_dragonfire_lcdc =
102  {
103  D4DLCDHW_Init_DragonFireLCDC,
104  D4DLCDHW_WriteData_DragonFireLCDC,
105  D4DLCDHW_ReadData_DragonFireLCDC,
106  D4DLCDHW_GetFbDescriptor_DragonFireLCDC,
107  D4DLCDHW_PinCtl_DragonFireLCDC,
108  D4DLCD_FlushBuffer_DragonFireLCDC,
109  D4DLCDHW_DeInit_DragonFireLCDC
110  };
111  /**************************************************************/
117  //**************************************************
118  /* Configure horizontal LCD timing
119  H = H_WAIT_1 + H_WIDTH + H_WAIT_2 + XMAX
120  H_WAIT1 = delay in Pixel CLK periods between OE & HSYNC
121  H_WIDTH = width of Horizontal Sync Pulse in Pixel CLK periods
122  H_WAIT2 = delay between HSYNC & first data of next line */
123 
124  /* Configure vertical LCD timing
125  V_WAIT1 = delay between OE and VSYNC (in TFT)
126  V_WIDTH = Vertical Sync pulse width in HSYNC periods
127  V_WAIT2 = delay between VSYNC and OE of the first line of next frame*/
128 
129  unsigned char Panel_Timing[][6] =
130  /*[H_WAIT_1, H_WIDTH, H_WAIT_2, V_WAIT_1, V_WIDTH, V_WAIT_2]*/
131  // {{/*12.0SVGA*/ 22, 14, 75, 24, 4, 20 },
132  {{/*12.0SVGA*/ 22, 14, 69, 24, 4, 19 },
133  {/* 3.5QVGA*/ 16, 4, 72, 16, 2, 8 },
134  {/* 5.7QVGA*/ 16, 4, 50, 40, 4, 8 },
135  {/* 6.4VGA*/ 36, 4, 96, 40, 4, 35 },
136  {/*10.4VGA */ 48, 14, 102, 32, 1, 35 },
137  {/*M52277EVB_PANEL */ 15, 1, 6, 9, 1, 7 }};
138 
139  static const D4DLCD_FRAMEBUFF_DESC d4dlcdhw_dragonfire_lcdc_desc =
140  {
145  };
146 
147 
148  /**************************************************************/
155  //-----------------------------------------------------------------------------
156  // FUNCTION: D4DLCDHW_Init_DragonFireLCDC
157  // SCOPE: Low Level Driver API function
158  // DESCRIPTION: The function is used for initialization of this low level driver
159  //
160  // PARAMETERS: none
161  //
162  // RETURNS: result: 1 - Success
163  // 0 - Failed
164  //-----------------------------------------------------------------------------
165  static unsigned char D4DLCDHW_Init_DragonFireLCDC(void)
166  {
167  Configure_VEEEN_ON();
168  Configure_LCD_Ports();
169 
170  #if D4DLCDHWFB_MIRROWED == 1
171  MCF_LCDC_LCD_SSAR = D4DLCDHWFB_START_ADDRESS + D4DLCDHWFB_X_MAX * D4DLCDHWFB_Y_MAX * 2;
172  #else
173  MCF_LCDC_LCD_SSAR = D4DLCDHWFB_START_ADDRESS;
174  #endif
175  MCF_LCDC_LCD_SR = (D4DLCDHWFB_X_MAX / 16) << 20 | (D4DLCDHWFB_Y_MAX);
176  MCF_LCDC_LCD_VPW = (D4DLCDHWFB_X_MAX / 2);
177 
178 
179  MCF_LCDC_LCD_DCR = ( 0 | MCF_LCDC_LCD_DCR_HM(4) | MCF_LCDC_LCD_DCR_TM(8) );
180 
181  Configure_Bursting();
182 
184 
185  LCDC_Enable();
186 
187  //raise LCDC priority
188  //(*(vuint32*)(0xFC004100)) = 0x76000021;
189 
190  return 1;
191  }
192 
193 
194  //-----------------------------------------------------------------------------
195  // FUNCTION: D4DLCDHW_DeInit_DragonFireLCDC
196  // SCOPE: Low Level Driver API function
197  // DESCRIPTION: The function is used for deinitialization of this low level driver
198  //
199  // PARAMETERS: none
200  //
201  // RETURNS: result: 1 - Success
202  // 0 - Failed
203  //-----------------------------------------------------------------------------
204  static unsigned char D4DLCDHW_DeInit_DragonFireLCDC(void)
205  {
206  LCDC_Disable();
207  return 1;
208  }
209 
210  //-----------------------------------------------------------------------------
211  // FUNCTION: D4DLCDHW_SendDataWord_DragonFireLCDC
212  // SCOPE: Low Level Driver API function
213  // DESCRIPTION: The function send the one 16 bit variable into LCD
214  //
215  // PARAMETERS: unsigned long addr address to write data
216  // unsigned short value variable to send
217  //
218  // RETURNS: none
219  //-----------------------------------------------------------------------------
220  static void D4DLCDHW_WriteData_DragonFireLCDC(unsigned long addr, D4D_COLOR value)
221  {
222  *((D4D_COLOR*)addr) = value;
223  }
224 
225 
226  //-----------------------------------------------------------------------------
227  // FUNCTION: D4DLCDHW_ReadDataWord_DragonFireLCDC
228  // SCOPE: Low Level Driver API function
229  // DESCRIPTION: The function reads the one 16 bit variable from LCD (if this function is supported)
230  //
231  // PARAMETERS: unsigned long addr address to read data
232  //
233  // RETURNS: unsigned short - the readed value
234  //
235  //-----------------------------------------------------------------------------
236  static D4D_COLOR D4DLCDHW_ReadData_DragonFireLCDC(unsigned long addr)
237  {
238  return *((D4D_COLOR*)addr);
239  }
240 
241 
242  //-----------------------------------------------------------------------------
243  // FUNCTION: D4DLCDHW_GetFbDescriptor_DragonFireLCDC
244  // SCOPE: Low Level Driver API function
245  // DESCRIPTION: The function return the pointer on filled frame buffer descriptor
246  //
247  // PARAMETERS: none
248  //
249  // RETURNS: D4DLCD_FRAMEBUFF_DESC* - pointer on frame buffer descriptor
250  //
251  //-----------------------------------------------------------------------------
252  static D4DLCD_FRAMEBUFF_DESC* D4DLCDHW_GetFbDescriptor_DragonFireLCDC(void)
253  {
254  return (D4DLCD_FRAMEBUFF_DESC*) &d4dlcdhw_dragonfire_lcdc_desc;
255  }
256 
257  //-----------------------------------------------------------------------------
258  // FUNCTION: D4DLCDHW_PinCtl_DragonFireLCDC
259  // SCOPE: Low Level Driver API function
260  // DESCRIPTION: allows control GPIO pins for LCD conrol purposes
261  //
262  // PARAMETERS: D4DLCDHW_PINS pinId - Pin identification
263  // D4DHW_PIN_STATE setState - Pin action
264  // RETURNS: for Get action retuns the pin value
265  //-----------------------------------------------------------------------------
266  static unsigned char D4DLCDHW_PinCtl_DragonFireLCDC(D4DLCDHW_PINS pinId, D4DHW_PIN_STATE setState)
267  {
268  (void)pinId;
269  (void)setState;
270  return 0;
271  }
272 
273  //-----------------------------------------------------------------------------
274  // FUNCTION: D4DLCD_FlushBuffer_DragonFireLCDC
275  // SCOPE: Low Level Driver API function
276  // DESCRIPTION: For buffered low level interfaces is used to inform
277  // driver the complete object is drawed and pending pixels should be flushed
278  //
279  // PARAMETERS: none
280  //
281  // RETURNS: none
282  //-----------------------------------------------------------------------------
283  static void D4DLCD_FlushBuffer_DragonFireLCDC(D4DLCD_FLUSH_MODE mode)
284  {
285  D4D_UNUSED(mode);
286  }
287 
288  /**************************************************
289  * Function name : Configure_VEEEN_ON(void)
290  * returns : return none
291  * arg1 : none
292  * arg2 : none
293  * Description : enable LCDC backlight w/ VEEE using PBE0
294  * Notes : restrictions, odd modes
295  **************************************************/
296  static void Configure_VEEEN_ON(void)
297  {
298  /* I2C1 is used as LCD enable for the kitted panel */
299 
300  MCF_PAD_PAR_I2C = 0;
301 
302  MCF_GPIO_PDDR_I2C |= MCF_GPIO_PDDR_I2C_PDDR_I2C1;
303 
304  MCF_GPIO_PODR_I2C |= MCF_GPIO_PODR_I2C_PODR_I2C1;
305 
306  /* BE0 was still used as LCD enable for external LCDs.
307  * This is a 1.8V signal so it doesn't drive high enough. For now
308  * I'm jumpering BE0/SD_DQM0 to 3.3V on J1. signa. So I'm
309  * putting BE0 as an input to avoid any contention on the line.
310  */
311  /* Enable BE3 and BE2 as byte enables. BE0 and BE1 are GPIO. */
312  MCF_PAD_PAR_BE = ( 0
313  | MCF_PAD_PAR_BE_PAR_BE2_BE2
314  | MCF_PAD_PAR_BE_PAR_BE3_BE3 );
315 
316  /* Configure BE0 as input */
317  MCF_GPIO_PDDR_BE &= ~MCF_GPIO_PDDR_BE_PDDR_BE0;
318 
319 
320  /* Code below is all for the prototype boards only */
321  #if 0
322  /* The current rev of the boards is setup to use BE0 as an LCD enable.
323  * This is a 1.8V signal so it doesn't drive high enough. For now
324  * I'm jumpering TOUT0 as a GPIO to the BE0 signal so that I can use
325  * it as an LCD enable instead. So I'm putting BE0 as an input to
326  * avoid any contention on the line.
327  */
328 
329  /* Enable BE3 and BE2 as byte enables. BE0 and BE1 are GPIO. */
330  MCF_GPIO_PAR_BE = ( 0
331  | MCF_GPIO_PAR_BE_PAR_BE3
332  | MCF_GPIO_PAR_BE_PAR_BE2 );
333 
334  /* Configure BE0 as input */
335  MCF_GPIO_PDDR_BE &= ~MCF_GPIO_PDDR_BE_PDDR_BE0;
336 
337 
338  /* Enable TOUT0 and TOUT1 as GPIO outputs */
339  MCF_GPIO_PDDR_TIMER = ( 0
340  | MCF_GPIO_PDDR_TIMER_PDDR_TIMER1
341  | MCF_GPIO_PDDR_TIMER_PDDR_TIMER0
342  );
343 
344  /* Set both signals high */
345  MCF_GPIO_PODR_TIMER = ( 0
346  | MCF_GPIO_PODR_TIMER_PODR_TIMER1
347  | MCF_GPIO_PODR_TIMER_PODR_TIMER0
348  );
349 
350  #endif
351 
352  } //End Configure_VEEEN_ON
353 
354 
355 /**************************************************
356 * Function name : void Configure_LCD_Ports(void)
357 * returns : return none
358 * arg1 : none
359 * arg2 : none
360 * Description : enable LCDC pins on GPIO
361 * Notes : restrictions, odd modes
362 **************************************************/
363 static void Configure_LCD_Ports(void)
364 {
365  MCF_PAD_PAR_LCDCTL = ( 0
366  | MCF_PAD_PAR_LCDCTL_PAR_ACD_OE(2)
367  | MCF_PAD_PAR_LCDCTL_PAR_FLM_VSYNC
368  | MCF_PAD_PAR_LCDCTL_PAR_LP_HSYNC
369  | MCF_PAD_PAR_LCDCTL_PAR_LSCLK );
370 
371  MCF_PAD_PAR_LCDH = ( 0
372  | MCF_PAD_PAR_LCDH_PAR_LD17(3)
373  | MCF_PAD_PAR_LCDH_PAR_LD16(3)
374  | MCF_PAD_PAR_LCDH_PAR_LD15(3)
375  | MCF_PAD_PAR_LCDH_PAR_LD14(3)
376  | MCF_PAD_PAR_LCDH_PAR_LD13(3)
377  | MCF_PAD_PAR_LCDH_PAR_LD12(3) );
378 
379  MCF_PAD_PAR_LCDL = ( 0
380  | MCF_PAD_PAR_LCDL_PAR_LD11(3)
381  | MCF_PAD_PAR_LCDL_PAR_LD10(3)
382  | MCF_PAD_PAR_LCDL_PAR_LD9(3)
383  | MCF_PAD_PAR_LCDL_PAR_LD8(3)
384  | MCF_PAD_PAR_LCDL_PAR_LD7(3)
385  | MCF_PAD_PAR_LCDL_PAR_LD6(3)
386  | MCF_PAD_PAR_LCDL_PAR_LD5(3)
387  | MCF_PAD_PAR_LCDL_PAR_LD4(3)
388  | MCF_PAD_PAR_LCDL_PAR_LD3(3)
389  | MCF_PAD_PAR_LCDL_PAR_LD2(3)
390  | MCF_PAD_PAR_LCDL_PAR_LD1(3)
391  | MCF_PAD_PAR_LCDL_PAR_LD0(3) );
392 
393  MCF_PAD_PAR_TIMER |= (MCF_PAD_PAR_TIMER_PAR_T0IN(1)
394  | MCF_PAD_PAR_TIMER_PAR_T1IN(1)
395  );
396 
397  MCF_PAD_PAR_UART |= MCF_PAD_PAR_UART_PAR_U1CTS(1)
398  | MCF_PAD_PAR_UART_PAR_U1RTS(1);
399 
400 }//End Configure_LCD_Ports
401 
402 /**************************************************
403 * Function name : void Configure_Bursting(void)
404 * returns : return none
405 * arg1 : none
406 * arg2 : none
407 * Description : enable LCDC to burst data
408 * Notes : restrictions, odd modes
409 **************************************************/
410 static void Configure_Bursting(void)
411 {
412  MCF_SCM_BCR = MCF_SCM_BCR_SBE_BURST_EN;
413 }//End Configure_Bursting
414 
415 /***************************************************
416 * Function name : LCDC_Init(LCDC_PANEL_TYP p_type, BPP_TYPE BPP, uint8 CLK_DIV)
417 * returns : return none
418 * arg1 : pointer to image
419 * arg2 : none
420 * Description : detailed description
421 * Notes : restrictions, odd modes
422 ****************************************************/
423 
424 static void LCDC_Init(LCDC_PANEL_TYPE p_type, Panel_Size panel, BPP_TYPE BPP, unsigned char ACD_DIV, unsigned char PixClkDiv)
425 
426 {
427 
428 /* Configure the panel settings that are used for all panels */
429  MCF_LCDC_LCD_PCR = (unsigned long)(0
430  | MCF_LCDC_LCD_PCR_PANEL_TYPE(p_type) // TFT enable/Color enable
431  // |MCF_LCDC_LPCR_PBSIZ(3) // Panel Bus Width, 0=1 bit,1=2,2=4,3=8 (does not matter for TFT)
432  |MCF_LCDC_LCD_PCR_BPIX(BPP) // BPP, 0=1bpp,1=2,2=4,3=8,4=12,5=16
433  // |MCF_LCDC_LPCR_PIXPOL // Pixel Polarity, 0 = Active High, 1 = Active Low
434  |MCF_LCDC_LCD_PCR_ACDSEL // ACD Clock Source select
435  |MCF_LCDC_LCD_PCR_ACD(ACD_DIV) // ACD Stuff
436  |MCF_LCDC_LCD_PCR_SCLKSEL // LSCLK Select, 0 = Disable OE & LSCLK when no data output in TFT mode for power savings, 1 = Always on
437  // |MCF_LCDC_LPCR_SHARP // Sharp Panel Signals Enable
438  |MCF_LCDC_LCD_PCR_PCD(PixClkDiv) // Pixel CLK Divider, actual divider is PCD value + 1
439  );
440 
441  /* Configure the LCD control signals for the panel */
442 
443  switch(panel)
444  { case SHARP_12SVGA:
445  MCF_LCDC_LCD_PCR |= ( 0
446  | MCF_LCDC_LCD_PCR_CLKPOL // LCD Shift Clock, 0 = Active Falling, 1 = Active Rising (reverse for TFT)
447  // |MCF_LCDC_LPCR_SHARP // Sharp Panel Signals Enable
448  //|MCF_LCDC_LPCR_PIXPOL // Pixel Polarity, 0 = Active High, 1 = Active Low
449  | MCF_LCDC_LCD_PCR_END_SEL // Output Enable Polarity, 0= Active High, 1 = Active Low
450  #if D4DLCDHWFB_MIRROWED == 1
451  | MCF_LCDC_LCD_PCR_REV_VS
452  #endif
453  );
454  MCF_LCDC_LCD_SCR = 0x00120300;
455  MCF_LCDC_LCD_PCCR = ( 0
456  | MCF_LCDC_LCD_PCCR_CLS_HI_WIDTH(0xA9)
457  | MCF_LCDC_LCD_PCCR_SCR(0x1)
458  | MCF_LCDC_LCD_PCCR_CC_EN
459  | MCF_LCDC_LCD_PCCR_PW(0xFF) );
460  //MCF_GPIO_DSCR_LCD = 0x03;
461  break;
462  case SHARP_104VGA:
463  MCF_LCDC_LCD_PCR |= (
464  MCF_LCDC_LCD_PCR_CLKPOL // LCD Shift Clock, 0 = Active Falling, 1 = Active Rising (reverse for TFT)
465  #ifdef _DIGITALPHOTOALBUM_H
466  |MCF_LCDC_LCD_PCR_END_SEL ); // Output Enable Polarity, 0= Active High, 1 = Active Low
467  #else
468  ); /* For some reason the example project doesn't work with the ENDSEL bit set. */
469  #endif
470  break;
471  case SHARP_64VGA:
472  MCF_LCDC_LCD_PCR |= (
473  MCF_LCDC_LCD_PCR_CLKPOL // LCD Shift Clock, 0 = Active Falling, 1 = Active Rising (reverse for TFT)
474  |MCF_LCDC_LCD_PCR_END_SEL
475  ); // Output Enable Polarity, 0= Active High, 1 = Active Low
476  break;
477  case SHARP_57QVGA:
478  MCF_LCDC_LCD_PCR |= (
479  MCF_LCDC_LCD_PCR_LPPOL // Line Pulse Polarity, 0 = Active High, 1 = Active Low
480  |MCF_LCDC_LCD_PCR_END_SEL
481  );
482  break;
483  case SHARP_35QVGA:
484  MCF_LCDC_LCD_PCR |= (
485  MCF_LCDC_LCD_PCR_LPPOL // Line Pulse Polarity, 0 = Active High, 1 = Active Low
486  | MCF_LCDC_LCD_PCR_OEPOL
487 // |MCF_LCDC_LPCR_ENDSEL
488  ); // Output Enable Polarity, 0= Active High, 1 = Active Low
489  break;
490  case M52277EVB_PANEL:
491  if ((BPP==BPP16)||(BPP==BPP18))
492  {
493  MCF_LCDC_LCD_PCR |= ( 0
494  | MCF_LCDC_LCD_PCR_PIXPOL
495  | MCF_LCDC_LCD_PCR_OEPOL
496  // | MCF_LCDC_LPCR_ACD(ACD_DIV)
497  | MCF_LCDC_LCD_PCR_SHARP // Enable SHARP control signal timing
498  | MCF_LCDC_LCD_PCR_END_SEL
499  | MCF_LCDC_LCD_PCR_SWAP_SEL
500 // BPP16/18 don't need | MCF_LCDC_LPCR_ENDSEL
501 // BPP16/18 don't need | MCF_LCDC_LPCR_SWAP_SEL
502  );
503 
504  }
505  else
506  {
507  MCF_LCDC_LCD_PCR |= ( 0
508  | MCF_LCDC_LCD_PCR_PIXPOL
509  | MCF_LCDC_LCD_PCR_OEPOL
510  | MCF_LCDC_LCD_PCR_ACD(ACD_DIV)
511  | MCF_LCDC_LCD_PCR_SHARP // Enable SHARP control signal timing
512  | MCF_LCDC_LCD_PCR_END_SEL
513  | MCF_LCDC_LCD_PCR_SWAP_SEL
514  );
515  }
516  MCF_LCDC_LCD_SCR = 0x00120300;
517  MCF_LCDC_LCD_PCCR = ( 0
518  | MCF_LCDC_LCD_PCCR_CLS_HI_WIDTH(0xA9)
519  | MCF_LCDC_LCD_PCCR_SCR(0x1)
520  | MCF_LCDC_LCD_PCCR_CC_EN
521  | MCF_LCDC_LCD_PCCR_PW(0xFF) );
522  break;
523 
524  default:
525  // printf("ERR!! Unsupported panel\n");
526  break;
527  }
528 
529 
530  // Configure horizontal LCD timing
531  //H = H_WIDTH + H_WAIT_2 + XMAX + H_WAIT_1
532  MCF_LCDC_LCD_HCR = (unsigned long)(0
533  |MCF_LCDC_LCD_HCR_H_WAIT_1(Panel_Timing[panel][0]) // H_WAIT1 + 1 = delay in Pixel CLK periods between OE & HSYNC
534  |MCF_LCDC_LCD_HCR_H_WIDTH(Panel_Timing[panel][1]) // H_WIDTH + 1 = width of Horizontal Sync Pulse in Pixel CLK periods
535  |MCF_LCDC_LCD_HCR_H_WAIT_2(Panel_Timing[panel][2]) // H_WAIT2 + 3 = delay between HSYNC & first data of next line
536  );
537 
538  // Configure vertical LCD timing
539  //V = V_WIDTH + V_WAIT_2 + YMAX + V_WAIT_1
540  MCF_LCDC_LCD_VCR = (unsigned long)(0
541  |MCF_LCDC_LCD_VCR_V_WAIT_1(Panel_Timing[panel][3]) // V_WAIT1 = delay between OE and VSYNC (in TFT)
542  |MCF_LCDC_LCD_VCR_V_WIDTH(Panel_Timing[panel][4])// V_WIDTH = Vertical Sync pulse width in HSYNC periods
543  |MCF_LCDC_LCD_VCR_V_WAIT_2(Panel_Timing[panel][5]) // V_WAIT2 = delay between VSYNC and OE of the first line of next frame
544  );
545 }
546 
547 /**************************************************
548 * Function name : void LCDC_Enable(void)
549 * returns : return none
550 * arg1 : none
551 * arg2 : none
552 * Description : enable LCDC in miscellaneous control register
553 * Notes : restrictions, odd modes
554 **************************************************/
555 static void LCDC_Enable(void)
556 { (MCF_CCM_MISCCR |= MCF_CCM_MISCCR_LCDCHEN);
557 }//End LCDC_Enable
558 
559 /**************************************************
560 * Function name : void LCDC_Disable(void)
561 * returns : return none
562 * arg1 : none
563 * arg2 : none
564 * Description : Disables LCDC in miscellaneous control register
565 * Notes : restrictions, odd modes
566 **************************************************/
567 static void LCDC_Disable(void)
568 { (MCF_CCM_MISCCR &= ~MCF_CCM_MISCCR_LCDCHEN);
569 }//End LCDC_Enable
570 
571 #endif //(D4D_MK_STR(D4D_LLD_LCD_HW) == d4dlcdhw_dragonfire_lcdc_ID)
#define D4DLCDHWFB_START_ADDRESS
#define D4DLCDHWFB_Y_BPP_BYTE
#define MCF_LCDC_LCD_PCR_PANEL_TYPE(x)
D4D Driver main header file.
D4D driver - dragonfire_lcdc hardware lcd driver function header file.
D4DHW_PIN_STATE
D4D low level MCU pin state enumeration type.
Definition: d4d_lldapi.h:73
D4DLCD_FLUSH_MODE
D4D low level eGUI flush screen types enumeration.
Definition: d4d_lldapi.h:136
D4D Driver private header file.
D4DLCDHW_PINS
D4D low level MCU types definition for general LCD screen control signals.
Definition: d4d_lldapi.h:96
D4D low level frame buffer LCD interface API structure.
Definition: d4d_lldapi.h:179
D4D low level frame buffer description structure.
Definition: d4d_lldapi.h:117
#define D4DLCDHWFB_X_MAX
#define D4D_UNUSED(x)
Macro used just for notify compiler that the input parameter is not used.
Definition: d4d_base.h:504
D4D driver - resistive touch screen driver function header file.
#define D4DLCDHWFB_PANEL_TYPE
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262
#define D4DLCDHWFB_PANEL_CLKDIV
#define D4DLCDHWFB_Y_MAX