Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 |
--- 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);
--- 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.