Add TFT commands

Fork of DigoleSerialDisp by Michael Shimniok

Committer:
pinfred
Date:
Fri Nov 11 20:40:55 2016 +0000
Revision:
7:783f39600291
Parent:
6:3ed9cddf46d0
add for write return code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shimniok 0:3cf7c2683c3a 1 /** Digole Serial Display library, I2C
shimniok 0:3cf7c2683c3a 2 *
shimniok 4:c4b2a8f0d056 3 * @Author: Digole Digital Solutions : www.digole.com ported from Arduino to mbed by Michael Shimniok www.bot-thoughts.com
shimniok 0:3cf7c2683c3a 4 */
shimniok 0:3cf7c2683c3a 5 #ifndef DigoleSerialDisp_h
shimniok 0:3cf7c2683c3a 6 #define DigoleSerialDisp_h
shimniok 0:3cf7c2683c3a 7
shimniok 0:3cf7c2683c3a 8 #include "mbed.h"
pinfred 7:783f39600291 9 #include "rtos.h"
shimniok 0:3cf7c2683c3a 10 #include <inttypes.h>
shimniok 0:3cf7c2683c3a 11
shimniok 0:3cf7c2683c3a 12 #define DEC 10
shimniok 0:3cf7c2683c3a 13 #define HEX 16
shimniok 0:3cf7c2683c3a 14 #define OCT 8
shimniok 0:3cf7c2683c3a 15 #define BIN 2
shimniok 0:3cf7c2683c3a 16
pinfred 7:783f39600291 17 #define delay(x) Thread::wait(x)
shimniok 0:3cf7c2683c3a 18
shimniok 0:3cf7c2683c3a 19 // Communication set up command
shimniok 0:3cf7c2683c3a 20 // Text function command
shimniok 0:3cf7c2683c3a 21 // Graph function command
shimniok 0:3cf7c2683c3a 22
shimniok 0:3cf7c2683c3a 23 #define Serial_UART 0;
shimniok 0:3cf7c2683c3a 24 #define Serial_I2C 1;
shimniok 0:3cf7c2683c3a 25 #define Serial_SPI 2;
shimniok 0:3cf7c2683c3a 26 #define _TEXT_ 0
shimniok 0:3cf7c2683c3a 27 #define _GRAPH_ 1
shimniok 0:3cf7c2683c3a 28
shimniok 0:3cf7c2683c3a 29 /** Digole Serial LCD/OLED Library
shimniok 4:c4b2a8f0d056 30 * www.digole.com/index.php?productID=535
shimniok 0:3cf7c2683c3a 31 *
shimniok 1:959715b1d042 32 * Includes Arduino Print class member functions
shimniok 0:3cf7c2683c3a 33 */
shimniok 0:3cf7c2683c3a 34 class DigoleSerialDisp {
shimniok 0:3cf7c2683c3a 35 public:
shimniok 0:3cf7c2683c3a 36
shimniok 0:3cf7c2683c3a 37 /** Create a new Digole Serial Display interface
shimniok 0:3cf7c2683c3a 38 *
shimniok 1:959715b1d042 39 * @param sda is the pin for I2C SDA
shimniok 1:959715b1d042 40 * @param scl is the pin for I2C SCL
shimniok 1:959715b1d042 41 * @param address is the 7-bit address (default is 0x27 for the device)
shimniok 0:3cf7c2683c3a 42 */
shimniok 0:3cf7c2683c3a 43 DigoleSerialDisp(PinName sda, PinName scl, uint8_t address=0x27);
shimniok 0:3cf7c2683c3a 44
shimniok 0:3cf7c2683c3a 45
shimniok 0:3cf7c2683c3a 46 /** Carryover from Arduino library, not needed
shimniok 0:3cf7c2683c3a 47 */
shimniok 0:3cf7c2683c3a 48 void begin(void) { } // nothing to do here
shimniok 0:3cf7c2683c3a 49
shimniok 0:3cf7c2683c3a 50
shimniok 0:3cf7c2683c3a 51 /** Write out a raw character
shimniok 1:959715b1d042 52 * @param x is the character to write
shimniok 1:959715b1d042 53 * @returns 1
shimniok 0:3cf7c2683c3a 54 */
shimniok 0:3cf7c2683c3a 55 size_t write(const char x);
shimniok 0:3cf7c2683c3a 56
shimniok 0:3cf7c2683c3a 57
shimniok 0:3cf7c2683c3a 58 /** Write out raw data from a buffer
shimniok 1:959715b1d042 59 * @param buffer is the char array to write
shimniok 1:959715b1d042 60 * @param size is the the number of bytes to write
shimniok 0:3cf7c2683c3a 61 * @returns size
shimniok 0:3cf7c2683c3a 62 */
shimniok 0:3cf7c2683c3a 63 size_t write(const char *buffer, size_t size);
shimniok 0:3cf7c2683c3a 64
shimniok 0:3cf7c2683c3a 65
shimniok 0:3cf7c2683c3a 66 /** Write out raw string
shimniok 1:959715b1d042 67 * @param str is the string to write
shimniok 0:3cf7c2683c3a 68 * @returns number of bytes written
shimniok 0:3cf7c2683c3a 69 */
shimniok 0:3cf7c2683c3a 70 size_t write(const char *str);
shimniok 0:3cf7c2683c3a 71
shimniok 0:3cf7c2683c3a 72
shimniok 0:3cf7c2683c3a 73 /** Prints a char to the display in a single I2C transmission using "TTb\0"
shimniok 0:3cf7c2683c3a 74 *
shimniok 1:959715b1d042 75 * @param c is the character to print
shimniok 0:3cf7c2683c3a 76 * @returns 1
shimniok 0:3cf7c2683c3a 77 */
shimniok 0:3cf7c2683c3a 78 size_t print(const char c);
shimniok 0:3cf7c2683c3a 79
shimniok 0:3cf7c2683c3a 80
shimniok 0:3cf7c2683c3a 81 /** Prints a string of data to the display in a single I2C transmission using "TTbbb...\0"
shimniok 0:3cf7c2683c3a 82 *
shimniok 1:959715b1d042 83 * @param s is the null-terminated char array to print
shimniok 0:3cf7c2683c3a 84 * @returns length of s
shimniok 0:3cf7c2683c3a 85 */
shimniok 0:3cf7c2683c3a 86 size_t print(const char s[]);
shimniok 0:3cf7c2683c3a 87
shimniok 0:3cf7c2683c3a 88
shimniok 0:3cf7c2683c3a 89 /** Print out an unsigned char as a number
shimniok 1:959715b1d042 90 * @param u is the integer to print
shimniok 1:959715b1d042 91 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 92 * @returns number of chars written
shimniok 0:3cf7c2683c3a 93 */
shimniok 0:3cf7c2683c3a 94 size_t print(unsigned char u, int base = DEC);
shimniok 0:3cf7c2683c3a 95
shimniok 0:3cf7c2683c3a 96
shimniok 0:3cf7c2683c3a 97 /** Print out an integer
shimniok 1:959715b1d042 98 * @param i is the integer to print
shimniok 1:959715b1d042 99 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 100 * @returns number of chars written
shimniok 0:3cf7c2683c3a 101 */
shimniok 0:3cf7c2683c3a 102 size_t print(int i, int base = DEC);
shimniok 0:3cf7c2683c3a 103
shimniok 0:3cf7c2683c3a 104
shimniok 0:3cf7c2683c3a 105 /** Print out an unsigned integer
shimniok 1:959715b1d042 106 * @param u is the integer to print
shimniok 1:959715b1d042 107 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 108 * @returns number of chars written
shimniok 0:3cf7c2683c3a 109 */
shimniok 0:3cf7c2683c3a 110 size_t print(unsigned int u, int base = DEC);
shimniok 0:3cf7c2683c3a 111
shimniok 0:3cf7c2683c3a 112
shimniok 0:3cf7c2683c3a 113 /** Print out a long as a number
shimniok 1:959715b1d042 114 * @param l is the integer to print
shimniok 1:959715b1d042 115 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 116 * @returns number of chars written
shimniok 0:3cf7c2683c3a 117 */
shimniok 0:3cf7c2683c3a 118 size_t print(long l, int base = DEC);
shimniok 0:3cf7c2683c3a 119
shimniok 0:3cf7c2683c3a 120
shimniok 0:3cf7c2683c3a 121 /** Print out an unsigned long
shimniok 1:959715b1d042 122 * @param l is the integer to print
shimniok 1:959715b1d042 123 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 124 * @returns number of chars written
shimniok 0:3cf7c2683c3a 125 */
shimniok 0:3cf7c2683c3a 126 size_t print(unsigned long l, int base = DEC);
shimniok 0:3cf7c2683c3a 127
shimniok 0:3cf7c2683c3a 128
shimniok 0:3cf7c2683c3a 129 /** Print out a double
shimniok 1:959715b1d042 130 * @param f is the integer to print
shimniok 1:959715b1d042 131 * @param digits is the number of digits after the decimal
shimniok 0:3cf7c2683c3a 132 */
shimniok 0:3cf7c2683c3a 133 size_t print(double f, int digits = 2);
shimniok 0:3cf7c2683c3a 134
shimniok 0:3cf7c2683c3a 135
shimniok 0:3cf7c2683c3a 136 /** Prints a string of data to the display in a single I2C transmission using "TTbbb...\0"
shimniok 0:3cf7c2683c3a 137 *
shimniok 1:959715b1d042 138 * @param s is the null-terminated char array to print
shimniok 0:3cf7c2683c3a 139 * @returns length of s
shimniok 0:3cf7c2683c3a 140 */
shimniok 0:3cf7c2683c3a 141 size_t println(const char s[]);
shimniok 0:3cf7c2683c3a 142
shimniok 0:3cf7c2683c3a 143
shimniok 0:3cf7c2683c3a 144 /** Prints a char the display in a single I2C transmission using "TTb\0"
shimniok 0:3cf7c2683c3a 145 *
shimniok 1:959715b1d042 146 * @param c is the character to print
shimniok 0:3cf7c2683c3a 147 * @returns 1
shimniok 0:3cf7c2683c3a 148 */
shimniok 0:3cf7c2683c3a 149 size_t println(char c);
shimniok 0:3cf7c2683c3a 150
shimniok 0:3cf7c2683c3a 151
shimniok 0:3cf7c2683c3a 152 /** Prints an unsigned char as a number
shimniok 0:3cf7c2683c3a 153 *
shimniok 1:959715b1d042 154 * @param u is the unsigned char number
shimniok 0:3cf7c2683c3a 155 * @returns 1
shimniok 0:3cf7c2683c3a 156 */
shimniok 0:3cf7c2683c3a 157 size_t println(unsigned char u, int base = DEC);
shimniok 0:3cf7c2683c3a 158
shimniok 0:3cf7c2683c3a 159
shimniok 0:3cf7c2683c3a 160 /** Print out an integer
shimniok 1:959715b1d042 161 * @param i is the integer to print
shimniok 1:959715b1d042 162 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 163 * @returns number of chars written
shimniok 0:3cf7c2683c3a 164 */
shimniok 0:3cf7c2683c3a 165 size_t println(int i, int base = DEC);
shimniok 0:3cf7c2683c3a 166
shimniok 0:3cf7c2683c3a 167
shimniok 0:3cf7c2683c3a 168 /** Print out an unsigned char as a number
shimniok 1:959715b1d042 169 * @param u is the integer to print
shimniok 1:959715b1d042 170 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 171 * @returns number of chars written
shimniok 0:3cf7c2683c3a 172 */
shimniok 0:3cf7c2683c3a 173 size_t println(unsigned int u, int base = DEC);
shimniok 0:3cf7c2683c3a 174
shimniok 0:3cf7c2683c3a 175
shimniok 0:3cf7c2683c3a 176 /** Print out a long as a number
shimniok 1:959715b1d042 177 * @param l is the integer to print
shimniok 1:959715b1d042 178 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 179 * @returns number of chars written
shimniok 0:3cf7c2683c3a 180 */
shimniok 0:3cf7c2683c3a 181 size_t println(long l, int base = DEC);
shimniok 0:3cf7c2683c3a 182
shimniok 0:3cf7c2683c3a 183
shimniok 0:3cf7c2683c3a 184 /** Print out an unsigned long
shimniok 1:959715b1d042 185 * @param l is the integer to print
shimniok 1:959715b1d042 186 * @param base is the base to print, either DEC (default), HEX, BIN
shimniok 1:959715b1d042 187 * @returns number of chars written
shimniok 0:3cf7c2683c3a 188 */
shimniok 0:3cf7c2683c3a 189 size_t println(unsigned long l, int base = DEC);
shimniok 0:3cf7c2683c3a 190
shimniok 0:3cf7c2683c3a 191
shimniok 0:3cf7c2683c3a 192 /** Print out a double
shimniok 1:959715b1d042 193 * @param f is the integer to print
shimniok 1:959715b1d042 194 * @param digits is the number of digits after the decimal
shimniok 1:959715b1d042 195 * @returns number of chars written
shimniok 0:3cf7c2683c3a 196 */
shimniok 0:3cf7c2683c3a 197 size_t println(double f, int digits = 2);
shimniok 0:3cf7c2683c3a 198
shimniok 0:3cf7c2683c3a 199
shimniok 3:e5615f0cb6ee 200 /** prints, well, nothing in this case, but pretend we printed a newline
shimniok 0:3cf7c2683c3a 201 * @returns 1
shimniok 0:3cf7c2683c3a 202 */
shimniok 0:3cf7c2683c3a 203 size_t println(void);
shimniok 0:3cf7c2683c3a 204
shimniok 0:3cf7c2683c3a 205
shimniok 0:3cf7c2683c3a 206 /*---------functions for Text and Graphic LCD adapters---------*/
shimniok 0:3cf7c2683c3a 207
shimniok 0:3cf7c2683c3a 208 /** Turns off the cursor */
shimniok 0:3cf7c2683c3a 209 void disableCursor(void);
shimniok 0:3cf7c2683c3a 210
shimniok 0:3cf7c2683c3a 211 /** Turns on the cursor */
shimniok 0:3cf7c2683c3a 212 void enableCursor(void);
shimniok 0:3cf7c2683c3a 213
shimniok 0:3cf7c2683c3a 214 /** Displays a string at specified coordinates
shimniok 1:959715b1d042 215 * @param x is the x coordinate to display the string
shimniok 1:959715b1d042 216 * @param y is the y coordinate to display the string
shimniok 1:959715b1d042 217 * @param s is the string to display
shimniok 0:3cf7c2683c3a 218 */
shimniok 0:3cf7c2683c3a 219 void drawStr(uint8_t x, uint8_t y, const char *s);
shimniok 0:3cf7c2683c3a 220
shimniok 0:3cf7c2683c3a 221 /** Sets the print position for graphics or text
shimniok 1:959715b1d042 222 * @param x is the x coordinate to display the string
shimniok 1:959715b1d042 223 * @param y is the y coordinate to display the string
shimniok 1:959715b1d042 224 * @param graph if set to _TEXT_ affects subsequent text position, otherwise, affects graphics position
shimniok 0:3cf7c2683c3a 225 */
shimniok 0:3cf7c2683c3a 226 void setPrintPos(uint8_t x, uint8_t y, uint8_t graph = _TEXT_);
shimniok 0:3cf7c2683c3a 227
shimniok 0:3cf7c2683c3a 228 /** Clears the display screen */
shimniok 0:3cf7c2683c3a 229 void clearScreen(void);
shimniok 0:3cf7c2683c3a 230
pinfred 6:3ed9cddf46d0 231
shimniok 0:3cf7c2683c3a 232 /** Configure your LCD if other than 1602 and the chip is other than KS0066U/F / HD44780
shimniok 1:959715b1d042 233 * @param col is the number of columns
shimniok 1:959715b1d042 234 * @param row is the number of rows
shimniok 0:3cf7c2683c3a 235 */
shimniok 0:3cf7c2683c3a 236 void setLCDColRow(uint8_t col, uint8_t row);
shimniok 0:3cf7c2683c3a 237
shimniok 0:3cf7c2683c3a 238 /** Sets a new I2C address for the display (default is 0x27), the adapter will store the new address in memory
shimniok 1:959715b1d042 239 * @param address is the the new address
shimniok 0:3cf7c2683c3a 240 */
shimniok 0:3cf7c2683c3a 241 void setI2CAddress(uint8_t add);
shimniok 0:3cf7c2683c3a 242
shimniok 0:3cf7c2683c3a 243 /** Display Config on/off, the factory default set is on,
shimniok 0:3cf7c2683c3a 244 * so, when the module is powered up, it will display
shimniok 0:3cf7c2683c3a 245 * current communication mode on LCD, after you
shimniok 0:3cf7c2683c3a 246 * design finished, you can turn it off
shimniok 1:959715b1d042 247 * @param v is the 1 is on, 0 is off
shimniok 0:3cf7c2683c3a 248 */
shimniok 0:3cf7c2683c3a 249 void displayConfig(uint8_t v);
shimniok 0:3cf7c2683c3a 250
shimniok 0:3cf7c2683c3a 251 /** Holdover from Arduino library; not needed */
shimniok 0:3cf7c2683c3a 252 void preprint(void);
shimniok 0:3cf7c2683c3a 253
shimniok 0:3cf7c2683c3a 254 /*----------Functions for Graphic LCD/OLED adapters only---------*/
shimniok 0:3cf7c2683c3a 255 //the functions in this section compatible with u8glib
shimniok 0:3cf7c2683c3a 256 void drawBitmap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *bitmap);
pinfred 5:920614dc6fca 257 void drawBitmap256(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *bitmap);
shimniok 0:3cf7c2683c3a 258 void setRot90(void);
shimniok 0:3cf7c2683c3a 259 void setRot180(void);
shimniok 0:3cf7c2683c3a 260 void setRot270(void);
shimniok 0:3cf7c2683c3a 261 void undoRotation(void);
shimniok 0:3cf7c2683c3a 262 void setRotation(uint8_t);
shimniok 0:3cf7c2683c3a 263 void setContrast(uint8_t);
shimniok 0:3cf7c2683c3a 264 void drawBox(uint8_t x, uint8_t y, uint8_t w, uint8_t h);
shimniok 0:3cf7c2683c3a 265 void drawCircle(uint8_t x, uint8_t y, uint8_t r, uint8_t = 0);
shimniok 0:3cf7c2683c3a 266 void drawDisc(uint8_t x, uint8_t y, uint8_t r);
shimniok 0:3cf7c2683c3a 267 void drawFrame(uint8_t x, uint8_t y, uint8_t w, uint8_t h);
shimniok 0:3cf7c2683c3a 268 void drawPixel(uint8_t x, uint8_t y, uint8_t = 1);
shimniok 0:3cf7c2683c3a 269 void drawLine(uint8_t x, uint8_t y, uint8_t x1, uint8_t y1);
shimniok 0:3cf7c2683c3a 270 void drawLineTo(uint8_t x, uint8_t y);
shimniok 0:3cf7c2683c3a 271 void drawHLine(uint8_t x, uint8_t y, uint8_t w);
shimniok 0:3cf7c2683c3a 272 void drawVLine(uint8_t x, uint8_t y, uint8_t h);
shimniok 0:3cf7c2683c3a 273 //-------------------------------
shimniok 0:3cf7c2683c3a 274 //special functions for our adapters
shimniok 0:3cf7c2683c3a 275
shimniok 0:3cf7c2683c3a 276 /** Sets the font
shimniok 0:3cf7c2683c3a 277 *
shimniok 0:3cf7c2683c3a 278 * @parameter font - available fonts: 6,10,18,51,120,123, user font 200-203
shimniok 0:3cf7c2683c3a 279 */
shimniok 0:3cf7c2683c3a 280 void setFont(uint8_t font);
shimniok 0:3cf7c2683c3a 281
shimniok 0:3cf7c2683c3a 282 /** go to next text line, depending on the font size */
shimniok 0:3cf7c2683c3a 283 void nextTextLine(void);
shimniok 0:3cf7c2683c3a 284
shimniok 0:3cf7c2683c3a 285 /** set color for graphic function */
shimniok 0:3cf7c2683c3a 286 void setColor(uint8_t);
pinfred 5:920614dc6fca 287
pinfred 5:920614dc6fca 288 /** set bg color for graphic function */
pinfred 5:920614dc6fca 289 void setBgColor(uint8_t);
shimniok 0:3cf7c2683c3a 290
shimniok 0:3cf7c2683c3a 291 /** Turn on back light */
shimniok 0:3cf7c2683c3a 292 void backLightOn(void);
shimniok 0:3cf7c2683c3a 293
shimniok 0:3cf7c2683c3a 294 /** Turn off back light */
shimniok 0:3cf7c2683c3a 295 void backLightOff(void);
shimniok 0:3cf7c2683c3a 296
shimniok 0:3cf7c2683c3a 297 /** send command to LCD drectly
shimniok 0:3cf7c2683c3a 298 * @param d - command
shimniok 0:3cf7c2683c3a 299 */
shimniok 0:3cf7c2683c3a 300 void directCommand(uint8_t d);
shimniok 0:3cf7c2683c3a 301
shimniok 0:3cf7c2683c3a 302 /** send data to LCD drectly
shimniok 1:959715b1d042 303 * @param d is the data
shimniok 0:3cf7c2683c3a 304 */
shimniok 0:3cf7c2683c3a 305 void directData(uint8_t d);
shimniok 0:3cf7c2683c3a 306
shimniok 0:3cf7c2683c3a 307 /** Move rectangle area on screen to another place
shimniok 1:959715b1d042 308 * @param x0, y1 is the top left of the area to move
shimniok 1:959715b1d042 309 * @param x1, y1 is the bottom right of the area to move
shimniok 1:959715b1d042 310 * @param xoffset, yoffset is the the distance to move
shimniok 0:3cf7c2683c3a 311 */
shimniok 0:3cf7c2683c3a 312 void moveArea(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, char xoffset, char yoffset);
shimniok 0:3cf7c2683c3a 313
shimniok 0:3cf7c2683c3a 314 /** Display startup screen */
pinfred 7:783f39600291 315 int displayStartScreen(uint8_t m);
shimniok 0:3cf7c2683c3a 316
shimniok 0:3cf7c2683c3a 317 /** Set display mode */
shimniok 0:3cf7c2683c3a 318 void setMode(uint8_t m);
shimniok 0:3cf7c2683c3a 319
shimniok 0:3cf7c2683c3a 320 /** set text position back to previous, only one back allowed */
shimniok 0:3cf7c2683c3a 321 void setTextPosBack(void);
shimniok 0:3cf7c2683c3a 322
shimniok 0:3cf7c2683c3a 323 void setTextPosOffset(char xoffset, char yoffset);
shimniok 0:3cf7c2683c3a 324 void setTextPosAbs(uint8_t x, uint8_t y);
shimniok 0:3cf7c2683c3a 325 void setLinePattern(uint8_t pattern);
shimniok 0:3cf7c2683c3a 326 /** Only for universal serial adapter */
shimniok 0:3cf7c2683c3a 327 void setLCDChip(uint8_t chip);
shimniok 0:3cf7c2683c3a 328
pinfred 7:783f39600291 329 void setDrawWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
pinfred 7:783f39600291 330 void resetDrawWindow();
pinfred 7:783f39600291 331 void cleanDrawWindow();
pinfred 7:783f39600291 332
shimniok 0:3cf7c2683c3a 333
shimniok 0:3cf7c2683c3a 334 /** Set Start Screen, 1st B is the lower byte of data length.
shimniok 0:3cf7c2683c3a 335 * Convert images to C array here: <a href="http://www.digole.com/tools/PicturetoC_Hex_converter.php">http://www.digole.com/tools/PicturetoC_Hex_converter.php</a>
shimniok 1:959715b1d042 336 * @param lon is the length of data
shimniok 1:959715b1d042 337 * @param data is the binary data
shimniok 0:3cf7c2683c3a 338 */
shimniok 0:3cf7c2683c3a 339 void uploadStartScreen(int lon, const unsigned char *data); //upload start screen
shimniok 0:3cf7c2683c3a 340
shimniok 0:3cf7c2683c3a 341 /** Upload a user font
shimniok 1:959715b1d042 342 * @param lon is the length of data
shimniok 1:959715b1d042 343 * @param data is the user font data
shimniok 1:959715b1d042 344 * @param sect is the section of memory you want to upload to
shimniok 0:3cf7c2683c3a 345 */
shimniok 0:3cf7c2683c3a 346 void uploadUserFont(int lon, const unsigned char *data, uint8_t sect); //upload user font
shimniok 0:3cf7c2683c3a 347
shimniok 0:3cf7c2683c3a 348 /** Send a Byte to output head on board
shimniok 1:959715b1d042 349 * @param x is the byte to output
shimniok 0:3cf7c2683c3a 350 */
shimniok 0:3cf7c2683c3a 351 void digitalOutput(uint8_t x);
shimniok 0:3cf7c2683c3a 352
shimniok 0:3cf7c2683c3a 353 private:
shimniok 0:3cf7c2683c3a 354 I2C _device;
shimniok 0:3cf7c2683c3a 355 uint8_t _address;
shimniok 0:3cf7c2683c3a 356 uint8_t _Comdelay;
shimniok 0:3cf7c2683c3a 357
shimniok 0:3cf7c2683c3a 358 size_t printNumber(unsigned long n, uint8_t base);
shimniok 0:3cf7c2683c3a 359 size_t printFloat(double number, uint8_t digits);
shimniok 0:3cf7c2683c3a 360 };
shimniok 0:3cf7c2683c3a 361
shimniok 0:3cf7c2683c3a 362 #endif