Mbed 4dGenie class

Dependents:   Genie_Test 039847382-S3_DS1621_and_LCD_V1

This is a work in progress.

4dGenie class to use with 4dLCD screens that are using the genie environment.

There are still some rare occasions where the 4dLCD might crash, for now i have no solution to this except doing a reset of the 4dLCD.

Please make sure to have the most up to date PmmC loaded on the screen.

usage example :

Mbed4dGenie test program

#include "mbed.h"
#include "mbed_genie.h"

DigitalOut myled(LED1);
/*
    The Mbed4dGenie class requires 3 parameters
    1 - Tx pin
    2 - Rx pin
    3 - Reset pin
*/
Mbed4dGenie lcd4d(PTE0,PTE1,PTB9);



int main() {
    int temp = 0;
printf("Mbed Genie demo \n\r");
lcd4d.Start();


 /*
 for example, in this loop we increment the thermometer0 object from 0 to 100
 */
 
    while(1) {
        if(temp >= 100)
        {
            temp = -1;
        }
        else
        {
            temp++;
        }

        lcd4d.genieWriteObject(GENIE_OBJ_LED_DIGITS,1,temp);

        myled = 1;
        wait(0.05);
        myled = 0;
        wait(0.05);
    }
}
Revision:
3:11c49c49cd1a
Parent:
2:f283764fe9b7
Child:
4:23c46eb6f0db
Child:
6:f4d3977b0eae
--- a/mbed_genie.cpp	Sun Feb 23 01:34:05 2014 +0000
+++ b/mbed_genie.cpp	Sun Feb 23 17:32:37 2014 +0000
@@ -4,8 +4,12 @@
 
 Serial pc(USBTX,USBRX);
 
-Mbed4dGenie::Mbed4dGenie(PinName TxPin,PinName RxPin) : _screen(TxPin,RxPin)
+Mbed4dGenie::Mbed4dGenie(PinName TxPin,PinName RxPin, PinName resetpin) : _screen(TxPin,RxPin) , _reset(resetpin)
 {
+    //reset the 4d screen
+    _reset = 1;
+    wait(0.25);
+    _reset = 0;
     _genieLinkStates[4] = GENIE_LINK_IDLE;
     _genieLinkStates[3] = GENIE_LINK_IDLE;
     _genieLinkStates[2] = GENIE_LINK_IDLE;
@@ -29,7 +33,7 @@
 {
     do 
     {
-        //genieDoEvents();
+        genieDoEvents();
     }
     while(_screen.readable ());
 }