An forked version of Christian B's excellent library for controlling the 4D systems touch screen display
Dependents: Genie_Test_Temperature
Fork of 4dGENIE by
Revision 9:d5855768a9b6, committed 2014-07-06
- Comitter:
- langster1980
- Date:
- Sun Jul 06 22:16:49 2014 +0000
- Parent:
- 8:b5ba0df2d0db
- Commit message:
- added genieGetEventData function in order to read rockerSW object
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 |
diff -r b5ba0df2d0db -r d5855768a9b6 mbed_genie.cpp --- a/mbed_genie.cpp Sun Jul 06 17:22:32 2014 +0000 +++ b/mbed_genie.cpp Sun Jul 06 22:16:49 2014 +0000 @@ -153,6 +153,20 @@ //The screen will respond with an NACK if the command was not understood, otherwise it will send a report object frame return WaitForReadAnswer(); } + +////////////////////// 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::writec(char data) { _screen.putc(data);
diff -r b5ba0df2d0db -r d5855768a9b6 mbed_genie.h --- a/mbed_genie.h Sun Jul 06 17:22:32 2014 +0000 +++ b/mbed_genie.h Sun Jul 06 22:16:49 2014 +0000 @@ -149,6 +149,7 @@ int8_t genieWriteObject (uint16_t object, uint16_t index, uint16_t data); int8_t genieWriteStr (uint16_t index, char *string); int8_t genieReadObj (uint16_t object, uint16_t index); + uint16_t genieGetEventData (genieFrame * e); //added by to read status of rocker_sw bool genieDequeueEvent(genieFrame * buff); void genieAttachEventHandler (genieUserEventHandlerPtr handler);