This is the Official SmartGPU 2 processor board library to use with MBED boards!!!

Dependents:   BounceBall_SG2 BounceBalls_SG2 EEPROM_SG2 Ellipses_SG2 ... more

Files at this revision

API Documentation at this revision

Comitter:
emmanuelchio
Date:
Tue Jul 09 08:18:07 2013 +0000
Child:
1:0bf6fac21233
Commit message:
Official SmartGPU 2 processor board - MBED library!!!

Changed in this revision

SMARTGPU2.cpp Show annotated file Show diff for this revision Revisions of this file
SMARTGPU2.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SMARTGPU2.cpp	Tue Jul 09 08:18:07 2013 +0000
@@ -0,0 +1,1389 @@
+/*********************************************************
+VIZIC TECHNOLOGIES. COPYRIGHT 2013.
+THE DATASHEETS, SOFTWARE AND LIBRARIES ARE PROVIDED "AS IS." 
+VIZIC EXPRESSLY DISCLAIM ANY WARRANTY OF ANY KIND, WHETHER 
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED 
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+OR NONINFRINGEMENT. IN NO EVENT SHALL VIZIC BE LIABLE FOR 
+ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, 
+LOST PROFITS OR LOST DATA, HARM TO YOUR EQUIPMENT, COST OF 
+PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, 
+ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO 
+ANY DEFENCE THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION,
+OR OTHER SIMILAR COSTS.
+*********************************************************/
+
+/********************************************************
+ MBED SMARTGPU2 LIBRARY VERSION V1.0
+ IMPORTANT : This library is created for the MBED Software IDE
+********************************************************/
+
+#include "mbed.h"
+#include "SMARTGPU2.h"
+
+/****************************************************************/
+//Communication Functions(PLATFORM DEPENDENT) - MODIFY TO FIT YOUR PLATFORM IF DIFFERENT THAN MBED
+/****************************************************************/
+//Sends a single character through the serial port(USART)
+#define putcharTX(data) _serialSMARTGPU2.putc(data)
+
+//Returns a single character obtained from the serial port(USART)
+#define getcharRX()     _serialSMARTGPU2.getc()
+
+//Changes/Sets a new baudrate of the Host
+#define setBaud(newBaud) _serialSMARTGPU2.baud(newBaud)
+
+//Performs a Hardware Reset on smartGPU2 RESETPIN
+SMARTGPUREPLY SMARTGPU2::reset(){       //Physically Reset the SMARTGPU2 board
+  _resetPin=GND;                 // set the pin to GND to reset 
+  wait_ms(500);
+  _resetPin=VCC;                 // set the pin to 5v to end reset
+  wait_ms(500);   
+  return OK;
+}
+
+//MBED Exclusive - Hardware Configuration
+void SMARTGPU2::init(){          //configure the MBED board for SMARTGPU2 board
+    setBaud(9600);
+    _resetPin=VCC;               // set the pin to 5v to end reset  
+}
+
+/****************************************************************/
+/****************************************************************/ 
+/****************************************************************/
+//SmartGPU2 Library exclusive Functions - DO NOT MODIFY DOWN FROM HERE
+/****************************************************************/
+/****************************************************************/
+/****************************************************************/
+ // SMART GPU2 DEFAULT BAUD RATE: 9600bps
+//It shoud be used like this : SMARTGPU2 lcd(TXPIN,RXPIN,RESET); for serial communication with SMARTGPU2
+SMARTGPU2::SMARTGPU2(PinName TXPin, PinName RXPin, PinName resetPin): _serialSMARTGPU2(TXPin,RXPin), _resetPin(resetPin){    
+    init();
+}
+
+SMARTGPUREPLY SMARTGPU2::start(){       //Init the SMARTGPU2
+  wait_ms(500); 
+  putcharTX('U');  
+  wait_ms(500);
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+
+/****************************************************************/
+//Master Functions
+/****************************************************************/
+SMARTGPUREPLY SMARTGPU2::erase(){       //Erase the SMARTGPU2 screen
+  putcharTX('M');             //Master function
+  putcharTX('E'); 
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::sleep(STATE state){       //Send SMARTGPU2 to sleep mode
+  putcharTX('M');             //Master function
+  putcharTX('Z'); 
+  putcharTX(state);
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::orientation(LCDORIENTATIONS side){       //Change display orientation
+  putcharTX('M');             //Master function
+  putcharTX('O'); 
+  putcharTX(side);
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::bright(unsigned char val){       //Change display brightness
+  putcharTX('M');             //Master function
+  putcharTX('B'); 
+  putcharTX(val);
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+// SMART GPU 2 DEFAULT/INITIAL BAUD RATE: 9600bps
+SMARTGPUREPLY SMARTGPU2::baudChange(unsigned long baud){       //Change baud rate of MBED and SMARTGPU2 board
+  unsigned char aux;
+
+  putcharTX('M');             //Master function  
+  putcharTX('X');
+  putcharTX(baud>>24);
+  putcharTX(baud>>16);
+  putcharTX(baud>>8);
+  putcharTX(baud);
+  aux=getcharRX();
+  if(aux=='O'){ //if command is successfull, change baudrate, if not just leave and return 'F'
+    wait_ms(150);
+    setBaud(baud);
+    wait_ms(200);
+    return (SMARTGPUREPLY)getcharRX();
+  }else{
+    return (SMARTGPUREPLY)aux;
+  }
+}
+
+SMARTGPUREPLY SMARTGPU2::setEraseBackColour(COLOUR colour){       //Change the default screen background colour for erase function
+  putcharTX('M');             //Master function
+  putcharTX('C');             //Background Colour
+  putcharTX(colour>>8);
+  putcharTX(colour); 
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+
+/****************************************************************/
+//Geometric Functions
+/****************************************************************/
+SMARTGPUREPLY SMARTGPU2::putPixel(AXIS x, AXIS y, COLOUR colour){       //Draw a pixel on the screen
+  putcharTX('G');             //Geometric function 
+  putcharTX('P'); 
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::drawLine(AXIS x1, AXIS y1, AXIS x2, AXIS y2, COLOUR colour){       //Draw a line on the screen
+  putcharTX('G');             //Geometric function  
+  putcharTX('L'); 
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);  
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::drawRectangle(AXIS x1, AXIS y1, AXIS x2, AXIS y2, COLOUR colour, FILLGEOM fill){       //Draw a rectangle on the screen
+  putcharTX('G');             //Geometric function 
+  putcharTX('R');             //Rectangle   
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);  
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  putcharTX(fill);  
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::drawRoundRect(AXIS x1, AXIS y1, AXIS x2, AXIS y2, RADIUS radius, COLOUR colour, FILLGEOM fill){      //Draw a rounded rectangle on the screen
+  putcharTX('G');             //Geometric function 
+  putcharTX('O');             //Rounded Rectangle   
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);  
+  putcharTX(radius>>8);
+  putcharTX(radius);   
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  putcharTX(fill);  
+  return (SMARTGPUREPLY)getcharRX();
+}
+    
+SMARTGPUREPLY SMARTGPU2::drawGradientRect(AXIS x1, AXIS y1, AXIS x2, AXIS y2, COLOUR firstColour, COLOUR lastColour, ORIENTATIONPARAMETER direction){
+  putcharTX('G');             //Geometric function 
+  putcharTX('G');             //Gradient rectangle function
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);  
+  putcharTX(firstColour>>8);
+  putcharTX(firstColour);
+  putcharTX(lastColour>>8);
+  putcharTX(lastColour);  
+  putcharTX(direction);  
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::drawTriangle(AXIS x1, AXIS y1, AXIS x2, AXIS y2, AXIS x3, AXIS y3, COLOUR colour, FILLGEOM fill){       //Draw a triangle on the screen
+  putcharTX('G');             //Geometric function  
+  putcharTX('T'); 
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);  
+  putcharTX(x3>>8); 
+  putcharTX(x3);
+  putcharTX(y3>>8);
+  putcharTX(y3);    
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  putcharTX(fill);  
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::drawArc(AXIS x, AXIS y, RADIUS radiusx, RADIUS radiusy, ARCQUADRANT quadrant, COLOUR colour, FILLGEOM fill){ //Draw an Arc on the screen
+  putcharTX('G');             //Geometric function  
+  putcharTX('A');             //Arc
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(radiusx>>8);
+  putcharTX(radiusx);
+  putcharTX(radiusy>>8);
+  putcharTX(radiusy);  
+  putcharTX(quadrant);
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  putcharTX(fill);  
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::drawCircle(AXIS x, AXIS y, RADIUS radius, COLOUR colour, FILLGEOM fill){       //Draw a circle on the screen
+  putcharTX('G');             //Geometric function  
+  putcharTX('C');             //Circle 
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(radius>>8);
+  putcharTX(radius);
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  putcharTX(fill);  
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::drawEllipse(AXIS x, AXIS y, RADIUS radiusx, RADIUS radiusy, COLOUR colour, FILLGEOM fill){       //Draw an Ellipse on the screen
+  putcharTX('G');             //Geometric function 
+  putcharTX('E');             //Ellipse 
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(radiusx>>8);
+  putcharTX(radiusx);
+  putcharTX(radiusy>>8);
+  putcharTX(radiusy);  
+  putcharTX(colour>>8);
+  putcharTX(colour);
+  putcharTX(fill);  
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+
+/****************************************************************/
+//String Functions
+/****************************************************************/
+SMARTGPUREPLY SMARTGPU2::putLetter(AXIS x, AXIS y, char letter, AXIS *xUpdated){  //Draw a letter on the screen on X,Y coords, returns updated value of X axis in xUpdated variable
+  unsigned int xUp = 0;          //variable to store the updated position of X axis after command is called/char is printed
+  
+  putcharTX('S');             //String Function 
+  putcharTX('L');             //Letter - a simple letter
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(letter); 
+ 
+  xUp=getcharRX();
+  xUp=xUp<<8;
+  xUp|=getcharRX();
+  *xUpdated = xUp;
+  return (SMARTGPUREPLY)getcharRX();  
+}
+
+SMARTGPUREPLY SMARTGPU2::printNumber(AXIS x, AXIS y, float number){ //Prints a float number on screen 
+  putcharTX('S');           //String Function 
+  putcharTX('N');           //Number
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(((char *)&number)[3]);
+  putcharTX(((char *)&number)[2]);
+  putcharTX(((char *)&number)[1]);
+  putcharTX(((char *)&number)[0]);    
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::string(AXIS x1, AXIS y1, AXIS x2, AXIS y2, char text[], NUMBEROFBYTES *SPB){    //Draw a string on the screen on defined Text Box coords, and stores the successfully printed bytes on SPB
+  unsigned int counter=0, sp=0; 
+  
+  putcharTX('S');             //String Function 
+  putcharTX('S');             //String 
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);   
+  while(1){
+    putcharTX(text[counter]);
+    if(text[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }  
+
+  sp=getcharRX();
+  sp=sp<<8;
+  sp|=getcharRX();
+  *SPB = sp;
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::stringSD(AXIS x1, AXIS y1, AXIS x2, AXIS y2, NUMBEROFBYTES BS, NUMBEROFBYTES BR, FILENAME name, NUMBEROFBYTES *SPB){       //Draw a String from a text file stored on the micro SD card
+  unsigned char counter=0, sp=0;
+  
+  putcharTX('S');             //String function 
+  putcharTX('F');             //text File from SD 
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);  
+  putcharTX(BS>>8);
+  putcharTX(BS);  
+  putcharTX(BR>>8);
+  putcharTX(BR);  
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+
+  sp=getcharRX();
+  sp=sp<<8;
+  sp|=getcharRX();
+  *SPB = sp; 
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::setTextColour(COLOUR colour){        //Set the default text colour for letters and strings
+  putcharTX('S');             //String Function 
+  putcharTX('C');             //Config  
+  putcharTX('T');             //Text
+  putcharTX(colour>>8);
+  putcharTX(colour); 
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::setTextBackColour(COLOUR colour){    //Set the default text background colour for letters and strings
+  putcharTX('S');             //String Function 
+  putcharTX('C');             //Config  
+  putcharTX('B');             //Background
+  putcharTX(colour>>8);
+  putcharTX(colour); 
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::setTextSize(FONTSIZE size){           //Set the default text size for letters and strings
+  putcharTX('S');             //String Function 
+  putcharTX('C');             //Config  
+  putcharTX('S');             //Size
+  putcharTX(size); 
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::setTextBackFill(TEXTBACKGROUNDCOLOURFILLUNFILL fillState){  //Set the default text FILL or UNFILL background letters and strings
+  putcharTX('S');             //String Function 
+  putcharTX('C');             //Config  
+  putcharTX('F');             //Fill
+  putcharTX(fillState); 
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+
+/****************************************************************/
+//Image Functions
+/****************************************************************/
+SMARTGPUREPLY SMARTGPU2::drawIcon(AXIS x1, AXIS y1, AXIS x2, AXIS y2, char icon[]){            //Send and image or icon pixel by pixel to SMARTGPU2, 16bit(2 bytes) each pixel RGB565
+  unsigned int i,j,k=0; 
+  
+  putcharTX('I');             //Image function 
+  putcharTX('I');             //Icon image received pixel by pixel
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2);
+  //Send icon buffer pixel by pixel
+  for(j=0;j<=(y2-y1);j++){
+    for(i=0;i<=(x2-x1);i++){
+        putcharTX(icon[k++]); //16bit per pixel - Upper 8bits part
+        putcharTX(icon[k++]); //16bit per pixel - Lower 8bits part
+    }
+  }
+  
+  return (SMARTGPUREPLY)getcharRX();  
+}
+
+SMARTGPUREPLY SMARTGPU2::imageBMPSD(AXIS x, AXIS y, FILENAME name){        //Draw an Image stored on the micro SD card on the screen, at X,Y top right corner coordinates
+  unsigned char counter=0;
+  
+  putcharTX('I');             //Image function 
+  putcharTX('B');             //BMP from SD card
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+SMARTGPUREPLY SMARTGPU2::imageJPGSD(AXIS x, AXIS y, JPGSCALEFACTOR scaleFactor, FILENAME name){        //Draw an Image stored on the micro SD card on the screen, at X,Y top right corner coordinates
+  unsigned char counter=0;
+  
+  putcharTX('I');             //Image function 
+  putcharTX('J');             //JPG from SD card
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(scaleFactor);
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+//Reads a defined x1,x1,x2,y2 box of the SmartGPU display, and returns it pixel by pixel in RGB 888 format, 1 byte per colour, 3 bytes per pixel
+SMARTGPUREPLY SMARTGPU2::getImageFromMemory(AXIS x1, AXIS y1, AXIS x2, AXIS y2, char buffer[]){ //Read the internal memory of the SMARTGPU2, This command returns 24bit pixels (3 bytes)
+  unsigned int i,j,k=0;
+  
+  putcharTX('I');             //Image function
+  putcharTX('M');             //from SmartGPU internal Display Memory
+  putcharTX(x1>>8); 
+  putcharTX(x1);
+  putcharTX(y1>>8);
+  putcharTX(y1);
+  putcharTX(x2>>8); 
+  putcharTX(x2);
+  putcharTX(y2>>8);
+  putcharTX(y2); 
+  //receive all the pixels
+  for(j=0;j<=(y2-y1);j++){
+    for(i=0;i<=(x2-x1);i++){
+        buffer[k++]=getcharRX(); //Red
+        buffer[k++]=getcharRX(); //Green        
+        buffer[k++]=getcharRX(); //Blue
+    }   
+  }
+  return (SMARTGPUREPLY)getcharRX();  
+}
+
+//takes a screenshot of SmartGPU2 display and stores it in the microSD card with consecutive names Screenshot000.bmp, Screenshot001.bmp, etc
+SMARTGPUREPLY SMARTGPU2::screenshot(){ 
+  putcharTX('I');             //Image function
+  putcharTX('S');             //Screenshot
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+
+/****************************************************************/
+//Video Functions
+/****************************************************************/
+//Allocates a ".vid" video stored on the micro SD card with the given filename name
+SMARTGPUREPLY SMARTGPU2::allocateVideoSD(FILENAME name, VIDDATA *videoData){ 
+  unsigned int wid=0, hei=0, fra=0, tot=0;
+  unsigned char counter=0;
+  
+  putcharTX('V');             //Video function   
+  putcharTX('A');             //Allocate
+  while(1){                   //Send Video Name
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+
+  ((unsigned char *) &wid)[1]=getcharRX(); //get video width
+  ((unsigned char *) &wid)[0]=getcharRX(); 
+  ((unsigned char *) &hei)[1]=getcharRX(); //get video height
+  ((unsigned char *) &hei)[0]=getcharRX();
+  ((unsigned char *) &fra)[1]=getcharRX(); //get video frames per second
+  ((unsigned char *) &fra)[0]=getcharRX();
+  ((unsigned char *) &tot)[1]=getcharRX(); //get video total frames
+  ((unsigned char *) &tot)[0]=getcharRX();
+  videoData->width        = wid;
+  videoData->height       = hei;
+  videoData->framesPerSec = fra;
+  videoData->totalFrames  = tot;
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+//deAllocates a ".vid" video previously allocated, must be called when no more calls to video will be done
+SMARTGPUREPLY SMARTGPU2::freeVideoSD(){  
+  putcharTX('V');             //Video function   
+  putcharTX('D');             //DeAllocate
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+ //Sets a video start Frame position, this function can be used to FastForward video or Rewing, returns 'F' if invalid position
+SMARTGPUREPLY SMARTGPU2::setFrameVideoSD(unsigned int startFrame){
+  putcharTX('V');             //Video function   
+  putcharTX('F');             //set Video Frame
+  putcharTX(startFrame>>8);
+  putcharTX(startFrame);
+  return (SMARTGPUREPLY)getcharRX();
+}
+
+ //Plays a previously allocated ".vid" video stored on mSD card on X,Y top right corner coordinates, starting from current Video Frame and plays framesToPlay
+SMARTGPUREPLY SMARTGPU2::playVideoSD(AXIS x, AXIS y, unsigned int framesToPlay){ //frames to play from current video Frame
+  putcharTX('V');             //Video function   
+  putcharTX('P');             //Play
+  putcharTX(x>>8); 
+  putcharTX(x);
+  putcharTX(y>>8);
+  putcharTX(y);
+  putcharTX(framesToPlay>>8);
+  putcharTX(framesToPlay);
+  return (SMARTGPUREPLY)getcharRX();
+}
+    
+
+/****************************************************************/
+//Audio Functions
+/****************************************************************/      
+SMARTGPUREPLY SMARTGPU2::initDACAudio(STATE state){
+  putcharTX('A');             //Audio Function
+  putcharTX('I');             //Init - Deinit DACs
+  putcharTX(state);           //Enable/Disable  
+  return (SMARTGPUREPLY)getcharRX();      
+}
+
+SMARTGPUREPLY SMARTGPU2::audioBoost(STATE state){
+  putcharTX('A');             //Audio Function
+  putcharTX('B');             //Boost
+  putcharTX(state);           //Enable/Disable
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+SMARTGPUREPLY SMARTGPU2::getWAVPlayState(STATE* state){ //returns ENABLE or DISABLE if any file is playing
+  putcharTX('A');             //Audio Function
+  putcharTX('G');             //Get playing File status  
+  *state = (STATE)getcharRX();        //Get state
+  return (SMARTGPUREPLY)getcharRX();  
+}
+
+SMARTGPUREPLY SMARTGPU2::playWAVFile(FILENAME name, unsigned int* seconds){ //returns in "seconds" variable the song duration in seconds
+  unsigned int counter=0;
+  unsigned int secs=0;
+  
+  putcharTX('A');             //Audio Function
+  putcharTX('P');             //Play WAV file
+  while(1){                      //Send file name
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+    break;
+    }   
+    counter++;
+  }
+
+  ((unsigned char *) &secs)[1]=getcharRX();  
+  ((unsigned char *) &secs)[0]=getcharRX();     
+  *seconds = secs;
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+SMARTGPUREPLY SMARTGPU2::pauseWAVFile(){ //pauses a playing file, returns 'F' if no file is playing
+  putcharTX('A');             //Audio Function
+  putcharTX('W');             //Pause file
+  return (SMARTGPUREPLY)getcharRX();   
+}
+
+SMARTGPUREPLY SMARTGPU2::stopWAVFile(){
+  putcharTX('A');             //Audio Function
+  putcharTX('S');             //Stop playing file
+  return (SMARTGPUREPLY)getcharRX();   
+}
+
+SMARTGPUREPLY SMARTGPU2::advanceWAVFile(unsigned int seconds){ //advance to the file to the given seconds parameter  
+  putcharTX('A');             //Audio Function
+  putcharTX('A');             //Advance file  
+  putcharTX(seconds>>8);
+  putcharTX(seconds);  
+  return (SMARTGPUREPLY)getcharRX();          //returns 'F' if no file is playing or if no seconds position exists, in this case file will stop playing
+}
+
+SMARTGPUREPLY SMARTGPU2::setVolumeWAV(unsigned char volume){
+  putcharTX('A');             //Audio Function
+  putcharTX('V');             //Volume
+  putcharTX(volume);
+  return (SMARTGPUREPLY)getcharRX();  
+}
+
+
+/****************************************************************/
+//Real Time Clock Functions
+/****************************************************************/          
+SMARTGPUREPLY SMARTGPU2::setupRTC(STATE *state){
+  putcharTX('R');              //RTC function - Real Time Clock
+  putcharTX('S');              //Setup RTC
+  *state = (STATE)getcharRX();  //Get state
+  return (SMARTGPUREPLY)getcharRX();   
+}
+    
+SMARTGPUREPLY SMARTGPU2::getRTCTimeDate(TIME *timeDate){
+  unsigned int counter=0;
+  
+  putcharTX('R');              //RTC function - Real Time Clock
+  putcharTX('P');              //Parameters
+  putcharTX('G');              //Get
+  timeDate->hour = getcharRX(); //hour
+  timeDate->minute = getcharRX();   //min
+  timeDate->second = getcharRX(); //sec
+  timeDate->day = getcharRX();  //day
+  timeDate->month = getcharRX();  //month
+  ((unsigned char*)&counter)[1] = getcharRX();       //year upper
+  ((unsigned char*)&counter)[0] = getcharRX();       //year lower
+  timeDate->year = counter;         //year 
+  return (SMARTGPUREPLY)getcharRX();
+}
+    
+SMARTGPUREPLY SMARTGPU2::setRTCTimeDate(TIME *timeDate){
+  putcharTX('R');              //RTC function - Real Time Clock
+  putcharTX('P');              //Parameters
+  putcharTX('S');              //Set
+  putcharTX(timeDate->hour);   //hour
+  putcharTX(timeDate->minute); //min
+  putcharTX(timeDate->second); //sec
+  putcharTX(timeDate->day);   //day
+  putcharTX(timeDate->month);  //month
+  putcharTX(timeDate->year>>8);//year upper
+  putcharTX(timeDate->year);      //year lower  
+  return (SMARTGPUREPLY)getcharRX();
+}
+    
+    
+/****************************************************************/
+//Objects Functions
+/****************************************************************/          
+SMARTGPUREPLY SMARTGPU2::objButton(AXIS x1, AXIS y1, AXIS x2, AXIS y2, ACTIVE activeState, char text[]){
+  unsigned int counter=0;
+  
+  putcharTX('O');              //Object function
+  putcharTX('B');              //Button
+  putcharTX(x1>>8);
+  putcharTX(x1);  
+  putcharTX(y1>>8);
+  putcharTX(y1);  
+  putcharTX(x2>>8);
+  putcharTX(x2);  
+  putcharTX(y2>>8);
+  putcharTX(y2);
+  putcharTX(activeState);
+  while(1){                      //Send button text
+    putcharTX(text[counter]);
+    if(text[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }    
+  return (SMARTGPUREPLY)getcharRX();  
+}
+
+SMARTGPUREPLY SMARTGPU2::objSwitch(AXIS x, AXIS y, unsigned int switchSize, ACTIVE activeState){
+  putcharTX('O');              //Object function
+  putcharTX('T');              //Switch
+  putcharTX(x>>8);
+  putcharTX(x);  
+  putcharTX(y>>8);
+  putcharTX(y);  
+  putcharTX(switchSize>>8);
+  putcharTX(switchSize);  
+  putcharTX(activeState);
+  return (SMARTGPUREPLY)getcharRX();
+}
+    
+SMARTGPUREPLY SMARTGPU2::objCheckbox(AXIS x, AXIS y, unsigned int checkboxSize, ACTIVE activeState){
+  putcharTX('O');              //Object function
+  putcharTX('C');              //Checkbox
+  putcharTX(x>>8);
+  putcharTX(x);  
+  putcharTX(y>>8);
+  putcharTX(y);  
+  putcharTX(checkboxSize>>8);
+  putcharTX(checkboxSize);  
+  putcharTX(activeState);
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+SMARTGPUREPLY SMARTGPU2::objProgressBar(AXIS x1, AXIS y1, AXIS x2, AXIS y2, unsigned char progress){
+  putcharTX('O');              //Object function
+  putcharTX('P');              //Progress Bar
+  putcharTX(x1>>8);
+  putcharTX(x1);  
+  putcharTX(y1>>8);
+  putcharTX(y1);  
+  putcharTX(x2>>8);
+  putcharTX(x2);  
+  putcharTX(y2>>8);
+  putcharTX(y2);
+  putcharTX(progress);
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+SMARTGPUREPLY SMARTGPU2::objSlider(AXIS x1, AXIS y1, AXIS x2, AXIS y2, unsigned char position, unsigned char divisions, ORIENTATIONPARAMETER sliderOrientation){
+  putcharTX('O');              //Object function
+  putcharTX('L');              //Slider
+  putcharTX(x1>>8);
+  putcharTX(x1);  
+  putcharTX(y1>>8);
+  putcharTX(y1);  
+  putcharTX(x2>>8);
+  putcharTX(x2);  
+  putcharTX(y2>>8);
+  putcharTX(y2);
+  putcharTX(position);
+  putcharTX(divisions);
+  putcharTX(sliderOrientation);
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+SMARTGPUREPLY SMARTGPU2::objScrollBar(AXIS x1, AXIS y1, AXIS x2, AXIS y2, unsigned char position, unsigned char divisions, ORIENTATIONPARAMETER scrollBarOrientation, ACTIVE activeState){
+  putcharTX('O');              //Object function
+  putcharTX('S');              //Scroll bar
+  putcharTX(x1>>8);
+  putcharTX(x1);  
+  putcharTX(y1>>8);
+  putcharTX(y1);  
+  putcharTX(x2>>8);
+  putcharTX(x2);  
+  putcharTX(y2>>8);
+  putcharTX(y2);
+  putcharTX(position);
+  putcharTX(divisions);
+  putcharTX(scrollBarOrientation);
+  putcharTX(activeState);
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+SMARTGPUREPLY SMARTGPU2::objWindow(AXIS x1, AXIS y1, AXIS x2, AXIS y2, FONTSIZE textSize, WINDOWTYPE winType, char text[]){
+  unsigned int counter=0;
+  
+  putcharTX('O');              //Object function
+  putcharTX('W');              //Window
+  putcharTX(x1>>8);
+  putcharTX(x1);  
+  putcharTX(y1>>8);
+  putcharTX(y1);  
+  putcharTX(x2>>8);
+  putcharTX(x2);  
+  putcharTX(y2>>8);
+  putcharTX(y2);
+  putcharTX(textSize);  
+  putcharTX(winType);
+  while(1){                      //Send button text
+    putcharTX(text[counter]);
+    if(text[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+  return (SMARTGPUREPLY)getcharRX();    
+}
+
+
+/****************************************************************/
+//EEPROM-FLASH Functions - Refer to "smartGPU2 Command Set" to learn about READ-WRITE procedure.
+/****************************************************************/          
+SMARTGPUREPLY SMARTGPU2::initClearEEPROMBuff(){
+  putcharTX('E');              //EEPROM function
+  putcharTX('I');              //Init/Clear EEPROM Buffer
+  return (SMARTGPUREPLY)getcharRX(); 
+}
+
+SMARTGPUREPLY SMARTGPU2::readEEPROMBuff(char buffer[], ADDRESS EEPROMbufferAddress, NUMBEROFBYTES bytesToRead, NUMBEROFBYTES *SRB){
+  unsigned int x=0, sr=0;
+  
+  putcharTX('E');              //EEPROM function
+  putcharTX('R');              //Read N bytes from EEPROM buffer to received buffer[]
+  putcharTX(EEPROMbufferAddress>>8); //address to start reading from EEPROM buffer
+  putcharTX(EEPROMbufferAddress);  
+  putcharTX(bytesToRead>>8);
+  putcharTX(bytesToRead); 
+  
+  for(x=0; x<bytesToRead; x++){
+    buffer[x]=getcharRX();
+  }
+  sr=getcharRX();
+  sr=sr<<8;
+  sr|=getcharRX();
+  *SRB = sr;                   //store succesfully read bytes  
+   return (SMARTGPUREPLY)getcharRX();  
+}
+
+SMARTGPUREPLY SMARTGPU2::writeEEPROMBuff(char buffer[], ADDRESS EEPROMbufferAddress, NUMBEROFBYTES bytesToWrite, NUMBEROFBYTES *SWB){
+  unsigned int x=0, sw=0;
+  
+  putcharTX('E');              //EEPROM function
+  putcharTX('W');              //Write N bytes to EEPROM buffer from received buffer[]
+  putcharTX(EEPROMbufferAddress>>8); //address to start writting to EEPROM buffer
+  putcharTX(EEPROMbufferAddress);  
+  putcharTX(bytesToWrite>>8);
+  putcharTX(bytesToWrite);    
+  for(x=0; x<bytesToWrite; x++){
+    putcharTX(buffer[x]);
+  }  
+
+  sw=getcharRX();
+  sw=sw<<8;
+  sw|=getcharRX();
+  *SWB = sw;                   //store succesfully written bytes
+   return (SMARTGPUREPLY)getcharRX();    
+}
+
+SMARTGPUREPLY SMARTGPU2::saveBuffToEEPROMPage(EEPROMPAGE page){
+  putcharTX('E');              //EEPROM function
+  putcharTX('S');              //Save EEPROM buffer contents to received EEPROM page#
+  putcharTX(page);
+  return (SMARTGPUREPLY)getcharRX(); 
+}
+
+SMARTGPUREPLY SMARTGPU2::fillBuffFromEEPROMPage(EEPROMPAGE page){
+  putcharTX('E');              //EEPROM function
+  putcharTX('F');              //Fill(copy) EEPROM buffer with received EEPROM page# contents
+  putcharTX(page);
+  return (SMARTGPUREPLY)getcharRX(); 
+}
+
+SMARTGPUREPLY SMARTGPU2::compBuffToEEPROMPage(EEPROMPAGE page, unsigned char *result){
+  putcharTX('E');              //EEPROM function
+  putcharTX('C');              //Compare EEPROM buffer contents with received EEPROM page#
+  putcharTX(page);
+  *result = getcharRX();
+  return (SMARTGPUREPLY)getcharRX(); 
+}   
+
+SMARTGPUREPLY SMARTGPU2::eraseEEPROMPage(EEPROMPAGE page){
+  putcharTX('E');              //EEPROM function
+  putcharTX('E');              //Erase received EEPROM page#
+  putcharTX(page);
+  return (SMARTGPUREPLY)getcharRX(); 
+}   
+
+    
+/****************************************************************/
+//Touch Functions
+//Those next Touch Functions return valid or invalid touch coordinates status(TOUCHREPLY) instead of ACK 'O' or NAK 'F'(SMARTGPUREPLY)
+/****************************************************************/
+TOUCHREPLY SMARTGPU2::touchScreen(POINT *point){ //Ask for a touch on the screen, if return==VALID, touch coords are valid and stored on xAxis and yAxis 
+  unsigned int x=0,y=0;
+  putcharTX('T');             //Touch Function
+  putcharTX('S');             //Screen touch 
+  ((unsigned char *) &x)[1]=getcharRX();
+  ((unsigned char *) &x)[0]=getcharRX();
+  ((unsigned char *) &y)[1]=getcharRX();
+  ((unsigned char *) &y)[0]=getcharRX();
+  if(getcharRX()=='O'){  //if touch coordinates are valid, assign values
+    point->x=x;
+    point->y=y;
+    return (TOUCHREPLY)VALID;
+  }
+  return (TOUCHREPLY)INVALID;
+}
+
+TOUCHREPLY SMARTGPU2::touchIcon(ICON *icon){ //Ask for a touch on the icons of the screen, if return==VALID, icon first letter is stored on icon
+  putcharTX('T');             //Touch Function
+  putcharTX('I');             //Icons touch
+  *icon = (ICON)getcharRX();
+  if(getcharRX()=='O'){  //if touch coordinates are valid
+    return (TOUCHREPLY)VALID;
+  }
+  return (TOUCHREPLY)INVALID;
+}
+
+
+/****************************************************************/
+//SD FAT management Functions
+//Those next SDF - SD Functions return file execution status(FILERESULT) instead of ACK 'O' or NAK 'F'(SMARTGPUREPLY)
+/****************************************************************/
+FILERESULT SMARTGPU2::SDFgetList(unsigned int *numOfDirs, unsigned int *numOfFiles){ //get number of dirs and files
+  FILERESULT res;
+  unsigned int dirs=0, files=0;
+    
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('L');           //List/count dirs and files
+  
+  ((unsigned char *) &dirs)[1]= getcharRX();       //Get Upper part
+  ((unsigned char *) &dirs)[0]= getcharRX();       //Get Lower part
+  ((unsigned char *) &files)[1]= getcharRX();      //Get Upper part
+  ((unsigned char *) &files)[0]= getcharRX();      //Get Lower part  
+  *numOfDirs=dirs;  
+  *numOfFiles=files;
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFgetDirName(ITEMNUMBER itemNumber, FILENAME name){ //searches for the "itemNumber" on the SD current folder and updates the buffer with the Dir name ended with NULL character
+  FILERESULT  res;
+  unsigned int  i=0;
+
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('G');           //Get name of given item file number
+  putcharTX('D');           //Directory
+  putcharTX(itemNumber>>8); //Send Upper part of itemNumber
+  putcharTX(itemNumber);    //Send Lower part of itemNumber
+  
+  while(1){
+    name[i]=getcharRX(); 
+    if(name[i]==0x00){         //if we find NULL character, means end of name
+        break;   
+    }
+    i++;
+  }
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                    //Return SD file execution status
+ }
+
+FILERESULT SMARTGPU2::SDFgetFileName(ITEMNUMBER itemNumber, FILENAME name){ //searches for the "itemNumber" on the SD current folder and updates the buffer with the File name ended with NULL character
+  FILERESULT  res;
+  unsigned int  i=0;
+
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('G');           //Get name of given item file number
+  putcharTX('F');           //File  
+  putcharTX(itemNumber>>8); //Send Upper part of itemNumber
+  putcharTX(itemNumber);    //Send Lower part of itemNumber
+
+  while(1){
+    name[i]=getcharRX(); 
+    if(name[i]==0x00){         //if we find NULL character, means end of name
+        break;   
+    }
+    i++;
+  }
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                    //Return SD file execution status
+ }
+ 
+FILERESULT SMARTGPU2::SDFgetDirPath(char path[]){ //obtains current dir path and stores on path[] buffer
+  FILERESULT  res;
+  unsigned int  i=0;
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('H');           //Get current Dir Path
+  
+  while(1){
+    path[i]=getcharRX(); 
+    if(path[i]==0x00){         //if we find NULL character, means end of path
+        break;   
+    }
+    i++;
+  }
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                    //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFnewDir(FILENAME name){ //create a new Directory, fails if already exist
+  FILERESULT res;
+  unsigned int counter=0;  
+ 
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('N');           //New
+  putcharTX('D');           //Directory/Folder  
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+    break;
+    }   
+    counter++;
+  }
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                    //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFnewFile(FILENAME name){ //create a new File, fails if already exist
+  FILERESULT res;
+  unsigned int counter=0;  
+ 
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('N');           //New
+  putcharTX('F');           //File 
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+    break;
+    }   
+    counter++;
+  }
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                    //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFopenDir(FILENAME name){ //opens an existing Dir
+  FILERESULT res;
+  unsigned int counter=0;  
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('D');           //Open Dir
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                    //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFopenFile(FILENAME name, OPENMODE mode, WORKSPACEBLOCK objectWorkspaceNo){ //opens an existing file in READONLY, WRITEONLY or READWRITE mode on the received object # workspace
+  FILERESULT res;
+  unsigned int counter=0;  
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('O');           //Open file
+  putcharTX(objectWorkspaceNo); //object workspace number to allocate open file 0-4
+  putcharTX(mode);          //Mode - READONLY,WRITEONLY,READWRITE
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                    //Return SD file execution status  
+}
+
+FILERESULT SMARTGPU2::SDFcloseFile(WORKSPACEBLOCK objectWorkspaceNo){ //close and save file object # workspace
+  FILERESULT res;
+
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('C');           //Close File
+  putcharTX(objectWorkspaceNo); //object workspace number to close 0-4  
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFsaveFile(WORKSPACEBLOCK objectWorkspaceNo){ //sync/save file object # workspace
+  FILERESULT res;
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('S');           //Save/Sync file - Save changes on file
+  putcharTX(objectWorkspaceNo); //object workspace number to save changes 0-4  
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFsetFilePointer(POINTERPOSITION pointerPosition, WORKSPACEBLOCK objectWorkspaceNo){ // set/move file pointer of file object # workspace
+  FILERESULT res;
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('P');           //Pointer position
+  putcharTX(objectWorkspaceNo); //object workspace number to move pointer 0-4  
+  putcharTX('S');           //Set  
+  putcharTX(pointerPosition>>24);
+  putcharTX(pointerPosition>>16);
+  putcharTX(pointerPosition>>8);
+  putcharTX(pointerPosition);
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}   
+
+FILERESULT SMARTGPU2::SDFgetFilePointer(POINTERPOSITION *pointerPosition, WORKSPACEBLOCK objectWorkspaceNo){ // get file pointer of file object # workspace
+  FILERESULT res;
+  unsigned long pos = 0;
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('P');           //Pointer position
+  putcharTX(objectWorkspaceNo); //object workspace number to get pointer 0-4  
+  putcharTX('G');           //Get
+  
+  ((unsigned char *) &pos)[3]=getcharRX();
+  ((unsigned char *) &pos)[2]=getcharRX();
+  ((unsigned char *) &pos)[1]=getcharRX();  
+  ((unsigned char *) &pos)[0]=getcharRX();
+  *pointerPosition =pos;
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}   
+
+FILERESULT SMARTGPU2::SDFreadFile(char buffer[], NUMBEROFBYTES BTR, NUMBEROFBYTES *SRB, WORKSPACEBLOCK objectWorkspaceNo){ //Bytes to Read, Succesfully Read Bytes, file object # to read bytes from
+  FILERESULT res;
+  unsigned int x=0, sr=0;
+
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('R');           //Read file
+  putcharTX(objectWorkspaceNo); //object workspace number to read 0-4    
+  putcharTX(BTR>>8);
+  putcharTX(BTR);  
+
+  for(x=0;x<BTR;x++){
+    buffer[x]=getcharRX();
+  }
+  sr=getcharRX();
+  sr=sr<<8;
+  sr|=getcharRX();
+  *SRB = sr;                   //store succesfully read bytes
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}   
+
+FILERESULT SMARTGPU2::SDFwriteFile(char buffer[], NUMBEROFBYTES BTW, NUMBEROFBYTES *SWB,  WORKSPACEBLOCK objectWorkspaceNo){ //Bytes to Write, Succesfully Written Bytes, file object # to write bytes
+  FILERESULT res;
+  unsigned int x=0, sw=0;
+ 
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('W');           //Write file
+  putcharTX(objectWorkspaceNo); //object workspace number to write bytes 0-4    
+  putcharTX(BTW>>8);
+  putcharTX(BTW);    
+  for(x=0;x<BTW;x++){
+    putcharTX(buffer[x]);
+  }
+
+  sw=getcharRX();
+  sw=sw<<8;
+  sw|=getcharRX();
+  *SWB = sw;                   //store succesfully written bytes   
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFtestFileError(WORKSPACEBLOCK objectWorkspaceNo){  //test for an error on file # workspace
+  FILERESULT res;
+
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('Q');           //Test 
+  putcharTX(objectWorkspaceNo); //object workspace number to write bytes 0-4    
+  putcharTX('R');           //Test Error  
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFtestFileEnd(WORKSPACEBLOCK objectWorkspaceNo){  //test for an error on file # workspace
+  FILERESULT res;
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('Q');           //Test 
+  putcharTX(objectWorkspaceNo); //object workspace number to write bytes 0-4    
+  putcharTX('E');           //Test End of File
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status 
+}
+
+FILERESULT SMARTGPU2::SDFtruncateFile(WORKSPACEBLOCK objectWorkspaceNo){  //truncates the file size to the current file read/write pointer of the file # workspace
+  FILERESULT res;
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('V');           //Truncate
+  putcharTX(objectWorkspaceNo); //object workspace number 0-4 to truncate on current pointerPosition
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status 
+}
+
+FILERESULT SMARTGPU2::SDFeraseDirFile(FILENAME name){ //Erases an existing Dir or File
+  FILERESULT res;
+  unsigned int counter=0;  
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('E');           //Erase Dir File
+  putcharTX('O');           //Unlock Erase Protection
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFsetFileTimeDate(TIME *timeDate, FILENAME name){ //Set Time and Date to an existing File
+  FILERESULT res;
+  unsigned int counter=0;  
+  
+  putcharTX('F');              //File function - memory card file management
+  putcharTX('T');              //Time/Date
+  putcharTX('S');              //Set
+  putcharTX(timeDate->hour);   //hour
+  putcharTX(timeDate->minute); //min
+  putcharTX(timeDate->second); //sec
+  putcharTX(timeDate->day);   //day
+  putcharTX(timeDate->month);  //month
+  putcharTX(timeDate->year>>8);//year upper
+  putcharTX(timeDate->year);      //year lower  
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  }
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status 
+}
+
+FILERESULT SMARTGPU2::SDFgetFileTimeDate(TIME *timeDate, FILENAME name){ //Get Time and Date to an existing File
+  FILERESULT res;
+  unsigned int counter=0;  
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('T');           //Time/Date
+  putcharTX('G');           //Get
+  while(1){
+    putcharTX(name[counter]);
+    if(name[counter]==0x00){
+      break;
+    }   
+    counter++;
+  } 
+
+  timeDate->hour = getcharRX();   //hour
+  timeDate->minute = getcharRX(); //min
+  timeDate->second = getcharRX(); //sec
+  timeDate->day = getcharRX();    //day
+  timeDate->month = getcharRX();  //month
+  ((unsigned char*)&counter)[1] = getcharRX();       //year upper
+  ((unsigned char*)&counter)[0] = getcharRX();       //year lower
+  timeDate->year = counter;         //year
+  res = (FILERESULT)getcharRX();  //Get SD file execution status
+  getcharRX();                    //Discard 'O' or 'F'
+  return res;                     //Return SD file execution status
+}
+
+FILERESULT SMARTGPU2::SDFgetFileSize(FILENAME name, unsigned long *fileSize){ //Get Size of an existing File
+  FILERESULT res;
+  unsigned int counter=0;  
+  unsigned long size=0;
+  
+    putcharTX('F');           //File function - memory card file management
+    putcharTX('I');           //Info
+    putcharTX('S');           //Size
+    while(1){
+        putcharTX(name[counter]);
+        if(name[counter]==0x00){
+        break;
+        }   
+        counter++;
+    }   
+
+  ((unsigned char *) &size)[3]=getcharRX();
+  ((unsigned char *) &size)[2]=getcharRX();
+  ((unsigned char *) &size)[1]=getcharRX();  
+  ((unsigned char *) &size)[0]=getcharRX(); 
+  *fileSize=size;
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status 
+}
+
+FILERESULT SMARTGPU2::SDFrenameMoveDirFile(FILENAME oldName, FILENAME newName){ //renames or moves an existing Dir or File
+  FILERESULT res;
+  unsigned int counter=0;  
+  
+    putcharTX('F');           //File function - memory card file management
+    putcharTX('M');           //Rename / Move
+    while(1){
+        putcharTX(oldName[counter]);
+        if(oldName[counter]==0x00){
+        break;
+        }   
+        counter++;
+    }
+    counter=0;
+    while(1){
+        putcharTX(newName[counter]);
+        if(newName[counter]==0x00){
+        break;
+        }   
+        counter++;
+  } 
+
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status 
+}
+
+FILERESULT SMARTGPU2::SDFgetFreeTotalSpace(unsigned long *freeSpace,unsigned long *totalSpace){ //Get free and total space in bytes of the microSD card
+  FILERESULT res;
+  unsigned long fSpace=0, tSpace=0;
+  
+  putcharTX('F');           //File function - memory card file management
+  putcharTX('F');           //Free/Total space
+
+  ((unsigned char *) &fSpace)[3]=getcharRX();
+  ((unsigned char *) &fSpace)[2]=getcharRX();
+  ((unsigned char *) &fSpace)[1]=getcharRX();  
+  ((unsigned char *) &fSpace)[0]=getcharRX(); 
+  ((unsigned char *) &tSpace)[3]=getcharRX();
+  ((unsigned char *) &tSpace)[2]=getcharRX();
+  ((unsigned char *) &tSpace)[1]=getcharRX();  
+  ((unsigned char *) &tSpace)[0]=getcharRX(); 
+  *freeSpace=fSpace;
+  *totalSpace=tSpace;  
+  res = (FILERESULT)getcharRX(); //Get SD file execution status
+  getcharRX();                   //Discard 'O' or 'F'
+  return res;                      //Return SD file execution status 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SMARTGPU2.h	Tue Jul 09 08:18:07 2013 +0000
@@ -0,0 +1,469 @@
+/*********************************************************
+VIZIC TECHNOLOGIES. COPYRIGHT 2013.
+THE DATASHEETS, SOFTWARE AND LIBRARIES ARE PROVIDED "AS IS." 
+VIZIC EXPRESSLY DISCLAIM ANY WARRANTY OF ANY KIND, WHETHER 
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED 
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+OR NONINFRINGEMENT. IN NO EVENT SHALL VIZIC BE LIABLE FOR 
+ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, 
+LOST PROFITS OR LOST DATA, HARM TO YOUR EQUIPMENT, COST OF 
+PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, 
+ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO 
+ANY DEFENCE THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION,
+OR OTHER SIMILAR COSTS.
+*********************************************************/
+
+/********************************************************
+ MBED SMARTGPU2 LIBRARY VERSION V1.0
+ IMPORTANT : This library is created for the MBED Software IDE
+********************************************************/
+
+#ifndef SMARTGPU2_h
+#define SMARTGPU2_h
+
+#include <mbed.h>
+
+//General MBED pinout defines
+#define TXPIN    p13
+#define RXPIN    p14
+#define RESETPIN p15
+
+//defines for SmartGPU2 LCD320x240 ONLY
+#define LCD_WIDTH  320
+#define LCD_HEIGHT 240
+#define MAX_X_LANDSCAPE 319
+#define MAX_Y_LANDSCAPE 239
+#define MAX_X_PORTRAIT  239
+#define MAX_Y_PORTRAIT  319
+
+//General definitions
+#define OFF 0
+#define ON  1
+#define GND 0
+#define VCC 1
+#define SCROLLBUTTONSIZE 25
+typedef unsigned int AXIS;
+typedef unsigned int COLOUR;
+typedef unsigned int RADIUS;
+typedef unsigned int NUMBEROFBYTES;
+typedef unsigned int ITEMNUMBER;
+typedef unsigned int ADDRESS;
+typedef unsigned long POINTERPOSITION;
+typedef char FILENAME[];
+
+typedef enum {
+    DISABLE, //0
+    ENABLE   //1
+} STATE; //to set Enable/Disable States
+
+typedef enum {
+    DESELECTED, //0
+    SELECTED    //1
+} ACTIVE; //to set Selected/DeSelected Active objects
+
+typedef enum {
+    DESELECTEDTRANS, //0 set an unselected top window with transparent center
+    SELECTEDTRANS,   //1 set a selected window with transparent center
+    SELECTEDGRAY,    //2 set a selected window with gray center
+    SELECTEDWHITE    //3 set a selected window with white center
+} WINDOWTYPE; //to set type of window to draw
+
+typedef struct {
+    AXIS x; //X axis
+    AXIS y; //Y axis
+} POINT;    //to create a point with point.x and point.y variables
+
+typedef enum {
+    OK   = 'O',  //Command successfully executed
+    FAIL = 'F'   //Command Fail
+} SMARTGPUREPLY; //to get SmartGPU2 command responses
+
+//Graphics functions definitions
+typedef enum {
+    UNFILL, //0
+    FILL    //1
+} FILLGEOM;  //to set fill or unfill colour geometry
+
+typedef enum {
+    HORIZONTAL, //0
+    VERTICAL    //1
+} ORIENTATIONPARAMETER;//to set gradient colour fade orientation and objects: scrollBar and Slider orientations
+
+typedef enum {
+    LANDSCAPE_LEFT,     //0 left
+    PORTRAIT_LOW,      //1 low
+    LANDSCAPE_RIGHT,     //2 right
+    PORTRAIT_TOP       //3 top
+} LCDORIENTATIONS;  //to set LCD orientations
+
+typedef enum {
+    QUADRANT1 = 1, //1
+    QUADRANT2,     //2
+    QUADRANT3,     //3
+    QUADRANT4      //4
+} ARCQUADRANT;     //to set desired arc drawing quadrant
+
+//basic colours definitions
+#define BLACK   0x0000
+#define WHITE   0xFFFF
+#define RED     0xF800
+#define GREEN   0x07E0
+#define BLUE    0x001F
+#define YELLOW  0xFFE0
+#define CYAN    0x07FF
+#define MAGENTA 0xF81F
+
+//fonts definitions
+typedef enum {
+    FONT0 = 0,
+    FONT1,
+    FONT2,
+    FONT3,
+    FONT4,
+    FONT5,
+    FONT6,
+    FONT7,
+    FONT8,
+    FONT9,
+    FONT10,
+    FONT11,
+    FONT12,
+    FONT13
+} FONTSIZE; //to set text font sizes
+
+typedef enum {
+    TRANS = 0,
+    FILLED
+} TEXTBACKGROUNDCOLOURFILLUNFILL; //to set text background colour to transparent or filled
+
+//Video 
+typedef struct {
+    unsigned int width;  //X width
+    unsigned int height; //Y height
+    unsigned int framesPerSec; //video frames per second
+    unsigned int totalFrames;  //video total frames in the file
+} VIDDATA;    //to create a Video Data struct containing, size X, size Y, frames per second and totalframes info
+
+//Touch definitions
+typedef enum {
+    INVALID,  //returned touch point is invalid
+    VALID     //returned touch point is valid
+} TOUCHREPLY; //to get SmartGPU2 touch responses
+
+typedef enum {
+    HOUSE    = 'H',
+    MESSAGE  = 'M',
+    BOOK     = 'B',
+    PHONE    = 'P',
+    SONG     = 'S',
+    NONE     = 'N'
+} ICON;  //to get the type of touched icon
+
+//File access definitions
+#define BEGINNING    0
+#define ALLCONTENTS  0
+typedef enum {
+    READONLY = 1, //1
+    WRITEONLY,    //2
+    READWRITE     //3
+} OPENMODE;       //to set the file access open mode
+
+//SMARTGPU2 Command Execution responses definitions
+typedef enum {
+    F_OK = 0,               /* (0) Succeeded */
+    F_DISK_ERR,         /* (1) A hard error occurred in the low level disk I/O layer */
+    F_INT_ERR,              /* (2) Assertion failed */
+    F_NOT_READY,            /* (3) The physical drive cannot work */
+    F_NO_FILE,              /* (4) Could not find the file */
+    F_NO_PATH,              /* (5) Could not find the path */
+    F_INVALID_NAME,     /* (6) The path name format is invalid */
+    F_DENIED,               /* (7) Access denied due to prohibited access or directory full */
+    F_EXIST,                /* (8) Access denied due to prohibited access */
+    F_INVALID_OBJECT,       /* (9) The file/directory object is invalid */
+    F_WRITE_PROTECTED,      /* (10) The physical drive is write protected */
+    F_INVALID_DRIVE,        /* (11) The logical drive number is invalid */
+    F_NOT_ENABLED,          /* (12) The volume has no work area */
+    F_NO_FILESYSTEM,        /* (13) There is no valid FAT volume */
+    F_MKFS_ABORTED,     /* (14) The f_mkfs() aborted due to any parameter error */
+    F_TIMEOUT,              /* (15) Could not get a grant to access the volume within defined period */
+    F_LOCKED,               /* (16) The operation is rejected according to the file sharing policy */
+    F_NOT_ENOUGH_CORE,      /* (17) LFN working buffer could not be allocated */
+    F_TOO_MANY_OPEN_FILES,  /* (18) Number of open files > _FS_SHARE */
+    F_INVALID_PARAMETER /* (19) Given parameter is invalid */
+} FILERESULT;              //to get all FAT related functions responses
+
+//SMARTGPU2 WorkSpaces definitions
+typedef enum {
+    WORKSPACE0 = 0, 
+    WORKSPACE1,
+    WORKSPACE2,
+    WORKSPACE3 
+} WORKSPACEBLOCK;  //to set the working workspace
+
+//SMARTGPU2 EEPROM pages definitions, each page is 2048bytes (2Kb) in size
+typedef enum {
+    PAGE0 = 0, 
+    PAGE1,
+    PAGE2,
+    PAGE3,
+    PAGE4,
+    PAGE5,
+    PAGE6,
+    PAGE7
+} EEPROMPAGE;  //to set the EEPROM page
+
+//Files Time and Date
+typedef struct {
+    unsigned char hour;
+    unsigned char minute;
+    unsigned char second;
+    unsigned char day;
+    unsigned char month;
+    unsigned int  year; 
+} TIME;    //to create a Time-Date info struct
+
+//JPG images scale factor definitions
+typedef enum {
+    SCALE1_1 = 0,  // 1 to 1
+    SCALE1_2,      // 1 to 2
+    SCALE1_4,      // 1 to 4
+    SCALE1_8       // 1 to 8
+} JPGSCALEFACTOR; //to set the desired JPG image decompression scale factor
+
+//Recommended(but not limited to) MBED-SmartGPU Baud rate definitions
+typedef enum{
+    BAUD0 = 9600,
+    BAUD1 = 19200,
+    BAUD2 = 57600,
+    BAUD3 = 115200,
+    BAUD4 = 256000,
+    BAUD5 = 500000,
+    BAUD6 = 1000000,
+    BAUD7 = 2000000
+} BAUDRATE;
+
+//**************************************************************************
+// class SMARTGPU2 SMARTGPU2.h
+// This is the main class. It shoud be used like this : SMARTGPU2 lcd(p13,p14,p15);
+//***************************************************************************
+class SMARTGPU2{
+    
+public:
+/****************************************************************/
+//MBED exclusive Functions
+/****************************************************************/
+    SMARTGPU2(PinName TXPin, PinName RXPin, PinName resetPin);
+    
+    void init();
+
+    SMARTGPUREPLY reset();
+    
+    SMARTGPUREPLY start();  
+
+/****************************************************************/
+//Master Functions
+/****************************************************************/  
+    SMARTGPUREPLY erase();
+
+    SMARTGPUREPLY sleep(STATE);
+    
+    SMARTGPUREPLY orientation(LCDORIENTATIONS);
+    
+    SMARTGPUREPLY bright(unsigned char);
+    
+    SMARTGPUREPLY baudChange(unsigned long);
+        
+    SMARTGPUREPLY setEraseBackColour(COLOUR);
+    
+/****************************************************************/
+//Geometric Functions
+/****************************************************************/      
+    SMARTGPUREPLY putPixel(AXIS, AXIS, COLOUR);
+    
+    SMARTGPUREPLY drawLine(AXIS, AXIS, AXIS, AXIS, COLOUR);
+    
+    SMARTGPUREPLY drawRectangle(AXIS, AXIS, AXIS, AXIS, COLOUR, FILLGEOM);
+
+    SMARTGPUREPLY drawRoundRect(AXIS, AXIS, AXIS, AXIS, RADIUS, COLOUR, FILLGEOM);
+    
+    SMARTGPUREPLY drawGradientRect(AXIS, AXIS, AXIS, AXIS, COLOUR, COLOUR, ORIENTATIONPARAMETER);
+    
+    SMARTGPUREPLY drawTriangle(AXIS, AXIS, AXIS, AXIS, AXIS, AXIS, COLOUR, FILLGEOM);
+    
+    SMARTGPUREPLY drawArc(AXIS, AXIS, RADIUS, RADIUS, ARCQUADRANT, COLOUR, FILLGEOM);
+    
+    SMARTGPUREPLY drawCircle(AXIS, AXIS, RADIUS, COLOUR, FILLGEOM);
+    
+    SMARTGPUREPLY drawEllipse(AXIS, AXIS, RADIUS, RADIUS, COLOUR, FILLGEOM);        
+    
+/****************************************************************/
+//String Functions
+/****************************************************************/      
+    SMARTGPUREPLY putLetter(AXIS, AXIS, char, AXIS*);
+    
+    SMARTGPUREPLY printNumber(AXIS, AXIS, float);   
+    
+    SMARTGPUREPLY string(AXIS, AXIS, AXIS, AXIS, char[], NUMBEROFBYTES*); //returns in NUMBEROFBYTES the successfully printed chars or letters
+    
+    SMARTGPUREPLY stringSD(AXIS, AXIS, AXIS, AXIS, NUMBEROFBYTES, NUMBEROFBYTES, FILENAME, NUMBEROFBYTES*); //returns in NUMBEROFBYTES the successfully printed chars or letters
+    
+    SMARTGPUREPLY setTextColour(COLOUR);
+    
+    SMARTGPUREPLY setTextBackColour(COLOUR);
+
+    SMARTGPUREPLY setTextSize(FONTSIZE);
+
+    SMARTGPUREPLY setTextBackFill(TEXTBACKGROUNDCOLOURFILLUNFILL);  
+    
+/****************************************************************/
+//Image Functions
+/****************************************************************/      
+    SMARTGPUREPLY drawIcon(AXIS, AXIS, AXIS, AXIS, char[]);
+    
+    SMARTGPUREPLY imageBMPSD(AXIS, AXIS, FILENAME);
+    
+    SMARTGPUREPLY imageJPGSD(AXIS, AXIS, JPGSCALEFACTOR, FILENAME); 
+
+    SMARTGPUREPLY getImageFromMemory(AXIS, AXIS, AXIS, AXIS, char[]); //Read the internal memory of the SMARTGPU2, This command returns 24bit pixels (3 bytes)
+
+    SMARTGPUREPLY screenshot();
+    
+/****************************************************************/
+//Video Functions
+/****************************************************************/          
+    SMARTGPUREPLY allocateVideoSD(FILENAME, VIDDATA*);
+
+    SMARTGPUREPLY freeVideoSD();
+    
+    SMARTGPUREPLY setFrameVideoSD(unsigned int);
+    
+    SMARTGPUREPLY playVideoSD(AXIS, AXIS, unsigned int);    
+    
+/****************************************************************/
+//Audio Functions
+/****************************************************************/      
+    SMARTGPUREPLY initDACAudio(STATE);
+
+    SMARTGPUREPLY audioBoost(STATE);
+
+    SMARTGPUREPLY getWAVPlayState(STATE*);
+
+    SMARTGPUREPLY playWAVFile(FILENAME, unsigned int*); //returns in unsigned int* the file duration in seconds
+
+    SMARTGPUREPLY pauseWAVFile();
+
+    SMARTGPUREPLY stopWAVFile();
+
+    SMARTGPUREPLY advanceWAVFile(unsigned int); //advance file to the parameter(means seconds)
+
+    SMARTGPUREPLY setVolumeWAV(unsigned char);  
+    
+/****************************************************************/
+//Real Time Clock Functions
+/****************************************************************/          
+    SMARTGPUREPLY setupRTC(STATE*);
+    
+    SMARTGPUREPLY getRTCTimeDate(TIME*);
+    
+    SMARTGPUREPLY setRTCTimeDate(TIME*);
+
+/****************************************************************/
+//Objects Functions - Refer to "smartGPU2 Command Set" to learn about minimum width and height objects size.
+/****************************************************************/          
+    SMARTGPUREPLY objButton(AXIS, AXIS, AXIS, AXIS, ACTIVE, char[]);
+
+    SMARTGPUREPLY objSwitch(AXIS, AXIS, unsigned int, ACTIVE);
+    
+    SMARTGPUREPLY objCheckbox(AXIS, AXIS, unsigned int, ACTIVE);
+
+    SMARTGPUREPLY objProgressBar(AXIS, AXIS, AXIS, AXIS, unsigned char);
+
+    SMARTGPUREPLY objSlider(AXIS, AXIS, AXIS, AXIS, unsigned char, unsigned char, ORIENTATIONPARAMETER);
+
+    SMARTGPUREPLY objScrollBar(AXIS, AXIS, AXIS, AXIS, unsigned char, unsigned char, ORIENTATIONPARAMETER, ACTIVE);
+
+    SMARTGPUREPLY objWindow(AXIS, AXIS, AXIS, AXIS, FONTSIZE, WINDOWTYPE, char[]);
+
+/****************************************************************/
+//EEPROM-FLASH Functions - Refer to "smartGPU2 Command Set" to learn about READ-WRITE procedure, and page SIZE.
+/****************************************************************/          
+    SMARTGPUREPLY initClearEEPROMBuff();
+
+    SMARTGPUREPLY readEEPROMBuff(char[], ADDRESS, NUMBEROFBYTES, NUMBEROFBYTES*);
+
+    SMARTGPUREPLY writeEEPROMBuff(char[], ADDRESS, NUMBEROFBYTES, NUMBEROFBYTES*);
+
+    SMARTGPUREPLY saveBuffToEEPROMPage(EEPROMPAGE);
+
+    SMARTGPUREPLY fillBuffFromEEPROMPage(EEPROMPAGE);
+
+    SMARTGPUREPLY compBuffToEEPROMPage(EEPROMPAGE, unsigned char*);
+    
+    SMARTGPUREPLY eraseEEPROMPage(EEPROMPAGE);
+    
+/****************************************************************/
+//Touch Functions
+//Those next Touch Functions return valid or invalid touch coordinates status(TOUCHREPLY) instead of ACK 'O' or NAK 'F'(SMARTGPUREPLY)
+/****************************************************************/  
+    TOUCHREPLY touchScreen(POINT*);
+    
+    TOUCHREPLY touchIcon(ICON*);
+    
+/****************************************************************/
+//SD FAT management Functions
+//Those next SDF - SD Functions return file execution status(FILERESULT) instead of ACK 'O' or NAK 'F'(SMARTGPUREPLY)
+/****************************************************************/
+    FILERESULT SDFgetList(unsigned int*, unsigned int*); //get number of dirs and files
+
+    FILERESULT SDFgetDirName(ITEMNUMBER, FILENAME); //searches for the "itemNumber" on the SD current folder and updates the buffer with the Dir name ended with NULL character
+
+    FILERESULT SDFgetFileName(ITEMNUMBER, FILENAME); //searches for the "itemNumber" on the SD current folder and updates the buffer with the File name ended with NULL character
+
+    FILERESULT SDFgetDirPath(char[]); //obtains current dir path and stores on path[] buffer
+
+    FILERESULT SDFnewDir(FILENAME); //create a new Directory, fails if already exist
+
+    FILERESULT SDFnewFile(FILENAME); //create a new File, fails if already exist
+    
+    FILERESULT SDFopenDir(FILENAME); //opens an existing Dir
+
+    FILERESULT SDFopenFile(FILENAME, OPENMODE, WORKSPACEBLOCK); //opens an existing file in READONLY, WRITEONLY or READWRITE mode on the received object # workspace
+
+    FILERESULT SDFcloseFile(WORKSPACEBLOCK); //close and save file object # workspace
+ 
+    FILERESULT SDFsaveFile(WORKSPACEBLOCK); //sync/save file object # workspace
+
+    FILERESULT SDFsetFilePointer(POINTERPOSITION, WORKSPACEBLOCK); // set/move file pointer of file object # workspace
+
+    FILERESULT SDFgetFilePointer(POINTERPOSITION*, WORKSPACEBLOCK); // get file pointer of file object # workspace
+
+    FILERESULT SDFreadFile(char[], NUMBEROFBYTES, NUMBEROFBYTES*, WORKSPACEBLOCK); //Bytes to Read, Succesfully Read Bytes, file object # to read bytes from
+
+    FILERESULT SDFwriteFile(char[], NUMBEROFBYTES,NUMBEROFBYTES*,  WORKSPACEBLOCK); //Bytes to Write, Succesfully Written Bytes, file object # to write bytes
+
+    FILERESULT SDFtestFileError(WORKSPACEBLOCK);  //test for an error on file # workspace
+
+    FILERESULT SDFtestFileEnd(WORKSPACEBLOCK);  //test for an error on file # workspace
+
+    FILERESULT SDFtruncateFile(WORKSPACEBLOCK);  //truncates the file size to the current file read/write pointer of the file # workspace
+
+    FILERESULT SDFeraseDirFile(FILENAME); //Erases an existing Dir or File
+
+    FILERESULT SDFsetFileTimeDate(TIME*, FILENAME); //Set Time and Date to an existing File
+
+    FILERESULT SDFgetFileTimeDate(TIME*, FILENAME); //Get Time and Date to an existing File
+
+    FILERESULT SDFgetFileSize(FILENAME, unsigned long *); //Get Size of an existing File
+
+    FILERESULT SDFrenameMoveDirFile(FILENAME, FILENAME); //renames or moves an existing Dir or File
+
+    FILERESULT SDFgetFreeTotalSpace(unsigned long *,unsigned long *); //Get free and total space in bytes of the microSD card
+    
+protected :
+ 
+    Serial     _serialSMARTGPU2;
+    DigitalOut _resetPin;   
+     
+};
+
+#endif