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 1:95e0e194a412, committed 2014-02-21
- Comitter:
- chris215
- Date:
- Fri Feb 21 02:47:32 2014 +0000
- Parent:
- 0:d2ed5a44c802
- Child:
- 2:f283764fe9b7
- Commit message:
- fixed some warnings
Changed in this revision
mbed_genie.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed_genie.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/mbed_genie.cpp Fri Feb 21 01:42:46 2014 +0000 +++ b/mbed_genie.cpp Fri Feb 21 02:47:32 2014 +0000 @@ -47,7 +47,7 @@ ////////////////////////////////////////////////////////////// // Number of times we have had a timeout -static int _genieTimeouts = 0; +//static int _genieTimeouts = 0; ////////////////////////////////////////////////////////////// @@ -62,7 +62,7 @@ ////////////////////////////////////////////////////////////// // Number of fatal errors encountered -static int _genieFatalErrors = 0; +//static int _genieFatalErrors = 0; ////////////////////// genieGetEventData //////////////////////// // // Returns the LSB and MSB of the event's data combined into @@ -318,7 +318,8 @@ rxframe_count++; return GENIE_EVENT_RXCHAR; } - } + } + return GENIE_EVENT_NONE; } ////////////////////// genieDequeueEvent /////////////////// @@ -407,7 +408,8 @@ _geniePutchar(checksum) ; - _geniePushLinkState(GENIE_LINK_WFAN); + _geniePushLinkState(GENIE_LINK_WFAN); + return GENIE_EVENT_NONE; } /////////////////////// genieWriteContrast ////////////////////// @@ -582,8 +584,6 @@ // Sets: _genieError with any errors encountered // uint8_t _genieGetchar() { - uint16_t result; - _genieError = ERROR_NONE;
--- a/mbed_genie.h Fri Feb 21 01:42:46 2014 +0000 +++ b/mbed_genie.h Fri Feb 21 02:47:32 2014 +0000 @@ -131,6 +131,6 @@ extern bool genieEventIs (genieFrame * e, uint8_t cmd, uint8_t object, uint8_t index); extern uint16_t genieGetEventData (genieFrame * e); extern uint16_t genieWriteObject (uint16_t object, uint16_t index, uint16_t data); -extern uint16_t genieWriteStr (uint16_t index, char *string); -extern void genieWriteContrast (uint16_t value); +extern uint16_t genieWriteStr (uint16_t index, char *string); +extern void genieWriteContrast (uint16_t value);