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.
N5110/N5110.h@3:8c1d53e31ed7, 2018-04-30 (annotated)
- Committer:
- ahmedhedait
- Date:
- Mon Apr 30 02:10:21 2018 +0000
- Revision:
- 3:8c1d53e31ed7
- Parent:
- 0:1b04b9bacf5a
The small circle is being moved by the joystick.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ahmedhedait | 0:1b04b9bacf5a | 1 | #ifndef N5110_H |
| ahmedhedait | 0:1b04b9bacf5a | 2 | #define N5110_H |
| ahmedhedait | 0:1b04b9bacf5a | 3 | |
| ahmedhedait | 0:1b04b9bacf5a | 4 | #include "mbed.h" |
| ahmedhedait | 0:1b04b9bacf5a | 5 | |
| ahmedhedait | 0:1b04b9bacf5a | 6 | // number of pixels on display |
| ahmedhedait | 0:1b04b9bacf5a | 7 | #define WIDTH 84 |
| ahmedhedait | 0:1b04b9bacf5a | 8 | #define HEIGHT 48 |
| ahmedhedait | 0:1b04b9bacf5a | 9 | #define BANKS 6 |
| ahmedhedait | 0:1b04b9bacf5a | 10 | |
| ahmedhedait | 0:1b04b9bacf5a | 11 | /// Fill types for 2D shapes |
| ahmedhedait | 0:1b04b9bacf5a | 12 | enum FillType { |
| ahmedhedait | 0:1b04b9bacf5a | 13 | FILL_TRANSPARENT, ///< Transparent with outline |
| ahmedhedait | 0:1b04b9bacf5a | 14 | FILL_BLACK, ///< Filled black |
| ahmedhedait | 0:1b04b9bacf5a | 15 | FILL_WHITE, ///< Filled white (no outline) |
| ahmedhedait | 0:1b04b9bacf5a | 16 | }; |
| ahmedhedait | 0:1b04b9bacf5a | 17 | |
| ahmedhedait | 0:1b04b9bacf5a | 18 | /** N5110 Class |
| ahmedhedait | 0:1b04b9bacf5a | 19 | @brief Library for interfacing with Nokia 5110 LCD display (https://www.sparkfun.com/products/10168) using the hardware SPI on the mbed. |
| ahmedhedait | 0:1b04b9bacf5a | 20 | @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). |
| ahmedhedait | 0:1b04b9bacf5a | 21 | @brief Can print characters and strings to the display using the included 5x7 font. |
| ahmedhedait | 0:1b04b9bacf5a | 22 | @brief The library also implements a screen buffer so that individual pixels on the display (84 x 48) can be set, cleared and read. |
| ahmedhedait | 0:1b04b9bacf5a | 23 | @brief The library can print primitive shapes (lines, circles, rectangles) |
| ahmedhedait | 0:1b04b9bacf5a | 24 | @brief Acknowledgements to Chris Yan's Nokia_5110 Library. |
| ahmedhedait | 0:1b04b9bacf5a | 25 | |
| ahmedhedait | 0:1b04b9bacf5a | 26 | @brief Revision 1.3 |
| ahmedhedait | 0:1b04b9bacf5a | 27 | |
| ahmedhedait | 0:1b04b9bacf5a | 28 | @author Craig A. Evans |
| ahmedhedait | 0:1b04b9bacf5a | 29 | @date 7th February 2017 |
| ahmedhedait | 0:1b04b9bacf5a | 30 | |
| ahmedhedait | 0:1b04b9bacf5a | 31 | @code |
| ahmedhedait | 0:1b04b9bacf5a | 32 | |
| ahmedhedait | 0:1b04b9bacf5a | 33 | #include "mbed.h" |
| ahmedhedait | 0:1b04b9bacf5a | 34 | #include "N5110.h" |
| ahmedhedait | 0:1b04b9bacf5a | 35 | |
| ahmedhedait | 0:1b04b9bacf5a | 36 | // rows,cols |
| ahmedhedait | 0:1b04b9bacf5a | 37 | int sprite[8][5] = { |
| ahmedhedait | 0:1b04b9bacf5a | 38 | { 0,0,1,0,0 }, |
| ahmedhedait | 0:1b04b9bacf5a | 39 | { 0,1,1,1,0 }, |
| ahmedhedait | 0:1b04b9bacf5a | 40 | { 0,0,1,0,0 }, |
| ahmedhedait | 0:1b04b9bacf5a | 41 | { 0,1,1,1,0 }, |
| ahmedhedait | 0:1b04b9bacf5a | 42 | { 1,1,1,1,1 }, |
| ahmedhedait | 0:1b04b9bacf5a | 43 | { 1,1,1,1,1 }, |
| ahmedhedait | 0:1b04b9bacf5a | 44 | { 1,1,0,1,1 }, |
| ahmedhedait | 0:1b04b9bacf5a | 45 | { 1,1,0,1,1 }, |
| ahmedhedait | 0:1b04b9bacf5a | 46 | }; |
| ahmedhedait | 0:1b04b9bacf5a | 47 | |
| ahmedhedait | 0:1b04b9bacf5a | 48 | // VCC,SCE,RST,D/C,MOSI,SCLK,LED |
| ahmedhedait | 0:1b04b9bacf5a | 49 | //N5110 lcd(p7,p8,p9,p10,p11,p13,p21); // LPC1768 - pwr from GPIO |
| ahmedhedait | 0:1b04b9bacf5a | 50 | N5110 lcd(p8,p9,p10,p11,p13,p21); // LPC1768 - powered from +3V3 - JP1 in 2/3 position |
| ahmedhedait | 0:1b04b9bacf5a | 51 | //N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); // K64F - pwr from 3V3 |
| ahmedhedait | 0:1b04b9bacf5a | 52 | |
| ahmedhedait | 0:1b04b9bacf5a | 53 | int main() |
| ahmedhedait | 0:1b04b9bacf5a | 54 | { |
| ahmedhedait | 0:1b04b9bacf5a | 55 | // first need to initialise display |
| ahmedhedait | 0:1b04b9bacf5a | 56 | lcd.init(); |
| ahmedhedait | 0:1b04b9bacf5a | 57 | |
| ahmedhedait | 0:1b04b9bacf5a | 58 | // change set contrast in range 0.0 to 1.0 |
| ahmedhedait | 0:1b04b9bacf5a | 59 | // 0.4 appears to be a good starting point |
| ahmedhedait | 0:1b04b9bacf5a | 60 | lcd.setContrast(0.4); |
| ahmedhedait | 0:1b04b9bacf5a | 61 | |
| ahmedhedait | 0:1b04b9bacf5a | 62 | while(1) { |
| ahmedhedait | 0:1b04b9bacf5a | 63 | |
| ahmedhedait | 0:1b04b9bacf5a | 64 | // these are default settings so not strictly needed |
| ahmedhedait | 0:1b04b9bacf5a | 65 | lcd.normalMode(); // normal colour mode |
| ahmedhedait | 0:1b04b9bacf5a | 66 | lcd.setBrightness(0.5); // put LED backlight on 50% |
| ahmedhedait | 0:1b04b9bacf5a | 67 | |
| ahmedhedait | 0:1b04b9bacf5a | 68 | lcd.clear(); |
| ahmedhedait | 0:1b04b9bacf5a | 69 | // x origin, y origin, rows, cols, sprite |
| ahmedhedait | 0:1b04b9bacf5a | 70 | lcd.drawSprite(20,6,8,5,(int *)sprite); |
| ahmedhedait | 0:1b04b9bacf5a | 71 | lcd.refresh(); |
| ahmedhedait | 0:1b04b9bacf5a | 72 | wait(5.0); |
| ahmedhedait | 0:1b04b9bacf5a | 73 | |
| ahmedhedait | 0:1b04b9bacf5a | 74 | lcd.clear(); // clear buffer at start of every loop |
| ahmedhedait | 0:1b04b9bacf5a | 75 | // can directly print strings at specified co-ordinates (must be less than 84 pixels to fit on display) |
| ahmedhedait | 0:1b04b9bacf5a | 76 | lcd.printString("Hello, World!",0,0); |
| ahmedhedait | 0:1b04b9bacf5a | 77 | |
| ahmedhedait | 0:1b04b9bacf5a | 78 | char buffer[14]; // each character is 6 pixels wide, screen is 84 pixels (84/6 = 14) |
| ahmedhedait | 0:1b04b9bacf5a | 79 | // so can display a string of a maximum 14 characters in length |
| ahmedhedait | 0:1b04b9bacf5a | 80 | // or create formatted strings - ensure they aren't more than 14 characters long |
| ahmedhedait | 0:1b04b9bacf5a | 81 | int temperature = 27; |
| ahmedhedait | 0:1b04b9bacf5a | 82 | int length = sprintf(buffer,"T = %2d C",temperature); // print formatted data to buffer |
| ahmedhedait | 0:1b04b9bacf5a | 83 | // it is important the format specifier ensures the length will fit in the buffer |
| ahmedhedait | 0:1b04b9bacf5a | 84 | if (length <= 14) // if string will fit on display (assuming printing at x=0) |
| ahmedhedait | 0:1b04b9bacf5a | 85 | lcd.printString(buffer,0,1); // display on screen |
| ahmedhedait | 0:1b04b9bacf5a | 86 | |
| ahmedhedait | 0:1b04b9bacf5a | 87 | float pressure = 1012.3; // same idea with floats |
| ahmedhedait | 0:1b04b9bacf5a | 88 | length = sprintf(buffer,"P = %.2f mb",pressure); |
| ahmedhedait | 0:1b04b9bacf5a | 89 | if (length <= 14) |
| ahmedhedait | 0:1b04b9bacf5a | 90 | lcd.printString(buffer,0,2); |
| ahmedhedait | 0:1b04b9bacf5a | 91 | |
| ahmedhedait | 0:1b04b9bacf5a | 92 | // can also print individual characters at specified place |
| ahmedhedait | 0:1b04b9bacf5a | 93 | lcd.printChar('X',5,3); |
| ahmedhedait | 0:1b04b9bacf5a | 94 | |
| ahmedhedait | 0:1b04b9bacf5a | 95 | // draw a line across the display at y = 40 pixels (origin top-left) |
| ahmedhedait | 0:1b04b9bacf5a | 96 | for (int i = 0; i < WIDTH; i++) { |
| ahmedhedait | 0:1b04b9bacf5a | 97 | lcd.setPixel(i,40,true); |
| ahmedhedait | 0:1b04b9bacf5a | 98 | } |
| ahmedhedait | 0:1b04b9bacf5a | 99 | // need to refresh display after setting pixels or writing strings |
| ahmedhedait | 0:1b04b9bacf5a | 100 | lcd.refresh(); |
| ahmedhedait | 0:1b04b9bacf5a | 101 | wait(5.0); |
| ahmedhedait | 0:1b04b9bacf5a | 102 | |
| ahmedhedait | 0:1b04b9bacf5a | 103 | // can check status of pixel using getPixel(x,y); |
| ahmedhedait | 0:1b04b9bacf5a | 104 | lcd.clear(); // clear buffer |
| ahmedhedait | 0:1b04b9bacf5a | 105 | lcd.setPixel(2,2,true); // set random pixel in buffer |
| ahmedhedait | 0:1b04b9bacf5a | 106 | lcd.refresh(); |
| ahmedhedait | 0:1b04b9bacf5a | 107 | wait(1.0); |
| ahmedhedait | 0:1b04b9bacf5a | 108 | |
| ahmedhedait | 0:1b04b9bacf5a | 109 | int pixel_to_test = lcd.getPixel(2,2); |
| ahmedhedait | 0:1b04b9bacf5a | 110 | |
| ahmedhedait | 0:1b04b9bacf5a | 111 | if ( pixel_to_test ) { |
| ahmedhedait | 0:1b04b9bacf5a | 112 | lcd.printString("2,2 is set",0,4); |
| ahmedhedait | 0:1b04b9bacf5a | 113 | } |
| ahmedhedait | 0:1b04b9bacf5a | 114 | |
| ahmedhedait | 0:1b04b9bacf5a | 115 | // this one shouldn't be set |
| ahmedhedait | 0:1b04b9bacf5a | 116 | lcd.setPixel(3,3,false); // clear random pixel in buffer |
| ahmedhedait | 0:1b04b9bacf5a | 117 | lcd.refresh(); |
| ahmedhedait | 0:1b04b9bacf5a | 118 | pixel_to_test = lcd.getPixel(3,3); |
| ahmedhedait | 0:1b04b9bacf5a | 119 | |
| ahmedhedait | 0:1b04b9bacf5a | 120 | if ( pixel_to_test == 0 ) { |
| ahmedhedait | 0:1b04b9bacf5a | 121 | lcd.printString("3,3 is clear",0,5); |
| ahmedhedait | 0:1b04b9bacf5a | 122 | } |
| ahmedhedait | 0:1b04b9bacf5a | 123 | |
| ahmedhedait | 0:1b04b9bacf5a | 124 | lcd.refresh(); |
| ahmedhedait | 0:1b04b9bacf5a | 125 | wait(4.0); |
| ahmedhedait | 0:1b04b9bacf5a | 126 | |
| ahmedhedait | 0:1b04b9bacf5a | 127 | lcd.clear(); // clear buffer |
| ahmedhedait | 0:1b04b9bacf5a | 128 | lcd.inverseMode(); // invert colours |
| ahmedhedait | 0:1b04b9bacf5a | 129 | lcd.setBrightness(1.0); // put LED backlight on full |
| ahmedhedait | 0:1b04b9bacf5a | 130 | |
| ahmedhedait | 0:1b04b9bacf5a | 131 | float array[84]; |
| ahmedhedait | 0:1b04b9bacf5a | 132 | |
| ahmedhedait | 0:1b04b9bacf5a | 133 | for (int i = 0; i < 84; i++) { |
| ahmedhedait | 0:1b04b9bacf5a | 134 | array[i] = 0.5 + 0.5*sin(i*2*3.14/84); |
| ahmedhedait | 0:1b04b9bacf5a | 135 | } |
| ahmedhedait | 0:1b04b9bacf5a | 136 | |
| ahmedhedait | 0:1b04b9bacf5a | 137 | // can also plot graphs - 84 elements only |
| ahmedhedait | 0:1b04b9bacf5a | 138 | // values must be in range 0.0 - 1.0 |
| ahmedhedait | 0:1b04b9bacf5a | 139 | lcd.plotArray(array); |
| ahmedhedait | 0:1b04b9bacf5a | 140 | lcd.refresh(); |
| ahmedhedait | 0:1b04b9bacf5a | 141 | wait(5.0); |
| ahmedhedait | 0:1b04b9bacf5a | 142 | |
| ahmedhedait | 0:1b04b9bacf5a | 143 | lcd.clear(); |
| ahmedhedait | 0:1b04b9bacf5a | 144 | lcd.normalMode(); // normal colour mode back |
| ahmedhedait | 0:1b04b9bacf5a | 145 | lcd.setBrightness(0.5); // put LED backlight on 50% |
| ahmedhedait | 0:1b04b9bacf5a | 146 | |
| ahmedhedait | 0:1b04b9bacf5a | 147 | // example of drawing lines |
| ahmedhedait | 0:1b04b9bacf5a | 148 | for (int x = 0; x < WIDTH ; x+=10) { |
| ahmedhedait | 0:1b04b9bacf5a | 149 | // x0,y0,x1,y1,type 0-white,1-black,2-dotted |
| ahmedhedait | 0:1b04b9bacf5a | 150 | lcd.drawLine(0,0,x,HEIGHT,2); |
| ahmedhedait | 0:1b04b9bacf5a | 151 | } |
| ahmedhedait | 0:1b04b9bacf5a | 152 | lcd.refresh(); // refresh after drawing shapes |
| ahmedhedait | 0:1b04b9bacf5a | 153 | wait(5.0); |
| ahmedhedait | 0:1b04b9bacf5a | 154 | |
| ahmedhedait | 0:1b04b9bacf5a | 155 | |
| ahmedhedait | 0:1b04b9bacf5a | 156 | lcd.clear(); |
| ahmedhedait | 0:1b04b9bacf5a | 157 | // example of how to draw circles |
| ahmedhedait | 0:1b04b9bacf5a | 158 | lcd.drawCircle(WIDTH/2,HEIGHT/2,20,FILL_BLACK); // x,y,radius,black fill |
| ahmedhedait | 0:1b04b9bacf5a | 159 | lcd.drawCircle(WIDTH/2,HEIGHT/2,10,FILL_WHITE); // x,y,radius,white fill |
| ahmedhedait | 0:1b04b9bacf5a | 160 | lcd.drawCircle(WIDTH/2,HEIGHT/2,30,FILL_TRANSPARENT); // x,y,radius,transparent with outline |
| ahmedhedait | 0:1b04b9bacf5a | 161 | lcd.refresh(); // refresh after drawing shapes |
| ahmedhedait | 0:1b04b9bacf5a | 162 | wait(5.0); |
| ahmedhedait | 0:1b04b9bacf5a | 163 | |
| ahmedhedait | 0:1b04b9bacf5a | 164 | lcd.clear(); |
| ahmedhedait | 0:1b04b9bacf5a | 165 | // example of how to draw rectangles |
| ahmedhedait | 0:1b04b9bacf5a | 166 | // origin x,y,width,height,type |
| ahmedhedait | 0:1b04b9bacf5a | 167 | lcd.drawRect(10,10,50,30,FILL_BLACK); // filled black rectangle |
| ahmedhedait | 0:1b04b9bacf5a | 168 | lcd.drawRect(15,15,20,10,FILL_WHITE); // filled white rectange (no outline) |
| ahmedhedait | 0:1b04b9bacf5a | 169 | lcd.drawRect(2,2,70,40,FILL_TRANSPARENT); // transparent, just outline |
| ahmedhedait | 0:1b04b9bacf5a | 170 | lcd.refresh(); // refresh after drawing shapes |
| ahmedhedait | 0:1b04b9bacf5a | 171 | wait(5.0); |
| ahmedhedait | 0:1b04b9bacf5a | 172 | |
| ahmedhedait | 0:1b04b9bacf5a | 173 | } |
| ahmedhedait | 0:1b04b9bacf5a | 174 | } |
| ahmedhedait | 0:1b04b9bacf5a | 175 | |
| ahmedhedait | 0:1b04b9bacf5a | 176 | |
| ahmedhedait | 0:1b04b9bacf5a | 177 | @endcode |
| ahmedhedait | 0:1b04b9bacf5a | 178 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 179 | class N5110 |
| ahmedhedait | 0:1b04b9bacf5a | 180 | { |
| ahmedhedait | 0:1b04b9bacf5a | 181 | private: |
| ahmedhedait | 0:1b04b9bacf5a | 182 | // objects |
| ahmedhedait | 0:1b04b9bacf5a | 183 | SPI *_spi; |
| ahmedhedait | 0:1b04b9bacf5a | 184 | PwmOut *_led; |
| ahmedhedait | 0:1b04b9bacf5a | 185 | DigitalOut *_pwr; |
| ahmedhedait | 0:1b04b9bacf5a | 186 | DigitalOut *_sce; |
| ahmedhedait | 0:1b04b9bacf5a | 187 | DigitalOut *_rst; |
| ahmedhedait | 0:1b04b9bacf5a | 188 | DigitalOut *_dc; |
| ahmedhedait | 0:1b04b9bacf5a | 189 | |
| ahmedhedait | 0:1b04b9bacf5a | 190 | // variables |
| ahmedhedait | 0:1b04b9bacf5a | 191 | unsigned char buffer[84][6]; // screen buffer - the 6 is for the banks - each one is 8 bits; |
| ahmedhedait | 0:1b04b9bacf5a | 192 | |
| ahmedhedait | 0:1b04b9bacf5a | 193 | public: |
| ahmedhedait | 0:1b04b9bacf5a | 194 | /** Create a N5110 object connected to the specified pins |
| ahmedhedait | 0:1b04b9bacf5a | 195 | * |
| ahmedhedait | 0:1b04b9bacf5a | 196 | * @param pwr Pin connected to Vcc on the LCD display (pin 1) |
| ahmedhedait | 0:1b04b9bacf5a | 197 | * @param sce Pin connected to chip enable (pin 3) |
| ahmedhedait | 0:1b04b9bacf5a | 198 | * @param rst Pin connected to reset (pin 4) |
| ahmedhedait | 0:1b04b9bacf5a | 199 | * @param dc Pin connected to data/command select (pin 5) |
| ahmedhedait | 0:1b04b9bacf5a | 200 | * @param mosi Pin connected to data input (MOSI) (pin 6) |
| ahmedhedait | 0:1b04b9bacf5a | 201 | * @param sclk Pin connected to serial clock (SCLK) (pin 7) |
| ahmedhedait | 0:1b04b9bacf5a | 202 | * @param led Pin connected to LED backlight (must be PWM) (pin 8) |
| ahmedhedait | 0:1b04b9bacf5a | 203 | * |
| ahmedhedait | 0:1b04b9bacf5a | 204 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 205 | N5110(PinName const pwrPin, |
| ahmedhedait | 0:1b04b9bacf5a | 206 | PinName const scePin, |
| ahmedhedait | 0:1b04b9bacf5a | 207 | PinName const rstPin, |
| ahmedhedait | 0:1b04b9bacf5a | 208 | PinName const dcPin, |
| ahmedhedait | 0:1b04b9bacf5a | 209 | PinName const mosiPin, |
| ahmedhedait | 0:1b04b9bacf5a | 210 | PinName const sclkPin, |
| ahmedhedait | 0:1b04b9bacf5a | 211 | PinName const ledPin); |
| ahmedhedait | 0:1b04b9bacf5a | 212 | |
| ahmedhedait | 0:1b04b9bacf5a | 213 | /** Create a N5110 object connected to the specified pins (Vcc to +3V3) |
| ahmedhedait | 0:1b04b9bacf5a | 214 | * |
| ahmedhedait | 0:1b04b9bacf5a | 215 | * @param sce Pin connected to chip enable (pin 3) |
| ahmedhedait | 0:1b04b9bacf5a | 216 | * @param rst Pin connected to reset (pin 4) |
| ahmedhedait | 0:1b04b9bacf5a | 217 | * @param dc Pin connected to data/command select (pin 5) |
| ahmedhedait | 0:1b04b9bacf5a | 218 | * @param mosi Pin connected to data input (MOSI) (pin 6) |
| ahmedhedait | 0:1b04b9bacf5a | 219 | * @param sclk Pin connected to serial clock (SCLK) (pin 7) |
| ahmedhedait | 0:1b04b9bacf5a | 220 | * @param led Pin connected to LED backlight (must be PWM) (pin 8) |
| ahmedhedait | 0:1b04b9bacf5a | 221 | * |
| ahmedhedait | 0:1b04b9bacf5a | 222 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 223 | N5110(PinName const scePin, |
| ahmedhedait | 0:1b04b9bacf5a | 224 | PinName const rstPin, |
| ahmedhedait | 0:1b04b9bacf5a | 225 | PinName const dcPin, |
| ahmedhedait | 0:1b04b9bacf5a | 226 | PinName const mosiPin, |
| ahmedhedait | 0:1b04b9bacf5a | 227 | PinName const sclkPin, |
| ahmedhedait | 0:1b04b9bacf5a | 228 | PinName const ledPin); |
| ahmedhedait | 0:1b04b9bacf5a | 229 | |
| ahmedhedait | 0:1b04b9bacf5a | 230 | /** |
| ahmedhedait | 0:1b04b9bacf5a | 231 | * Free allocated memory when object goes out of scope |
| ahmedhedait | 0:1b04b9bacf5a | 232 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 233 | ~N5110(); |
| ahmedhedait | 0:1b04b9bacf5a | 234 | |
| ahmedhedait | 0:1b04b9bacf5a | 235 | /** Initialise display |
| ahmedhedait | 0:1b04b9bacf5a | 236 | * |
| ahmedhedait | 0:1b04b9bacf5a | 237 | * Powers up the display and turns on backlight (50% brightness default). |
| ahmedhedait | 0:1b04b9bacf5a | 238 | * Sets the display up in horizontal addressing mode and with normal video mode. |
| ahmedhedait | 0:1b04b9bacf5a | 239 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 240 | void init(); |
| ahmedhedait | 0:1b04b9bacf5a | 241 | |
| ahmedhedait | 0:1b04b9bacf5a | 242 | /** Turn off |
| ahmedhedait | 0:1b04b9bacf5a | 243 | * |
| ahmedhedait | 0:1b04b9bacf5a | 244 | * Powers down the display and turns of the backlight. |
| ahmedhedait | 0:1b04b9bacf5a | 245 | * Needs to be reinitialised before being re-used. |
| ahmedhedait | 0:1b04b9bacf5a | 246 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 247 | void turnOff(); |
| ahmedhedait | 0:1b04b9bacf5a | 248 | |
| ahmedhedait | 0:1b04b9bacf5a | 249 | /** Clear |
| ahmedhedait | 0:1b04b9bacf5a | 250 | * |
| ahmedhedait | 0:1b04b9bacf5a | 251 | * Clears the screen buffer. |
| ahmedhedait | 0:1b04b9bacf5a | 252 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 253 | void clear(); |
| ahmedhedait | 0:1b04b9bacf5a | 254 | |
| ahmedhedait | 0:1b04b9bacf5a | 255 | /** Set screen constrast |
| ahmedhedait | 0:1b04b9bacf5a | 256 | * @param constrast - float in range 0.0 to 1.0 (0.40 to 0.60 is usually a good value) |
| ahmedhedait | 0:1b04b9bacf5a | 257 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 258 | void setContrast(float contrast); |
| ahmedhedait | 0:1b04b9bacf5a | 259 | |
| ahmedhedait | 0:1b04b9bacf5a | 260 | /** Turn on normal video mode (default) |
| ahmedhedait | 0:1b04b9bacf5a | 261 | * Black on white |
| ahmedhedait | 0:1b04b9bacf5a | 262 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 263 | void normalMode(); |
| ahmedhedait | 0:1b04b9bacf5a | 264 | |
| ahmedhedait | 0:1b04b9bacf5a | 265 | /** Turn on inverse video mode (default) |
| ahmedhedait | 0:1b04b9bacf5a | 266 | * White on black |
| ahmedhedait | 0:1b04b9bacf5a | 267 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 268 | void inverseMode(); |
| ahmedhedait | 0:1b04b9bacf5a | 269 | |
| ahmedhedait | 0:1b04b9bacf5a | 270 | /** Set Brightness |
| ahmedhedait | 0:1b04b9bacf5a | 271 | * |
| ahmedhedait | 0:1b04b9bacf5a | 272 | * Sets brightness of LED backlight. |
| ahmedhedait | 0:1b04b9bacf5a | 273 | * @param brightness - float in range 0.0 to 1.0 |
| ahmedhedait | 0:1b04b9bacf5a | 274 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 275 | void setBrightness(float const brightness); |
| ahmedhedait | 0:1b04b9bacf5a | 276 | |
| ahmedhedait | 0:1b04b9bacf5a | 277 | /** Print String |
| ahmedhedait | 0:1b04b9bacf5a | 278 | * |
| ahmedhedait | 0:1b04b9bacf5a | 279 | * Prints a string of characters to the screen buffer. String is cut-off after the 83rd pixel. |
| ahmedhedait | 0:1b04b9bacf5a | 280 | * @param x - the column number (0 to 83) |
| ahmedhedait | 0:1b04b9bacf5a | 281 | * @param y - the row number (0 to 5) - the display is split into 6 banks - each bank can be considered a row |
| ahmedhedait | 0:1b04b9bacf5a | 282 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 283 | void printString(char const *str, |
| ahmedhedait | 0:1b04b9bacf5a | 284 | unsigned int const x, |
| ahmedhedait | 0:1b04b9bacf5a | 285 | unsigned int const y); |
| ahmedhedait | 0:1b04b9bacf5a | 286 | |
| ahmedhedait | 0:1b04b9bacf5a | 287 | /** Print Character |
| ahmedhedait | 0:1b04b9bacf5a | 288 | * |
| ahmedhedait | 0:1b04b9bacf5a | 289 | * Sends a character to the screen buffer. Printed at the specified location. Character is cut-off after the 83rd pixel. |
| ahmedhedait | 0:1b04b9bacf5a | 290 | * @param c - the character to print. Can print ASCII as so printChar('C'). |
| ahmedhedait | 0:1b04b9bacf5a | 291 | * @param x - the column number (0 to 83) |
| ahmedhedait | 0:1b04b9bacf5a | 292 | * @param y - the row number (0 to 5) - the display is split into 6 banks - each bank can be considered a row |
| ahmedhedait | 0:1b04b9bacf5a | 293 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 294 | void printChar(char const c, |
| ahmedhedait | 0:1b04b9bacf5a | 295 | unsigned int const x, |
| ahmedhedait | 0:1b04b9bacf5a | 296 | unsigned int const y); |
| ahmedhedait | 0:1b04b9bacf5a | 297 | |
| ahmedhedait | 0:1b04b9bacf5a | 298 | /** |
| ahmedhedait | 0:1b04b9bacf5a | 299 | * @brief Set a Pixel |
| ahmedhedait | 0:1b04b9bacf5a | 300 | * |
| ahmedhedait | 0:1b04b9bacf5a | 301 | * @param x The x co-ordinate of the pixel (0 to 83) |
| ahmedhedait | 0:1b04b9bacf5a | 302 | * @param y The y co-ordinate of the pixel (0 to 47) |
| ahmedhedait | 0:1b04b9bacf5a | 303 | * @param state The state of the pixel [true=black (default), false=white] |
| ahmedhedait | 0:1b04b9bacf5a | 304 | * |
| ahmedhedait | 0:1b04b9bacf5a | 305 | * @details This function sets the state of a pixel in the screen buffer. |
| ahmedhedait | 0:1b04b9bacf5a | 306 | * The third parameter can be omitted, |
| ahmedhedait | 0:1b04b9bacf5a | 307 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 308 | void setPixel(unsigned int const x, |
| ahmedhedait | 0:1b04b9bacf5a | 309 | unsigned int const y, |
| ahmedhedait | 0:1b04b9bacf5a | 310 | bool const state = true); |
| ahmedhedait | 0:1b04b9bacf5a | 311 | |
| ahmedhedait | 0:1b04b9bacf5a | 312 | /** |
| ahmedhedait | 0:1b04b9bacf5a | 313 | * @brief Clear a Pixel |
| ahmedhedait | 0:1b04b9bacf5a | 314 | * |
| ahmedhedait | 0:1b04b9bacf5a | 315 | * @param x - the x co-ordinate of the pixel (0 to 83) |
| ahmedhedait | 0:1b04b9bacf5a | 316 | * @param y - the y co-ordinate of the pixel (0 to 47) |
| ahmedhedait | 0:1b04b9bacf5a | 317 | * |
| ahmedhedait | 0:1b04b9bacf5a | 318 | * @details This function clears pixel in the screen buffer |
| ahmedhedait | 0:1b04b9bacf5a | 319 | * |
| ahmedhedait | 0:1b04b9bacf5a | 320 | * @deprecated Use setPixel(x, y, false) instead |
| ahmedhedait | 0:1b04b9bacf5a | 321 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 322 | void clearPixel(unsigned int const x, |
| ahmedhedait | 0:1b04b9bacf5a | 323 | unsigned int const y) |
| ahmedhedait | 0:1b04b9bacf5a | 324 | __attribute__((deprecated("Use setPixel(x,y,false) instead"))); |
| ahmedhedait | 0:1b04b9bacf5a | 325 | |
| ahmedhedait | 0:1b04b9bacf5a | 326 | /** Get a Pixel |
| ahmedhedait | 0:1b04b9bacf5a | 327 | * |
| ahmedhedait | 0:1b04b9bacf5a | 328 | * This function gets the status of a pixel in the screen buffer. |
| ahmedhedait | 0:1b04b9bacf5a | 329 | * @param x - the x co-ordinate of the pixel (0 to 83) |
| ahmedhedait | 0:1b04b9bacf5a | 330 | * @param y - the y co-ordinate of the pixel (0 to 47) |
| ahmedhedait | 0:1b04b9bacf5a | 331 | * @returns |
| ahmedhedait | 0:1b04b9bacf5a | 332 | * 0 - pixel is clear |
| ahmedhedait | 0:1b04b9bacf5a | 333 | * 1 - pixel is set |
| ahmedhedait | 0:1b04b9bacf5a | 334 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 335 | int getPixel(unsigned int const x, |
| ahmedhedait | 0:1b04b9bacf5a | 336 | unsigned int const y) const; |
| ahmedhedait | 0:1b04b9bacf5a | 337 | |
| ahmedhedait | 0:1b04b9bacf5a | 338 | /** Refresh display |
| ahmedhedait | 0:1b04b9bacf5a | 339 | * |
| ahmedhedait | 0:1b04b9bacf5a | 340 | * This functions sends the screen buffer to the display. |
| ahmedhedait | 0:1b04b9bacf5a | 341 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 342 | void refresh(); |
| ahmedhedait | 0:1b04b9bacf5a | 343 | |
| ahmedhedait | 0:1b04b9bacf5a | 344 | /** Randomise buffer |
| ahmedhedait | 0:1b04b9bacf5a | 345 | * |
| ahmedhedait | 0:1b04b9bacf5a | 346 | * This function fills the buffer with random data. Can be used to test the display. |
| ahmedhedait | 0:1b04b9bacf5a | 347 | * A call to refresh() must be made to update the display to reflect the change in pixels. |
| ahmedhedait | 0:1b04b9bacf5a | 348 | * The seed is not set and so the generated pattern will probably be the same each time. |
| ahmedhedait | 0:1b04b9bacf5a | 349 | * TODO: Randomise the seed - maybe using the noise on the AnalogIn pins. |
| ahmedhedait | 0:1b04b9bacf5a | 350 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 351 | void randomiseBuffer(); |
| ahmedhedait | 0:1b04b9bacf5a | 352 | |
| ahmedhedait | 0:1b04b9bacf5a | 353 | /** Plot Array |
| ahmedhedait | 0:1b04b9bacf5a | 354 | * |
| ahmedhedait | 0:1b04b9bacf5a | 355 | * This function plots a one-dimensional array in the buffer. |
| ahmedhedait | 0:1b04b9bacf5a | 356 | * @param array[] - y values of the plot. Values should be normalised in the range 0.0 to 1.0. First 84 plotted. |
| ahmedhedait | 0:1b04b9bacf5a | 357 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 358 | void plotArray(float const array[]); |
| ahmedhedait | 0:1b04b9bacf5a | 359 | |
| ahmedhedait | 0:1b04b9bacf5a | 360 | /** Draw Circle |
| ahmedhedait | 0:1b04b9bacf5a | 361 | * |
| ahmedhedait | 0:1b04b9bacf5a | 362 | * This function draws a circle at the specified origin with specified radius in the screen buffer |
| ahmedhedait | 0:1b04b9bacf5a | 363 | * Uses the midpoint circle algorithm. |
| ahmedhedait | 0:1b04b9bacf5a | 364 | * @see http://en.wikipedia.org/wiki/Midpoint_circle_algorithm |
| ahmedhedait | 0:1b04b9bacf5a | 365 | * @param x0 - x-coordinate of centre |
| ahmedhedait | 0:1b04b9bacf5a | 366 | * @param y0 - y-coordinate of centre |
| ahmedhedait | 0:1b04b9bacf5a | 367 | * @param radius - radius of circle in pixels |
| ahmedhedait | 0:1b04b9bacf5a | 368 | * @param fill - fill-type for the shape |
| ahmedhedait | 0:1b04b9bacf5a | 369 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 370 | void drawCircle(unsigned int const x0, |
| ahmedhedait | 0:1b04b9bacf5a | 371 | unsigned int const y0, |
| ahmedhedait | 0:1b04b9bacf5a | 372 | unsigned int const radius, |
| ahmedhedait | 0:1b04b9bacf5a | 373 | FillType const fill); |
| ahmedhedait | 0:1b04b9bacf5a | 374 | |
| ahmedhedait | 0:1b04b9bacf5a | 375 | /** Draw Line |
| ahmedhedait | 0:1b04b9bacf5a | 376 | * |
| ahmedhedait | 0:1b04b9bacf5a | 377 | * This function draws a line between the specified points using linear interpolation. |
| ahmedhedait | 0:1b04b9bacf5a | 378 | * @param x0 - x-coordinate of first point |
| ahmedhedait | 0:1b04b9bacf5a | 379 | * @param y0 - y-coordinate of first point |
| ahmedhedait | 0:1b04b9bacf5a | 380 | * @param x1 - x-coordinate of last point |
| ahmedhedait | 0:1b04b9bacf5a | 381 | * @param y1 - y-coordinate of last point |
| ahmedhedait | 0:1b04b9bacf5a | 382 | * @param type - 0 white,1 black,2 dotted |
| ahmedhedait | 0:1b04b9bacf5a | 383 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 384 | void drawLine(unsigned int const x0, |
| ahmedhedait | 0:1b04b9bacf5a | 385 | unsigned int const y0, |
| ahmedhedait | 0:1b04b9bacf5a | 386 | unsigned int const x1, |
| ahmedhedait | 0:1b04b9bacf5a | 387 | unsigned int const y1, |
| ahmedhedait | 0:1b04b9bacf5a | 388 | unsigned int const type); |
| ahmedhedait | 0:1b04b9bacf5a | 389 | |
| ahmedhedait | 0:1b04b9bacf5a | 390 | /** Draw Rectangle |
| ahmedhedait | 0:1b04b9bacf5a | 391 | * |
| ahmedhedait | 0:1b04b9bacf5a | 392 | * This function draws a rectangle. |
| ahmedhedait | 0:1b04b9bacf5a | 393 | * @param x0 - x-coordinate of origin (top-left) |
| ahmedhedait | 0:1b04b9bacf5a | 394 | * @param y0 - y-coordinate of origin (top-left) |
| ahmedhedait | 0:1b04b9bacf5a | 395 | * @param width - width of rectangle |
| ahmedhedait | 0:1b04b9bacf5a | 396 | * @param height - height of rectangle |
| ahmedhedait | 0:1b04b9bacf5a | 397 | * @param fill - fill-type for the shape |
| ahmedhedait | 0:1b04b9bacf5a | 398 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 399 | void drawRect(unsigned int const x0, |
| ahmedhedait | 0:1b04b9bacf5a | 400 | unsigned int const y0, |
| ahmedhedait | 0:1b04b9bacf5a | 401 | unsigned int const width, |
| ahmedhedait | 0:1b04b9bacf5a | 402 | unsigned int const height, |
| ahmedhedait | 0:1b04b9bacf5a | 403 | FillType const fill); |
| ahmedhedait | 0:1b04b9bacf5a | 404 | |
| ahmedhedait | 0:1b04b9bacf5a | 405 | /** Draw Sprite |
| ahmedhedait | 0:1b04b9bacf5a | 406 | * |
| ahmedhedait | 0:1b04b9bacf5a | 407 | * This function draws a sprite as defined in a 2D array |
| ahmedhedait | 0:1b04b9bacf5a | 408 | * @param x0 - x-coordinate of origin (top-left) |
| ahmedhedait | 0:1b04b9bacf5a | 409 | * @param y0 - y-coordinate of origin (top-left) |
| ahmedhedait | 0:1b04b9bacf5a | 410 | * @param nrows - number of rows in sprite |
| ahmedhedait | 0:1b04b9bacf5a | 411 | * @param ncols - number of columns in sprite |
| ahmedhedait | 0:1b04b9bacf5a | 412 | * @param sprite - 2D array representing the sprite |
| ahmedhedait | 0:1b04b9bacf5a | 413 | */ |
| ahmedhedait | 0:1b04b9bacf5a | 414 | void drawSprite(int x0, |
| ahmedhedait | 0:1b04b9bacf5a | 415 | int y0, |
| ahmedhedait | 0:1b04b9bacf5a | 416 | int nrows, |
| ahmedhedait | 0:1b04b9bacf5a | 417 | int ncols, |
| ahmedhedait | 0:1b04b9bacf5a | 418 | int *sprite); |
| ahmedhedait | 0:1b04b9bacf5a | 419 | |
| ahmedhedait | 0:1b04b9bacf5a | 420 | |
| ahmedhedait | 0:1b04b9bacf5a | 421 | private: |
| ahmedhedait | 0:1b04b9bacf5a | 422 | // methods |
| ahmedhedait | 0:1b04b9bacf5a | 423 | void setXYAddress(unsigned int const x, |
| ahmedhedait | 0:1b04b9bacf5a | 424 | unsigned int const y); |
| ahmedhedait | 0:1b04b9bacf5a | 425 | void initSPI(); |
| ahmedhedait | 0:1b04b9bacf5a | 426 | void turnOn(); |
| ahmedhedait | 0:1b04b9bacf5a | 427 | void reset(); |
| ahmedhedait | 0:1b04b9bacf5a | 428 | void clearRAM(); |
| ahmedhedait | 0:1b04b9bacf5a | 429 | void sendCommand(unsigned char command); |
| ahmedhedait | 0:1b04b9bacf5a | 430 | void sendData(unsigned char data); |
| ahmedhedait | 0:1b04b9bacf5a | 431 | void setTempCoefficient(char tc); // 0 to 3 |
| ahmedhedait | 0:1b04b9bacf5a | 432 | void setBias(char bias); // 0 to 7 |
| ahmedhedait | 0:1b04b9bacf5a | 433 | }; |
| ahmedhedait | 0:1b04b9bacf5a | 434 | |
| ahmedhedait | 0:1b04b9bacf5a | 435 | const unsigned char font5x7[480] = { |
| ahmedhedait | 0:1b04b9bacf5a | 436 | 0x00, 0x00, 0x00, 0x00, 0x00,// (space) |
| ahmedhedait | 0:1b04b9bacf5a | 437 | 0x00, 0x00, 0x5F, 0x00, 0x00,// ! |
| ahmedhedait | 0:1b04b9bacf5a | 438 | 0x00, 0x07, 0x00, 0x07, 0x00,// " |
| ahmedhedait | 0:1b04b9bacf5a | 439 | 0x14, 0x7F, 0x14, 0x7F, 0x14,// # |
| ahmedhedait | 0:1b04b9bacf5a | 440 | 0x24, 0x2A, 0x7F, 0x2A, 0x12,// $ |
| ahmedhedait | 0:1b04b9bacf5a | 441 | 0x23, 0x13, 0x08, 0x64, 0x62,// % |
| ahmedhedait | 0:1b04b9bacf5a | 442 | 0x36, 0x49, 0x55, 0x22, 0x50,// & |
| ahmedhedait | 0:1b04b9bacf5a | 443 | 0x00, 0x05, 0x03, 0x00, 0x00,// ' |
| ahmedhedait | 0:1b04b9bacf5a | 444 | 0x00, 0x1C, 0x22, 0x41, 0x00,// ( |
| ahmedhedait | 0:1b04b9bacf5a | 445 | 0x00, 0x41, 0x22, 0x1C, 0x00,// ) |
| ahmedhedait | 0:1b04b9bacf5a | 446 | 0x08, 0x2A, 0x1C, 0x2A, 0x08,// * |
| ahmedhedait | 0:1b04b9bacf5a | 447 | 0x08, 0x08, 0x3E, 0x08, 0x08,// + |
| ahmedhedait | 0:1b04b9bacf5a | 448 | 0x00, 0x50, 0x30, 0x00, 0x00,// , |
| ahmedhedait | 0:1b04b9bacf5a | 449 | 0x08, 0x08, 0x08, 0x08, 0x08,// - |
| ahmedhedait | 0:1b04b9bacf5a | 450 | 0x00, 0x60, 0x60, 0x00, 0x00,// . |
| ahmedhedait | 0:1b04b9bacf5a | 451 | 0x20, 0x10, 0x08, 0x04, 0x02,// / |
| ahmedhedait | 0:1b04b9bacf5a | 452 | 0x3E, 0x51, 0x49, 0x45, 0x3E,// 0 |
| ahmedhedait | 0:1b04b9bacf5a | 453 | 0x00, 0x42, 0x7F, 0x40, 0x00,// 1 |
| ahmedhedait | 0:1b04b9bacf5a | 454 | 0x42, 0x61, 0x51, 0x49, 0x46,// 2 |
| ahmedhedait | 0:1b04b9bacf5a | 455 | 0x21, 0x41, 0x45, 0x4B, 0x31,// 3 |
| ahmedhedait | 0:1b04b9bacf5a | 456 | 0x18, 0x14, 0x12, 0x7F, 0x10,// 4 |
| ahmedhedait | 0:1b04b9bacf5a | 457 | 0x27, 0x45, 0x45, 0x45, 0x39,// 5 |
| ahmedhedait | 0:1b04b9bacf5a | 458 | 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6 |
| ahmedhedait | 0:1b04b9bacf5a | 459 | 0x01, 0x71, 0x09, 0x05, 0x03,// 7 |
| ahmedhedait | 0:1b04b9bacf5a | 460 | 0x36, 0x49, 0x49, 0x49, 0x36,// 8 |
| ahmedhedait | 0:1b04b9bacf5a | 461 | 0x06, 0x49, 0x49, 0x29, 0x1E,// 9 |
| ahmedhedait | 0:1b04b9bacf5a | 462 | 0x00, 0x36, 0x36, 0x00, 0x00,// : |
| ahmedhedait | 0:1b04b9bacf5a | 463 | 0x00, 0x56, 0x36, 0x00, 0x00,// ; |
| ahmedhedait | 0:1b04b9bacf5a | 464 | 0x00, 0x08, 0x14, 0x22, 0x41,// < |
| ahmedhedait | 0:1b04b9bacf5a | 465 | 0x14, 0x14, 0x14, 0x14, 0x14,// = |
| ahmedhedait | 0:1b04b9bacf5a | 466 | 0x41, 0x22, 0x14, 0x08, 0x00,// > |
| ahmedhedait | 0:1b04b9bacf5a | 467 | 0x02, 0x01, 0x51, 0x09, 0x06,// ? |
| ahmedhedait | 0:1b04b9bacf5a | 468 | 0x32, 0x49, 0x79, 0x41, 0x3E,// @ |
| ahmedhedait | 0:1b04b9bacf5a | 469 | 0x7E, 0x11, 0x11, 0x11, 0x7E,// A |
| ahmedhedait | 0:1b04b9bacf5a | 470 | 0x7F, 0x49, 0x49, 0x49, 0x36,// B |
| ahmedhedait | 0:1b04b9bacf5a | 471 | 0x3E, 0x41, 0x41, 0x41, 0x22,// C |
| ahmedhedait | 0:1b04b9bacf5a | 472 | 0x7F, 0x41, 0x41, 0x22, 0x1C,// D |
| ahmedhedait | 0:1b04b9bacf5a | 473 | 0x7F, 0x49, 0x49, 0x49, 0x41,// E |
| ahmedhedait | 0:1b04b9bacf5a | 474 | 0x7F, 0x09, 0x09, 0x01, 0x01,// F |
| ahmedhedait | 0:1b04b9bacf5a | 475 | 0x3E, 0x41, 0x41, 0x51, 0x32,// G |
| ahmedhedait | 0:1b04b9bacf5a | 476 | 0x7F, 0x08, 0x08, 0x08, 0x7F,// H |
| ahmedhedait | 0:1b04b9bacf5a | 477 | 0x00, 0x41, 0x7F, 0x41, 0x00,// I |
| ahmedhedait | 0:1b04b9bacf5a | 478 | 0x20, 0x40, 0x41, 0x3F, 0x01,// J |
| ahmedhedait | 0:1b04b9bacf5a | 479 | 0x7F, 0x08, 0x14, 0x22, 0x41,// K |
| ahmedhedait | 0:1b04b9bacf5a | 480 | 0x7F, 0x40, 0x40, 0x40, 0x40,// L |
| ahmedhedait | 0:1b04b9bacf5a | 481 | 0x7F, 0x02, 0x04, 0x02, 0x7F,// M |
| ahmedhedait | 0:1b04b9bacf5a | 482 | 0x7F, 0x04, 0x08, 0x10, 0x7F,// N |
| ahmedhedait | 0:1b04b9bacf5a | 483 | 0x3E, 0x41, 0x41, 0x41, 0x3E,// O |
| ahmedhedait | 0:1b04b9bacf5a | 484 | 0x7F, 0x09, 0x09, 0x09, 0x06,// P |
| ahmedhedait | 0:1b04b9bacf5a | 485 | 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q |
| ahmedhedait | 0:1b04b9bacf5a | 486 | 0x7F, 0x09, 0x19, 0x29, 0x46,// R |
| ahmedhedait | 0:1b04b9bacf5a | 487 | 0x46, 0x49, 0x49, 0x49, 0x31,// S |
| ahmedhedait | 0:1b04b9bacf5a | 488 | 0x01, 0x01, 0x7F, 0x01, 0x01,// T |
| ahmedhedait | 0:1b04b9bacf5a | 489 | 0x3F, 0x40, 0x40, 0x40, 0x3F,// U |
| ahmedhedait | 0:1b04b9bacf5a | 490 | 0x1F, 0x20, 0x40, 0x20, 0x1F,// V |
| ahmedhedait | 0:1b04b9bacf5a | 491 | 0x7F, 0x20, 0x18, 0x20, 0x7F,// W |
| ahmedhedait | 0:1b04b9bacf5a | 492 | 0x63, 0x14, 0x08, 0x14, 0x63,// X |
| ahmedhedait | 0:1b04b9bacf5a | 493 | 0x03, 0x04, 0x78, 0x04, 0x03,// Y |
| ahmedhedait | 0:1b04b9bacf5a | 494 | 0x61, 0x51, 0x49, 0x45, 0x43,// Z |
| ahmedhedait | 0:1b04b9bacf5a | 495 | 0x00, 0x00, 0x7F, 0x41, 0x41,// [ |
| ahmedhedait | 0:1b04b9bacf5a | 496 | 0x02, 0x04, 0x08, 0x10, 0x20,// "\" |
| ahmedhedait | 0:1b04b9bacf5a | 497 | 0x41, 0x41, 0x7F, 0x00, 0x00,// ] |
| ahmedhedait | 0:1b04b9bacf5a | 498 | 0x04, 0x02, 0x01, 0x02, 0x04,// ^ |
| ahmedhedait | 0:1b04b9bacf5a | 499 | 0x40, 0x40, 0x40, 0x40, 0x40,// _ |
| ahmedhedait | 0:1b04b9bacf5a | 500 | 0x00, 0x01, 0x02, 0x04, 0x00,// ` |
| ahmedhedait | 0:1b04b9bacf5a | 501 | 0x20, 0x54, 0x54, 0x54, 0x78,// a |
| ahmedhedait | 0:1b04b9bacf5a | 502 | 0x7F, 0x48, 0x44, 0x44, 0x38,// b |
| ahmedhedait | 0:1b04b9bacf5a | 503 | 0x38, 0x44, 0x44, 0x44, 0x20,// c |
| ahmedhedait | 0:1b04b9bacf5a | 504 | 0x38, 0x44, 0x44, 0x48, 0x7F,// d |
| ahmedhedait | 0:1b04b9bacf5a | 505 | 0x38, 0x54, 0x54, 0x54, 0x18,// e |
| ahmedhedait | 0:1b04b9bacf5a | 506 | 0x08, 0x7E, 0x09, 0x01, 0x02,// f |
| ahmedhedait | 0:1b04b9bacf5a | 507 | 0x08, 0x14, 0x54, 0x54, 0x3C,// g |
| ahmedhedait | 0:1b04b9bacf5a | 508 | 0x7F, 0x08, 0x04, 0x04, 0x78,// h |
| ahmedhedait | 0:1b04b9bacf5a | 509 | 0x00, 0x44, 0x7D, 0x40, 0x00,// i |
| ahmedhedait | 0:1b04b9bacf5a | 510 | 0x20, 0x40, 0x44, 0x3D, 0x00,// j |
| ahmedhedait | 0:1b04b9bacf5a | 511 | 0x00, 0x7F, 0x10, 0x28, 0x44,// k |
| ahmedhedait | 0:1b04b9bacf5a | 512 | 0x00, 0x41, 0x7F, 0x40, 0x00,// l |
| ahmedhedait | 0:1b04b9bacf5a | 513 | 0x7C, 0x04, 0x18, 0x04, 0x78,// m |
| ahmedhedait | 0:1b04b9bacf5a | 514 | 0x7C, 0x08, 0x04, 0x04, 0x78,// n |
| ahmedhedait | 0:1b04b9bacf5a | 515 | 0x38, 0x44, 0x44, 0x44, 0x38,// o |
| ahmedhedait | 0:1b04b9bacf5a | 516 | 0x7C, 0x14, 0x14, 0x14, 0x08,// p |
| ahmedhedait | 0:1b04b9bacf5a | 517 | 0x08, 0x14, 0x14, 0x18, 0x7C,// q |
| ahmedhedait | 0:1b04b9bacf5a | 518 | 0x7C, 0x08, 0x04, 0x04, 0x08,// r |
| ahmedhedait | 0:1b04b9bacf5a | 519 | 0x48, 0x54, 0x54, 0x54, 0x20,// s |
| ahmedhedait | 0:1b04b9bacf5a | 520 | 0x04, 0x3F, 0x44, 0x40, 0x20,// t |
| ahmedhedait | 0:1b04b9bacf5a | 521 | 0x3C, 0x40, 0x40, 0x20, 0x7C,// u |
| ahmedhedait | 0:1b04b9bacf5a | 522 | 0x1C, 0x20, 0x40, 0x20, 0x1C,// v |
| ahmedhedait | 0:1b04b9bacf5a | 523 | 0x3C, 0x40, 0x30, 0x40, 0x3C,// w |
| ahmedhedait | 0:1b04b9bacf5a | 524 | 0x44, 0x28, 0x10, 0x28, 0x44,// x |
| ahmedhedait | 0:1b04b9bacf5a | 525 | 0x0C, 0x50, 0x50, 0x50, 0x3C,// y |
| ahmedhedait | 0:1b04b9bacf5a | 526 | 0x44, 0x64, 0x54, 0x4C, 0x44,// z |
| ahmedhedait | 0:1b04b9bacf5a | 527 | 0x00, 0x08, 0x36, 0x41, 0x00,// { |
| ahmedhedait | 0:1b04b9bacf5a | 528 | 0x00, 0x00, 0x7F, 0x00, 0x00,// | |
| ahmedhedait | 0:1b04b9bacf5a | 529 | 0x00, 0x41, 0x36, 0x08, 0x00,// } |
| ahmedhedait | 0:1b04b9bacf5a | 530 | 0x08, 0x08, 0x2A, 0x1C, 0x08,// -> |
| ahmedhedait | 0:1b04b9bacf5a | 531 | 0x08, 0x1C, 0x2A, 0x08, 0x08 // <- |
| ahmedhedait | 0:1b04b9bacf5a | 532 | }; |
| ahmedhedait | 0:1b04b9bacf5a | 533 | |
| ahmedhedait | 0:1b04b9bacf5a | 534 | #endif |