New work version with additional functions

Dependencies:   4DGL-UC ConfigFile MODSERIAL mbed mbos

Fork of CDU_Mbed_35 by Engravity-CDU

Committer:
WillemBraat
Date:
Thu Aug 28 14:39:32 2014 +0000
Revision:
19:9d8032cb0f12
Parent:
18:fd672797458c
Child:
20:2d6ac4577e68
Added CDU_hw_sw.cpp. All hardware and software related functions moved from display.cpp to here.
; Added funtions for reading MAC and IP addresses.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
LvdK 7:6576a287e563 1 //Display control functions --
LvdK 7:6576a287e563 2 #include "mbed.h"
LvdK 7:6576a287e563 3 #include "TFT_4DGL.h"
LvdK 7:6576a287e563 4 #include "display.h"
LvdK 8:422544d24df3 5 #include <string>
WillemBraat 17:b3545e9d38f7 6 #include "pins.h"
WillemBraat 18:fd672797458c 7
LvdK 7:6576a287e563 8 using namespace std;
WillemBraat 17:b3545e9d38f7 9
WillemBraat 19:9d8032cb0f12 10 extern string CDU_Hardware();
WillemBraat 19:9d8032cb0f12 11 extern string CDU_Firmware();
WillemBraat 19:9d8032cb0f12 12 extern string CDU_Compile();
WillemBraat 19:9d8032cb0f12 13 extern string CDU_MAC();
WillemBraat 19:9d8032cb0f12 14 extern string CDU_IP();
WillemBraat 19:9d8032cb0f12 15
WillemBraat 17:b3545e9d38f7 16 DigitalOut VGA_SOURCE( VGA_SOURCE_SELECT ); //control line for video switch between INT and EXT video
WillemBraat 17:b3545e9d38f7 17 DigitalOut VGA_SELECT( VGA_ON_OFF ); //control line to select/deselect video switch
LvdK 7:6576a287e563 18 /*
LvdK 7:6576a287e563 19 =====================================================
LvdK 7:6576a287e563 20 SGC (Serial Graphics Controller) PLATFORM OUTPUT FILE
LvdK 7:6576a287e563 21 =====================================================
LvdK 7:6576a287e563 22 *******************************************************
LvdK 7:6576a287e563 23 * Must set 'New image format' for usage on Picaso SGC *
LvdK 7:6576a287e563 24 * Data: *
LvdK 7:6576a287e563 25 * 0x59, 0x06, 0x00 *
LvdK 7:6576a287e563 26 * 4DSL command: *
LvdK 7:6576a287e563 27 * Control(6,0) *
LvdK 7:6576a287e563 28 *******************************************************
LvdK 7:6576a287e563 29 ---------------------------------------------------------------------------------------
LvdK 7:6576a287e563 30 File "logo_flyengravity.jpg" (logo_flyengravity.jpg)
LvdK 7:6576a287e563 31 Sector Address 0x000000
LvdK 7:6576a287e563 32 X = 0 Y = 135 Width = 640 Height = 215 Bits = 16
LvdK 7:6576a287e563 33 Display Image from Memory Card (Serial Command):
LvdK 7:6576a287e563 34 Syntax:
LvdK 7:6576a287e563 35 @, I, x, y, SectorAdd(hi), SectorAdd(mid), SectorAdd(lo)
LvdK 7:6576a287e563 36 Picaso Data:
LvdK 7:6576a287e563 37 0x40, 0x49, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00
LvdK 7:6576a287e563 38 4DSL command:
LvdK 7:6576a287e563 39 NewUSDImage(0, 135, 0x000000)
LvdK 7:6576a287e563 40 ---------------------------------------------------------------------------------------
LvdK 7:6576a287e563 41 File "Testscreen.png" (Testscreen.png)
LvdK 7:6576a287e563 42 Sector Address 0x00021A
LvdK 7:6576a287e563 43 X = 0 Y = 0 Width = 640 Height = 480 Bits = 16
LvdK 7:6576a287e563 44 Display Image from Memory Card (Serial Command):
LvdK 7:6576a287e563 45 Syntax:
LvdK 7:6576a287e563 46 @, I, x, y, SectorAdd(hi), SectorAdd(mid), SectorAdd(lo)
LvdK 7:6576a287e563 47 Picaso Data:
LvdK 7:6576a287e563 48 0x40, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1A
LvdK 7:6576a287e563 49 4DSL command:
LvdK 7:6576a287e563 50 NewUSDImage(0, 0, 0x00021A)
LvdK 7:6576a287e563 51 */
LvdK 7:6576a287e563 52 /*Display Commands
LvdK 7:6576a287e563 53 $PCDUCLS Erase to active background colour (default black) or white
LvdK 7:6576a287e563 54 ===================================================================
LvdK 7:6576a287e563 55 Syntax: $PCDUCLS, <mode>*<checksum>CRLF
LvdK 8:422544d24df3 56 <mode>=0 : Clear screen to current background colour (default=black)
LvdK 8:422544d24df3 57 <mode>=1 : Clear screen to white
LvdK 7:6576a287e563 58 $PCDUSBC Set Background Color
LvdK 7:6576a287e563 59 ====================================================================
LvdK 7:6576a287e563 60 Syntax: $PCDUSBC,<Rcolour>,<Gcolour>,<Bcolour>*<checksum>CRLF
LvdK 8:422544d24df3 61 < Rcolour > : RED (000‐255)
LvdK 8:422544d24df3 62 < Gcolour > : GREEN (000‐255)
LvdK 8:422544d24df3 63 < Bcolour > : BLUE (000‐255)
LvdK 8:422544d24df3 64 Set background colour to RGB as defined in the three data fields.
LvdK 7:6576a287e563 65 $PCDUWTX WTX=WRITE TEXT Write text on any X,Y position on the screen.
LvdK 7:6576a287e563 66 =====================================================================
LvdK 7:6576a287e563 67 Syntax: $PCDUWTX,<Fsize>,<Fstyle>,<Rcolour>,<Gcolour>,<Bcolour>,<Text><Col>,<Row>*<checksum>CRLF
LvdK 8:422544d24df3 68 <Fsize> : Font size (F0..F9). Currently F0 and F1 are implemented.
LvdK 8:422544d24df3 69 <Fstyle> : Font style (S=Standard, B=Bold, I=Italic, U=Underline, N=Negative)
LvdK 8:422544d24df3 70 < Rcolour > : RED (000‐255)
LvdK 8:422544d24df3 71 < Gcolour > : GREEN (000‐255)
LvdK 8:422544d24df3 72 < Bcolour > : BLUE (000‐255)
LvdK 8:422544d24df3 73 <Text> : Any printable ASCII character except the * character as this is used as the text field delimiter.
LvdK 7:6576a287e563 74 Maximum length is 24 characters, minimum length is 1 character for font F0.
LvdK 7:6576a287e563 75 Maximum length is 48 characters, minumum length is 1 character for font F1.
LvdK 8:422544d24df3 76 <Col> : Horizontal position of the first character (1..24)
LvdK 8:422544d24df3 77 <Row> : Vertical position of the line (1..14)
LvdK 7:6576a287e563 78 $PCDUETX ETX=ERASE TEXT
LvdK 8:422544d24df3 79 =============================================================
LvdK 7:6576a287e563 80 Syntax: $PCDUETX, <Col>,<Row>,<n>*<checksum>CRLF
LvdK 8:422544d24df3 81 <Col> : Horizontal position of the first character (1..24 for font F0 or 1..48 for font F1)
LvdK 8:422544d24df3 82 <Row> : Vertical position of the line (1‐14)
LvdK 8:422544d24df3 83 <n> : number of characters to be erased (1..24 for font F0 or 1..48 for font F1)
LvdK 7:6576a287e563 84 $PCDUKTX Write text attached to a Select Key
LvdK 7:6576a287e563 85 ===========================================================
LvdK 7:6576a287e563 86 Syntax: $PCDUKTX,<KeyID>,<Texttype>,<Fsize>,<Fstyle>,<Rcolour>,<Gcolour>,<Bcolour>,<Text>*< checksum>CRLF
LvdK 8:422544d24df3 87 <KeyID> : Numbering is 00 – 49 for left keys and 50 – 99 for right keys. Top keys are 00 and 50.
LvdK 8:422544d24df3 88 <Texttype> : M or S, meaning Main text or Subtext.
LvdK 8:422544d24df3 89 <Fsize> : Font size (F0..F9). Currently F0 and F1 are implemented.
LvdK 8:422544d24df3 90 <Fstyle> : Font style (S=Standard, B=Bold, I=Italic, U=Underline, N=Negative)
LvdK 8:422544d24df3 91 < Rcolour > : RED (000‐255)
LvdK 8:422544d24df3 92 < Gcolour > : GREEN (000‐255)
LvdK 8:422544d24df3 93 < Bcolour > : BLUE (000‐255)
LvdK 8:422544d24df3 94 <Text> : Any printable ASCII character within the character set.except the * character as this is used as the text field delimiter.
LvdK 7:6576a287e563 95 Maximum length is 24 characters, minimum length is 1 character for font F0
LvdK 8:422544d24df3 96 Maximum length is 48 characters, minumum length is 1 character for font F1.
LvdK 7:6576a287e563 97 */
WillemBraat 17:b3545e9d38f7 98
LvdK 7:6576a287e563 99 //Control lines for VGA driver board
WillemBraat 17:b3545e9d38f7 100 TFT_4DGL display(VGA_TX,VGA_RX,VGA_RESET); // serial tx, serial rx, reset pin
WillemBraat 17:b3545e9d38f7 101
LvdK 7:6576a287e563 102 //Character & String functions
LvdK 7:6576a287e563 103 char* str2char( string cString ) //convert a string to a character array
LvdK 7:6576a287e563 104 {
LvdK 7:6576a287e563 105 int nStrLen=cString.size();
LvdK 7:6576a287e563 106 std::string cInput( cString );
LvdK 7:6576a287e563 107 char* cText = new char[nStrLen+1];
LvdK 7:6576a287e563 108 strncpy(cText, cInput.c_str(), nStrLen);
LvdK 7:6576a287e563 109 cText[nStrLen] = '\0';
LvdK 7:6576a287e563 110 return cText;
LvdK 7:6576a287e563 111 }
LvdK 8:422544d24df3 112
LvdK 7:6576a287e563 113 int centertext( string cString, int nChars, int nCharWidth )
LvdK 7:6576a287e563 114 //calculates the startposition on the screen to center the text
LvdK 7:6576a287e563 115 //needs the actual string (cString), screenwidth in characters (nChars) and the character width (nCharWidth)
LvdK 7:6576a287e563 116 {
LvdK 7:6576a287e563 117 int nStart;
LvdK 7:6576a287e563 118 nStart = nCharWidth*( nChars/2-( cString.size()/2 ));
LvdK 7:6576a287e563 119 return nStart;
LvdK 7:6576a287e563 120 }
LvdK 8:422544d24df3 121
LvdK 7:6576a287e563 122 int righttext( string cString, int nChars, int nCharWidth )
LvdK 7:6576a287e563 123 //calculates the startposition on the screen to right-align the text
LvdK 7:6576a287e563 124 //needs the actual string (cString), screenwidth in characters (nChars) and the character width (nCharWidth)
LvdK 7:6576a287e563 125 {
LvdK 7:6576a287e563 126 int nStart;
LvdK 7:6576a287e563 127 nStart = nCharWidth*( nChars - cString.size());
LvdK 7:6576a287e563 128 return nStart;
LvdK 7:6576a287e563 129 }
WillemBraat 13:d60c746c097c 130
LvdK 7:6576a287e563 131 int nFontSize( int nfont_number )
LvdK 7:6576a287e563 132 {
LvdK 8:422544d24df3 133 int nFontWidth = 24;
LvdK 7:6576a287e563 134 switch ( nfont_number )
LvdK 7:6576a287e563 135 {
LvdK 7:6576a287e563 136 case 0:
LvdK 7:6576a287e563 137 {
LvdK 8:422544d24df3 138 nFontWidth = SMALLCHAR;
LvdK 8:422544d24df3 139 //nFontWidth = FONT_12X34;
LvdK 7:6576a287e563 140 break;
LvdK 7:6576a287e563 141 }
LvdK 7:6576a287e563 142 case 1:
LvdK 7:6576a287e563 143 {
LvdK 8:422544d24df3 144 nFontWidth = LARGECHAR;
LvdK 8:422544d24df3 145 //nFontWidth = FONT_24X34;
LvdK 7:6576a287e563 146 break;
LvdK 7:6576a287e563 147 }
LvdK 7:6576a287e563 148 }
LvdK 8:422544d24df3 149 return ( nFontWidth );
LvdK 8:422544d24df3 150 }
LvdK 7:6576a287e563 151
LvdK 7:6576a287e563 152 int nFontWidth (int nfont_number )
LvdK 7:6576a287e563 153 {
LvdK 7:6576a287e563 154 int nFont = 12;
LvdK 7:6576a287e563 155 switch ( nfont_number )
LvdK 7:6576a287e563 156 {
LvdK 7:6576a287e563 157 case 0:
LvdK 7:6576a287e563 158 {
LvdK 7:6576a287e563 159 nFont = 12;
LvdK 7:6576a287e563 160 break;
LvdK 7:6576a287e563 161 }
LvdK 7:6576a287e563 162 case 1:
LvdK 7:6576a287e563 163 {
LvdK 7:6576a287e563 164 nFont = 24;
LvdK 7:6576a287e563 165 break;
LvdK 7:6576a287e563 166 }
LvdK 7:6576a287e563 167 }
LvdK 7:6576a287e563 168 return ( nFont );
LvdK 8:422544d24df3 169 }
LvdK 7:6576a287e563 170
LvdK 7:6576a287e563 171 unsigned int cRGB( char cRED, char cGREEN, char cBLUE )
LvdK 7:6576a287e563 172 {
LvdK 7:6576a287e563 173 //assemble separate colors into 1 integer value as 0xRRGGBB
LvdK 7:6576a287e563 174 //Display driver requires this format
LvdK 7:6576a287e563 175 unsigned int RGB = cBLUE + 256*cGREEN + 65536*cRED;
LvdK 7:6576a287e563 176 return ( RGB );
LvdK 8:422544d24df3 177 }
LvdK 7:6576a287e563 178
LvdK 7:6576a287e563 179 int LeftOrRight( int nTextLine, string cString, int nChars, int nCharWidth )
LvdK 7:6576a287e563 180 {
LvdK 8:422544d24df3 181 // nChars is the maximum numbers of characters on the line
LvdK 8:422544d24df3 182 // nCharWidth is the characterwidth in pixels
LvdK 7:6576a287e563 183 //decide to print data left aligned or right aligned
LvdK 7:6576a287e563 184 //00 - 49 is left side of screen
LvdK 7:6576a287e563 185 //50 - 99 is right side of screen
LvdK 8:422544d24df3 186 int nHorPos = 0;
LvdK 7:6576a287e563 187 // nChars is number of characters on this line (24 or 48)
LvdK 7:6576a287e563 188 // nCharWidth is the character width in pixels
LvdK 8:422544d24df3 189
LvdK 7:6576a287e563 190 if ( nTextLine < 50 )
LvdK 7:6576a287e563 191 // Left side adjust
LvdK 7:6576a287e563 192 {
LvdK 7:6576a287e563 193 nHorPos = 0;
LvdK 7:6576a287e563 194 }
LvdK 7:6576a287e563 195 else
LvdK 7:6576a287e563 196 // Right side adjust
LvdK 7:6576a287e563 197 {
LvdK 7:6576a287e563 198 nHorPos = righttext( cString, nChars, nCharWidth );
LvdK 7:6576a287e563 199 }
LvdK 7:6576a287e563 200 return ( nHorPos );
LvdK 7:6576a287e563 201 }
WillemBraat 18:fd672797458c 202
LvdK 7:6576a287e563 203 int nLine2Pixel( int nLine )
LvdK 7:6576a287e563 204 {
LvdK 7:6576a287e563 205 //calculate vertical pixelposition from linenumber
LvdK 7:6576a287e563 206 int nPixel = 0;
LvdK 7:6576a287e563 207 switch ( nLine )
LvdK 7:6576a287e563 208 {
LvdK 7:6576a287e563 209 case 1:
LvdK 7:6576a287e563 210 {
LvdK 7:6576a287e563 211 nPixel = LINE1;
LvdK 7:6576a287e563 212 break;
LvdK 7:6576a287e563 213 }
LvdK 7:6576a287e563 214 case 2:
LvdK 7:6576a287e563 215 {
LvdK 7:6576a287e563 216 nPixel = LINE2;
LvdK 7:6576a287e563 217 break;
LvdK 7:6576a287e563 218 }
LvdK 8:422544d24df3 219
LvdK 7:6576a287e563 220 case 3:
LvdK 7:6576a287e563 221 {
LvdK 7:6576a287e563 222 nPixel = LINE3;
LvdK 7:6576a287e563 223 break;
LvdK 7:6576a287e563 224 }
LvdK 8:422544d24df3 225
LvdK 7:6576a287e563 226 case 4:
LvdK 7:6576a287e563 227 {
LvdK 7:6576a287e563 228 nPixel = LINE4;
LvdK 7:6576a287e563 229 break;
LvdK 7:6576a287e563 230 }
LvdK 8:422544d24df3 231
LvdK 7:6576a287e563 232 case 5:
LvdK 7:6576a287e563 233 {
LvdK 7:6576a287e563 234 nPixel = LINE5;
LvdK 7:6576a287e563 235 break;
LvdK 7:6576a287e563 236 }
LvdK 8:422544d24df3 237
LvdK 7:6576a287e563 238 case 6:
LvdK 7:6576a287e563 239 {
LvdK 7:6576a287e563 240 nPixel = LINE6;
LvdK 7:6576a287e563 241 break;
LvdK 7:6576a287e563 242 }
LvdK 8:422544d24df3 243
LvdK 7:6576a287e563 244 case 7:
LvdK 7:6576a287e563 245 {
LvdK 7:6576a287e563 246 nPixel = LINE7;
LvdK 7:6576a287e563 247 break;
LvdK 7:6576a287e563 248 }
LvdK 8:422544d24df3 249
LvdK 7:6576a287e563 250 case 8:
LvdK 7:6576a287e563 251 {
LvdK 7:6576a287e563 252 nPixel = LINE8;
LvdK 7:6576a287e563 253 break;
LvdK 7:6576a287e563 254 }
LvdK 8:422544d24df3 255
LvdK 7:6576a287e563 256 case 9:
LvdK 7:6576a287e563 257 {
LvdK 7:6576a287e563 258 nPixel = LINE9;
LvdK 7:6576a287e563 259 break;
LvdK 7:6576a287e563 260 }
LvdK 8:422544d24df3 261
LvdK 7:6576a287e563 262 case 10:
LvdK 7:6576a287e563 263 {
LvdK 7:6576a287e563 264 nPixel = LINE10;
LvdK 7:6576a287e563 265 break;
LvdK 7:6576a287e563 266 }
LvdK 8:422544d24df3 267
LvdK 7:6576a287e563 268 case 11:
LvdK 7:6576a287e563 269 {
LvdK 7:6576a287e563 270 nPixel = LINE11;
LvdK 7:6576a287e563 271 break;
LvdK 7:6576a287e563 272 }
LvdK 8:422544d24df3 273
LvdK 7:6576a287e563 274 case 12:
LvdK 7:6576a287e563 275 {
LvdK 7:6576a287e563 276 nPixel = LINE12;
LvdK 7:6576a287e563 277 break;
LvdK 7:6576a287e563 278 }
LvdK 8:422544d24df3 279
LvdK 7:6576a287e563 280 case 13:
LvdK 7:6576a287e563 281 {
LvdK 7:6576a287e563 282 nPixel = LINE13;
LvdK 7:6576a287e563 283 break;
LvdK 7:6576a287e563 284 }
LvdK 8:422544d24df3 285
LvdK 7:6576a287e563 286 case 14:
LvdK 7:6576a287e563 287 {
LvdK 7:6576a287e563 288 nPixel = LINE14;
LvdK 7:6576a287e563 289 break;
LvdK 7:6576a287e563 290 }
LvdK 8:422544d24df3 291
LvdK 7:6576a287e563 292 }
LvdK 7:6576a287e563 293 return ( nPixel ) ;
LvdK 7:6576a287e563 294 }
WillemBraat 18:fd672797458c 295
LvdK 7:6576a287e563 296 void VGA_SIGNAL( int Source, int On_Off)
LvdK 7:6576a287e563 297 {
LvdK 7:6576a287e563 298 VGA_SOURCE = Source;
LvdK 7:6576a287e563 299 VGA_SELECT = On_Off;
LvdK 7:6576a287e563 300 }
WillemBraat 18:fd672797458c 301
LvdK 7:6576a287e563 302 void CDU_InitDisplay()
LvdK 7:6576a287e563 303 {
LvdK 7:6576a287e563 304 display.baudrate( 9600 ); //init uVGAIII card
LvdK 7:6576a287e563 305 VGA_SIGNAL( VGA_INT, VGA_ON ); //select INTERNTAL video and set VGA switch ON
LvdK 7:6576a287e563 306 }
WillemBraat 18:fd672797458c 307
WillemBraat 18:fd672797458c 308
LvdK 7:6576a287e563 309 void CDU_StartScreen()
LvdK 8:422544d24df3 310 {
LvdK 7:6576a287e563 311 string cTitle1="ENGRAVITY";
LvdK 7:6576a287e563 312 string cTitle2="CONTROL & DISPLAY UNIT";
WillemBraat 18:fd672797458c 313
LvdK 8:422544d24df3 314 display.cls();
LvdK 7:6576a287e563 315
LvdK 7:6576a287e563 316 display.graphic_string( str2char( cTitle1 ), centertext( cTitle1, 24, LARGECHAR), LINE6, FONT_24X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 317 wait_ms(100);
LvdK 7:6576a287e563 318 display.graphic_string( str2char( cTitle2 ), centertext( cTitle2, 24, LARGECHAR), LINE8, FONT_24X34, RED, 1, 1 );
LvdK 8:422544d24df3 319 wait_ms(100);
LvdK 7:6576a287e563 320 display.graphic_string( str2char( cTitle2 ), centertext( cTitle2, 24, LARGECHAR), LINE8, FONT_24X34, GREEN, 1, 1 );
LvdK 8:422544d24df3 321 wait_ms(100);
LvdK 7:6576a287e563 322 display.graphic_string( str2char( cTitle2) , centertext( cTitle2, 24, LARGECHAR), LINE8, FONT_24X34, BLUE, 1, 1 );
LvdK 8:422544d24df3 323 wait_ms(100);
WillemBraat 18:fd672797458c 324
WillemBraat 18:fd672797458c 325 display.cls();
WillemBraat 19:9d8032cb0f12 326
WillemBraat 19:9d8032cb0f12 327 //Hardware & Firmware information
WillemBraat 19:9d8032cb0f12 328 display.graphic_string( str2char( CDU_Hardware() ), centertext( CDU_Hardware(), 48, SMALLCHAR), LINE6, FONT_12X34, WHITE, 1, 1 );
WillemBraat 19:9d8032cb0f12 329 display.graphic_string( str2char( CDU_Firmware() ), centertext( CDU_Firmware(), 48, SMALLCHAR), LINE7, FONT_12X34, WHITE, 1, 1 );
WillemBraat 19:9d8032cb0f12 330 display.graphic_string( str2char( CDU_Compile() ) , centertext( CDU_Compile() , 48, SMALLCHAR), LINE8, FONT_12X34, WHITE, 1, 1 );
WillemBraat 19:9d8032cb0f12 331 display.graphic_string( str2char( CDU_MAC() ) , centertext( CDU_MAC() , 48, SMALLCHAR), LINE10, FONT_12X34, WHITE, 1, 1 );
WillemBraat 19:9d8032cb0f12 332 display.graphic_string( str2char( CDU_IP() ) , centertext( CDU_IP() , 48, SMALLCHAR), LINE11, FONT_12X34, WHITE, 1, 1 );
WillemBraat 18:fd672797458c 333 wait_ms(5000);
LvdK 8:422544d24df3 334 }
WillemBraat 18:fd672797458c 335
LvdK 7:6576a287e563 336 void CDU_ScreenAlign()
LvdK 7:6576a287e563 337 //Draw a wireframe for aligning the screen on display with keys
LvdK 7:6576a287e563 338 {
LvdK 7:6576a287e563 339 display.cls();
LvdK 8:422544d24df3 340
LvdK 7:6576a287e563 341 display.pen_size(WIREFRAME);
LvdK 7:6576a287e563 342 display.rectangle(XMIN,YMIN,XMAX,YMAX, WHITE);
LvdK 7:6576a287e563 343 display.line(XMIN,LINE2,XMAX,LINE2, WHITE);
LvdK 7:6576a287e563 344 display.line(XMIN,LINE3,XMAX,LINE3, WHITE);
LvdK 7:6576a287e563 345 display.line(XMIN,LINE4,XMAX,LINE4, WHITE);
LvdK 7:6576a287e563 346 display.line(XMIN,LINE5,XMAX,LINE5, WHITE);
LvdK 7:6576a287e563 347 display.line(XMIN,LINE6,XMAX,LINE6, WHITE);
LvdK 7:6576a287e563 348 display.line(XMIN,LINE7,XMAX,LINE7, WHITE);
LvdK 7:6576a287e563 349 display.line(XMIN,LINE8,XMAX,LINE8, WHITE);
LvdK 7:6576a287e563 350 display.line(XMIN,LINE9,XMAX,LINE9, WHITE);
LvdK 7:6576a287e563 351 display.line(XMIN,LINE10,XMAX,LINE10, WHITE);
LvdK 7:6576a287e563 352 display.line(XMIN,LINE11,XMAX,LINE11, WHITE);
LvdK 7:6576a287e563 353 display.line(XMIN,LINE12,XMAX,LINE12, WHITE);
LvdK 7:6576a287e563 354 display.line(XMIN,LINE13,XMAX,LINE13, WHITE);
LvdK 7:6576a287e563 355 display.line(XMIN,LINE14,XMAX,LINE14, WHITE);
LvdK 7:6576a287e563 356 }
LvdK 7:6576a287e563 357 void CDU_TestScreen()
LvdK 7:6576a287e563 358 {
LvdK 7:6576a287e563 359 display.display_control(IMAGE_FORMAT, NEW); //set correct image for reading from SD
LvdK 7:6576a287e563 360 display.cls();
LvdK 7:6576a287e563 361 display.showpicture(0x00, 0x00, 0x00, 0x14, 0x00, 0x01, 0xB5); // Testscreen
LvdK 7:6576a287e563 362 }
LvdK 7:6576a287e563 363 void CDU_LogoScreen()
LvdK 7:6576a287e563 364 {
LvdK 8:422544d24df3 365 display.display_control(IMAGE_FORMAT, NEW); //set correct image for reading from SD
LvdK 7:6576a287e563 366 display.cls();
LvdK 7:6576a287e563 367 display.showpicture(0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00); // Engravity logo
LvdK 7:6576a287e563 368 }
LvdK 8:422544d24df3 369
LvdK 7:6576a287e563 370 void CDU_Page()
LvdK 7:6576a287e563 371 {
LvdK 7:6576a287e563 372 display.cls();
LvdK 7:6576a287e563 373 display.graphic_string( "PERF INIT" , 8*24, LINE1, FONT_24X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 374
LvdK 7:6576a287e563 375 display.graphic_string( "GW/CRZ CG" , 0, LINE2, FONT_12X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 376 display.graphic_string( "CRZ ALT" , 41*12, LINE2, FONT_12X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 377
LvdK 7:6576a287e563 378 display.graphic_string( "___._ / 26.2%" , 0, LINE3, FONT_24X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 379 display.graphic_string( "_____" , 19*24, LINE3, FONT_24X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 380 display.graphic_string( "FUEL" , 0, LINE4, FONT_12X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 381 display.graphic_string( "CRZ/WIND" , 40*12, LINE4, FONT_12X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 382
LvdK 7:6576a287e563 383 display.graphic_string( "0.0" , 0, LINE5, FONT_24X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 384 display.graphic_string( "000$ /---" , 15*24, LINE5, FONT_24X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 385
LvdK 7:6576a287e563 386 display.graphic_string( "ZFW" , 0, LINE6, FONT_12X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 387 display.graphic_string( "___._ " , 0, LINE7, FONT_24X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 388
LvdK 7:6576a287e563 389 display.graphic_string( "RESERVES" , 0, LINE8, FONT_12X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 390 display.graphic_string( "__._ " , 0, LINE9, FONT_24X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 391
LvdK 7:6576a287e563 392 display.graphic_string( "COST INDEX" , 0, LINE10, FONT_12X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 393 display.graphic_string( "TRANS ALT" , 39*12, LINE10, FONT_12X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 394
LvdK 7:6576a287e563 395 display.graphic_string( "___" , 0, LINE11, FONT_24X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 396 display.graphic_string( "_____" , 19*24, LINE11, FONT_24X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 397
LvdK 8:422544d24df3 398 display.graphic_string( "------------------------------------------------" , 0, LINE12, FONT_12X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 399
LvdK 7:6576a287e563 400 display.graphic_string( "<INDEX" , 0, LINE13, FONT_24X34, WHITE, 1, 1 );
LvdK 7:6576a287e563 401 display.graphic_string( "N1 LIMIT>" , 15*24, LINE13, FONT_24X34, WHITE, 1, 1 );
LvdK 8:422544d24df3 402
LvdK 7:6576a287e563 403 display.graphic_string( "SCRATCHPAD DATA LINE", centertext("SCRATCHPAD DATA LINE", 24, LARGECHAR) , LINE14, FONT_24X34, RED, 1, 1 );
LvdK 8:422544d24df3 404
LvdK 7:6576a287e563 405 }
LvdK 8:422544d24df3 406
LvdK 7:6576a287e563 407 void CDU_displayclear(){
LvdK 7:6576a287e563 408 display.cls();
LvdK 7:6576a287e563 409 }
LvdK 8:422544d24df3 410
LvdK 7:6576a287e563 411