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
uOLED.h@23:dd9a280c8be5, 2010-12-26 (annotated)
- Committer:
- Nakor
- Date:
- Sun Dec 26 19:41:25 2010 +0000
- Revision:
- 23:dd9a280c8be5
- Parent:
- 22:66401b612b1b
- Child:
- 24:22c2d08f111d
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nakor | 0:4f009971ac11 | 1 | /* mbed 4D uOLED Library |
Nakor | 0:4f009971ac11 | 2 | * Originally designed for use with uOLED-96-G1 (SGC) |
Nakor | 0:4f009971ac11 | 3 | * serially controlled .96" screen. |
Nakor | 0:4f009971ac11 | 4 | * |
Nakor | 0:4f009971ac11 | 5 | * This is a modified library originally obtained from |
Nakor | 0:4f009971ac11 | 6 | * Erik van Wijk's library code at: |
Nakor | 0:4f009971ac11 | 7 | * http://mbed.org/users/evwijk/libraries/microOLED/li4nzn |
Nakor | 5:93ea03e2a688 | 8 | * |
Nakor | 5:93ea03e2a688 | 9 | * This library (uOLED) by Aaron Goselin. |
Nakor | 5:93ea03e2a688 | 10 | * 2010 |
Nakor | 0:4f009971ac11 | 11 | */ |
Nakor | 0:4f009971ac11 | 12 | |
Nakor | 0:4f009971ac11 | 13 | #ifndef _MBED_UOLED_ |
Nakor | 0:4f009971ac11 | 14 | #define _MBED_UOLED_ |
Nakor | 0:4f009971ac11 | 15 | |
Nakor | 0:4f009971ac11 | 16 | #include "mbed.h" |
Nakor | 0:4f009971ac11 | 17 | |
Nakor | 0:4f009971ac11 | 18 | #define OLED_FONT5X7 0x01 |
Nakor | 0:4f009971ac11 | 19 | #define OLED_FONT8X8 0x02 |
Nakor | 0:4f009971ac11 | 20 | #define OLED_FONT8X12 0x03 |
Nakor | 0:4f009971ac11 | 21 | |
Nakor | 0:4f009971ac11 | 22 | #define OLED_DISPLAYCONTROL_DISPLAY 0x01 |
Nakor | 0:4f009971ac11 | 23 | #define OLED_DISPLAYCONTROL_CONTRAST 0x02 |
Nakor | 0:4f009971ac11 | 24 | #define OLED_DISPLAYCONTROL_POWER 0x03 |
Nakor | 0:4f009971ac11 | 25 | |
Nakor | 0:4f009971ac11 | 26 | /** uOLED control class using Serial |
Nakor | 0:4f009971ac11 | 27 | * |
Nakor | 0:4f009971ac11 | 28 | * Example: |
Nakor | 0:4f009971ac11 | 29 | * @code |
Nakor | 0:4f009971ac11 | 30 | * // Draw text on the screen. |
Nakor | 0:4f009971ac11 | 31 | * #include "mbed.h" |
Nakor | 0:4f009971ac11 | 32 | * #include "uOLED.h" |
Nakor | 0:4f009971ac11 | 33 | * |
Nakor | 0:4f009971ac11 | 34 | * uOLED SGC(p9, p10, p11); |
Nakor | 0:4f009971ac11 | 35 | * |
Nakor | 5:93ea03e2a688 | 36 | * int main() |
Nakor | 0:4f009971ac11 | 37 | * { |
Nakor | 0:4f009971ac11 | 38 | * SGC.drawText(0, 0, 0, FF, "This is text"); |
Nakor | 0:4f009971ac11 | 39 | * } |
Nakor | 3:949c5ac54e9c | 40 | * @endcode |
Nakor | 0:4f009971ac11 | 41 | */ |
Nakor | 0:4f009971ac11 | 42 | class uOLED { |
Nakor | 0:4f009971ac11 | 43 | public: |
Nakor | 0:4f009971ac11 | 44 | |
Nakor | 4:51f274633e70 | 45 | /** Create an instance of the uOLED class. |
Nakor | 4:51f274633e70 | 46 | * |
Nakor | 2:559b81f2bb1e | 47 | * @param serialTX - mbed TX pin to be used |
Nakor | 2:559b81f2bb1e | 48 | * @param serialRX - mbed RX pin to be used |
Nakor | 2:559b81f2bb1e | 49 | * @param reset - mbed pin to control reset of the uOLED |
Nakor | 1:476dcc382de3 | 50 | */ |
Nakor | 0:4f009971ac11 | 51 | uOLED(PinName serialTX, PinName serialRX, PinName reset); |
Nakor | 1:476dcc382de3 | 52 | |
Nakor | 17:cee1c66b3133 | 53 | /** Convert RGB value into the type of value that the uOLED wants. |
Nakor | 17:cee1c66b3133 | 54 | * |
Nakor | 17:cee1c66b3133 | 55 | * @param red Red value. |
Nakor | 17:cee1c66b3133 | 56 | * @param green Green value. |
Nakor | 17:cee1c66b3133 | 57 | * @param blue Blue value. |
Nakor | 1:476dcc382de3 | 58 | */ |
Nakor | 0:4f009971ac11 | 59 | short getRGB(char red, char green, char blue); |
Nakor | 0:4f009971ac11 | 60 | |
Nakor | 17:cee1c66b3133 | 61 | /** !!ToDo!! |
Nakor | 17:cee1c66b3133 | 62 | * |
Nakor | 2:559b81f2bb1e | 63 | * @param returns something. |
Nakor | 1:476dcc382de3 | 64 | */ |
Nakor | 0:4f009971ac11 | 65 | bool addBitmappedCharacter(char character, char data[8]); |
Nakor | 17:cee1c66b3133 | 66 | |
Nakor | 17:cee1c66b3133 | 67 | /** !!ToDO!! |
Nakor | 19:cc4f5d01f080 | 68 | * |
Nakor | 2:559b81f2bb1e | 69 | * @param returns something. |
Nakor | 1:476dcc382de3 | 70 | */ |
Nakor | 0:4f009971ac11 | 71 | bool blockCopyPaste(char sourceX, char sourceY, char destinationX, char destinationY, char width, char height); |
Nakor | 17:cee1c66b3133 | 72 | |
Nakor | 17:cee1c66b3133 | 73 | /** Display control. |
Nakor | 17:cee1c66b3133 | 74 | * |
Nakor | 19:cc4f5d01f080 | 75 | * Display ON/OFF, set contrast, and PowerUp/Shutdown. |
Nakor | 17:cee1c66b3133 | 76 | * |
Nakor | 17:cee1c66b3133 | 77 | * @param mode Sets specified mode. |
Nakor | 17:cee1c66b3133 | 78 | * @param value Value option for mode. |
Nakor | 17:cee1c66b3133 | 79 | * |
Nakor | 18:77ec40174c31 | 80 | * - Mode: 01 Display ON/OFF |
Nakor | 18:77ec40174c31 | 81 | * - Value: 00 OFF |
Nakor | 18:77ec40174c31 | 82 | * - Value: 01 ON |
Nakor | 18:77ec40174c31 | 83 | * - Mode: 02 Contrast Adjust |
Nakor | 18:77ec40174c31 | 84 | * - Value range: 0x00 to 0x0F |
Nakor | 18:77ec40174c31 | 85 | * - Mode: 03 Display PowerUp/Shutdown (low power mode) |
Nakor | 18:77ec40174c31 | 86 | * - Value 00 Shutdown |
Nakor | 18:77ec40174c31 | 87 | * - Value 01 Powerup |
Nakor | 1:476dcc382de3 | 88 | */ |
Nakor | 17:cee1c66b3133 | 89 | bool displayControl(char mode, char value); |
Nakor | 17:cee1c66b3133 | 90 | |
Nakor | 19:cc4f5d01f080 | 91 | /** !!ToDo!! |
Nakor | 19:cc4f5d01f080 | 92 | * |
Nakor | 2:559b81f2bb1e | 93 | * @param returns something. |
Nakor | 1:476dcc382de3 | 94 | */ |
Nakor | 0:4f009971ac11 | 95 | bool displayUserBitmappedCharacter(char character, char x, char y, short color); |
Nakor | 19:cc4f5d01f080 | 96 | |
Nakor | 19:cc4f5d01f080 | 97 | /** Draw a circle. |
Nakor | 19:cc4f5d01f080 | 98 | * |
Nakor | 19:cc4f5d01f080 | 99 | * @param x X position of circle center. |
Nakor | 19:cc4f5d01f080 | 100 | * @param y Y position of circle center. |
Nakor | 19:cc4f5d01f080 | 101 | * @param radius Radius of the circle. |
Nakor | 19:cc4f5d01f080 | 102 | * @param red Amount of red. |
Nakor | 19:cc4f5d01f080 | 103 | * @param green Amount of green. |
Nakor | 19:cc4f5d01f080 | 104 | * @param blue Amount of blue. |
Nakor | 1:476dcc382de3 | 105 | */ |
Nakor | 19:cc4f5d01f080 | 106 | bool drawCircle(char x, char y, char radius, short red, short green, short blue); |
Nakor | 19:cc4f5d01f080 | 107 | |
Nakor | 19:cc4f5d01f080 | 108 | /** !!ToDo!! |
Nakor | 19:cc4f5d01f080 | 109 | * |
Nakor | 2:559b81f2bb1e | 110 | * @param returns something. |
Nakor | 1:476dcc382de3 | 111 | */ |
Nakor | 0:4f009971ac11 | 112 | bool drawCharacter(char character, char column, char row, short color); |
Nakor | 19:cc4f5d01f080 | 113 | |
Nakor | 19:cc4f5d01f080 | 114 | /** !!ToDo!! |
Nakor | 19:cc4f5d01f080 | 115 | * |
Nakor | 2:559b81f2bb1e | 116 | * @param returns something. |
Nakor | 1:476dcc382de3 | 117 | */ |
Nakor | 0:4f009971ac11 | 118 | bool drawImage(char x, char y, char width, char height, char colorMode, char *pixels); |
Nakor | 19:cc4f5d01f080 | 119 | |
Nakor | 19:cc4f5d01f080 | 120 | /** Draw a line. |
Nakor | 19:cc4f5d01f080 | 121 | * |
Nakor | 19:cc4f5d01f080 | 122 | * @param x1 Top left horizontal start position. |
Nakor | 19:cc4f5d01f080 | 123 | * @param y1 Top left vertical start position. |
Nakor | 19:cc4f5d01f080 | 124 | * @param x2 Bottom right horizontal start position. |
Nakor | 19:cc4f5d01f080 | 125 | * @param y2 Bottom right vertical end position. |
Nakor | 19:cc4f5d01f080 | 126 | * @param red Amount of red. |
Nakor | 19:cc4f5d01f080 | 127 | * @param green Amount of green. |
Nakor | 19:cc4f5d01f080 | 128 | * @param blue Amount of blue. |
Nakor | 1:476dcc382de3 | 129 | */ |
Nakor | 19:cc4f5d01f080 | 130 | bool drawLine(char x1, char y1, char x2, char y2, short red, short green, short blue); |
Nakor | 19:cc4f5d01f080 | 131 | |
Nakor | 21:87a2227c1ad2 | 132 | /** !!ToDo!! |
Nakor | 21:87a2227c1ad2 | 133 | * |
Nakor | 2:559b81f2bb1e | 134 | * @param returns something. |
Nakor | 1:476dcc382de3 | 135 | */ |
Nakor | 0:4f009971ac11 | 136 | bool drawPolygon(char vertices, char *x, char *y, short color); |
Nakor | 21:87a2227c1ad2 | 137 | |
Nakor | 21:87a2227c1ad2 | 138 | /** Draw a rectangle. |
Nakor | 21:87a2227c1ad2 | 139 | * |
Nakor | 21:87a2227c1ad2 | 140 | * @param x Top left horizontal start position. |
Nakor | 21:87a2227c1ad2 | 141 | * @param y Top left vertical start position. |
Nakor | 21:87a2227c1ad2 | 142 | * @param width Bottom right horizontal end position. |
Nakor | 21:87a2227c1ad2 | 143 | * @param height Bottom right vertical end position. |
Nakor | 21:87a2227c1ad2 | 144 | * @param red Amount of red. |
Nakor | 21:87a2227c1ad2 | 145 | * @param green Amount of green. |
Nakor | 21:87a2227c1ad2 | 146 | * @param blue Amount of blue. |
Nakor | 1:476dcc382de3 | 147 | */ |
Nakor | 21:87a2227c1ad2 | 148 | bool drawRectangle(char x, char y, char width, char height, short red, short green, short blue); |
Nakor | 21:87a2227c1ad2 | 149 | |
Nakor | 5:93ea03e2a688 | 150 | /** Draw text to the screen. |
Nakor | 5:93ea03e2a688 | 151 | * |
Nakor | 5:93ea03e2a688 | 152 | * @param column X coordinate for text placement. |
Nakor | 5:93ea03e2a688 | 153 | * @param row Y coordinate for text placement. |
Nakor | 5:93ea03e2a688 | 154 | * @param font Which font to use (Uses 0, 1, or 2). More fonts can be added. |
Nakor | 5:93ea03e2a688 | 155 | * @param color Font colour to use. |
Nakor | 5:93ea03e2a688 | 156 | * @param *text Character array (string) to be displayed. |
Nakor | 5:93ea03e2a688 | 157 | * |
Nakor | 5:93ea03e2a688 | 158 | * Example: |
Nakor | 5:93ea03e2a688 | 159 | * @code |
Nakor | 5:93ea03e2a688 | 160 | * SGC.drawText(0, 0, 0, FF, "This is text"); |
Nakor | 5:93ea03e2a688 | 161 | * @endcode |
Nakor | 1:476dcc382de3 | 162 | */ |
Nakor | 21:87a2227c1ad2 | 163 | bool drawText(char column, char row, char font, short red, short green, short blue, char *text); |
Nakor | 21:87a2227c1ad2 | 164 | |
Nakor | 14:3d90211095d4 | 165 | /** Draw unformated text to the screen. |
Nakor | 14:3d90211095d4 | 166 | * The manual describes this as "graphics format". |
Nakor | 14:3d90211095d4 | 167 | * |
Nakor | 14:3d90211095d4 | 168 | * @param x X coordinate for text placement. |
Nakor | 14:3d90211095d4 | 169 | * @param y Y coordinate for text placement. |
Nakor | 14:3d90211095d4 | 170 | * @param font Which font to use (Uses 0, 1, or 2). More fonts can be added. |
Nakor | 14:3d90211095d4 | 171 | * @param red Amount of red in text colour RGB value. |
Nakor | 14:3d90211095d4 | 172 | * @param green Amount of green in text colour RGB value. |
Nakor | 14:3d90211095d4 | 173 | * @param blue Amount of blue in text colour RGB value. |
Nakor | 14:3d90211095d4 | 174 | * @param width Text width. |
Nakor | 14:3d90211095d4 | 175 | * @param height Text height. |
Nakor | 14:3d90211095d4 | 176 | * @param *text Character array (string) to be displayed. |
Nakor | 14:3d90211095d4 | 177 | * |
Nakor | 14:3d90211095d4 | 178 | * Example: |
Nakor | 14:3d90211095d4 | 179 | * @code |
Nakor | 16:6f5d07cfff03 | 180 | * SGC.drawTextUF(0, 0, 0, 20, 20, 255, 1, 1, "This is text"); |
Nakor | 14:3d90211095d4 | 181 | * @endcode |
Nakor | 14:3d90211095d4 | 182 | */ |
Nakor | 15:06ef508fef4b | 183 | bool drawTextUF(char x, char y, char font, short red, short green, short blue, char width, char height, char *text); |
Nakor | 21:87a2227c1ad2 | 184 | |
Nakor | 21:87a2227c1ad2 | 185 | /** Draw a triangle. |
Nakor | 21:87a2227c1ad2 | 186 | * |
Nakor | 21:87a2227c1ad2 | 187 | * Vertices must be defined counter clockwise. |
Nakor | 21:87a2227c1ad2 | 188 | * |
Nakor | 21:87a2227c1ad2 | 189 | * @param x1 Vertice 1 X coordinate. |
Nakor | 21:87a2227c1ad2 | 190 | * @param y1 Vertice 1 Y coordinate. |
Nakor | 21:87a2227c1ad2 | 191 | * @param x2 Vertice 2 X coordinate. |
Nakor | 21:87a2227c1ad2 | 192 | * @param y2 Vertice 2 Y coordinate. |
Nakor | 21:87a2227c1ad2 | 193 | * @param x3 Vertice 3 X coordinate. |
Nakor | 21:87a2227c1ad2 | 194 | * @param y3 Vertice 3 Y coordinate. |
Nakor | 21:87a2227c1ad2 | 195 | * @param red Amount of red. |
Nakor | 21:87a2227c1ad2 | 196 | * @param blue Amount of blue. |
Nakor | 21:87a2227c1ad2 | 197 | * @param green Amount of green. |
Nakor | 6:080d52539972 | 198 | */ |
Nakor | 21:87a2227c1ad2 | 199 | bool drawTriangle(char x1, char y1, char x2, char y2, char x3, char y3, short red, short green, short blue); |
Nakor | 21:87a2227c1ad2 | 200 | |
Nakor | 21:87a2227c1ad2 | 201 | /** Clear the screen. |
Nakor | 21:87a2227c1ad2 | 202 | * |
Nakor | 21:87a2227c1ad2 | 203 | * Remove everything except the background colour. |
Nakor | 21:87a2227c1ad2 | 204 | * |
Nakor | 21:87a2227c1ad2 | 205 | * @param returns success or failure. |
Nakor | 1:476dcc382de3 | 206 | */ |
Nakor | 0:4f009971ac11 | 207 | bool eraseScreen(); |
Nakor | 21:87a2227c1ad2 | 208 | |
Nakor | 0:4f009971ac11 | 209 | /** Initialize the screen. This must be completed before any other communication with the device. |
Nakor | 21:87a2227c1ad2 | 210 | * |
Nakor | 0:4f009971ac11 | 211 | * Timing allows for at least 500ms delay for initialization. |
Nakor | 21:87a2227c1ad2 | 212 | * |
Nakor | 2:559b81f2bb1e | 213 | * @param returns bool indicating success or failure of initialization. |
Nakor | 0:4f009971ac11 | 214 | */ |
Nakor | 0:4f009971ac11 | 215 | bool init(); |
Nakor | 21:87a2227c1ad2 | 216 | |
Nakor | 21:87a2227c1ad2 | 217 | /** Set pen size. |
Nakor | 21:87a2227c1ad2 | 218 | * |
Nakor | 21:87a2227c1ad2 | 219 | * Sets if objects should be drawn solid or wire frame. |
Nakor | 21:87a2227c1ad2 | 220 | * Does not apply to polygon function. |
Nakor | 21:87a2227c1ad2 | 221 | * |
Nakor | 21:87a2227c1ad2 | 222 | * @param size Sets solid or wire frame. |
Nakor | 21:87a2227c1ad2 | 223 | * - 0x00 = Solid |
Nakor | 21:87a2227c1ad2 | 224 | * - 0x01 = Wire frame. |
Nakor | 1:476dcc382de3 | 225 | */ |
Nakor | 0:4f009971ac11 | 226 | bool penSize(char size); |
Nakor | 21:87a2227c1ad2 | 227 | |
Nakor | 22:66401b612b1b | 228 | /** Draw a coloured pixel at designated position. |
Nakor | 22:66401b612b1b | 229 | * |
Nakor | 22:66401b612b1b | 230 | * @param x Horizontal position of pixel. |
Nakor | 22:66401b612b1b | 231 | * @param y Vertical position of pixel. |
Nakor | 22:66401b612b1b | 232 | * @param red Amount of red. |
Nakor | 22:66401b612b1b | 233 | * @param green Amount of green. |
Nakor | 22:66401b612b1b | 234 | * @param blue Amount of blue. |
Nakor | 1:476dcc382de3 | 235 | */ |
Nakor | 22:66401b612b1b | 236 | bool putPixel(char x, char y, short red, short green, short blue); |
Nakor | 22:66401b612b1b | 237 | |
Nakor | 22:66401b612b1b | 238 | /** Read the colour of a specified pixel. |
Nakor | 22:66401b612b1b | 239 | * |
Nakor | 22:66401b612b1b | 240 | * @param x X coordinate. |
Nakor | 22:66401b612b1b | 241 | * @param y Y coordinate. |
Nakor | 22:66401b612b1b | 242 | * @param returns 2 byte pixel colour in RGB format. |
Nakor | 22:66401b612b1b | 243 | * - MSB: R4R3R2R1R0G5G4G3 |
Nakor | 22:66401b612b1b | 244 | * - LSB: G2G1G0B4B3B2B1B0 |
Nakor | 1:476dcc382de3 | 245 | */ |
Nakor | 0:4f009971ac11 | 246 | short readPixel(char x, char y); |
Nakor | 22:66401b612b1b | 247 | |
Nakor | 7:c2fa784eb477 | 248 | /** Replaces the background colour with a new colour. |
Nakor | 7:c2fa784eb477 | 249 | * |
Nakor | 13:f2b9f249bcff | 250 | * @param red Red value (0 to 255). |
Nakor | 13:f2b9f249bcff | 251 | * @param green Green value (0 to 255). |
Nakor | 13:f2b9f249bcff | 252 | * @param blue Blue value (0 to 255). |
Nakor | 7:c2fa784eb477 | 253 | */ |
Nakor | 13:f2b9f249bcff | 254 | bool setBackgroundColour(char red, char green, char blue); |
Nakor | 22:66401b612b1b | 255 | |
Nakor | 22:66401b612b1b | 256 | /** Set font (for future text). |
Nakor | 22:66401b612b1b | 257 | * |
Nakor | 22:66401b612b1b | 258 | * 3 default fonts are supplied. Further font sets can be added. |
Nakor | 22:66401b612b1b | 259 | * |
Nakor | 22:66401b612b1b | 260 | * @param font Font selection. Either a default or otherwise. |
Nakor | 22:66401b612b1b | 261 | * - DEFAULT: 0x00 = 5x7 small size font set |
Nakor | 22:66401b612b1b | 262 | * - DEFAULT: 0x01 = 8x8 medium size font set |
Nakor | 22:66401b612b1b | 263 | * - DEFAULT: 0x02 = 8x12 large size font set |
Nakor | 7:c2fa784eb477 | 264 | */ |
Nakor | 22:66401b612b1b | 265 | bool setFont(char font); |
Nakor | 22:66401b612b1b | 266 | |
Nakor | 22:66401b612b1b | 267 | /** Draw a text button to the screen. |
Nakor | 22:66401b612b1b | 268 | * |
Nakor | 22:66401b612b1b | 269 | * @param state Button down (0x00) or button up (0x01). |
Nakor | 22:66401b612b1b | 270 | * @param x Top left horizontal start position. |
Nakor | 22:66401b612b1b | 271 | * @param y Top left vertical start position. |
Nakor | 22:66401b612b1b | 272 | * @param red Amount of red (for button not text). |
Nakor | 22:66401b612b1b | 273 | * @param green Amount of green (for button not text). |
Nakor | 22:66401b612b1b | 274 | * @param blue Amount of blue (for button not text). |
Nakor | 22:66401b612b1b | 275 | * @param font Set which font set to use for the button. 3 default font sets are supplied and more can be added. |
Nakor | 22:66401b612b1b | 276 | * - DEFAULT: 0x00 = 5x7 small size font set |
Nakor | 22:66401b612b1b | 277 | * - DEFAULT: 0x01 = 8x8 medium size font set |
Nakor | 22:66401b612b1b | 278 | * - DEFAULT: 0x02 = 8x12 large size font set |
Nakor | 22:66401b612b1b | 279 | * @param textRed Amount of red for text. |
Nakor | 22:66401b612b1b | 280 | * @param textGreen Amount of green for text. |
Nakor | 22:66401b612b1b | 281 | * @param textBlue Amount of blue for text. |
Nakor | 22:66401b612b1b | 282 | * @param textWidth Width of characters (text). Affect total width of string and button. |
Nakor | 22:66401b612b1b | 283 | * @param textHeight Height of characters (text). Affects total height of string and button. |
Nakor | 22:66401b612b1b | 284 | * @param *text Character array (string) to display in the button. |
Nakor | 1:476dcc382de3 | 285 | */ |
Nakor | 22:66401b612b1b | 286 | bool textButton(char state, char x, char y, short red, short green, short blue, char font, short textRed, short textGreen, short textBlue, char textWidth, char textHeight, char *text); |
Nakor | 22:66401b612b1b | 287 | |
Nakor | 23:dd9a280c8be5 | 288 | /** Set text mode (transparent or opaque). |
Nakor | 23:dd9a280c8be5 | 289 | * |
Nakor | 23:dd9a280c8be5 | 290 | * Opaque text has a rectangle drawn behind it (blocking out what is under it) and transparent text does not. |
Nakor | 23:dd9a280c8be5 | 291 | * |
Nakor | 23:dd9a280c8be5 | 292 | * @param mode Set text to transparent (0x00) or opaque (0x01). |
Nakor | 1:476dcc382de3 | 293 | */ |
Nakor | 0:4f009971ac11 | 294 | bool textMode(char mode); |
Nakor | 23:dd9a280c8be5 | 295 | |
Nakor | 23:dd9a280c8be5 | 296 | /** Retrieve current version info of the device. |
Nakor | 23:dd9a280c8be5 | 297 | * |
Nakor | 23:dd9a280c8be5 | 298 | * Response: |
Nakor | 23:dd9a280c8be5 | 299 | * |
Nakor | 23:dd9a280c8be5 | 300 | * device_type Indicates device type. |
Nakor | 23:dd9a280c8be5 | 301 | * - 0x00 = micro-OLED |
Nakor | 23:dd9a280c8be5 | 302 | * - 0x01 = micro-LCD |
Nakor | 23:dd9a280c8be5 | 303 | * - 0x02 = micro-VGA |
Nakor | 23:dd9a280c8be5 | 304 | * hardware_rev Indicates device hardware version. |
Nakor | 23:dd9a280c8be5 | 305 | * firmware_rev Indicates device firmware version. |
Nakor | 23:dd9a280c8be5 | 306 | * horizontal_res Indicates the horizontal resolution of the display. |
Nakor | 23:dd9a280c8be5 | 307 | * - 0x22 = 220 pixels |
Nakor | 23:dd9a280c8be5 | 308 | * - 0x28 = 128 pixels |
Nakor | 23:dd9a280c8be5 | 309 | * - 0x32 = 320 pixels |
Nakor | 23:dd9a280c8be5 | 310 | * - 0x60 = 160 pixels |
Nakor | 23:dd9a280c8be5 | 311 | * - 0x64 = 64 pixels |
Nakor | 23:dd9a280c8be5 | 312 | * - 0x76 = 176 pixels |
Nakor | 23:dd9a280c8be5 | 313 | * - 0x96 = 96 pixels |
Nakor | 23:dd9a280c8be5 | 314 | * vertical_res Indicates the vertical resolution of the display. |
Nakor | 23:dd9a280c8be5 | 315 | * - See horizontal_res (identical). |
Nakor | 23:dd9a280c8be5 | 316 | * |
Nakor | 23:dd9a280c8be5 | 317 | * @param onScreen Set output option. |
Nakor | 23:dd9a280c8be5 | 318 | * - 0x00 = Output to serial port only. |
Nakor | 23:dd9a280c8be5 | 319 | * - 0x01 = Output to serial port and screen. |
Nakor | 23:dd9a280c8be5 | 320 | * @param *info Character array to store results. |
Nakor | 1:476dcc382de3 | 321 | */ |
Nakor | 0:4f009971ac11 | 322 | bool versionInfo(bool onScreen, char *info); |
Nakor | 0:4f009971ac11 | 323 | |
Nakor | 0:4f009971ac11 | 324 | |
Nakor | 0:4f009971ac11 | 325 | protected: |
Nakor | 0:4f009971ac11 | 326 | Serial _oled; |
Nakor | 0:4f009971ac11 | 327 | DigitalOut _reset; |
Nakor | 0:4f009971ac11 | 328 | |
Nakor | 0:4f009971ac11 | 329 | void resetDisplay(); |
Nakor | 8:0a92ceb34cd0 | 330 | }; |
Nakor | 8:0a92ceb34cd0 | 331 | |
Nakor | 8:0a92ceb34cd0 | 332 | #endif |