Daiki Kato / Mbed 2 deprecated GR-PEACH_Digital_Signage_display_shield

Dependencies:   GR-PEACH_video GraphicsFramework R_BSP SDFileSystem_tmp mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
dkato
Date:
Fri May 27 06:43:05 2016 +0000
Parent:
6:e7bafd9bba1a
Commit message:
Fix the frequency.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri May 27 04:57:05 2016 +0000
+++ b/main.cpp	Fri May 27 06:43:05 2016 +0000
@@ -24,17 +24,16 @@
 #include "rtos.h"
 #include "SDFileSystem.h"
 
-#define SVGA                                (0u)  /*  800 x 600 */
-#define XGA                                 (1u)  /* 1024 x 768 */
-#define HD_720p                             (2u)  /* 1280 x 720 */
-#define WXGA                                (3u)  /* 1280 x 800 */
+#define SVGA                                (0u)  /*  800x600@60  37.9kHz/60Hz */
+#define XGA                                 (1u)  /* 1024x768@60  48.4kHz/60Hz */
+#define HD_720p                             (2u)  /* 1280x720@60  45.0kHz/60Hz */
 
 /**** User Selection *********/
 #define WAIT_TIME                           (10000) /* wait time (ms) */
 #define DISSOLVE_STEP_NUM                   (16)    /* minimum 1 */
 #define SCROLL_STEP_NUM                     (8)     /* minimum 1 */
 #define SCROLL_DIRECTION                    (-1)    /* Select 1(left to right) or -1(right to left) */
-#define LCD_SIZE                            HD_720p /* Select SVGA, XGA, HD_720p or WXGA */
+#define LCD_SIZE                            HD_720p /* Select SVGA, XGA, or HD_720p */
 /*****************************/
 
 #define FILE_NAME_LEN                       (64)
@@ -43,9 +42,9 @@
 #define MAX_JPEG_SIZE                       (1024 * 450)
 
 /* LCD Parameter */
-#define LCD_INPUT_CLOCK                     (66.67f)
+#define LCD_INPUT_CLOCK                     (66.67)
 #if ( LCD_SIZE == SVGA )
-#define LCD_OUTPUT_CLOCK                    (40.000f)
+#define LCD_OUTPUT_CLOCK                    (40.0003)
 #define LCD_PIXEL_WIDTH                     (800u)
 #define LCD_PIXEL_HEIGHT                    (600u)
 #define LCD_H_BACK_PORCH                    (88u)
@@ -55,7 +54,7 @@
 #define LCD_V_FRONT_PORCH                   (1u)
 #define LCD_V_SYNC_WIDTH                    (4u)
 #elif ( LCD_SIZE == XGA )
-#define LCD_OUTPUT_CLOCK                    (65.000f)
+#define LCD_OUTPUT_CLOCK                    (65.0002)
 #define LCD_PIXEL_WIDTH                     (1024u)
 #define LCD_PIXEL_HEIGHT                    (768u)
 #define LCD_H_BACK_PORCH                    (160u)
@@ -65,7 +64,7 @@
 #define LCD_V_FRONT_PORCH                   (3u)
 #define LCD_V_SYNC_WIDTH                    (6u)
 #elif ( LCD_SIZE == HD_720p )
-#define LCD_OUTPUT_CLOCK                    (74.1800f)
+#define LCD_OUTPUT_CLOCK                    (74.1800)
 #define LCD_PIXEL_WIDTH                     (1280u)
 #define LCD_PIXEL_HEIGHT                    (720u)
 #define LCD_H_BACK_PORCH                    (220u)
@@ -74,16 +73,6 @@
 #define LCD_V_BACK_PORCH                    (20u)
 #define LCD_V_FRONT_PORCH                   (5u)
 #define LCD_V_SYNC_WIDTH                    (5u)
-#elif ( LCD_SIZE == WXGA )
-#define LCD_OUTPUT_CLOCK                    (85.4000f)
-#define LCD_PIXEL_WIDTH                     (1280u)
-#define LCD_PIXEL_HEIGHT                    (800u)
-#define LCD_H_BACK_PORCH                    (200u)
-#define LCD_H_FRONT_PORCH                   (64u)
-#define LCD_H_SYNC_WIDTH                    (136u)
-#define LCD_V_BACK_PORCH                    (24u)
-#define LCD_V_FRONT_PORCH                   (1u)
-#define LCD_V_SYNC_WIDTH                    (3u)
 #endif
 
 /* FRAME BUFFER Parameter */
@@ -144,8 +133,8 @@
     lcd_config.outputClock          = LCD_OUTPUT_CLOCK;
     lcd_config.lcd_outformat        = DisplayBase::LCD_OUTFORMAT_RGB888;
     lcd_config.lcd_edge             = DisplayBase::EDGE_RISING;
-    lcd_config.h_toatal_period      = (LCD_PIXEL_WIDTH  + LCD_H_FRONT_PORCH + LCD_H_BACK_PORCH);
-    lcd_config.v_toatal_period      = (LCD_PIXEL_HEIGHT + LCD_V_FRONT_PORCH + LCD_V_BACK_PORCH);
+    lcd_config.h_toatal_period      = (LCD_PIXEL_WIDTH  + LCD_H_FRONT_PORCH + LCD_H_BACK_PORCH + LCD_H_SYNC_WIDTH);
+    lcd_config.v_toatal_period      = (LCD_PIXEL_HEIGHT + LCD_V_FRONT_PORCH + LCD_V_BACK_PORCH + LCD_V_SYNC_WIDTH);
 
     lcd_config.h_disp_widht         = LCD_PIXEL_WIDTH;
     lcd_config.v_disp_widht         = LCD_PIXEL_HEIGHT;
@@ -289,6 +278,8 @@
     }
     Start_LCD_Display();
 
+    Thread::wait(100);  // wait sd mount
+
     SDFileSystem sd(P8_5, P8_6, P8_3, P8_4, "sd");
     FILE * fp = NULL;
     DIR  * d = NULL;