Modifications in 4DGL library. Added CDU_hw_sw.h for version info. Added pins.h for hardware pin remapping

Dependencies:   4DGL-UC MODSERIAL mbed mbos

Fork of CDU_Mbed_30 by Engravity-CDU

Revision:
20:150afde94910
Parent:
19:9d8032cb0f12
Child:
21:f348e6f0f7d4
--- a/display.cpp	Thu Aug 28 14:39:32 2014 +0000
+++ b/display.cpp	Thu Sep 25 11:34:21 2014 +0000
@@ -15,6 +15,7 @@
 
 DigitalOut VGA_SOURCE( VGA_SOURCE_SELECT ); //control line for video switch between INT and EXT video
 DigitalOut VGA_SELECT( VGA_ON_OFF ); //control line to select/deselect video switch
+
 /*
 =====================================================
 SGC (Serial Graphics Controller) PLATFORM OUTPUT FILE
@@ -37,6 +38,7 @@
 0x40, 0x49, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00
 4DSL command:
 NewUSDImage(0, 135, 0x000000)
+
 ---------------------------------------------------------------------------------------
 File "Testscreen.png" (Testscreen.png)
 Sector Address 0x00021A
@@ -49,52 +51,8 @@
 4DSL command:
 NewUSDImage(0, 0, 0x00021A)
 */
-/*Display Commands
-$PCDUCLS Erase to active background colour (default black) or white
-===================================================================
-Syntax: $PCDUCLS, <mode>*<checksum>CRLF
-<mode>=0 : Clear screen to current background colour (default=black)
-<mode>=1 : Clear screen to white
-$PCDUSBC Set Background Color
-====================================================================
-Syntax: $PCDUSBC,<Rcolour>,<Gcolour>,<Bcolour>*<checksum>CRLF
-< Rcolour > : RED (000‐255)
-< Gcolour > : GREEN (000‐255)
-< Bcolour > : BLUE (000‐255)
-Set background colour to RGB as defined in the three data fields.
-$PCDUWTX WTX=WRITE TEXT Write text on any X,Y position on the screen.
-=====================================================================
-Syntax: $PCDUWTX,<Fsize>,<Fstyle>,<Rcolour>,<Gcolour>,<Bcolour>,<Text><Col>,<Row>*<checksum>CRLF
-<Fsize> : Font size (F0..F9). Currently F0 and F1 are implemented.
-<Fstyle> : Font style (S=Standard, B=Bold, I=Italic, U=Underline, N=Negative)
-< Rcolour > : RED (000‐255)
-< Gcolour > : GREEN (000‐255)
-< Bcolour > : BLUE (000‐255)
-<Text> : Any printable ASCII character except the * character as this is used as the text field delimiter.
-  Maximum length is 24 characters, minimum length is 1 character for font F0.
-  Maximum length is 48 characters, minumum length is 1 character for font F1.
-<Col> : Horizontal position of the first character (1..24)
-<Row> : Vertical position of the line (1..14)
-$PCDUETX ETX=ERASE TEXT
-=============================================================
-Syntax: $PCDUETX, <Col>,<Row>,<n>*<checksum>CRLF
-<Col> : Horizontal position of the first character (1..24 for font F0 or 1..48 for font F1)
-<Row> : Vertical position of the line (1‐14)
-<n> : number of characters to be erased (1..24 for font F0 or 1..48 for font F1)
-$PCDUKTX                Write text attached to a Select Key
-===========================================================
-Syntax: $PCDUKTX,<KeyID>,<Texttype>,<Fsize>,<Fstyle>,<Rcolour>,<Gcolour>,<Bcolour>,<Text>*< checksum>CRLF
-<KeyID> : Numbering is 00 – 49 for left keys and 50 – 99 for right keys. Top keys are 00 and 50.
-<Texttype> : M or S, meaning Main text or Subtext.
-<Fsize> : Font size (F0..F9). Currently F0 and F1 are implemented.
-<Fstyle> : Font style (S=Standard, B=Bold, I=Italic, U=Underline, N=Negative)
-< Rcolour > : RED (000‐255)
-< Gcolour > : GREEN (000‐255)
-< Bcolour > : BLUE (000‐255)
-<Text> : Any printable ASCII character within the character set.except the * character as this is used as the text field delimiter.
- Maximum length is 24 characters, minimum length is 1 character for font F0
-Maximum length is 48 characters, minumum length is 1 character for font F1.
-*/
+
+
 
 //Control lines for VGA driver board
 TFT_4DGL display(VGA_TX,VGA_RX,VGA_RESET); // serial tx, serial rx, reset pin
@@ -302,7 +260,23 @@
 void CDU_InitDisplay()
 {
     display.baudrate( 9600 );       //init uVGAIII card
-    VGA_SIGNAL( VGA_INT, VGA_ON );  //select INTERNTAL video and set VGA switch ON
+    VGA_SIGNAL( VGA_INT, VGA_ON );  //select INTERNAL video and set VGA switch ON
+}
+
+
+void CDU_TVScreen()
+{
+    display.display_control(IMAGE_FORMAT, NEW); //set correct image for reading from SD
+    display.cls();
+    display.showpicture( 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xCD );    // TVscreen
+}
+
+
+void CDU_LogoScreen()
+{
+    display.display_control(IMAGE_FORMAT, NEW); //set correct image for reading from SD    
+    display.cls();
+    display.showpicture( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);    // Engravity logo
 }
 
 
@@ -353,19 +327,17 @@
     display.line(XMIN,LINE12,XMAX,LINE12, WHITE);
     display.line(XMIN,LINE13,XMAX,LINE13, WHITE);
     display.line(XMIN,LINE14,XMAX,LINE14, WHITE);
-}
-void CDU_TestScreen()
-{
-    display.display_control(IMAGE_FORMAT, NEW); //set correct image for reading from SD
-    display.cls();
-    display.showpicture(0x00, 0x00, 0x00, 0x14, 0x00, 0x01, 0xB5);    // Testscreen
+    
+    //Hardware & Firmware information
+    display.graphic_string( str2char( CDU_Hardware() ), centertext( CDU_Hardware(), 48, SMALLCHAR), LINE6,  FONT_12X34, WHITE, 1, 1 );
+    display.graphic_string( str2char( CDU_Firmware() ), centertext( CDU_Firmware(), 48, SMALLCHAR), LINE7,  FONT_12X34, WHITE, 1, 1 );
+    display.graphic_string( str2char( CDU_Compile() ) , centertext( CDU_Compile() , 48, SMALLCHAR), LINE8,  FONT_12X34, WHITE, 1, 1 );
+    display.graphic_string( str2char( CDU_MAC() )     , centertext( CDU_MAC()     , 48, SMALLCHAR), LINE10, FONT_12X34, WHITE, 1, 1 );  
+    display.graphic_string( str2char( CDU_IP() )      , centertext( CDU_IP()      , 48, SMALLCHAR), LINE11, FONT_12X34, WHITE, 1, 1 );          
+    
 }
-void CDU_LogoScreen()
-{
-    display.display_control(IMAGE_FORMAT, NEW); //set correct image for reading from SD   
-    display.cls();
-    display.showpicture(0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00);    // Engravity logo
-}
+
+
  
 void CDU_Page()
 {