Library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website).

Dependents:   LV7_LCDtest LV7_Grupa5_Tim003_Zadatak1 lv7_Grupa5_Tim008_zad1 LV7_PAI_Grupa5_tim10_Zadatak1 ... more

This library is designed to make it easy to interface an mbed with a Nokia 5110 LCD display.

These can be found at Sparkfun (https://www.sparkfun.com/products/10168) and Adafruit (http://www.adafruit.com/product/338).

The library uses the SPI peripheral on the mbed which means it is much faster sending data to the display than other libraries available on other platforms that use software SPI.

The library can print strings as well as controlling individual pixels, meaning that both text and primitive graphics can be displayed.

Committer:
eencae
Date:
Thu Apr 23 18:57:52 2015 +0000
Revision:
19:ba8addc061ea
Parent:
18:1af393359298
Child:
21:4cbdc20fea9f
1) Replaced literal values in library with WIDTH, HEIGHT, BANKS etc.; 2) User now needs to manually call refresh() after drawing lines/circles/rects. Was previously in drawLine() and so sent the entire buffer to display after every line - very slow.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
eencae 1:df68f34cd32d 1 /**
eencae 2:e93021cfb0a9 2 @file N5110.h
eencae 1:df68f34cd32d 3
eencae 5:6ea180eef702 4 @brief Header file containing member functions and variables
eencae 4:e923c54c1c7d 5
eencae 0:d563e74f0ae9 6 */
eencae 0:d563e74f0ae9 7
eencae 0:d563e74f0ae9 8 #ifndef N5110_H
eencae 0:d563e74f0ae9 9 #define N5110_H
eencae 0:d563e74f0ae9 10
eencae 0:d563e74f0ae9 11 // Command Bytes - taken from Chris Yan's library
eencae 2:e93021cfb0a9 12 // More information can be found in the display datasheet
eencae 2:e93021cfb0a9 13 // H = 0 - Basic instructions
eencae 0:d563e74f0ae9 14 #define CMD_DC_CLEAR_DISPLAY 0x08
eencae 0:d563e74f0ae9 15 #define CMD_DC_NORMAL_MODE 0x0C
eencae 0:d563e74f0ae9 16 #define CMD_DC_FILL_DISPLAY 0x09
eencae 0:d563e74f0ae9 17 #define CMD_DC_INVERT_VIDEO 0x0D
eencae 0:d563e74f0ae9 18 #define CMD_FS_HORIZONTAL_MODE 0x00
eencae 0:d563e74f0ae9 19 #define CMD_FS_VERTICAL_MODE 0x02
eencae 0:d563e74f0ae9 20 #define CMD_FS_BASIC_MODE 0x00
eencae 0:d563e74f0ae9 21 #define CMD_FS_EXTENDED_MODE 0x01
eencae 0:d563e74f0ae9 22 #define CMD_FS_ACTIVE_MODE 0x00
eencae 0:d563e74f0ae9 23 #define CMD_FS_POWER_DOWN_MODE 0x04
eencae 2:e93021cfb0a9 24 // H = 1 - Extended instructions
eencae 0:d563e74f0ae9 25 #define CMD_TC_TEMP_0 0x04
eencae 0:d563e74f0ae9 26 #define CMD_TC_TEMP_1 0x05
eencae 0:d563e74f0ae9 27 #define CMD_TC_TEMP_2 0x06
eencae 0:d563e74f0ae9 28 #define CMD_TC_TEMP_3 0x07
eencae 0:d563e74f0ae9 29 #define CMD_BI_MUX_24 0x15
eencae 0:d563e74f0ae9 30 #define CMD_BI_MUX_48 0x13
eencae 0:d563e74f0ae9 31 #define CMD_BI_MUX_100 0x10
eencae 0:d563e74f0ae9 32 #define CMD_VOP_6V06 0xB2
eencae 0:d563e74f0ae9 33 #define CMD_VOP_7V38 0xC8
eencae 0:d563e74f0ae9 34
eencae 17:780a542d5f8b 35 // number of pixels on display
eencae 13:908644099648 36 #define WIDTH 84
eencae 13:908644099648 37 #define HEIGHT 48
eencae 17:780a542d5f8b 38 #define BANKS 6
eencae 13:908644099648 39
eencae 0:d563e74f0ae9 40 #include "mbed.h"
eencae 0:d563e74f0ae9 41
eencae 17:780a542d5f8b 42 /**
eencae 16:b37a3a260598 43 @brief Library for interfacing with Nokia 5110 LCD display (https://www.sparkfun.com/products/10168) using the hardware SPI on the mbed.
eencae 5:6ea180eef702 44 @brief The display is powered from a GPIO pin meaning it can be controlled via software. The LED backlight is also software-controllable (via PWM pin).
eencae 17:780a542d5f8b 45 @brief Can print characters and strings to the display using the included 5x7 font.
eencae 5:6ea180eef702 46 @brief The library also implements a screen buffer so that individual pixels on the display (84 x 48) can be set, cleared and read.
eencae 17:780a542d5f8b 47 @brief The library can print primitive shapes (lines, circles, rectangles)
eencae 5:6ea180eef702 48 @brief Acknowledgements to Chris Yan's Nokia_5110 Library.
eencae 5:6ea180eef702 49
eencae 17:780a542d5f8b 50 @brief Revision 1.2
eencae 5:6ea180eef702 51
eencae 5:6ea180eef702 52 @author Craig A. Evans
eencae 17:780a542d5f8b 53 @date 17th March 2015
eencae 2:e93021cfb0a9 54 *
eencae 2:e93021cfb0a9 55 * Example:
eencae 2:e93021cfb0a9 56 * @code
eencae 17:780a542d5f8b 57
eencae 13:908644099648 58 #include "mbed.h"
eencae 13:908644099648 59 #include "N5110.h"
eencae 13:908644099648 60
eencae 13:908644099648 61 // VCC,SCE,RST,D/C,MOSI,SCLK,LED
eencae 13:908644099648 62 N5110 lcd(p7,p8,p9,p10,p11,p13,p21);
eencae 13:908644099648 63 // Can also power (VCC) directly from VOUT (3.3 V) -
eencae 17:780a542d5f8b 64 // Can give better performance due to current limitation from GPIO pin
eencae 13:908644099648 65
eencae 13:908644099648 66 int main()
eencae 13:908644099648 67 {
eencae 13:908644099648 68 // first need to initialise display
eencae 13:908644099648 69 lcd.init();
eencae 13:908644099648 70
eencae 13:908644099648 71 while(1) {
eencae 13:908644099648 72
eencae 13:908644099648 73 // these are default settings so not strictly needed
eencae 13:908644099648 74 lcd.normalMode(); // normal colour mode
eencae 17:780a542d5f8b 75 lcd.setBrightness(0.5); // put LED backlight on 50%
eencae 17:780a542d5f8b 76
eencae 13:908644099648 77 // can directly print strings at specified co-ordinates
eencae 13:908644099648 78 lcd.printString("Hello, World!",0,0);
eencae 13:908644099648 79
eencae 17:780a542d5f8b 80 char buffer[14]; // each character is 6 pixels wide, screen is 84 pixels (84/6 = 14)
eencae 17:780a542d5f8b 81 // so can display a string of a maximum 14 characters in length
eencae 13:908644099648 82 // or create formatted strings - ensure they aren't more than 14 characters long
eencae 13:908644099648 83 int temperature = 27;
eencae 13:908644099648 84 int length = sprintf(buffer,"T = %2d C",temperature); // print formatted data to buffer
eencae 13:908644099648 85 // it is important the format specifier ensures the length will fit in the buffer
eencae 13:908644099648 86 if (length <= 14) // if string will fit on display
eencae 13:908644099648 87 lcd.printString(buffer,0,1); // display on screen
eencae 17:780a542d5f8b 88
eencae 13:908644099648 89 float pressure = 1012.3; // same idea with floats
eencae 13:908644099648 90 length = sprintf(buffer,"P = %.2f mb",pressure);
eencae 13:908644099648 91 if (length <= 14)
eencae 13:908644099648 92 lcd.printString(buffer,0,2);
eencae 17:780a542d5f8b 93
eencae 17:780a542d5f8b 94 // can also print individual characters at specified place
eencae 13:908644099648 95 lcd.printChar('X',5,3);
eencae 17:780a542d5f8b 96
eencae 17:780a542d5f8b 97 // draw a line across the display at y = 40 pixels (origin top-left)
eencae 13:908644099648 98 for (int i = 0; i < WIDTH; i++) {
eencae 17:780a542d5f8b 99 lcd.setPixel(i,40);
eencae 13:908644099648 100 }
eencae 13:908644099648 101 // need to refresh display after setting pixels
eencae 17:780a542d5f8b 102 lcd.refresh();
eencae 17:780a542d5f8b 103
eencae 13:908644099648 104 // can also check status of pixels using getPixel(x,y)
eencae 17:780a542d5f8b 105
eencae 13:908644099648 106 wait(5.0);
eencae 13:908644099648 107 lcd.clear(); // clear display
eencae 13:908644099648 108 lcd.inverseMode(); // invert colours
eencae 13:908644099648 109 lcd.setBrightness(1.0); // put LED backlight on full
eencae 17:780a542d5f8b 110
eencae 13:908644099648 111 float array[84];
eencae 17:780a542d5f8b 112
eencae 13:908644099648 113 for (int i = 0; i < 84; i++) {
eencae 17:780a542d5f8b 114 array[i] = 0.5 + 0.5*sin(i*2*3.14/84);
eencae 13:908644099648 115 }
eencae 17:780a542d5f8b 116
eencae 13:908644099648 117 // can also plot graphs - 84 elements only
eencae 13:908644099648 118 // values must be in range 0.0 - 1.0
eencae 13:908644099648 119 lcd.plotArray(array);
eencae 17:780a542d5f8b 120 wait(5.0);
eencae 17:780a542d5f8b 121 lcd.clear();
eencae 17:780a542d5f8b 122 lcd.normalMode(); // normal colour mode back
eencae 17:780a542d5f8b 123 lcd.setBrightness(0.5); // put LED backlight on 50%
eencae 17:780a542d5f8b 124
eencae 17:780a542d5f8b 125 // example of drawing lines
eencae 17:780a542d5f8b 126 for (int x = 0; x < WIDTH ; x+=10) {
eencae 17:780a542d5f8b 127 // x0,y0,x1,y1,type 0-white,1-black,2-dotted
eencae 17:780a542d5f8b 128 lcd.drawLine(0,0,x,HEIGHT,2);
eencae 17:780a542d5f8b 129 }
eencae 19:ba8addc061ea 130 lcd.refresh(); // need to refresh screen after drawing lines
eencae 17:780a542d5f8b 131
eencae 17:780a542d5f8b 132 wait(5.0);
eencae 17:780a542d5f8b 133 lcd.clear();
eencae 17:780a542d5f8b 134
eencae 17:780a542d5f8b 135 // example of how to draw circles
eencae 17:780a542d5f8b 136 lcd.drawCircle(WIDTH/2,HEIGHT/2,20,1); // x,y,radius,black fill
eencae 17:780a542d5f8b 137 lcd.drawCircle(WIDTH/2,HEIGHT/2,10,2); // x,y,radius,white fill
eencae 17:780a542d5f8b 138 lcd.drawCircle(WIDTH/2,HEIGHT/2,30,0); // x,y,radius,transparent with outline
eencae 19:ba8addc061ea 139 lcd.refresh(); // need to refresh screen after drawing circles
eencae 17:780a542d5f8b 140
eencae 17:780a542d5f8b 141 wait(5.0);
eencae 17:780a542d5f8b 142 lcd.clear();
eencae 17:780a542d5f8b 143
eencae 17:780a542d5f8b 144 // example of how to draw rectangles
eencae 17:780a542d5f8b 145 // origin x,y,width,height,type
eencae 17:780a542d5f8b 146 lcd.drawRect(10,10,50,30,1); // filled black rectangle
eencae 17:780a542d5f8b 147 lcd.drawRect(15,15,20,10,2); // filled white rectange (no outline)
eencae 17:780a542d5f8b 148 lcd.drawRect(2,2,70,40,0); // transparent, just outline
eencae 19:ba8addc061ea 149 lcd.refresh(); // need to refresh screen after drawing rects
eencae 17:780a542d5f8b 150
eencae 19:ba8addc061ea 151
eencae 19:ba8addc061ea 152 wait(5.0);
eencae 17:780a542d5f8b 153 lcd.clear();
eencae 10:6f3abb40202b 154
eencae 13:908644099648 155 }
eencae 13:908644099648 156 }
eencae 13:908644099648 157
eencae 17:780a542d5f8b 158
eencae 2:e93021cfb0a9 159 * @endcode
eencae 2:e93021cfb0a9 160 */
eencae 1:df68f34cd32d 161 class N5110
eencae 1:df68f34cd32d 162 {
eencae 0:d563e74f0ae9 163
eencae 1:df68f34cd32d 164 public:
eencae 1:df68f34cd32d 165 /** Create a N5110 object connected to the specified pins
eencae 1:df68f34cd32d 166 *
eencae 1:df68f34cd32d 167 * @param pwr Pin connected to Vcc on the LCD display (pin 1)
eencae 1:df68f34cd32d 168 * @param sce Pin connected to chip enable (pin 3)
eencae 1:df68f34cd32d 169 * @param rst Pin connected to reset (pin 4)
eencae 1:df68f34cd32d 170 * @param dc Pin connected to data/command select (pin 5)
eencae 1:df68f34cd32d 171 * @param mosi Pin connected to data input (MOSI) (pin 6)
eencae 1:df68f34cd32d 172 * @param sclk Pin connected to serial clock (SCLK) (pin 7)
eencae 17:780a542d5f8b 173 * @param led Pin connected to LED backlight (must be PWM) (pin 8)
eencae 17:780a542d5f8b 174 *
eencae 1:df68f34cd32d 175 */
eencae 1:df68f34cd32d 176 N5110(PinName pwrPin, PinName scePin, PinName rstPin, PinName dcPin, PinName mosiPin, PinName sclkPin, PinName ledPin);
eencae 17:780a542d5f8b 177
eencae 1:df68f34cd32d 178 /** Initialise display
eencae 1:df68f34cd32d 179 *
eencae 1:df68f34cd32d 180 * Powers up the display and turns on backlight (50% brightness default).
eencae 1:df68f34cd32d 181 * Sets the display up in horizontal addressing mode and with normal video mode.
eencae 1:df68f34cd32d 182 */
eencae 1:df68f34cd32d 183 void init();
eencae 17:780a542d5f8b 184
eencae 1:df68f34cd32d 185 /** Turn off
eencae 1:df68f34cd32d 186 *
eencae 1:df68f34cd32d 187 * Powers down the display and turns of the backlight.
eencae 1:df68f34cd32d 188 * Needs to be reinitialised before being re-used.
eencae 1:df68f34cd32d 189 */
eencae 1:df68f34cd32d 190 void turnOff();
eencae 17:780a542d5f8b 191
eencae 1:df68f34cd32d 192 /** Clears
eencae 1:df68f34cd32d 193 *
eencae 1:df68f34cd32d 194 * Clears the screen.
eencae 1:df68f34cd32d 195 */
eencae 1:df68f34cd32d 196 void clear();
eencae 17:780a542d5f8b 197
eencae 1:df68f34cd32d 198 /** Turn on normal video mode (default)
eencae 1:df68f34cd32d 199 * Black on white
eencae 1:df68f34cd32d 200 */
eencae 1:df68f34cd32d 201 void normalMode();
eencae 17:780a542d5f8b 202
eencae 1:df68f34cd32d 203 /** Turn on inverse video mode (default)
eencae 1:df68f34cd32d 204 * White on black
eencae 1:df68f34cd32d 205 */
eencae 1:df68f34cd32d 206 void inverseMode();
eencae 17:780a542d5f8b 207
eencae 1:df68f34cd32d 208 /** Set Brightness
eencae 1:df68f34cd32d 209 *
eencae 1:df68f34cd32d 210 * Sets brightness of LED backlight.
eencae 1:df68f34cd32d 211 * @param brightness - float in range 0.0 to 1.0
eencae 1:df68f34cd32d 212 */
eencae 1:df68f34cd32d 213 void setBrightness(float brightness);
eencae 17:780a542d5f8b 214
eencae 2:e93021cfb0a9 215 /** Print String
eencae 2:e93021cfb0a9 216 *
eencae 18:1af393359298 217 * Prints a string of characters to the display. String is cut-off after the 83rd pixel.
eencae 2:e93021cfb0a9 218 * @param x - the column number (0 to 83)
eencae 2:e93021cfb0a9 219 * @param y - the row number (0 to 5) - the display is split into 6 banks - each bank can be considered a row
eencae 2:e93021cfb0a9 220 */
eencae 1:df68f34cd32d 221 void printString(const char * str,int x,int y);
eencae 17:780a542d5f8b 222
eencae 1:df68f34cd32d 223 /** Print Character
eencae 1:df68f34cd32d 224 *
eencae 18:1af393359298 225 * Sends a character to the display. Printed at the specified location. Character is cut-off after the 83rd pixel.
eencae 1:df68f34cd32d 226 * @param c - the character to print. Can print ASCII as so printChar('C').
eencae 13:908644099648 227 * @param x - the column number (0 to 83)
eencae 13:908644099648 228 * @param y - the row number (0 to 5) - the display is split into 6 banks - each bank can be considered a row
eencae 1:df68f34cd32d 229 */
eencae 13:908644099648 230 void printChar(char c,int x,int y);
eencae 17:780a542d5f8b 231
eencae 6:adb79338d40f 232 /** Set a Pixel
eencae 6:adb79338d40f 233 *
eencae 6:adb79338d40f 234 * This function sets a pixel in the display. A call to refresh() must be made
eencae 6:adb79338d40f 235 * to update the display to reflect the change in pixels.
eencae 6:adb79338d40f 236 * @param x - the x co-ordinate of the pixel (0 to 83)
eencae 17:780a542d5f8b 237 * @param y - the y co-ordinate of the pixel (0 to 47)
eencae 6:adb79338d40f 238 */
eencae 1:df68f34cd32d 239 void setPixel(int x, int y);
eencae 17:780a542d5f8b 240
eencae 6:adb79338d40f 241 /** Clear a Pixel
eencae 6:adb79338d40f 242 *
eencae 6:adb79338d40f 243 * This function clears pixel in the display. A call to refresh() must be made
eencae 6:adb79338d40f 244 * to update the display to reflect the change in pixels.
eencae 6:adb79338d40f 245 * @param x - the x co-ordinate of the pixel (0 to 83)
eencae 17:780a542d5f8b 246 * @param y - the y co-ordinate of the pixel (0 to 47)
eencae 6:adb79338d40f 247 */
eencae 1:df68f34cd32d 248 void clearPixel(int x, int y);
eencae 17:780a542d5f8b 249
eencae 6:adb79338d40f 250 /** Get a Pixel
eencae 6:adb79338d40f 251 *
eencae 6:adb79338d40f 252 * This function gets the status of a pixel in the display.
eencae 6:adb79338d40f 253 * @param x - the x co-ordinate of the pixel (0 to 83)
eencae 17:780a542d5f8b 254 * @param y - the y co-ordinate of the pixel (0 to 47)
eencae 17:780a542d5f8b 255 * @returns
eencae 6:adb79338d40f 256 * 0 - pixel is clear
eencae 6:adb79338d40f 257 * non-zero - pixel is set
eencae 6:adb79338d40f 258 */
eencae 7:3010f24e0a81 259 int getPixel(int x, int y);
eencae 17:780a542d5f8b 260
eencae 6:adb79338d40f 261 /** Refresh display
eencae 6:adb79338d40f 262 *
eencae 6:adb79338d40f 263 * This functions refreshes the display to reflect the current data in the buffer.
eencae 17:780a542d5f8b 264 */
eencae 6:adb79338d40f 265 void refresh();
eencae 17:780a542d5f8b 266
eencae 6:adb79338d40f 267 /** Randomise buffer
eencae 6:adb79338d40f 268 *
eencae 17:780a542d5f8b 269 * This function fills the buffer with random data. Can be used to test the display.
eencae 6:adb79338d40f 270 * A call to refresh() must be made to update the display to reflect the change in pixels.
eencae 6:adb79338d40f 271 * The seed is not set and so the generated pattern will probably be the same each time.
eencae 6:adb79338d40f 272 * TODO: Randomise the seed - maybe using the noise on the AnalogIn pins.
eencae 6:adb79338d40f 273 */
eencae 1:df68f34cd32d 274 void randomiseBuffer();
eencae 17:780a542d5f8b 275
eencae 8:40abe5736eca 276 /** Plot Array
eencae 8:40abe5736eca 277 *
eencae 17:780a542d5f8b 278 * This function plots a one-dimensional array on the display.
eencae 17:780a542d5f8b 279 * @param array[] - y values of the plot. Values should be normalised in the range 0.0 to 1.0. First 84 plotted.
eencae 8:40abe5736eca 280 */
eencae 8:40abe5736eca 281 void plotArray(float array[]);
eencae 1:df68f34cd32d 282
eencae 17:780a542d5f8b 283 /** Draw Circle
eencae 17:780a542d5f8b 284 *
eencae 17:780a542d5f8b 285 * This function draws a circle at the specified origin with specified radius to the display.
eencae 17:780a542d5f8b 286 * Uses the midpoint circle algorithm.
eencae 17:780a542d5f8b 287 * @see http://en.wikipedia.org/wiki/Midpoint_circle_algorithm
eencae 17:780a542d5f8b 288 * @param x0 - x-coordinate of centre
eencae 17:780a542d5f8b 289 * @param y0 - y-coordinate of centre
eencae 17:780a542d5f8b 290 * @param radius - radius of circle in pixels
eencae 17:780a542d5f8b 291 * @param fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
eencae 17:780a542d5f8b 292 */
eencae 17:780a542d5f8b 293 void drawCircle(int x0,int y0,int radius,int fill);
eencae 17:780a542d5f8b 294
eencae 17:780a542d5f8b 295 /** Draw Line
eencae 17:780a542d5f8b 296 *
eencae 17:780a542d5f8b 297 * This function draws a line between the specified points using linear interpolation.
eencae 17:780a542d5f8b 298 * @param x0 - x-coordinate of first point
eencae 17:780a542d5f8b 299 * @param y0 - y-coordinate of first point
eencae 17:780a542d5f8b 300 * @param x1 - x-coordinate of last point
eencae 17:780a542d5f8b 301 * @param y1 - y-coordinate of last point
eencae 17:780a542d5f8b 302 * @param type - 0 white,1 black,2 dotted
eencae 17:780a542d5f8b 303 */
eencae 17:780a542d5f8b 304 void drawLine(int x0,int y0,int x1,int y1,int type);
eencae 17:780a542d5f8b 305
eencae 17:780a542d5f8b 306 /** Draw Rectangle
eencae 17:780a542d5f8b 307 *
eencae 17:780a542d5f8b 308 * This function draws a rectangle.
eencae 17:780a542d5f8b 309 * @param x0 - x-coordinate of origin (top-left)
eencae 17:780a542d5f8b 310 * @param y0 - y-coordinate of origin (top-left)
eencae 17:780a542d5f8b 311 * @param width - width of rectangle
eencae 17:780a542d5f8b 312 * @param height - height of rectangle
eencae 17:780a542d5f8b 313 * @param fill - 0 transparent (w/outline), 1 filled black, 2 filled white (wo/outline)
eencae 17:780a542d5f8b 314 */
eencae 17:780a542d5f8b 315 void drawRect(int x0,int y0,int width,int height,int fill);
eencae 17:780a542d5f8b 316
eencae 17:780a542d5f8b 317
eencae 1:df68f34cd32d 318 private:
eencae 13:908644099648 319
eencae 13:908644099648 320 void setXYAddress(int x, int y);
eencae 1:df68f34cd32d 321 void initSPI();
eencae 1:df68f34cd32d 322 void turnOn();
eencae 1:df68f34cd32d 323 void reset();
eencae 1:df68f34cd32d 324 void clearRAM();
eencae 6:adb79338d40f 325 void clearBuffer();
eencae 1:df68f34cd32d 326 void sendCommand(unsigned char command);
eencae 1:df68f34cd32d 327 void sendData(unsigned char data);
eencae 1:df68f34cd32d 328
eencae 1:df68f34cd32d 329 public:
eencae 1:df68f34cd32d 330 unsigned char buffer[84][6]; // screen buffer - the 6 is for the banks - each one is 8 bits;
eencae 1:df68f34cd32d 331
eencae 1:df68f34cd32d 332 private: // private variables
eencae 1:df68f34cd32d 333 SPI* spi;
eencae 1:df68f34cd32d 334 PwmOut* led;
eencae 1:df68f34cd32d 335 DigitalOut* pwr;
eencae 1:df68f34cd32d 336 DigitalOut* sce;
eencae 1:df68f34cd32d 337 DigitalOut* rst;
eencae 1:df68f34cd32d 338 DigitalOut* dc;
eencae 0:d563e74f0ae9 339
eencae 0:d563e74f0ae9 340 };
eencae 0:d563e74f0ae9 341
eencae 0:d563e74f0ae9 342 const unsigned char font5x7[480] = {
eencae 0:d563e74f0ae9 343 0x00, 0x00, 0x00, 0x00, 0x00,// (space)
eencae 0:d563e74f0ae9 344 0x00, 0x00, 0x5F, 0x00, 0x00,// !
eencae 0:d563e74f0ae9 345 0x00, 0x07, 0x00, 0x07, 0x00,// "
eencae 0:d563e74f0ae9 346 0x14, 0x7F, 0x14, 0x7F, 0x14,// #
eencae 0:d563e74f0ae9 347 0x24, 0x2A, 0x7F, 0x2A, 0x12,// $
eencae 0:d563e74f0ae9 348 0x23, 0x13, 0x08, 0x64, 0x62,// %
eencae 0:d563e74f0ae9 349 0x36, 0x49, 0x55, 0x22, 0x50,// &
eencae 0:d563e74f0ae9 350 0x00, 0x05, 0x03, 0x00, 0x00,// '
eencae 0:d563e74f0ae9 351 0x00, 0x1C, 0x22, 0x41, 0x00,// (
eencae 0:d563e74f0ae9 352 0x00, 0x41, 0x22, 0x1C, 0x00,// )
eencae 0:d563e74f0ae9 353 0x08, 0x2A, 0x1C, 0x2A, 0x08,// *
eencae 0:d563e74f0ae9 354 0x08, 0x08, 0x3E, 0x08, 0x08,// +
eencae 0:d563e74f0ae9 355 0x00, 0x50, 0x30, 0x00, 0x00,// ,
eencae 0:d563e74f0ae9 356 0x08, 0x08, 0x08, 0x08, 0x08,// -
eencae 0:d563e74f0ae9 357 0x00, 0x60, 0x60, 0x00, 0x00,// .
eencae 0:d563e74f0ae9 358 0x20, 0x10, 0x08, 0x04, 0x02,// /
eencae 0:d563e74f0ae9 359 0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
eencae 0:d563e74f0ae9 360 0x00, 0x42, 0x7F, 0x40, 0x00,// 1
eencae 0:d563e74f0ae9 361 0x42, 0x61, 0x51, 0x49, 0x46,// 2
eencae 0:d563e74f0ae9 362 0x21, 0x41, 0x45, 0x4B, 0x31,// 3
eencae 0:d563e74f0ae9 363 0x18, 0x14, 0x12, 0x7F, 0x10,// 4
eencae 0:d563e74f0ae9 364 0x27, 0x45, 0x45, 0x45, 0x39,// 5
eencae 0:d563e74f0ae9 365 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
eencae 0:d563e74f0ae9 366 0x01, 0x71, 0x09, 0x05, 0x03,// 7
eencae 0:d563e74f0ae9 367 0x36, 0x49, 0x49, 0x49, 0x36,// 8
eencae 0:d563e74f0ae9 368 0x06, 0x49, 0x49, 0x29, 0x1E,// 9
eencae 0:d563e74f0ae9 369 0x00, 0x36, 0x36, 0x00, 0x00,// :
eencae 0:d563e74f0ae9 370 0x00, 0x56, 0x36, 0x00, 0x00,// ;
eencae 0:d563e74f0ae9 371 0x00, 0x08, 0x14, 0x22, 0x41,// <
eencae 0:d563e74f0ae9 372 0x14, 0x14, 0x14, 0x14, 0x14,// =
eencae 0:d563e74f0ae9 373 0x41, 0x22, 0x14, 0x08, 0x00,// >
eencae 0:d563e74f0ae9 374 0x02, 0x01, 0x51, 0x09, 0x06,// ?
eencae 0:d563e74f0ae9 375 0x32, 0x49, 0x79, 0x41, 0x3E,// @
eencae 0:d563e74f0ae9 376 0x7E, 0x11, 0x11, 0x11, 0x7E,// A
eencae 0:d563e74f0ae9 377 0x7F, 0x49, 0x49, 0x49, 0x36,// B
eencae 0:d563e74f0ae9 378 0x3E, 0x41, 0x41, 0x41, 0x22,// C
eencae 0:d563e74f0ae9 379 0x7F, 0x41, 0x41, 0x22, 0x1C,// D
eencae 0:d563e74f0ae9 380 0x7F, 0x49, 0x49, 0x49, 0x41,// E
eencae 0:d563e74f0ae9 381 0x7F, 0x09, 0x09, 0x01, 0x01,// F
eencae 0:d563e74f0ae9 382 0x3E, 0x41, 0x41, 0x51, 0x32,// G
eencae 0:d563e74f0ae9 383 0x7F, 0x08, 0x08, 0x08, 0x7F,// H
eencae 0:d563e74f0ae9 384 0x00, 0x41, 0x7F, 0x41, 0x00,// I
eencae 0:d563e74f0ae9 385 0x20, 0x40, 0x41, 0x3F, 0x01,// J
eencae 0:d563e74f0ae9 386 0x7F, 0x08, 0x14, 0x22, 0x41,// K
eencae 0:d563e74f0ae9 387 0x7F, 0x40, 0x40, 0x40, 0x40,// L
eencae 0:d563e74f0ae9 388 0x7F, 0x02, 0x04, 0x02, 0x7F,// M
eencae 0:d563e74f0ae9 389 0x7F, 0x04, 0x08, 0x10, 0x7F,// N
eencae 0:d563e74f0ae9 390 0x3E, 0x41, 0x41, 0x41, 0x3E,// O
eencae 0:d563e74f0ae9 391 0x7F, 0x09, 0x09, 0x09, 0x06,// P
eencae 0:d563e74f0ae9 392 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
eencae 0:d563e74f0ae9 393 0x7F, 0x09, 0x19, 0x29, 0x46,// R
eencae 0:d563e74f0ae9 394 0x46, 0x49, 0x49, 0x49, 0x31,// S
eencae 0:d563e74f0ae9 395 0x01, 0x01, 0x7F, 0x01, 0x01,// T
eencae 0:d563e74f0ae9 396 0x3F, 0x40, 0x40, 0x40, 0x3F,// U
eencae 0:d563e74f0ae9 397 0x1F, 0x20, 0x40, 0x20, 0x1F,// V
eencae 0:d563e74f0ae9 398 0x7F, 0x20, 0x18, 0x20, 0x7F,// W
eencae 0:d563e74f0ae9 399 0x63, 0x14, 0x08, 0x14, 0x63,// X
eencae 0:d563e74f0ae9 400 0x03, 0x04, 0x78, 0x04, 0x03,// Y
eencae 0:d563e74f0ae9 401 0x61, 0x51, 0x49, 0x45, 0x43,// Z
eencae 0:d563e74f0ae9 402 0x00, 0x00, 0x7F, 0x41, 0x41,// [
eencae 0:d563e74f0ae9 403 0x02, 0x04, 0x08, 0x10, 0x20,// "\"
eencae 0:d563e74f0ae9 404 0x41, 0x41, 0x7F, 0x00, 0x00,// ]
eencae 0:d563e74f0ae9 405 0x04, 0x02, 0x01, 0x02, 0x04,// ^
eencae 0:d563e74f0ae9 406 0x40, 0x40, 0x40, 0x40, 0x40,// _
eencae 0:d563e74f0ae9 407 0x00, 0x01, 0x02, 0x04, 0x00,// `
eencae 0:d563e74f0ae9 408 0x20, 0x54, 0x54, 0x54, 0x78,// a
eencae 0:d563e74f0ae9 409 0x7F, 0x48, 0x44, 0x44, 0x38,// b
eencae 0:d563e74f0ae9 410 0x38, 0x44, 0x44, 0x44, 0x20,// c
eencae 0:d563e74f0ae9 411 0x38, 0x44, 0x44, 0x48, 0x7F,// d
eencae 0:d563e74f0ae9 412 0x38, 0x54, 0x54, 0x54, 0x18,// e
eencae 0:d563e74f0ae9 413 0x08, 0x7E, 0x09, 0x01, 0x02,// f
eencae 0:d563e74f0ae9 414 0x08, 0x14, 0x54, 0x54, 0x3C,// g
eencae 0:d563e74f0ae9 415 0x7F, 0x08, 0x04, 0x04, 0x78,// h
eencae 0:d563e74f0ae9 416 0x00, 0x44, 0x7D, 0x40, 0x00,// i
eencae 0:d563e74f0ae9 417 0x20, 0x40, 0x44, 0x3D, 0x00,// j
eencae 0:d563e74f0ae9 418 0x00, 0x7F, 0x10, 0x28, 0x44,// k
eencae 0:d563e74f0ae9 419 0x00, 0x41, 0x7F, 0x40, 0x00,// l
eencae 0:d563e74f0ae9 420 0x7C, 0x04, 0x18, 0x04, 0x78,// m
eencae 0:d563e74f0ae9 421 0x7C, 0x08, 0x04, 0x04, 0x78,// n
eencae 0:d563e74f0ae9 422 0x38, 0x44, 0x44, 0x44, 0x38,// o
eencae 0:d563e74f0ae9 423 0x7C, 0x14, 0x14, 0x14, 0x08,// p
eencae 0:d563e74f0ae9 424 0x08, 0x14, 0x14, 0x18, 0x7C,// q
eencae 0:d563e74f0ae9 425 0x7C, 0x08, 0x04, 0x04, 0x08,// r
eencae 0:d563e74f0ae9 426 0x48, 0x54, 0x54, 0x54, 0x20,// s
eencae 0:d563e74f0ae9 427 0x04, 0x3F, 0x44, 0x40, 0x20,// t
eencae 0:d563e74f0ae9 428 0x3C, 0x40, 0x40, 0x20, 0x7C,// u
eencae 0:d563e74f0ae9 429 0x1C, 0x20, 0x40, 0x20, 0x1C,// v
eencae 0:d563e74f0ae9 430 0x3C, 0x40, 0x30, 0x40, 0x3C,// w
eencae 0:d563e74f0ae9 431 0x44, 0x28, 0x10, 0x28, 0x44,// x
eencae 0:d563e74f0ae9 432 0x0C, 0x50, 0x50, 0x50, 0x3C,// y
eencae 0:d563e74f0ae9 433 0x44, 0x64, 0x54, 0x4C, 0x44,// z
eencae 0:d563e74f0ae9 434 0x00, 0x08, 0x36, 0x41, 0x00,// {
eencae 0:d563e74f0ae9 435 0x00, 0x00, 0x7F, 0x00, 0x00,// |
eencae 0:d563e74f0ae9 436 0x00, 0x41, 0x36, 0x08, 0x00,// }
eencae 0:d563e74f0ae9 437 0x08, 0x08, 0x2A, 0x1C, 0x08,// ->
eencae 0:d563e74f0ae9 438 0x08, 0x1C, 0x2A, 0x08, 0x08 // <-
eencae 0:d563e74f0ae9 439 };
eencae 0:d563e74f0ae9 440
eencae 14:520a02fc12aa 441 #endif