Heavily documented control library for the uOLED-96-G1 (SGC) by 4D Systems. Will likely work with any of the 4D Systems serial controlled screens. <<info>> All examples in the documentation have been tested to the best of my current abilities, but there are a few functions that I simply do not use. I have created a Lighthouse page for this library. You may submit bug reports or feature requests to [[http://mbed-uoled.lighthouseapp.com|this page]]. If you really do not wish to sign up for a Lighthouse account you may also post any bugs or requests [[/users/Nakor/notebook/uoled-bug-reports/|here]]. <</info>>
Dependents: DS18B20 DS18B20GSM Astromed Astromed_build20121123
Revision 31:7ad5bf258a1e, committed 2011-01-09
- Comitter:
- Nakor
- Date:
- Sun Jan 09 20:24:37 2011 +0000
- Parent:
- 30:41a872ad6155
- Commit message:
- Added screen copy function (save screen to uSD).
Changed in this revision
uOLED.cpp | Show annotated file Show diff for this revision Revisions of this file |
uOLED.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 41a872ad6155 -r 7ad5bf258a1e uOLED.cpp --- a/uOLED.cpp Sat Jan 08 09:06:11 2011 +0000 +++ b/uOLED.cpp Sun Jan 09 20:24:37 2011 +0000 @@ -62,6 +62,21 @@ return (_oled.getc() == OLED_ACK); } +bool uOLED::screenCopy(char x, char y, char width, char height, char sectorHi, char sectorMid, char sectorLow) +{ + _oled.putc(0x40); + _oled.putc(0x43); + _oled.putc(x); + _oled.putc(y); + _oled.putc(width); + _oled.putc(height); + _oled.putc(sectorHi); + _oled.putc(sectorMid); + _oled.putc(sectorLow); + + return (_oled.getc() == OLED_ACK); +} + bool uOLED::displayControl(char mode, char value) { _oled.putc(0x59); _oled.putc(mode);
diff -r 41a872ad6155 -r 7ad5bf258a1e uOLED.h --- a/uOLED.h Sat Jan 08 09:06:11 2011 +0000 +++ b/uOLED.h Sun Jan 09 20:24:37 2011 +0000 @@ -122,6 +122,27 @@ */ bool blockCopyPaste(char sourceX, char sourceY, char destinationX, char destinationY, char width, char height); + /** Save a specified block of the screen to the uSD. + * + * @param x Top left horizontal start position of screen area to be copied. + * @param y Top left vertical start position of screen area to be copied. + * @param width Width of screen area to be copied. + * @param height Height of screen area to be copied. + * @param sectorHi High sector address. + * @param sectorMid Mid sector address. + * @param sectorLow Low sector address. + * + * Example: + * @code + * // Save a block of the screen from (0x, 0y) to (20x, 20y) and save it on the uSD + * // at (0x00, 0x10, 0x66) + * // (x, y, width, height, sectorHi, sectorMid, sectorLow) + * SGC.screenCopy(0, 0, 20, 20, 0x00, 0x10, 0x66); + * @endcode + */ + bool screenCopy(char x, char y, char width, char height, char sectorHi, char sectorMid, char sectorLow); + + /** Display control. * * Display ON/OFF, set contrast, and PowerUp/Shutdown.