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:
25:caf134ebfc34
Parent:
24:22c2d08f111d
Child:
26:5a2128799f60
--- a/uOLED.h	Sun Dec 26 19:42:52 2010 +0000
+++ b/uOLED.h	Mon Dec 27 03:21:23 2010 +0000
@@ -47,6 +47,12 @@
     * @param serialTX - mbed TX pin to be used
     * @param serialRX - mbed RX pin to be used
     * @param reset - mbed pin to control reset of the uOLED
+    *
+    * Example:
+    * @code
+    * // (serialTX, serialRX, reset)
+    * uOLED SGC(p9, p10, p11);
+    * @endcode
     */
     uOLED(PinName serialTX, PinName serialRX, PinName reset);
     
@@ -55,18 +61,44 @@
     * @param red Red value.
     * @param green Green value.
     * @param blue Blue value.
+    *
+    * Example:
+    * @code
+    * // (red, green, blue)
+    * SGC.getRGB(120, 255, 50);
+    * @endcode
     */
     short getRGB(char red, char green, char blue);
 
-    /** !!ToDo!!
+    /** Add user defined bitmap character into internal memory.
     * 
-    * @param returns something.
+    * @param character Character index to add to memory.  Range is 0-31 (0x00 to 0x1F).  32 8x8 characters.
+    * @param data[8] 8 data bytes that make up the composition of the bitmap character.  8x8 composition is 1 byte wide (8 bits) by 8 bytes deep.
+    *
+    * Example:
+    * @code
+    * // Array containing data for 8x8 "O" character.
+    * char data[8] = {0x18, 0x24, 0x42, 0x81, 0x81, 0x42, 0x24, 0x18};
+    * // (characterIndex, characterData)
+    * SGC.addBitmappedCharacter(0x01, data);
+    * @endcode
     */
     bool addBitmappedCharacter(char character, char data[8]);
     
-    /** !!ToDO!!
+    /** Copy and paste a specified block of the screen.
     * 
-    * @param returns something.
+    * @param sourceX Top left horizontal start position of screen area to be copied.
+    * @param sourceY Top left vertical start position of screen area to be copied.
+    * @param destinationX Top left horizontal start position of where copied area is to be pasted.
+    * @param destinationY Top left vertical start position of where copied area is to be pasted.
+    * @param width Width of screen area to be copied.
+    * @param height Height of screen area to be copied.
+    *
+    * Example:
+    * @code
+    * // (sourceX, sourceY, destinationX, destinationY, width, height)
+    * SGC.blockCopyPaste(0, 0, 25, 5, 10, 10);
+    * @endcode
     */
     bool blockCopyPaste(char sourceX, char sourceY, char destinationX, char destinationY, char width, char height);
     
@@ -85,14 +117,29 @@
     * - Mode: 03 Display PowerUp/Shutdown (low power mode)
     *   - Value 00 Shutdown
     *   - Value 01 Powerup
+    *
+    * Example:
+    * @code
+    * // Turn display ON.
+    * SGC.displayControl(0x01, 0x01)
+    * // Set contrast to medium.
+    * SGC.displayControl(0x02, 0x08);
+    * // Shutdown display.
+    * SGC.displayControl(0x03, 0x00);
+    * @endcode
     */
     bool displayControl(char mode, char value);
     
-    /** !!ToDo!!
+    /** Draw previously defined user bitmap character at specified location (and colour).
     * 
-    * @param returns something.
+    * @param character Character index of previously defined bitmap character.  Range is 0 to 31 (0x00 to 0x1F).  32 8x8 characters.
+    * @param x Horizontal display position of character.
+    * @param y Vertical display position of character.
+    * @param red Amount of red.
+    * @param green Amount of green.
+    * @param blue Amount of blue.
     */
-    bool displayUserBitmappedCharacter(char character, char x, char y, short color);
+    bool displayUserBitmappedCharacter(char character, char x, char y, short red, short green, short blue);
     
     /** Draw a circle.
     * 
@@ -105,15 +152,31 @@
     */
     bool drawCircle(char x, char y, char radius, short red, short green, short blue);
     
-    /** !!ToDo!!
+    /** Draw ASCII character (text format)
     * 
-    * @param returns something.
+    * @param character Inbuilt standard ASCII character.  Range 32 to 127 (0x20 to 0x7F).
+    * @param column Horizontal position of character.
+    * - range: 0-20 for 5x7 font.
+    * - range: 0-15 for 8x8 and 8x12 fonts.
+    * @param row Vertical position of character.
+    * @param red Amount of red.
+    * @param green Amount of green.
+    * @param blue Amount of blue.
     */
-    bool drawCharacter(char character, char column, char row, short color);
+    bool drawCharacter(char character, char column, char row, short red, short green, short blue);
     
-    /** !!ToDo!!
+    /** Display a bitmap image on the screen at specified location and size.
     * 
-    * @param returns something.
+    * @param x Image horizontal start position (top left).
+    * @param y Image vertical start position (top left).
+    * @param width Horizontal size of the image.
+    * @param height Vertical size of the image.
+    * @param colorMode Colour mode to use for the image.
+    * - 0x08 = 256 colour mode (8bits/1byte per pixel)
+    * - 0x10 = 65K colour mode (16bits/2bytes per pixel)
+    * @param *pixels Image pixel data.
+    * - Colour Mode 0x08 (256 colour mode):  Number of pixels = width x height
+    * - Colour Mode 0x10 (65K colour mode):  Number of pixels = 2 x width x height
     */
     bool drawImage(char x, char y, char width, char height, char colorMode, char *pixels);
     
@@ -129,11 +192,16 @@
     */
     bool drawLine(char x1, char y1, char x2, char y2, short red, short green, short blue);
     
-    /** !!ToDo!!
+    /** Draw a polygon (user defined shape) to the screen.
     * 
-    * @param returns something.
+    * @param vertices Number of vertices from 3 to 7.
+    * @param *x Array of vertices' X coordinates.
+    * @param *y Array of vertices' Y coordinates.
+    * @param red Amount of red.
+    * @param green Amount of green.
+    * @param blue Amount of blue.
     */
-    bool drawPolygon(char vertices, char *x, char *y, short color);
+    bool drawPolygon(char vertices, char *x, char *y, short red, short green, short blue);
     
     /** Draw a rectangle.
     *