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); } }
Diff: mbed_genie.cpp
- Revision:
- 10:4d9f1be4a901
- Parent:
- 9:b74deaac80f9
- Child:
- 11:9196f72fc325
diff -r b74deaac80f9 -r 4d9f1be4a901 mbed_genie.cpp --- a/mbed_genie.cpp Tue Jul 08 15:52:26 2014 +0000 +++ b/mbed_genie.cpp Tue Jul 08 18:34:47 2014 +0000 @@ -20,6 +20,18 @@ _screen.attach(this,&Mbed4dGenie::RxIrqHandler,Serial::RxIrq); } +////////////////////// genieGetEventData //////////////////////// +// +// Returns the LSB and MSB of the event's data combined into +// a single uint16 +// +// The data is transmitted from the display in big-endian format +// and stored the same so the user can't just access it as an int +// directly from the structure. +// +uint16_t Mbed4dGenie::genieGetEventData (genieFrame * e) { + return (e->reportObject.data_msb << 8) + e->reportObject.data_lsb; +} void Mbed4dGenie::RxIrqHandler(void) {