Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed flakiness by adding missing delay() after clearing display, the…

…n fixed sluggishness - not terrible anymore
  • Loading branch information...
commit efc28622fe6432335527c6187c3c81efe1f8cbae 1 parent ec5cfe6
Limor "Ladyada" Fried ladyada authored
305 Adafruit_GP9002.cpp
@@ -2,14 +2,10 @@
2 2 #include <util/delay.h>
3 3 #include <stdlib.h>
4 4
  5 +#include "Adafruit_GFX.h"
5 6 #include "Adafruit_GP9002.h"
6 7 #include "glcdfont.c"
7 8
8   -static uint8_t is_reversed = 0;
9   -
10   -// a 5x7 font table
11   -extern uint8_t PROGMEM font[];
12   -
13 9 Adafruit_GP9002::Adafruit_GP9002(int8_t SCLK, int8_t MISO, int8_t MOSI,
14 10 int8_t CS, int8_t DC) {
15 11 _sclk = SCLK;
@@ -18,67 +14,85 @@ Adafruit_GP9002::Adafruit_GP9002(int8_t SCLK, int8_t MISO, int8_t MOSI,
18 14 _cs = CS;
19 15 _dc = DC;
20 16
21   - WIDTH = 128;
22   - HEIGHT = 64;
  17 + constructor(128, 64);
23 18 }
24 19
  20 +void Adafruit_GP9002::begin(void) {
  21 + // set pin directions
  22 + pinMode(_mosi, OUTPUT);
  23 + pinMode(_miso, INPUT);
  24 + pinMode(_sclk, OUTPUT);
  25 + pinMode(_dc, OUTPUT);
  26 + pinMode(_cs, OUTPUT);
25 27
26   -void Adafruit_GP9002::drawString(uint8_t x, uint8_t line, char *c) {
27   - while (c[0] != 0) {
28   - drawChar(x, line, c[0]);
29   - c++;
30   - x += 6; // 6 pixels wide
31   - if (x + 6 >= this->WIDTH) {
32   - x = 0; // ran out of this line
33   - line++;
34   - }
35   - if (line >= (this->HEIGHT/8))
36   - return; // ran out of space :(
37   - }
  28 + clkport = portOutputRegister(digitalPinToPort(_sclk));
  29 + clkpinmask = digitalPinToBitMask(_sclk);
  30 + mosiport = portOutputRegister(digitalPinToPort(_mosi));
  31 + mosipinmask = digitalPinToBitMask(_mosi);
  32 + csport = portOutputRegister(digitalPinToPort(_cs));
  33 + cspinmask = digitalPinToBitMask(_cs);
  34 + dcport = portOutputRegister(digitalPinToPort(_dc));
  35 + dcpinmask = digitalPinToBitMask(_dc);
  36 + misopin = portInputRegister(digitalPinToPort(_miso));
  37 + misopinmask = digitalPinToBitMask(_miso);
38 38
39   -}
  39 + command(GP9002_DISPLAY);
  40 + dataWrite(GP9002_DISPLAY_MONOCHROME);
  41 + command(GP9002_LOWERADDR1);
  42 + dataWrite(0x0);
  43 + command(GP9002_HIGHERADDR1);
  44 + dataWrite(0x0);
  45 + command(GP9002_LOWERADDR2);
  46 + dataWrite(0x0);
  47 + command(GP9002_HIGHERADDR2);
  48 + dataWrite(0x4);
  49 + command(GP9002_OR);
  50 + command(GP9002_CLEARSCREEN);
  51 + command(GP9002_DISPLAY1ON);
40 52
41   -void Adafruit_GP9002::drawChar(uint8_t x, uint8_t line, uint8_t c) {
42   - if ((line >= this->HEIGHT/8) || (x >= (this->WIDTH - 6)))
43   - return;
44   - for (uint8_t i =0; i<5; i++ ) {
45   - //buffer[x + (line*128) ] = pgm_read_byte(font+(c*5)+i);
46   - x++;
47   - }
  53 + // hold the address so we can read and then write
  54 + command(GP9002_ADDRHELD);
48 55 }
49 56
50 57
  58 +
51 59 // updated high speed drawing!
52   -void Adafruit_GP9002::drawFastVLine(uint8_t x, uint8_t orig_y, uint8_t h, uint8_t color) {
53   -
54   - while (orig_y % 8) {
  60 +void Adafruit_GP9002::drawFastVLine(uint16_t x, uint16_t orig_y, uint16_t h, uint16_t color) {
  61 +
  62 + while (h && (orig_y % 8)) {
55 63 drawPixel(x, orig_y, color);
56 64 orig_y++;
57 65 h--;
58 66 }
59   -
60   - // calculate addr
61   - uint16_t addr = 0;
62   - addr = x*8;
63   - addr += orig_y/8;
64   -
65   - command(GP9002_ADDRINCR);
66   - command(GP9002_ADDRL);
67   - data(addr & 0xFF);
68   - command(GP9002_ADDRH);
69   - data(addr >> 8);
70   - command(GP9002_DATAWRITE);
71   - while (h >= 8) {
72   - // draw 8 pixels at once!
73   - if (color)
74   - data(0xFF);
75   - else
76   - data(0x00);
77   - h -= 8;
78   - orig_y += 8;
79   - }
80   - command(GP9002_ADDRHELD);
81 67
  68 + if (h >= 8) {
  69 + // calculate addr
  70 + uint16_t addr = 0;
  71 + addr = x*8;
  72 + addr += orig_y/8;
  73 +
  74 + command(GP9002_ADDRINCR);
  75 + command(GP9002_ADDRL);
  76 + dataWrite(addr & 0xFF);
  77 + command(GP9002_ADDRH);
  78 + dataWrite(addr >> 8);
  79 + command(GP9002_DATAWRITE);
  80 +
  81 + *dcport &= ~dcpinmask;
  82 + *csport &= ~cspinmask;
  83 + while (h >= 8) {
  84 + // draw 8 pixels at once!
  85 + if (color)
  86 + fastSPIwrite(0xFF);
  87 + else
  88 + fastSPIwrite(0);
  89 + h -= 8;
  90 + orig_y += 8;
  91 + }
  92 + *csport |= cspinmask;
  93 + command(GP9002_ADDRHELD);
  94 + }
  95 +
82 96 while (h) {
83 97 drawPixel(x, orig_y, color);
84 98 orig_y++;
@@ -86,14 +100,9 @@ void Adafruit_GP9002::drawFastVLine(uint8_t x, uint8_t orig_y, uint8_t h, uint8_
86 100 }
87 101 }
88 102
89   -
90   -
91   -
92   -
93   -
94 103 // the most basic function, set a single pixel
95   -void Adafruit_GP9002::drawPixel(uint8_t x, uint8_t y, uint8_t color) {
96   - if ((x >= this->WIDTH) || (y >= this->HEIGHT))
  104 +void Adafruit_GP9002::drawPixel(uint16_t x, uint16_t y, uint16_t color) {
  105 + if ((x >= width()) || (y >= height()))
97 106 return;
98 107
99 108 uint8_t p;
@@ -101,120 +110,130 @@ void Adafruit_GP9002::drawPixel(uint8_t x, uint8_t y, uint8_t color) {
101 110 // calculate addr
102 111 uint16_t addr = 0;
103 112 addr = x*8;
  113 + y = 63 - y;
104 114 addr += y/8;
105 115
106   - // hold the address so we can read and then write
107   - command(GP9002_ADDRHELD);
108   -
109 116 command(GP9002_ADDRL);
110   - data(addr & 0xFF);
  117 + dataWrite(addr & 0xFF);
111 118 command(GP9002_ADDRH);
112   - data(addr >> 8);
113   -
  119 + dataWrite(addr >> 8);
114 120 command(GP9002_DATAREAD);
115   - data(0x0);
116   - p = data(0x0);
117   -
118   - p |= (1 << (7-(y % 8)));
  121 + dataRead();
  122 + p = dataRead();
  123 +
  124 + if (color)
  125 + p |= (1 << (7-(y % 8)));
  126 + else
  127 + p &= ~(1 << (7-(y % 8)));
119 128 command(GP9002_DATAWRITE);
120   - data(p);
  129 + dataWrite(p);
121 130 }
122 131
123 132
124   -void Adafruit_GP9002::begin(void) {
125   - // set pin directions
126   - pinMode(_mosi, OUTPUT);
127   - pinMode(_miso, INPUT);
128   - pinMode(_sclk, OUTPUT);
129   - pinMode(_dc, OUTPUT);
130   - pinMode(_cs, OUTPUT);
131 133
132   - command(GP9002_DISPLAY);
133   - data(GP9002_DISPLAY_MONOCHROME);
134   - command(GP9002_OR);
135   - command(GP9002_CLEARSCREEN);
136   - command(GP9002_DISPLAY1ON);
137   -}
138   -
139   -
140   -void Adafruit_GP9002::invert(uint8_t i) {
141   - // command(GP9002_XOR);
142   -}
143   -
144   -uint8_t Adafruit_GP9002::spiTransfer(uint8_t d, uint8_t datacommand) {
145   - uint8_t reply = 0;
  134 +void Adafruit_GP9002::invert(boolean i) {
  135 + // This is kinda clumsy but it does work
  136 + // fill the opposite screen with all on pixels so we can invert!
  137 + uint16_t addr = 0x400;
146 138
147   - volatile uint8_t *sclkportreg, *mosiportreg, *misoportreg;
148   - uint8_t sclkpin, mosipin, misopin;
  139 + command(GP9002_ADDRINCR);
  140 + command(GP9002_ADDRL);
  141 + dataWrite(addr & 0xFF);
  142 + command(GP9002_ADDRH);
  143 + dataWrite(addr >> 8);
  144 + command(GP9002_DATAWRITE);
149 145
150   - digitalWrite(_dc, datacommand);
151   - digitalWrite(_cs, LOW);
  146 + if (i) {
  147 + while (addr < 0x0800) {
  148 + dataWrite(0xFF);
  149 + addr++;
  150 + }
  151 + command(GP9002_XOR);
  152 + } else {
  153 + while (addr < 0x0800) {
  154 + dataWrite(0x00);
  155 + addr++;
  156 + }
  157 + command(GP9002_OR);
  158 + }
  159 + command(GP9002_ADDRHELD);
152 160
153   - sclkportreg = portOutputRegister(digitalPinToPort(_sclk));
154   - sclkpin = digitalPinToBitMask(_sclk);
155   - mosiportreg = portOutputRegister(digitalPinToPort(_mosi));
156   - mosipin = digitalPinToBitMask(_mosi);
157   - misoportreg = portInputRegister(digitalPinToPort(_miso));
158   - misopin = digitalPinToBitMask(_miso);
  161 +}
159 162
  163 +void Adafruit_GP9002::slowSPIwrite(uint8_t d) {
160 164 for (uint8_t i=0; i<8; i++) {
161   - //digitalWrite(_sclk, LOW);
162   - *sclkportreg &= ~sclkpin;
  165 + digitalWrite(_sclk, LOW);
163 166 if (d & _BV(i)) {
164   - //digitalWrite(_mosi, HIGH);
165   - *mosiportreg |= mosipin;
  167 + digitalWrite(_mosi, HIGH);
166 168 } else {
167   - //digitalWrite(_mosi, LOW);
168   - *mosiportreg &= ~mosipin;
  169 + digitalWrite(_mosi, LOW);
169 170 }
170   - //delayMicroseconds(10);
171   - //digitalWrite(_sclk, HIGH);
172   - *sclkportreg |= sclkpin;
  171 + digitalWrite(_sclk, HIGH);
  172 + }
  173 +}
173 174
  175 +inline void Adafruit_GP9002::fastSPIwrite(uint8_t d) {
  176 + for(uint8_t bit = 0x1; bit != 0x00; bit <<= 1) {
  177 + *clkport &= ~clkpinmask;
  178 + if(d & bit) *mosiport |= mosipinmask;
  179 + else *mosiport &= ~mosipinmask;
  180 + *clkport |= clkpinmask;
  181 + }
  182 +}
  183 +
  184 +uint8_t Adafruit_GP9002::slowSPIread(void) {
  185 + uint8_t reply = 0;
  186 + for (uint8_t i=0; i<8; i++) {
  187 + digitalWrite(_sclk, LOW);
  188 +
  189 + digitalWrite(_sclk, HIGH);
174 190 if (digitalRead(_miso))
175   - //if ((*misoportreg) & misopin)
176 191 reply |= _BV(i);
177   - delayMicroseconds(5);
178 192 }
179   - digitalWrite(_cs, HIGH);
180   -
181   - return reply;
  193 + return reply;
182 194 }
183 195
  196 +inline uint8_t Adafruit_GP9002::fastSPIread(void) {
  197 + uint8_t reply = 0;
  198 + for (uint8_t i=0; i<8; i++) {
  199 + *clkport &= ~clkpinmask;
  200 +
  201 + *clkport |= clkpinmask;
  202 + if ((*misopin) & misopinmask)
  203 + reply |= _BV(i);
  204 + }
  205 + return reply;
  206 +}
184 207
185 208 void Adafruit_GP9002::command(uint8_t d) {
186   - volatile uint8_t *sclkportreg, *mosiportreg;
187   - uint8_t sclkpin, mosipin;
  209 + *dcport |= dcpinmask;
  210 + *csport &= ~cspinmask;
  211 + fastSPIwrite(d);
  212 + *csport |= cspinmask;
  213 + delayMicroseconds(1); // should be 400ns actually
  214 +}
188 215
189   - digitalWrite(_dc, HIGH);
190   - digitalWrite(_cs, LOW);
  216 +inline void Adafruit_GP9002::dataWrite(uint8_t d) {
  217 + *dcport &= ~dcpinmask;
  218 + *csport &= ~cspinmask;
191 219
192   - /*
193   - sclkportreg = portOutputRegister(digitalPinToPort(_sclk));
194   - sclkpin = digitalPinToBitMask(_sclk);
195   -
196   - mosiportreg = portOutputRegister(digitalPinToPort(_mosi));
197   - mosipin = digitalPinToBitMask(_mosi);
198   - */
199   - for (uint8_t i=0; i<8; i++) {
  220 + fastSPIwrite(d);
200 221
201   - digitalWrite(_sclk, LOW);
202   - //*sclkportreg &= ~sclkpin;
203   - if (d & _BV(i)) {
204   - digitalWrite(_mosi, HIGH);
205   - //*mosiportreg |= mosipin;
206   - } else {
207   - digitalWrite(_mosi, LOW);
208   - //*mosiportreg &= ~mosipin;
209   - }
210   - digitalWrite(_sclk, HIGH);
211   - //*sclkportreg |= sclkpin;
212   - }
213   - digitalWrite(_cs, HIGH);
  222 + *csport |= cspinmask;
  223 + delayMicroseconds(1); // should be 600ns actually
214 224 }
  225 +inline uint8_t Adafruit_GP9002::dataRead() {
  226 + uint8_t r;
  227 +
  228 + *dcport &= ~dcpinmask;
  229 + *csport &= ~cspinmask;
215 230
216   -uint8_t Adafruit_GP9002::data(uint8_t d) {
217   - return spiTransfer(d, LOW);
  231 + r = fastSPIread();
  232 +
  233 + *csport |= cspinmask;
  234 + delayMicroseconds(1);
  235 +
  236 + return r;
218 237 }
219 238
220 239 void Adafruit_GP9002::setBrightness(uint8_t val) {
@@ -224,6 +243,8 @@ void Adafruit_GP9002::setBrightness(uint8_t val) {
224 243 // clear everything
225 244 void Adafruit_GP9002::clearDisplay(void) {
226 245 command(GP9002_CLEARSCREEN);
  246 +
  247 + delay(1);
227 248 }
228 249
229 250 void Adafruit_GP9002::displayOff(void) {
26 Adafruit_GP9002.h
@@ -7,7 +7,7 @@
7 7 #include "WProgram.h"
8 8 #endif
9 9
10   -#include "Adafruit_MonoGfx.h"
  10 +#include "Adafruit_GFX.h"
11 11
12 12 #define BLACK 0
13 13 #define WHITE 1
@@ -24,7 +24,7 @@
24 24 #define GP9002_LOWERADDR1 0x0A
25 25 #define GP9002_HIGHERADDR1 0x0B
26 26 #define GP9002_LOWERADDR2 0x0C
27   -#define GP9002_HIGHERADDR1 0x1D
  27 +#define GP9002_HIGHERADDR2 0x0D
28 28 #define GP9002_ADDRL 0x0E
29 29 #define GP9002_ADDRH 0x0F
30 30 #define GP9002_OR 0x10
@@ -41,16 +41,21 @@
41 41 #define GP9002_CHARBRIGHT 0x24
42 42
43 43
44   -class Adafruit_GP9002 : public Adafruit_MonoGfx {
  44 +class Adafruit_GP9002 : public Adafruit_GFX {
45 45 public:
46 46 Adafruit_GP9002(int8_t SCLK, int8_t MISO, int8_t MOSI,
47 47 int8_t CS, int8_t DC);
48 48
49 49 // particular to this display
50 50 void begin(void);
51   - uint8_t spiTransfer(uint8_t d, uint8_t datacommand);
  51 + uint8_t slowSPIread();
  52 + uint8_t fastSPIread();
  53 + void slowSPIwrite(uint8_t);
  54 + void fastSPIwrite(uint8_t);
  55 +
52 56 void command(uint8_t c);
53   - uint8_t data(uint8_t c);
  57 + void dataWrite(uint8_t c);
  58 + uint8_t dataRead(void);
54 59 void setBrightness(uint8_t val);
55 60 void invert(uint8_t i);
56 61
@@ -58,14 +63,15 @@ class Adafruit_GP9002 : public Adafruit_MonoGfx {
58 63 void displayOff();
59 64 void clearDisplay(void);
60 65
61   - void drawPixel(uint8_t x, uint8_t y, uint8_t color);
62   - void drawFastVLine(uint8_t x, uint8_t y, uint8_t h, uint8_t color);
63   -
64   - void drawChar(uint8_t x, uint8_t line, uint8_t c);
65   - void drawString(uint8_t x, uint8_t line, char *c);
  66 + void drawPixel(uint16_t x, uint16_t y, uint16_t color);
  67 + void drawFastVLine(uint16_t x, uint16_t y, uint16_t h, uint16_t color);
66 68
67 69 private:
68 70 int8_t _miso, _mosi, _sclk, _dc, _cs;
  71 +
  72 + volatile uint8_t *mosiport, *misopin, *clkport, *csport, *dcport;
  73 + uint8_t mosipinmask, misopinmask, clkpinmask, cspinmask, dcpinmask;
  74 +
69 75 void spiwrite(uint8_t c);
70 76 };
71 77
148 Adafruit_MonoGfx.cpp
... ... @@ -1,148 +0,0 @@
1   -#include "Adafruit_MonoGfx.h"
2   -
3   -// draw a circle outline
4   -void Adafruit_MonoGfx::drawCircle(uint8_t x0, uint8_t y0, uint8_t r,
5   - uint8_t color) {
6   - int8_t f = 1 - r;
7   - int8_t ddF_x = 1;
8   - int8_t ddF_y = -2 * r;
9   - int8_t x = 0;
10   - int8_t y = r;
11   -
12   - drawPixel(x0, y0+r, color);
13   - drawPixel(x0, y0-r, color);
14   - drawPixel(x0+r, y0, color);
15   - drawPixel(x0-r, y0, color);
16   -
17   - while (x<y) {
18   - if (f >= 0) {
19   - y--;
20   - ddF_y += 2;
21   - f += ddF_y;
22   - }
23   - x++;
24   - ddF_x += 2;
25   - f += ddF_x;
26   -
27   - drawPixel(x0 + x, y0 + y, color);
28   - drawPixel(x0 - x, y0 + y, color);
29   - drawPixel(x0 + x, y0 - y, color);
30   - drawPixel(x0 - x, y0 - y, color);
31   -
32   - drawPixel(x0 + y, y0 + x, color);
33   - drawPixel(x0 - y, y0 + x, color);
34   - drawPixel(x0 + y, y0 - x, color);
35   - drawPixel(x0 - y, y0 - x, color);
36   -
37   - }
38   -}
39   -
40   -void Adafruit_MonoGfx::fillCircle(uint8_t x0, uint8_t y0, uint8_t r,
41   - uint8_t color) {
42   - int8_t f = 1 - r;
43   - int8_t ddF_x = 1;
44   - int8_t ddF_y = -2 * r;
45   - int8_t x = 0;
46   - int8_t y = r;
47   -
48   - drawFastVLine(x0, y0-r, r*2+1, color);
49   -
50   - while (x<y) {
51   - if (f >= 0) {
52   - y--;
53   - ddF_y += 2;
54   - f += ddF_y;
55   - }
56   - x++;
57   - ddF_x += 2;
58   - f += ddF_x;
59   -
60   - drawFastVLine(x0+x, y0-y, y*2+1, color);
61   - drawFastVLine(x0-x, y0-y, y*2+1, color);
62   -
63   - drawFastVLine(x0+y, y0-x, x*2+1, color);
64   - drawFastVLine(x0-y, y0-x, x*2+1, color);
65   - }
66   -}
67   -
68   -// bresenham's algorithm - thx wikpedia
69   -void Adafruit_MonoGfx::drawLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
70   - uint8_t color) {
71   - uint8_t steep = abs(y1 - y0) > abs(x1 - x0);
72   - if (steep) {
73   - swap(x0, y0);
74   - swap(x1, y1);
75   - }
76   -
77   - if (x0 > x1) {
78   - swap(x0, x1);
79   - swap(y0, y1);
80   - }
81   -
82   - uint8_t dx, dy;
83   - dx = x1 - x0;
84   - dy = abs(y1 - y0);
85   -
86   - int8_t err = dx / 2;
87   - int8_t ystep;
88   -
89   - if (y0 < y1) {
90   - ystep = 1;
91   - } else {
92   - ystep = -1;}
93   -
94   - for (; x0<x1; x0++) {
95   - if (steep) {
96   - drawPixel(y0, x0, color);
97   - } else {
98   - drawPixel(x0, y0, color);
99   - }
100   - err -= dy;
101   - if (err < 0) {
102   - y0 += ystep;
103   - err += dx;
104   - }
105   - }
106   -}
107   -
108   -
109   -// draw a rectangle
110   -void Adafruit_MonoGfx::drawRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h,
111   - uint8_t color) {
112   - // very stupid version, but works!
113   - for (uint8_t i=x; i<x+w; i++) {
114   - drawPixel(i, y, color);
115   - drawPixel(i, y+h-1, color);
116   - }
117   - for (uint8_t i=y; i<y+h; i++) {
118   - drawPixel(x, i, color);
119   - drawPixel(x+w-1, i, color);
120   - }
121   -}
122   -
123   -void Adafruit_MonoGfx::drawFastVLine(uint8_t x, uint8_t y, uint8_t h, uint8_t color) {
124   - // stupidest version
125   - for (uint8_t j=y; j<y+h; j++) {
126   - drawPixel(x, j, color);
127   - }
128   -}
129   -
130   -void Adafruit_MonoGfx::fillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h,
131   - uint8_t color) {
132   - // stupidest version
133   - for (uint8_t i=x; i<x+w; i++) {
134   - drawFastVLine(i, y, h, color);
135   - }
136   -}
137   -
138   -void Adafruit_MonoGfx::drawBitmap(uint8_t x, uint8_t y,
139   - const uint8_t *bitmap, uint8_t w, uint8_t h,
140   - uint8_t color) {
141   - for (uint8_t j=0; j<h; j++) {
142   - for (uint8_t i=0; i<w; i++ ) {
143   - if (pgm_read_byte(bitmap + i + (j/8)*w) & _BV(j%8)) {
144   - drawPixel(x+i, y+j, color);
145   - }
146   - }
147   - }
148   -}
46 Adafruit_MonoGfx.h
... ... @@ -1,46 +0,0 @@
1   -#ifndef _ADAFRUIT_MONOGFX_H
2   -#define _ADAFRUIT_MONOGFX_H
3   -
4   -#if ARDUINO >= 100
5   - #include "Arduino.h"
6   -#else
7   - #include "WProgram.h"
8   -#endif
9   -
10   -#define swap(a, b) { uint8_t t = a; a = b; b = t; }
11   -
12   -class Adafruit_MonoGfx {
13   - public:
14   - // this must be defined by the subclass
15   - virtual void drawPixel(uint8_t x, uint8_t y, uint8_t color);
16   -
17   - // these are 'generic' drawing functions, so we can share them!
18   - void drawLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
19   - uint8_t color);
20   - virtual void drawFastVLine(uint8_t x, uint8_t y, uint8_t h, uint8_t color);
21   - void drawRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h,
22   - uint8_t color);
23   - void fillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h,
24   - uint8_t color);
25   -
26   - void drawCircle(uint8_t x0, uint8_t y0, uint8_t r,
27   - uint8_t color);
28   - void fillCircle(uint8_t x0, uint8_t y0, uint8_t r,
29   - uint8_t color);
30   -
31   - void drawBitmap(uint8_t x, uint8_t y,
32   - const uint8_t *bitmap, uint8_t w, uint8_t h,
33   - uint8_t color);
34   -
35   -
36   - // return the size of the display
37   - uint8_t width() { return WIDTH; }
38   - uint8_t height() { return HEIGHT; }
39   -
40   - protected:
41   - uint8_t WIDTH, HEIGHT;
42   -
43   -
44   -};
45   -
46   -#endif
265 examples/GraphicVFDtest/GraphicVFDtest.pde
... ... @@ -0,0 +1,265 @@
  1 +#include "Adafruit_GFX.h"
  2 +#include "Adafruit_GP9002.h"
  3 +
  4 +#define _MISO 2 // #8
  5 +#define _CLK 3 // #11
  6 +#define _MOSI 4 // #12
  7 +#define _DC 6 // #14
  8 +#define _CS 5 // #13
  9 +
  10 +
  11 +Adafruit_GP9002 display = Adafruit_GP9002(_CLK, _MISO, _MOSI, _CS, _DC);
  12 +
  13 +// connect #15, #16, #17 to 5V
  14 +// connect #9 #18 #19 #20 to ground
  15 +
  16 +#define NUMFLAKES 10
  17 +#define XPOS 0
  18 +#define YPOS 1
  19 +#define DELTAY 2
  20 +
  21 +
  22 +#define LOGO16_GLCD_HEIGHT 16
  23 +#define LOGO16_GLCD_WIDTH 16
  24 +static unsigned char __attribute__ ((progmem)) logo16_glcd_bmp[]={
  25 +0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0xf8, 0xbe, 0x9f, 0xff, 0xf8, 0xc0, 0xc0, 0xc0, 0x80, 0x00,
  26 +0x20, 0x3c, 0x3f, 0x3f, 0x1f, 0x19, 0x1f, 0x7b, 0xfb, 0xfe, 0xfe, 0x07, 0x07, 0x07, 0x03, 0x00, };
  27 +
  28 +
  29 +void setup() {
  30 + Serial.begin(9600);
  31 +
  32 + display.begin();
  33 + // init done
  34 +
  35 + delay(2000);
  36 + display.clearDisplay(); // clears the screen and buffer
  37 +
  38 + // draw a single pixel
  39 + display.drawPixel(10, 10, WHITE);
  40 + delay(2000);
  41 + display.clearDisplay();
  42 +
  43 + // draw many lines
  44 + testdrawline();
  45 + delay(2000);
  46 + display.clearDisplay();
  47 +
  48 + // draw rectangles
  49 + testdrawrect();
  50 + delay(2000);
  51 + display.clearDisplay();
  52 +
  53 + // draw multiple rectangles
  54 + testfillrect();
  55 + delay(2000);
  56 + display.clearDisplay();
  57 +
  58 + // draw mulitple circles
  59 + testdrawcircle();
  60 + delay(2000);
  61 + display.clearDisplay();
  62 +
  63 + // draw a circle, 10 pixel radius
  64 + display.fillCircle(display.width()/2, display.height()/2, 10, WHITE);
  65 + delay(2000);
  66 + display.clearDisplay();
  67 +
  68 + testdrawroundrect();
  69 + delay(2000);
  70 + display.clearDisplay();
  71 +
  72 + testfillroundrect();
  73 + delay(2000);
  74 + display.clearDisplay();
  75 +
  76 + testdrawtriangle();
  77 + delay(2000);
  78 + display.clearDisplay();
  79 +
  80 + testfilltriangle();
  81 + delay(2000);
  82 + display.clearDisplay();
  83 +
  84 + // draw the first ~12 characters in the font
  85 + testdrawchar();
  86 + delay(2000);
  87 + display.clearDisplay();
  88 +
  89 + // text display tests
  90 + display.setTextSize(1);
  91 + display.setTextColor(WHITE);
  92 + display.setCursor(0,0);
  93 + display.println("Hello, world!");
  94 + display.setTextColor(BLACK, WHITE); // 'inverted' text
  95 + display.println(3.141592);
  96 + display.setTextSize(2);
  97 + display.setTextColor(WHITE);
  98 + display.print("0x"); display.println(0xDEADBEEF, HEX);
  99 + delay(2000);
  100 +
  101 + // miniature bitmap display
  102 + display.clearDisplay();
  103 + display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);
  104 +
  105 + // invert the display
  106 + display.invertDisplay(true);
  107 + delay(1000);
  108 + display.invertDisplay(false);
  109 + delay(1000);
  110 +
  111 + // draw a bitmap icon and 'animate' movement
  112 + testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);
  113 +}
  114 +
  115 +
  116 +void loop() {
  117 +
  118 +}
  119 +
  120 +
  121 +void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {
  122 + uint8_t icons[NUMFLAKES][3];
  123 + srandom(666); // whatever seed
  124 +
  125 + // initialize
  126 + for (uint8_t f=0; f< NUMFLAKES; f++) {
  127 + icons[f][XPOS] = random() % display.width();
  128 + icons[f][YPOS] = 0;
  129 + icons[f][DELTAY] = random() % 5 + 1;
  130 +
  131 + Serial.print("x: ");
  132 + Serial.print(icons[f][XPOS], DEC);
  133 + Serial.print(" y: ");
  134 + Serial.print(icons[f][YPOS], DEC);
  135 + Serial.print(" dy: ");
  136 + Serial.println(icons[f][DELTAY], DEC);
  137 + }
  138 +
  139 + while (1) {
  140 + // draw each icon
  141 + for (uint8_t f=0; f< NUMFLAKES; f++) {
  142 + display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);
  143 + }
  144 + delay(200);
  145 +
  146 + // then erase it + move it
  147 + for (uint8_t f=0; f< NUMFLAKES; f++) {
  148 + display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);
  149 + // move it
  150 + icons[f][YPOS] += icons[f][DELTAY];
  151 + // if its gone, reinit
  152 + if (icons[f][YPOS] > display.height()) {
  153 + icons[f][XPOS] = random() % display.width();
  154 + icons[f][YPOS] = 0;
  155 + icons[f][DELTAY] = random() % 5 + 1;
  156 + }
  157 + }
  158 + }
  159 +}
  160 +
  161 +
  162 +void testdrawchar(void) {
  163 + display.setTextSize(1);
  164 + display.setTextColor(WHITE);
  165 + display.setCursor(0,0);
  166 +
  167 + for (uint8_t i=0; i < 168; i++) {
  168 + if (i == '\n') continue;
  169 + display.write(i);
  170 + //if ((i > 0) && (i % 14 == 0))
  171 + //display.println();
  172 + }
  173 +}
  174 +
  175 +void testdrawcircle(void) {
  176 + for (uint8_t i=0; i<display.height(); i+=2) {
  177 + display.drawCircle(display.width()/2, display.height()/2, i, WHITE);
  178 + }
  179 +}
  180 +
  181 +void testfillrect(void) {
  182 + uint8_t color = 1;
  183 + for (uint8_t i=0; i<display.height()/2; i+=3) {
  184 + // alternate colors
  185 + display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);
  186 + color++;
  187 + }
  188 +}
  189 +
  190 +void testdrawtriangle(void) {
  191 + for (uint16_t i=0; i<min(display.width(),display.height())/2; i+=5) {
  192 + display.drawTriangle(display.width()/2, display.height()/2-i,
  193 + display.width()/2-i, display.height()/2+i,
  194 + display.width()/2+i, display.height()/2+i, WHITE);
  195 + }
  196 +}
  197 +
  198 +void testfilltriangle(void) {
  199 + uint8_t color = WHITE;
  200 + for (int16_t i=min(display.width(),display.height())/2; i>0; i-=5) {
  201 + display.fillTriangle(display.width()/2, display.height()/2-i,
  202 + display.width()/2-i, display.height()/2+i,
  203 + display.width()/2+i, display.height()/2+i, color);
  204 + if (color == BLACK) color = WHITE;
  205 + else color = BLACK;
  206 + }
  207 +}
  208 +
  209 +void testdrawroundrect(void) {
  210 + for (uint8_t i=0; i<display.height()/2-2; i+=2) {
  211 + display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, WHITE);
  212 + }
  213 +}
  214 +
  215 +void testfillroundrect(void) {
  216 + uint8_t color = WHITE;
  217 + for (uint8_t i=0; i<display.height()/2-2; i+=2) {
  218 + display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, color);
  219 + if (color == BLACK) color = WHITE;
  220 + else color = BLACK;
  221 + }
  222 +}
  223 +
  224 +void testdrawrect(void) {
  225 + for (uint8_t i=0; i<display.height()/2; i+=2) {
  226 + display.drawRect(i, i, display.width()-2*i, display.height()-2*i, WHITE);
  227 + }
  228 +}
  229 +
  230 +void testdrawline() {
  231 + for (uint8_t i=0; i<display.width(); i+=4) {
  232 + display.drawLine(0, 0, i, display.height()-1, WHITE);
  233 + }
  234 + for (uint8_t i=0; i<display.height(); i+=4) {
  235 + display.drawLine(0, 0, display.width()-1, i, WHITE);
  236 + }
  237 + delay(250);
  238 +
  239 + display.clearDisplay();
  240 + for (uint8_t i=0; i<display.width(); i+=4) {
  241 + display.drawLine(0, display.height()-1, i, 0, WHITE);
  242 + }
  243 + for (int8_t i=display.height()-1; i>=0; i-=4) {
  244 + display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);
  245 + }
  246 + delay(250);
  247 +
  248 + display.clearDisplay();
  249 + for (int8_t i=display.width()-1; i>=0; i-=4) {
  250 + display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);
  251 + }
  252 + for (int8_t i=display.height()-1; i>=0; i-=4) {
  253 + display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);
  254 + }
  255 + delay(250);
  256 +
  257 + display.clearDisplay();
  258 + for (uint8_t i=0; i<display.height(); i+=4) {
  259 + display.drawLine(display.width()-1, 0, 0, i, WHITE);
  260 + }
  261 + for (uint8_t i=0; i<display.width(); i+=4) {
  262 + display.drawLine(display.width()-1, 0, i, display.height()-1, WHITE);
  263 + }
  264 + delay(250);
  265 +}
266 glcdfont.c
... ... @@ -1,266 +0,0 @@
1   -#include <avr/io.h>
2   -#include <avr/pgmspace.h>
3   -
4   -#ifndef FONT5X7_H
5   -#define FONT5X7_H
6   -
7   -// standard ascii 5x7 font
8   -
9   -static unsigned char font[] PROGMEM = {
10   - 0x00, 0x00, 0x00, 0x00, 0x00,
11   - 0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
12   - 0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
13   - 0x1C, 0x3E, 0x7C, 0x3E, 0x1C,
14   - 0x18, 0x3C, 0x7E, 0x3C, 0x18,
15   - 0x1C, 0x57, 0x7D, 0x57, 0x1C,
16   - 0x1C, 0x5E, 0x7F, 0x5E, 0x1C,
17   - 0x00, 0x18, 0x3C, 0x18, 0x00,
18   - 0xFF, 0xE7, 0xC3, 0xE7, 0xFF,
19   - 0x00, 0x18, 0x24, 0x18, 0x00,
20   - 0xFF, 0xE7, 0xDB, 0xE7, 0xFF,
21   - 0x30, 0x48, 0x3A, 0x06, 0x0E,
22   - 0x26, 0x29, 0x79, 0x29, 0x26,
23   - 0x40, 0x7F, 0x05, 0x05, 0x07,
24   - 0x40, 0x7F, 0x05, 0x25, 0x3F,
25   - 0x5A, 0x3C, 0xE7, 0x3C, 0x5A,
26   - 0x7F, 0x3E, 0x1C, 0x1C, 0x08,
27   - 0x08, 0x1C, 0x1C, 0x3E, 0x7F,
28   - 0x14, 0x22, 0x7F, 0x22, 0x14,
29   - 0x5F, 0x5F, 0x00, 0x5F, 0x5F,
30   - 0x06, 0x09, 0x7F, 0x01, 0x7F,
31   - 0x00, 0x66, 0x89, 0x95, 0x6A,
32   - 0x60, 0x60, 0x60, 0x60, 0x60,
33   - 0x94, 0xA2, 0xFF, 0xA2, 0x94,
34   - 0x08, 0x04, 0x7E, 0x04, 0x08,
35   - 0x10, 0x20, 0x7E, 0x20, 0x10,
36   - 0x08, 0x08, 0x2A, 0x1C, 0x08,
37   - 0x08, 0x1C, 0x2A, 0x08, 0x08,
38   - 0x1E, 0x10, 0x10, 0x10, 0x10,
39   - 0x0C, 0x1E, 0x0C, 0x1E, 0x0C,
40   - 0x30, 0x38, 0x3E, 0x38, 0x30,
41   - 0x06, 0x0E, 0x3E, 0x0E, 0x06,
42   - 0x00, 0x00, 0x00, 0x00, 0x00,
43   - 0x00, 0x00, 0x5F, 0x00, 0x00,
44   - 0x00, 0x07, 0x00, 0x07, 0x00,
45   - 0x14, 0x7F, 0x14, 0x7F, 0x14,
46   - 0x24, 0x2A, 0x7F, 0x2A, 0x12,
47   - 0x23, 0x13, 0x08, 0x64, 0x62,
48   - 0x36, 0x49, 0x56, 0x20, 0x50,
49   - 0x00, 0x08, 0x07, 0x03, 0x00,
50   - 0x00, 0x1C, 0x22, 0x41, 0x00,
51   - 0x00, 0x41, 0x22, 0x1C, 0x00,
52   - 0x2A, 0x1C, 0x7F, 0x1C, 0x2A,
53   - 0x08, 0x08, 0x3E, 0x08, 0x08,
54   - 0x00, 0x80, 0x70, 0x30, 0x00,
55   - 0x08, 0x08, 0x08, 0x08, 0x08,
56   - 0x00, 0x00, 0x60, 0x60, 0x00,
57   - 0x20, 0x10, 0x08, 0x04, 0x02,
58   - 0x3E, 0x51, 0x49, 0x45, 0x3E,
59   - 0x00, 0x42, 0x7F, 0x40, 0x00,
60   - 0x72, 0x49, 0x49, 0x49, 0x46,
61   - 0x21, 0x41, 0x49, 0x4D, 0x33,
62   - 0x18, 0x14, 0x12, 0x7F, 0x10,
63   - 0x27, 0x45, 0x45, 0x45, 0x39,
64   - 0x3C, 0x4A, 0x49, 0x49, 0x31,
65   - 0x41, 0x21, 0x11, 0x09, 0x07,
66   - 0x36, 0x49, 0x49, 0x49, 0x36,
67   - 0x46, 0x49, 0x49, 0x29, 0x1E,
68   - 0x00, 0x00, 0x14, 0x00, 0x00,
69   - 0x00, 0x40, 0x34, 0x00, 0x00,
70   - 0x00, 0x08, 0x14, 0x22, 0x41,
71   - 0x14, 0x14, 0x14, 0x14, 0x14,
72   - 0x00, 0x41, 0x22, 0x14, 0x08,
73   - 0x02, 0x01, 0x59, 0x09, 0x06,
74   - 0x3E, 0x41, 0x5D, 0x59, 0x4E,
75   - 0x7C, 0x12, 0x11, 0x12, 0x7C,
76   - 0x7F, 0x49, 0x49, 0x49, 0x36,
77   - 0x3E, 0x41, 0x41, 0x41, 0x22,
78   - 0x7F, 0x41, 0x41, 0x41, 0x3E,
79   - 0x7F, 0x49, 0x49, 0x49, 0x41,
80   - 0x7F, 0x09, 0x09, 0x09, 0x01,
81   - 0x3E, 0x41, 0x41, 0x51, 0x73,
82   - 0x7F, 0x08, 0x08, 0x08, 0x7F,
83   - 0x00, 0x41, 0x7F, 0x41, 0x00,
84   - 0x20, 0x40, 0x41, 0x3F, 0x01,
85   - 0x7F, 0x08, 0x14, 0x22, 0x41,
86   - 0x7F, 0x40, 0x40, 0x40, 0x40,
87   - 0x7F, 0x02, 0x1C, 0x02, 0x7F,
88   - 0x7F, 0x04, 0x08, 0x10, 0x7F,
89   - 0x3E, 0x41, 0x41, 0x41, 0x3E,
90   - 0x7F, 0x09, 0x09, 0x09, 0x06,
91   - 0x3E, 0x41, 0x51, 0x21, 0x5E,
92   - 0x7F, 0x09, 0x19, 0x29, 0x46,
93   - 0x26, 0x49, 0x49, 0x49, 0x32,
94   - 0x03, 0x01, 0x7F, 0x01, 0x03,
95   - 0x3F, 0x40, 0x40, 0x40, 0x3F,
96   - 0x1F, 0x20, 0x40, 0x20, 0x1F,
97   - 0x3F, 0x40, 0x38, 0x40, 0x3F,
98   - 0x63, 0x14, 0x08, 0x14, 0x63,
99   - 0x03, 0x04, 0x78, 0x04, 0x03,
100   - 0x61, 0x59, 0x49, 0x4D, 0x43,
101   - 0x00, 0x7F, 0x41, 0x41, 0x41,
102   - 0x02, 0x04, 0x08, 0x10, 0x20,
103   - 0x00, 0x41, 0x41, 0x41, 0x7F,
104   - 0x04, 0x02, 0x01, 0x02, 0x04,
105   - 0x40, 0x40, 0x40, 0x40, 0x40,
106   - 0x00, 0x03, 0x07, 0x08, 0x00,
107   - 0x20, 0x54, 0x54, 0x78, 0x40,
108   - 0x7F, 0x28, 0x44, 0x44, 0x38,
109   - 0x38, 0x44, 0x44, 0x44, 0x28,
110   - 0x38, 0x44, 0x44, 0x28, 0x7F,
111   - 0x38, 0x54, 0x54, 0x54, 0x18,
112   - 0x00, 0x08, 0x7E, 0x09, 0x02,
113   - 0x18, 0xA4, 0xA4, 0x9C, 0x78,
114   - 0x7F, 0x08, 0x04, 0x04, 0x78,
115   - 0x00, 0x44, 0x7D, 0x40, 0x00,
116   - 0x20, 0x40, 0x40, 0x3D, 0x00,
117   - 0x7F, 0x10, 0x28, 0x44, 0x00,
118   - 0x00, 0x41, 0x7F, 0x40, 0x00,
119   - 0x7C, 0x04, 0x78, 0x04, 0x78,
120   - 0x7C, 0x08, 0x04, 0x04, 0x78,
121   - 0x38, 0x44, 0x44, 0x44, 0x38,
122   - 0xFC, 0x18, 0x24, 0x24, 0x18,
123   - 0x18, 0x24, 0x24, 0x18, 0xFC,
124   - 0x7C, 0x08, 0x04, 0x04, 0x08,
125   - 0x48, 0x54, 0x54, 0x54, 0x24,
126   - 0x04, 0x04, 0x3F, 0x44, 0x24,
127   - 0x3C, 0x40, 0x40, 0x20, 0x7C,
128   - 0x1C, 0x20, 0x40, 0x20, 0x1C,
129   - 0x3C, 0x40, 0x30, 0x40, 0x3C,
130   - 0x44, 0x28, 0x10, 0x28, 0x44,
131   - 0x4C, 0x90, 0x90, 0x90, 0x7C,
132   - 0x44, 0x64, 0x54, 0x4C, 0x44,
133   - 0x00, 0x08, 0x36, 0x41, 0x00,
134   - 0x00, 0x00, 0x77, 0x00, 0x00,
135   - 0x00, 0x41, 0x36, 0x08, 0x00,
136   - 0x02, 0x01, 0x02, 0x04, 0x02,
137   - 0x3C, 0x26, 0x23, 0x26, 0x3C,
138   - 0x1E, 0xA1, 0xA1, 0x61, 0x12,
139   - 0x3A, 0x40, 0x40, 0x20, 0x7A,
140   - 0x38, 0x54, 0x54, 0x55, 0x59,
141   - 0x21, 0x55, 0x55, 0x79, 0x41,
142   - 0x21, 0x54, 0x54, 0x78, 0x41,
143   - 0x21, 0x55, 0x54, 0x78, 0x40,
144   - 0x20, 0x54, 0x55, 0x79, 0x40,
145   - 0x0C, 0x1E, 0x52, 0x72, 0x12,
146   - 0x39, 0x55, 0x55, 0x55, 0x59,
147   - 0x39, 0x54, 0x54, 0x54, 0x59,
148   - 0x39, 0x55, 0x54, 0x54, 0x58,
149   - 0x00, 0x00, 0x45, 0x7C, 0x41,
150   - 0x00, 0x02, 0x45, 0x7D, 0x42,
151   - 0x00, 0x01, 0x45, 0x7C, 0x40,
152   - 0xF0, 0x29, 0x24, 0x29, 0xF0,
153   - 0xF0, 0x28, 0x25, 0x28, 0xF0,
154   - 0x7C, 0x54, 0x55, 0x45, 0x00,
155   - 0x20, 0x54, 0x54, 0x7C, 0x54,
156   - 0x7C, 0x0A, 0x09, 0x7F, 0x49,
157   - 0x32, 0x49, 0x49, 0x49, 0x32,
158   - 0x32, 0x48, 0x48, 0x48, 0x32,
159   - 0x32, 0x4A, 0x48, 0x48, 0x30,
160   - 0x3A, 0x41, 0x41, 0x21, 0x7A,
161   - 0x3A, 0x42, 0x40, 0x20, 0x78,
162   - 0x00, 0x9D, 0xA0, 0xA0, 0x7D,
163   - 0x39, 0x44, 0x44, 0x44, 0x39,
164   - 0x3D, 0x40, 0x40, 0x40, 0x3D,
165   - 0x3C, 0x24, 0xFF, 0x24, 0x24,
166   - 0x48, 0x7E, 0x49, 0x43, 0x66,
167   - 0x2B, 0x2F, 0xFC, 0x2F, 0x2B,
168   - 0xFF, 0x09, 0x29, 0xF6, 0x20,
169   - 0xC0, 0x88, 0x7E, 0x09, 0x03,
170   - 0x20, 0x54, 0x54, 0x79, 0x41,
171   - 0x00, 0x00, 0x44, 0x7D, 0x41,
172   - 0x30, 0x48, 0x48, 0x4A, 0x32,
173   - 0x38, 0x40, 0x40, 0x22, 0x7A,
174   - 0x00, 0x7A, 0x0A, 0x0A, 0x72,
175   - 0x7D, 0x0D, 0x19, 0x31, 0x7D,
176   - 0x26, 0x29, 0x29, 0x2F, 0x28,
177   - 0x26, 0x29, 0x29, 0x29, 0x26,
178   - 0x30, 0x48, 0x4D, 0x40, 0x20,
179   - 0x38, 0x08, 0x08, 0x08, 0x08,
180   - 0x08, 0x08, 0x08, 0x08, 0x38,
181   - 0x2F, 0x10, 0xC8, 0xAC, 0xBA,
182   - 0x2F, 0x10, 0x28, 0x34, 0xFA,
183   - 0x00, 0x00, 0x7B, 0x00, 0x00,
184   - 0x08, 0x14, 0x2A, 0x14, 0x22,
185   - 0x22, 0x14, 0x2A, 0x14, 0x08,
186   - 0xAA, 0x00, 0x55, 0x00, 0xAA,
187   - 0xAA, 0x55, 0xAA, 0x55, 0xAA,
188   - 0x00, 0x00, 0x00, 0xFF, 0x00,
189   - 0x10, 0x10, 0x10, 0xFF, 0x00,
190   - 0x14, 0x14, 0x14, 0xFF, 0x00,
191   - 0x10, 0x10, 0xFF, 0x00, 0xFF,
192   - 0x10, 0x10, 0xF0, 0x10, 0xF0,
193   - 0x14, 0x14, 0x14, 0xFC, 0x00,
194   - 0x14, 0x14, 0xF7, 0x00, 0xFF,
195   - 0x00, 0x00, 0xFF, 0x00, 0xFF,
196   - 0x14, 0x14, 0xF4, 0x04, 0xFC,
197   - 0x14, 0x14, 0x17, 0x10, 0x1F,
198   - 0x10, 0x10, 0x1F, 0x10, 0x1F,
199   - 0x14, 0x14, 0x14, 0x1F, 0x00,
200   - 0x10, 0x10, 0x10, 0xF0, 0x00,
201   - 0x00, 0x00, 0x00, 0x1F, 0x10,
202   - 0x10, 0x10, 0x10, 0x1F, 0x10,
203   - 0x10, 0x10, 0x10, 0xF0, 0x10,
204   - 0x00, 0x00, 0x00, 0xFF, 0x10,
205   - 0x10, 0x10, 0x10, 0x10, 0x10,
206   - 0x10, 0x10, 0x10, 0xFF, 0x10,
207   - 0x00, 0x00, 0x00, 0xFF, 0x14,
208   - 0x00, 0x00, 0xFF, 0x00, 0xFF,
209   - 0x00, 0x00, 0x1F, 0x10, 0x17,
210   - 0x00, 0x00, 0xFC, 0x04, 0xF4,
211   - 0x14, 0x14, 0x17, 0x10, 0x17,
212   - 0x14, 0x14, 0xF4, 0x04, 0xF4,
213   - 0x00, 0x00, 0xFF, 0x00, 0xF7,
214   - 0x14, 0x14, 0x14, 0x14, 0x14,
215   - 0x14, 0x14, 0xF7, 0x00, 0xF7,
216   - 0x14, 0x14, 0x14, 0x17, 0x14,
217   - 0x10, 0x10, 0x1F, 0x10, 0x1F,
218   - 0x14, 0x14, 0x14, 0xF4, 0x14,
219   - 0x10, 0x10, 0xF0, 0x10, 0xF0,
220   - 0x00, 0x00, 0x1F, 0x10, 0x1F,
221   - 0x00, 0x00, 0x00, 0x1F, 0x14,
222   - 0x00, 0x00, 0x00, 0xFC, 0x14,
223   - 0x00, 0x00, 0xF0, 0x10, 0xF0,
224   - 0x10, 0x10, 0xFF, 0x10, 0xFF,
225   - 0x14, 0x14, 0x14, 0xFF, 0x14,
226   - 0x10, 0x10, 0x10, 0x1F, 0x00,
227   - 0x00, 0x00, 0x00, 0xF0, 0x10,
228   - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
229   - 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
230   - 0xFF, 0xFF, 0xFF, 0x00, 0x00,
231   - 0x00, 0x00, 0x00, 0xFF, 0xFF,
232   - 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
233   - 0x38, 0x44, 0x44, 0x38, 0x44,
234   - 0x7C, 0x2A, 0x2A, 0x3E, 0x14,
235   - 0x7E, 0x02, 0x02, 0x06, 0x06,
236   - 0x02, 0x7E, 0x02, 0x7E, 0x02,
237   - 0x63, 0x55, 0x49, 0x41, 0x63,
238   - 0x38, 0x44, 0x44, 0x3C, 0x04,
239   - 0x40, 0x7E, 0x20, 0x1E, 0x20,
240   - 0x06, 0x02, 0x7E, 0x02, 0x02,
241   - 0x99, 0xA5, 0xE7, 0xA5, 0x99,
242   - 0x1C, 0x2A, 0x49, 0x2A, 0x1C,
243   - 0x4C, 0x72, 0x01, 0x72, 0x4C,
244   - 0x30, 0x4A, 0x4D, 0x4D, 0x30,
245   - 0x30, 0x48, 0x78, 0x48, 0x30,
246   - 0xBC, 0x62, 0x5A, 0x46, 0x3D,
247   - 0x3E, 0x49, 0x49, 0x49, 0x00,
248   - 0x7E, 0x01, 0x01, 0x01, 0x7E,
249   - 0x2A, 0x2A, 0x2A, 0x2A, 0x2A,
250   - 0x44, 0x44, 0x5F, 0x44, 0x44,
251   - 0x40, 0x51, 0x4A, 0x44, 0x40,
252   - 0x40, 0x44, 0x4A, 0x51, 0x40,
253   - 0x00, 0x00, 0xFF, 0x01, 0x03,
254   - 0xE0, 0x80, 0xFF, 0x00, 0x00,
255   - 0x08, 0x08, 0x6B, 0x6B, 0x08,
256   - 0x36, 0x12, 0x36, 0x24, 0x36,
257   - 0x06, 0x0F, 0x09, 0x0F, 0x06,