Prototipe
Dependents: LPC1768_Noritake_SC16IS752 LPC1768_Noritake_v5-2 08_SCT_menu
query.cpp@0:cbd2824917b1, 2016-08-10 (annotated)
- Committer:
- irsanjul
- Date:
- Wed Aug 10 03:38:46 2016 +0000
- Revision:
- 0:cbd2824917b1
- Child:
- 1:1a088a2b53ec
testes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
irsanjul | 0:cbd2824917b1 | 1 | #include "mbed.h" |
irsanjul | 0:cbd2824917b1 | 2 | #include "query.h" |
irsanjul | 0:cbd2824917b1 | 3 | #include <string.h> |
irsanjul | 0:cbd2824917b1 | 4 | |
irsanjul | 0:cbd2824917b1 | 5 | extern Serial dbg; |
irsanjul | 0:cbd2824917b1 | 6 | |
irsanjul | 0:cbd2824917b1 | 7 | Noritake_VFD_GU7000::Noritake_VFD_GU7000(PinName sda, PinName scl) : uart(sda, scl, SC16IS752_SA5, NC, SC16IS752::Channel_A) |
irsanjul | 0:cbd2824917b1 | 8 | { |
irsanjul | 0:cbd2824917b1 | 9 | if(!uart.init(38400)) |
irsanjul | 0:cbd2824917b1 | 10 | dbg.printf(RED "IC is not init\r\n" DEF); |
irsanjul | 0:cbd2824917b1 | 11 | else dbg.printf("IC is ready\r\n"); |
irsanjul | 0:cbd2824917b1 | 12 | } |
irsanjul | 0:cbd2824917b1 | 13 | |
irsanjul | 0:cbd2824917b1 | 14 | void Noritake_VFD_GU7000::writePort(uint8_t data) |
irsanjul | 0:cbd2824917b1 | 15 | { |
irsanjul | 0:cbd2824917b1 | 16 | uart.put(data); |
irsanjul | 0:cbd2824917b1 | 17 | } |
irsanjul | 0:cbd2824917b1 | 18 | void Noritake_VFD_GU7000::hardReset() |
irsanjul | 0:cbd2824917b1 | 19 | { |
irsanjul | 0:cbd2824917b1 | 20 | uart.put(0x0c); |
irsanjul | 0:cbd2824917b1 | 21 | wait_ms(200); |
irsanjul | 0:cbd2824917b1 | 22 | uart.put(0x1f); |
irsanjul | 0:cbd2824917b1 | 23 | uart.put(0x24); |
irsanjul | 0:cbd2824917b1 | 24 | uart.put(0x00); |
irsanjul | 0:cbd2824917b1 | 25 | uart.put(0x00); |
irsanjul | 0:cbd2824917b1 | 26 | uart.put(0x00); |
irsanjul | 0:cbd2824917b1 | 27 | uart.put(0x00); |
irsanjul | 0:cbd2824917b1 | 28 | } |
irsanjul | 0:cbd2824917b1 | 29 | |
irsanjul | 0:cbd2824917b1 | 30 | |
irsanjul | 0:cbd2824917b1 | 31 | void Noritake_VFD_GU7000::GU7000_back() { |
irsanjul | 0:cbd2824917b1 | 32 | command(0x08); |
irsanjul | 0:cbd2824917b1 | 33 | } |
irsanjul | 0:cbd2824917b1 | 34 | |
irsanjul | 0:cbd2824917b1 | 35 | void Noritake_VFD_GU7000::GU7000_forward() { |
irsanjul | 0:cbd2824917b1 | 36 | command(0x09); |
irsanjul | 0:cbd2824917b1 | 37 | } |
irsanjul | 0:cbd2824917b1 | 38 | |
irsanjul | 0:cbd2824917b1 | 39 | void Noritake_VFD_GU7000::GU7000_lineFeed() { |
irsanjul | 0:cbd2824917b1 | 40 | command(0x0a); |
irsanjul | 0:cbd2824917b1 | 41 | } |
irsanjul | 0:cbd2824917b1 | 42 | |
irsanjul | 0:cbd2824917b1 | 43 | void Noritake_VFD_GU7000::GU7000_home() { |
irsanjul | 0:cbd2824917b1 | 44 | command(0x0b); |
irsanjul | 0:cbd2824917b1 | 45 | } |
irsanjul | 0:cbd2824917b1 | 46 | |
irsanjul | 0:cbd2824917b1 | 47 | void Noritake_VFD_GU7000::GU7000_carriageReturn() { |
irsanjul | 0:cbd2824917b1 | 48 | command(0x0d); |
irsanjul | 0:cbd2824917b1 | 49 | } |
irsanjul | 0:cbd2824917b1 | 50 | |
irsanjul | 0:cbd2824917b1 | 51 | void Noritake_VFD_GU7000::GU7000_setCursor(unsigned x, unsigned y) { |
irsanjul | 0:cbd2824917b1 | 52 | command(0x1f); |
irsanjul | 0:cbd2824917b1 | 53 | command('$'); |
irsanjul | 0:cbd2824917b1 | 54 | command_xy(x, y); |
irsanjul | 0:cbd2824917b1 | 55 | } |
irsanjul | 0:cbd2824917b1 | 56 | |
irsanjul | 0:cbd2824917b1 | 57 | void Noritake_VFD_GU7000::GU7000_clearScreen() { |
irsanjul | 0:cbd2824917b1 | 58 | command(0x0c); |
irsanjul | 0:cbd2824917b1 | 59 | } |
irsanjul | 0:cbd2824917b1 | 60 | |
irsanjul | 0:cbd2824917b1 | 61 | void Noritake_VFD_GU7000::GU7000_cursorOn() { |
irsanjul | 0:cbd2824917b1 | 62 | command(0x1f, 'C', 1); |
irsanjul | 0:cbd2824917b1 | 63 | } |
irsanjul | 0:cbd2824917b1 | 64 | |
irsanjul | 0:cbd2824917b1 | 65 | void Noritake_VFD_GU7000::GU7000_cursorOff() { |
irsanjul | 0:cbd2824917b1 | 66 | command(0x1f, 'C', 0); |
irsanjul | 0:cbd2824917b1 | 67 | } |
irsanjul | 0:cbd2824917b1 | 68 | |
irsanjul | 0:cbd2824917b1 | 69 | void Noritake_VFD_GU7000::GU7000_init() { |
irsanjul | 0:cbd2824917b1 | 70 | wait_us(NORITAKE_VFD_RESET_DELAY); |
irsanjul | 0:cbd2824917b1 | 71 | command(0x1b); |
irsanjul | 0:cbd2824917b1 | 72 | command('@'); |
irsanjul | 0:cbd2824917b1 | 73 | } |
irsanjul | 0:cbd2824917b1 | 74 | |
irsanjul | 0:cbd2824917b1 | 75 | void Noritake_VFD_GU7000::GU7000_reset() { |
irsanjul | 0:cbd2824917b1 | 76 | this->hardReset(); |
irsanjul | 0:cbd2824917b1 | 77 | } |
irsanjul | 0:cbd2824917b1 | 78 | |
irsanjul | 0:cbd2824917b1 | 79 | void Noritake_VFD_GU7000::GU7000_useMultibyteChars(bool enable) { |
irsanjul | 0:cbd2824917b1 | 80 | #if (NORITAKE_VFD_MODEL_CLASS-7000)/100==9 || (NORITAKE_VFD_MODEL_CLASS-7000)/100==1 |
irsanjul | 0:cbd2824917b1 | 81 | us_command('g', 0x02); |
irsanjul | 0:cbd2824917b1 | 82 | command(enable); |
irsanjul | 0:cbd2824917b1 | 83 | #endif |
irsanjul | 0:cbd2824917b1 | 84 | } |
irsanjul | 0:cbd2824917b1 | 85 | |
irsanjul | 0:cbd2824917b1 | 86 | void Noritake_VFD_GU7000::GU7000_setMultibyteCharset(uint8_t code) { |
irsanjul | 0:cbd2824917b1 | 87 | #if (NORITAKE_VFD_MODEL_CLASS-7000)/100==9 || (NORITAKE_VFD_MODEL_CLASS-7000)/100==1 |
irsanjul | 0:cbd2824917b1 | 88 | us_command('g', 0x0f); |
irsanjul | 0:cbd2824917b1 | 89 | command(code); |
irsanjul | 0:cbd2824917b1 | 90 | #endif |
irsanjul | 0:cbd2824917b1 | 91 | } |
irsanjul | 0:cbd2824917b1 | 92 | |
irsanjul | 0:cbd2824917b1 | 93 | void Noritake_VFD_GU7000::GU7000_useCustomChars(bool enable) { |
irsanjul | 0:cbd2824917b1 | 94 | command(0x1b, '%', enable); |
irsanjul | 0:cbd2824917b1 | 95 | } |
irsanjul | 0:cbd2824917b1 | 96 | |
irsanjul | 0:cbd2824917b1 | 97 | static inline uint8_t getColumn(const uint8_t *src, int col) { |
irsanjul | 0:cbd2824917b1 | 98 | uint8_t out = 0; |
irsanjul | 0:cbd2824917b1 | 99 | for (int i=0; i<8; i++) |
irsanjul | 0:cbd2824917b1 | 100 | if (src[i] & (1<<(4-col))) out += 1<<(7-i); |
irsanjul | 0:cbd2824917b1 | 101 | return out; |
irsanjul | 0:cbd2824917b1 | 102 | } |
irsanjul | 0:cbd2824917b1 | 103 | |
irsanjul | 0:cbd2824917b1 | 104 | void Noritake_VFD_GU7000::GU7000_defineCustomChar(uint8_t code, FontFormat format, const uint8_t *data) { |
irsanjul | 0:cbd2824917b1 | 105 | command(0x1b, '&', 0x01); |
irsanjul | 0:cbd2824917b1 | 106 | command(code); |
irsanjul | 0:cbd2824917b1 | 107 | command(code); |
irsanjul | 0:cbd2824917b1 | 108 | |
irsanjul | 0:cbd2824917b1 | 109 | switch (format) { |
irsanjul | 0:cbd2824917b1 | 110 | case CUUFormat: |
irsanjul | 0:cbd2824917b1 | 111 | command(5); |
irsanjul | 0:cbd2824917b1 | 112 | for (uint8_t i=0; i<5; i++) |
irsanjul | 0:cbd2824917b1 | 113 | command(getColumn(data, i)); |
irsanjul | 0:cbd2824917b1 | 114 | break; |
irsanjul | 0:cbd2824917b1 | 115 | |
irsanjul | 0:cbd2824917b1 | 116 | case GU70005x7Format: |
irsanjul | 0:cbd2824917b1 | 117 | command(5); |
irsanjul | 0:cbd2824917b1 | 118 | print((const char*)data, 5); |
irsanjul | 0:cbd2824917b1 | 119 | break; |
irsanjul | 0:cbd2824917b1 | 120 | case GU70007x8Format: |
irsanjul | 0:cbd2824917b1 | 121 | command(7); |
irsanjul | 0:cbd2824917b1 | 122 | print((const char*)data, 7); |
irsanjul | 0:cbd2824917b1 | 123 | break; |
irsanjul | 0:cbd2824917b1 | 124 | } |
irsanjul | 0:cbd2824917b1 | 125 | } |
irsanjul | 0:cbd2824917b1 | 126 | |
irsanjul | 0:cbd2824917b1 | 127 | void Noritake_VFD_GU7000::GU7000_deleteCustomChar(uint8_t code) { |
irsanjul | 0:cbd2824917b1 | 128 | command(0x01b, '?', 0x01); |
irsanjul | 0:cbd2824917b1 | 129 | command(code); |
irsanjul | 0:cbd2824917b1 | 130 | } |
irsanjul | 0:cbd2824917b1 | 131 | |
irsanjul | 0:cbd2824917b1 | 132 | void Noritake_VFD_GU7000::GU7000_setAsciiVariant(AsciiVariant code) { |
irsanjul | 0:cbd2824917b1 | 133 | command(0x1b, 'R', code); |
irsanjul | 0:cbd2824917b1 | 134 | } |
irsanjul | 0:cbd2824917b1 | 135 | |
irsanjul | 0:cbd2824917b1 | 136 | void Noritake_VFD_GU7000::GU7000_setCharset(Charset code) { |
irsanjul | 0:cbd2824917b1 | 137 | command(0x1b, 't', code); |
irsanjul | 0:cbd2824917b1 | 138 | } |
irsanjul | 0:cbd2824917b1 | 139 | |
irsanjul | 0:cbd2824917b1 | 140 | void Noritake_VFD_GU7000::GU7000_setScrollMode(ScrollMode mode) { |
irsanjul | 0:cbd2824917b1 | 141 | command(0x1f); |
irsanjul | 0:cbd2824917b1 | 142 | command(mode); |
irsanjul | 0:cbd2824917b1 | 143 | } |
irsanjul | 0:cbd2824917b1 | 144 | |
irsanjul | 0:cbd2824917b1 | 145 | void Noritake_VFD_GU7000::GU7000_setHorizScrollSpeed(uint8_t speed) { |
irsanjul | 0:cbd2824917b1 | 146 | command(0x1f, 's', speed); |
irsanjul | 0:cbd2824917b1 | 147 | } |
irsanjul | 0:cbd2824917b1 | 148 | |
irsanjul | 0:cbd2824917b1 | 149 | void Noritake_VFD_GU7000::GU7000_invertOff() { |
irsanjul | 0:cbd2824917b1 | 150 | command(0x1f, 'r', 0); |
irsanjul | 0:cbd2824917b1 | 151 | } |
irsanjul | 0:cbd2824917b1 | 152 | |
irsanjul | 0:cbd2824917b1 | 153 | void Noritake_VFD_GU7000::GU7000_invertOn() { |
irsanjul | 0:cbd2824917b1 | 154 | command(0x1f, 'r', 1); |
irsanjul | 0:cbd2824917b1 | 155 | } |
irsanjul | 0:cbd2824917b1 | 156 | |
irsanjul | 0:cbd2824917b1 | 157 | void Noritake_VFD_GU7000::GU7000_setCompositionMode(CompositionMode mode) { |
irsanjul | 0:cbd2824917b1 | 158 | command(0x1f, 'w', mode); |
irsanjul | 0:cbd2824917b1 | 159 | } |
irsanjul | 0:cbd2824917b1 | 160 | |
irsanjul | 0:cbd2824917b1 | 161 | void Noritake_VFD_GU7000::GU7000_setScreenBrightness(unsigned level) { |
irsanjul | 0:cbd2824917b1 | 162 | if (level == 0) |
irsanjul | 0:cbd2824917b1 | 163 | GU7000_displayOff(); |
irsanjul | 0:cbd2824917b1 | 164 | else if (level <= 100) { |
irsanjul | 0:cbd2824917b1 | 165 | GU7000_displayOn(); |
irsanjul | 0:cbd2824917b1 | 166 | command(0x1f, 'X', (level*10 + 120)/125); |
irsanjul | 0:cbd2824917b1 | 167 | } |
irsanjul | 0:cbd2824917b1 | 168 | } |
irsanjul | 0:cbd2824917b1 | 169 | |
irsanjul | 0:cbd2824917b1 | 170 | void Noritake_VFD_GU7000::GU7000_wait(uint8_t time) { |
irsanjul | 0:cbd2824917b1 | 171 | us_command('a', 0x01); |
irsanjul | 0:cbd2824917b1 | 172 | command(time); |
irsanjul | 0:cbd2824917b1 | 173 | } |
irsanjul | 0:cbd2824917b1 | 174 | |
irsanjul | 0:cbd2824917b1 | 175 | void Noritake_VFD_GU7000::GU7000_scrollScreen(unsigned x, unsigned y, unsigned times, uint8_t speed) { |
irsanjul | 0:cbd2824917b1 | 176 | unsigned pos = (x*NORITAKE_VFD_LINES)+(y/8); |
irsanjul | 0:cbd2824917b1 | 177 | us_command('a', 0x10); |
irsanjul | 0:cbd2824917b1 | 178 | command(pos); |
irsanjul | 0:cbd2824917b1 | 179 | command(pos>>8); |
irsanjul | 0:cbd2824917b1 | 180 | command(times); |
irsanjul | 0:cbd2824917b1 | 181 | command(times>>8); |
irsanjul | 0:cbd2824917b1 | 182 | command(speed); |
irsanjul | 0:cbd2824917b1 | 183 | } |
irsanjul | 0:cbd2824917b1 | 184 | |
irsanjul | 0:cbd2824917b1 | 185 | void Noritake_VFD_GU7000::GU7000_blinkScreen() { |
irsanjul | 0:cbd2824917b1 | 186 | us_command('a', 0x11); |
irsanjul | 0:cbd2824917b1 | 187 | command(0); |
irsanjul | 0:cbd2824917b1 | 188 | command(0); |
irsanjul | 0:cbd2824917b1 | 189 | command(0); |
irsanjul | 0:cbd2824917b1 | 190 | command(0); |
irsanjul | 0:cbd2824917b1 | 191 | } |
irsanjul | 0:cbd2824917b1 | 192 | |
irsanjul | 0:cbd2824917b1 | 193 | void Noritake_VFD_GU7000::GU7000_blinkScreen(bool enable, bool reverse, uint8_t onTime, uint8_t offTime, uint8_t times) { |
irsanjul | 0:cbd2824917b1 | 194 | us_command('a', 0x11); |
irsanjul | 0:cbd2824917b1 | 195 | command(enable? (reverse? 2: 1): 0); |
irsanjul | 0:cbd2824917b1 | 196 | command(onTime); |
irsanjul | 0:cbd2824917b1 | 197 | command(offTime); |
irsanjul | 0:cbd2824917b1 | 198 | command(times); |
irsanjul | 0:cbd2824917b1 | 199 | } |
irsanjul | 0:cbd2824917b1 | 200 | |
irsanjul | 0:cbd2824917b1 | 201 | void Noritake_VFD_GU7000::GU7000_displayOff() { |
irsanjul | 0:cbd2824917b1 | 202 | us_command('a', 0x40); |
irsanjul | 0:cbd2824917b1 | 203 | command(0); |
irsanjul | 0:cbd2824917b1 | 204 | } |
irsanjul | 0:cbd2824917b1 | 205 | |
irsanjul | 0:cbd2824917b1 | 206 | void Noritake_VFD_GU7000::GU7000_displayOn() { |
irsanjul | 0:cbd2824917b1 | 207 | us_command('a', 0x40); |
irsanjul | 0:cbd2824917b1 | 208 | command(0x01); |
irsanjul | 0:cbd2824917b1 | 209 | } |
irsanjul | 0:cbd2824917b1 | 210 | |
irsanjul | 0:cbd2824917b1 | 211 | void Noritake_VFD_GU7000::GU7000_screenSaver(ScreenSaver mode) { |
irsanjul | 0:cbd2824917b1 | 212 | us_command('a', 0x40); |
irsanjul | 0:cbd2824917b1 | 213 | command(mode); |
irsanjul | 0:cbd2824917b1 | 214 | } |
irsanjul | 0:cbd2824917b1 | 215 | |
irsanjul | 0:cbd2824917b1 | 216 | void Noritake_VFD_GU7000::GU7000_setFontStyle(bool proportional, bool evenSpacing) { |
irsanjul | 0:cbd2824917b1 | 217 | us_command('g', 0x03); |
irsanjul | 0:cbd2824917b1 | 218 | command(proportional*2 + evenSpacing); |
irsanjul | 0:cbd2824917b1 | 219 | } |
irsanjul | 0:cbd2824917b1 | 220 | |
irsanjul | 0:cbd2824917b1 | 221 | void Noritake_VFD_GU7000::GU7000_setFontSize(uint8_t x, uint8_t y, bool tall) { |
irsanjul | 0:cbd2824917b1 | 222 | if (x<=4 && y<=2) { |
irsanjul | 0:cbd2824917b1 | 223 | us_command('g', 0x40); |
irsanjul | 0:cbd2824917b1 | 224 | command(x); |
irsanjul | 0:cbd2824917b1 | 225 | command(y); |
irsanjul | 0:cbd2824917b1 | 226 | #if (NORITAKE_VFD_MODEL_CLASS-7000)/100==9 || (NORITAKE_VFD_MODEL_CLASS-7000)/100==1 |
irsanjul | 0:cbd2824917b1 | 227 | us_command('g', 0x01); |
irsanjul | 0:cbd2824917b1 | 228 | command(tall+1); |
irsanjul | 0:cbd2824917b1 | 229 | #endif |
irsanjul | 0:cbd2824917b1 | 230 | } |
irsanjul | 0:cbd2824917b1 | 231 | } |
irsanjul | 0:cbd2824917b1 | 232 | |
irsanjul | 0:cbd2824917b1 | 233 | void Noritake_VFD_GU7000::GU7000_selectWindow(uint8_t window) { |
irsanjul | 0:cbd2824917b1 | 234 | if (window <= 4) |
irsanjul | 0:cbd2824917b1 | 235 | command(0x10 + window); |
irsanjul | 0:cbd2824917b1 | 236 | } |
irsanjul | 0:cbd2824917b1 | 237 | |
irsanjul | 0:cbd2824917b1 | 238 | void Noritake_VFD_GU7000::GU7000_defineWindow(uint8_t window, unsigned x, unsigned y, unsigned width, unsigned height) { |
irsanjul | 0:cbd2824917b1 | 239 | us_command('w', 0x02); |
irsanjul | 0:cbd2824917b1 | 240 | command(window); |
irsanjul | 0:cbd2824917b1 | 241 | command(0x01); |
irsanjul | 0:cbd2824917b1 | 242 | command_xy(x, y); |
irsanjul | 0:cbd2824917b1 | 243 | command_xy(width, height); |
irsanjul | 0:cbd2824917b1 | 244 | } |
irsanjul | 0:cbd2824917b1 | 245 | |
irsanjul | 0:cbd2824917b1 | 246 | void Noritake_VFD_GU7000::GU7000_deleteWindow(uint8_t window) { |
irsanjul | 0:cbd2824917b1 | 247 | us_command('w', 0x02); |
irsanjul | 0:cbd2824917b1 | 248 | command(window); |
irsanjul | 0:cbd2824917b1 | 249 | command(0); |
irsanjul | 0:cbd2824917b1 | 250 | command_xy(0, 0); |
irsanjul | 0:cbd2824917b1 | 251 | command_xy(0, 0); |
irsanjul | 0:cbd2824917b1 | 252 | } |
irsanjul | 0:cbd2824917b1 | 253 | |
irsanjul | 0:cbd2824917b1 | 254 | void Noritake_VFD_GU7000::GU7000_joinScreens() { |
irsanjul | 0:cbd2824917b1 | 255 | us_command('w', 0x10); |
irsanjul | 0:cbd2824917b1 | 256 | command(0x01); |
irsanjul | 0:cbd2824917b1 | 257 | } |
irsanjul | 0:cbd2824917b1 | 258 | |
irsanjul | 0:cbd2824917b1 | 259 | void Noritake_VFD_GU7000::GU7000_separateScreens() { |
irsanjul | 0:cbd2824917b1 | 260 | us_command('w', 0x10); |
irsanjul | 0:cbd2824917b1 | 261 | command(0); |
irsanjul | 0:cbd2824917b1 | 262 | } |
irsanjul | 0:cbd2824917b1 | 263 | |
irsanjul | 0:cbd2824917b1 | 264 | void Noritake_VFD_GU7000::print(char c) { |
irsanjul | 0:cbd2824917b1 | 265 | command(c); |
irsanjul | 0:cbd2824917b1 | 266 | } |
irsanjul | 0:cbd2824917b1 | 267 | |
irsanjul | 0:cbd2824917b1 | 268 | void Noritake_VFD_GU7000::print(const char *str, ...) { |
irsanjul | 0:cbd2824917b1 | 269 | while (*str) |
irsanjul | 0:cbd2824917b1 | 270 | writePort(*str++); |
irsanjul | 0:cbd2824917b1 | 271 | } |
irsanjul | 0:cbd2824917b1 | 272 | |
irsanjul | 0:cbd2824917b1 | 273 | void Noritake_VFD_GU7000::print(const char *buffer, size_t size) { |
irsanjul | 0:cbd2824917b1 | 274 | while (size--) |
irsanjul | 0:cbd2824917b1 | 275 | print(*buffer++); |
irsanjul | 0:cbd2824917b1 | 276 | } |
irsanjul | 0:cbd2824917b1 | 277 | |
irsanjul | 0:cbd2824917b1 | 278 | void Noritake_VFD_GU7000::print(long number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 279 | if (number < 0) { |
irsanjul | 0:cbd2824917b1 | 280 | print('-'); |
irsanjul | 0:cbd2824917b1 | 281 | number = -number; |
irsanjul | 0:cbd2824917b1 | 282 | } |
irsanjul | 0:cbd2824917b1 | 283 | printNumber(number, base); |
irsanjul | 0:cbd2824917b1 | 284 | } |
irsanjul | 0:cbd2824917b1 | 285 | |
irsanjul | 0:cbd2824917b1 | 286 | void Noritake_VFD_GU7000::print(int number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 287 | print((long)number, base); |
irsanjul | 0:cbd2824917b1 | 288 | } |
irsanjul | 0:cbd2824917b1 | 289 | |
irsanjul | 0:cbd2824917b1 | 290 | void Noritake_VFD_GU7000::print(unsigned long number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 291 | printNumber(number, base); |
irsanjul | 0:cbd2824917b1 | 292 | } |
irsanjul | 0:cbd2824917b1 | 293 | |
irsanjul | 0:cbd2824917b1 | 294 | void Noritake_VFD_GU7000::print(unsigned number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 295 | print((unsigned long)number, base); |
irsanjul | 0:cbd2824917b1 | 296 | } |
irsanjul | 0:cbd2824917b1 | 297 | |
irsanjul | 0:cbd2824917b1 | 298 | void Noritake_VFD_GU7000::crlf() { |
irsanjul | 0:cbd2824917b1 | 299 | GU7000_carriageReturn(); |
irsanjul | 0:cbd2824917b1 | 300 | GU7000_lineFeed(); |
irsanjul | 0:cbd2824917b1 | 301 | } |
irsanjul | 0:cbd2824917b1 | 302 | |
irsanjul | 0:cbd2824917b1 | 303 | void Noritake_VFD_GU7000::println(char c) { |
irsanjul | 0:cbd2824917b1 | 304 | print(c); |
irsanjul | 0:cbd2824917b1 | 305 | crlf(); |
irsanjul | 0:cbd2824917b1 | 306 | } |
irsanjul | 0:cbd2824917b1 | 307 | |
irsanjul | 0:cbd2824917b1 | 308 | void Noritake_VFD_GU7000::println(const char *str) { |
irsanjul | 0:cbd2824917b1 | 309 | print(str); |
irsanjul | 0:cbd2824917b1 | 310 | crlf(); |
irsanjul | 0:cbd2824917b1 | 311 | } |
irsanjul | 0:cbd2824917b1 | 312 | |
irsanjul | 0:cbd2824917b1 | 313 | void Noritake_VFD_GU7000::println(const char *buffer, size_t size) { |
irsanjul | 0:cbd2824917b1 | 314 | print(buffer, size); |
irsanjul | 0:cbd2824917b1 | 315 | crlf(); |
irsanjul | 0:cbd2824917b1 | 316 | } |
irsanjul | 0:cbd2824917b1 | 317 | |
irsanjul | 0:cbd2824917b1 | 318 | void Noritake_VFD_GU7000::println(long number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 319 | print(number, base); |
irsanjul | 0:cbd2824917b1 | 320 | crlf(); |
irsanjul | 0:cbd2824917b1 | 321 | } |
irsanjul | 0:cbd2824917b1 | 322 | |
irsanjul | 0:cbd2824917b1 | 323 | void Noritake_VFD_GU7000::println(int number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 324 | println((long) number, base); |
irsanjul | 0:cbd2824917b1 | 325 | } |
irsanjul | 0:cbd2824917b1 | 326 | |
irsanjul | 0:cbd2824917b1 | 327 | void Noritake_VFD_GU7000::println(unsigned long number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 328 | print(number, base); |
irsanjul | 0:cbd2824917b1 | 329 | crlf(); |
irsanjul | 0:cbd2824917b1 | 330 | } |
irsanjul | 0:cbd2824917b1 | 331 | |
irsanjul | 0:cbd2824917b1 | 332 | void Noritake_VFD_GU7000::println(unsigned number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 333 | println((unsigned long) number, base); |
irsanjul | 0:cbd2824917b1 | 334 | } |
irsanjul | 0:cbd2824917b1 | 335 | |
irsanjul | 0:cbd2824917b1 | 336 | void Noritake_VFD_GU7000::printNumber(unsigned long number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 337 | if (number/base) |
irsanjul | 0:cbd2824917b1 | 338 | printNumber(number/base, base); |
irsanjul | 0:cbd2824917b1 | 339 | number %= base; |
irsanjul | 0:cbd2824917b1 | 340 | print(number + (number < 10? '0': 'A' - 10)); |
irsanjul | 0:cbd2824917b1 | 341 | } |
irsanjul | 0:cbd2824917b1 | 342 | |
irsanjul | 0:cbd2824917b1 | 343 | void Noritake_VFD_GU7000::GU7000_setBacklightColor(uint8_t r, uint8_t g, uint8_t b) { |
irsanjul | 0:cbd2824917b1 | 344 | #if NORITAKE_VFD_MODEL_CLASS==7040 |
irsanjul | 0:cbd2824917b1 | 345 | command(0x1f, 'L', 0x10); |
irsanjul | 0:cbd2824917b1 | 346 | command(b & 0xf0); |
irsanjul | 0:cbd2824917b1 | 347 | command(g & 0xf0); |
irsanjul | 0:cbd2824917b1 | 348 | command(r & 0xf0); |
irsanjul | 0:cbd2824917b1 | 349 | #endif |
irsanjul | 0:cbd2824917b1 | 350 | } |
irsanjul | 0:cbd2824917b1 | 351 | |
irsanjul | 0:cbd2824917b1 | 352 | void Noritake_VFD_GU7000::GU7000_setBacklightColor(unsigned rgb) { |
irsanjul | 0:cbd2824917b1 | 353 | GU7000_setBacklightColor((rgb>>8 & 0x0f)*16, (rgb>>4 & 0x0f)*16, (rgb & 0x0f)*16); |
irsanjul | 0:cbd2824917b1 | 354 | } |
irsanjul | 0:cbd2824917b1 | 355 | |
irsanjul | 0:cbd2824917b1 | 356 | void Noritake_VFD_GU7000::GU7000_drawImage(unsigned width, uint8_t height, const uint8_t *data) { |
irsanjul | 0:cbd2824917b1 | 357 | if (height > NORITAKE_VFD_HEIGHT) return; |
irsanjul | 0:cbd2824917b1 | 358 | us_command('f', 0x11); |
irsanjul | 0:cbd2824917b1 | 359 | command_xy(width, height); |
irsanjul | 0:cbd2824917b1 | 360 | command((uint8_t) 1); |
irsanjul | 0:cbd2824917b1 | 361 | for (unsigned i = 0; i<(height/8)*width; i++) |
irsanjul | 0:cbd2824917b1 | 362 | command(data[i]); |
irsanjul | 0:cbd2824917b1 | 363 | } |
irsanjul | 0:cbd2824917b1 | 364 | |
irsanjul | 0:cbd2824917b1 | 365 | void Noritake_VFD_GU7000::GU7000_drawFROMImage(unsigned long address, uint8_t srcHeight, unsigned width, uint8_t height) { |
irsanjul | 0:cbd2824917b1 | 366 | #if (NORITAKE_VFD_MODEL_CLASS-7000)/100==9 || (NORITAKE_VFD_MODEL_CLASS-7000)/100==1 |
irsanjul | 0:cbd2824917b1 | 367 | if (height > NORITAKE_VFD_HEIGHT) return; |
irsanjul | 0:cbd2824917b1 | 368 | us_command('f', 0x10); |
irsanjul | 0:cbd2824917b1 | 369 | command(0x01); |
irsanjul | 0:cbd2824917b1 | 370 | command(address); |
irsanjul | 0:cbd2824917b1 | 371 | command(address>>8); |
irsanjul | 0:cbd2824917b1 | 372 | command(address>>16); |
irsanjul | 0:cbd2824917b1 | 373 | command(srcHeight/8); |
irsanjul | 0:cbd2824917b1 | 374 | command((srcHeight/8)>>8); |
irsanjul | 0:cbd2824917b1 | 375 | command_xy(width, height); |
irsanjul | 0:cbd2824917b1 | 376 | command((uint8_t) 1); |
irsanjul | 0:cbd2824917b1 | 377 | #endif |
irsanjul | 0:cbd2824917b1 | 378 | } |
irsanjul | 0:cbd2824917b1 | 379 | |
irsanjul | 0:cbd2824917b1 | 380 | static unsigned min(unsigned x, unsigned y) { return x<y? x: y; } |
irsanjul | 0:cbd2824917b1 | 381 | |
irsanjul | 0:cbd2824917b1 | 382 | void Noritake_VFD_GU7000::GU7000_fillRect(unsigned x0, unsigned y0, unsigned x1, unsigned y1, bool on) { |
irsanjul | 0:cbd2824917b1 | 383 | x0 = min(NORITAKE_VFD_WIDTH, x0); |
irsanjul | 0:cbd2824917b1 | 384 | x1 = min(NORITAKE_VFD_WIDTH, x1); |
irsanjul | 0:cbd2824917b1 | 385 | y0 = min(NORITAKE_VFD_HEIGHT, y0); |
irsanjul | 0:cbd2824917b1 | 386 | y1 = min(NORITAKE_VFD_HEIGHT, y1); |
irsanjul | 0:cbd2824917b1 | 387 | if (y1<=y0 || x1<=x0) return; |
irsanjul | 0:cbd2824917b1 | 388 | uint8_t bufw = 8, bufh = (y1-y0+7)/8*8; |
irsanjul | 0:cbd2824917b1 | 389 | uint8_t *buf = (uint8_t*)alloca(bufh/8 * bufw); |
irsanjul | 0:cbd2824917b1 | 390 | for (unsigned x = 0; x < x1-x0; x += bufw) { |
irsanjul | 0:cbd2824917b1 | 391 | uint8_t part = (x + bufw < x1-x0)? bufw: (x1-x0) - x; |
irsanjul | 0:cbd2824917b1 | 392 | memset(buf, 0, bufh/8 * bufw); |
irsanjul | 0:cbd2824917b1 | 393 | if (on) |
irsanjul | 0:cbd2824917b1 | 394 | for (uint8_t col = 0; col < part; col++) { |
irsanjul | 0:cbd2824917b1 | 395 | for (uint8_t py = y0 % 8; py < y0 % 8 + min(y1-y0, 8); py++) |
irsanjul | 0:cbd2824917b1 | 396 | buf[col*bufh/8] |= 1 << (7-py); |
irsanjul | 0:cbd2824917b1 | 397 | for (uint8_t row = (y0+7)/8; row < y1/8; row++) |
irsanjul | 0:cbd2824917b1 | 398 | buf[row - y0/8 + col*bufh/8] = 0xff; |
irsanjul | 0:cbd2824917b1 | 399 | if (y0/8 != y1/8) |
irsanjul | 0:cbd2824917b1 | 400 | for (uint8_t py = 0; py < y1 % 8; py++) |
irsanjul | 0:cbd2824917b1 | 401 | buf[(y1-y0)/8 + col*bufh/8] |= 1 << (7-py); |
irsanjul | 0:cbd2824917b1 | 402 | } |
irsanjul | 0:cbd2824917b1 | 403 | GU7000_setCursor(x + x0, y0); |
irsanjul | 0:cbd2824917b1 | 404 | GU7000_drawImage(bufw, bufh, buf); |
irsanjul | 0:cbd2824917b1 | 405 | } |
irsanjul | 0:cbd2824917b1 | 406 | } |
irsanjul | 0:cbd2824917b1 | 407 | |
irsanjul | 0:cbd2824917b1 | 408 | void Noritake_VFD_GU7000::command(uint8_t data) { |
irsanjul | 0:cbd2824917b1 | 409 | writePort(data); |
irsanjul | 0:cbd2824917b1 | 410 | } |
irsanjul | 0:cbd2824917b1 | 411 | void Noritake_VFD_GU7000::command_xy(unsigned x, unsigned y) { |
irsanjul | 0:cbd2824917b1 | 412 | command(x); |
irsanjul | 0:cbd2824917b1 | 413 | command(x>>8); |
irsanjul | 0:cbd2824917b1 | 414 | y /= 8; |
irsanjul | 0:cbd2824917b1 | 415 | command(y); |
irsanjul | 0:cbd2824917b1 | 416 | command(y>>8); |
irsanjul | 0:cbd2824917b1 | 417 | } |
irsanjul | 0:cbd2824917b1 | 418 | void Noritake_VFD_GU7000::command_xy1(unsigned x, unsigned y) { |
irsanjul | 0:cbd2824917b1 | 419 | command(x); |
irsanjul | 0:cbd2824917b1 | 420 | command(x>>8); |
irsanjul | 0:cbd2824917b1 | 421 | command(y); |
irsanjul | 0:cbd2824917b1 | 422 | command(y>>8); |
irsanjul | 0:cbd2824917b1 | 423 | } |
irsanjul | 0:cbd2824917b1 | 424 | |
irsanjul | 0:cbd2824917b1 | 425 | void Noritake_VFD_GU7000::us_command(uint8_t group, uint8_t cmd) { |
irsanjul | 0:cbd2824917b1 | 426 | command(0x1f); |
irsanjul | 0:cbd2824917b1 | 427 | command(0x28); |
irsanjul | 0:cbd2824917b1 | 428 | command(group); |
irsanjul | 0:cbd2824917b1 | 429 | command(cmd); |
irsanjul | 0:cbd2824917b1 | 430 | } |
irsanjul | 0:cbd2824917b1 | 431 | |
irsanjul | 0:cbd2824917b1 | 432 | void Noritake_VFD_GU7000::command(uint8_t prefix, uint8_t group, uint8_t cmd) { |
irsanjul | 0:cbd2824917b1 | 433 | command(prefix); |
irsanjul | 0:cbd2824917b1 | 434 | command(group); |
irsanjul | 0:cbd2824917b1 | 435 | command(cmd); |
irsanjul | 0:cbd2824917b1 | 436 | } |
irsanjul | 0:cbd2824917b1 | 437 | |
irsanjul | 0:cbd2824917b1 | 438 | void Noritake_VFD_GU7000::print(unsigned x, uint8_t y, const char *buffer, uint8_t len) { |
irsanjul | 0:cbd2824917b1 | 439 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 440 | us_command('d', 0x30); |
irsanjul | 0:cbd2824917b1 | 441 | command_xy1(x, y); |
irsanjul | 0:cbd2824917b1 | 442 | command(0); |
irsanjul | 0:cbd2824917b1 | 443 | command(len); |
irsanjul | 0:cbd2824917b1 | 444 | while (len--) |
irsanjul | 0:cbd2824917b1 | 445 | command(*buffer++); |
irsanjul | 0:cbd2824917b1 | 446 | #endif |
irsanjul | 0:cbd2824917b1 | 447 | } |
irsanjul | 0:cbd2824917b1 | 448 | |
irsanjul | 0:cbd2824917b1 | 449 | void Noritake_VFD_GU7000::print(unsigned x, uint8_t y, const char *str) { |
irsanjul | 0:cbd2824917b1 | 450 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 451 | print(x, y, str, strlen(str)); |
irsanjul | 0:cbd2824917b1 | 452 | #endif |
irsanjul | 0:cbd2824917b1 | 453 | } |
irsanjul | 0:cbd2824917b1 | 454 | void Noritake_VFD_GU7000::print(unsigned x, uint8_t y, char c) { |
irsanjul | 0:cbd2824917b1 | 455 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 456 | print(x, y, &c, 1); |
irsanjul | 0:cbd2824917b1 | 457 | #endif |
irsanjul | 0:cbd2824917b1 | 458 | } |
irsanjul | 0:cbd2824917b1 | 459 | void Noritake_VFD_GU7000::print(unsigned x, uint8_t y, int number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 460 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 461 | if (number < 0) { |
irsanjul | 0:cbd2824917b1 | 462 | print(x, y, '-'); |
irsanjul | 0:cbd2824917b1 | 463 | print(-1, y, (unsigned)-number, base); |
irsanjul | 0:cbd2824917b1 | 464 | } else |
irsanjul | 0:cbd2824917b1 | 465 | print(x, y, (unsigned)number, base); |
irsanjul | 0:cbd2824917b1 | 466 | #endif |
irsanjul | 0:cbd2824917b1 | 467 | } |
irsanjul | 0:cbd2824917b1 | 468 | void Noritake_VFD_GU7000::print(unsigned x, uint8_t y, unsigned number, uint8_t base) { |
irsanjul | 0:cbd2824917b1 | 469 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 470 | char buf[16], *p = buf + sizeof buf; |
irsanjul | 0:cbd2824917b1 | 471 | do |
irsanjul | 0:cbd2824917b1 | 472 | *--p = number % base + (number % base < 10? '0': 'A' - 10); |
irsanjul | 0:cbd2824917b1 | 473 | while (number /= base); |
irsanjul | 0:cbd2824917b1 | 474 | print(x, y, p, buf + sizeof buf - p); |
irsanjul | 0:cbd2824917b1 | 475 | #endif |
irsanjul | 0:cbd2824917b1 | 476 | } |
irsanjul | 0:cbd2824917b1 | 477 | void Noritake_VFD_GU7000::GU7000_drawImage(unsigned x, uint8_t y, unsigned width, uint8_t height, const uint8_t *data) { |
irsanjul | 0:cbd2824917b1 | 478 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 479 | us_command('d', 0x21); |
irsanjul | 0:cbd2824917b1 | 480 | command_xy1(x, y); |
irsanjul | 0:cbd2824917b1 | 481 | command_xy1(width, height); |
irsanjul | 0:cbd2824917b1 | 482 | command(0x01); |
irsanjul | 0:cbd2824917b1 | 483 | for (unsigned i = 0; i<(height/8)*width; i++) |
irsanjul | 0:cbd2824917b1 | 484 | command(data[i]); |
irsanjul | 0:cbd2824917b1 | 485 | #endif |
irsanjul | 0:cbd2824917b1 | 486 | } |
irsanjul | 0:cbd2824917b1 | 487 | void Noritake_VFD_GU7000::GU7000_drawImage(unsigned x, uint8_t y, ImageMemoryArea area, unsigned long address, uint8_t srcHeight, unsigned width, uint8_t height, unsigned offsetx, unsigned offsety) { |
irsanjul | 0:cbd2824917b1 | 488 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 489 | if (height > NORITAKE_VFD_HEIGHT) return; |
irsanjul | 0:cbd2824917b1 | 490 | us_command('d', 0x20); |
irsanjul | 0:cbd2824917b1 | 491 | command_xy1(x, y); |
irsanjul | 0:cbd2824917b1 | 492 | command(area); |
irsanjul | 0:cbd2824917b1 | 493 | command(address); |
irsanjul | 0:cbd2824917b1 | 494 | command(address>>8); |
irsanjul | 0:cbd2824917b1 | 495 | command(address>>16); |
irsanjul | 0:cbd2824917b1 | 496 | command(srcHeight/8); |
irsanjul | 0:cbd2824917b1 | 497 | command(srcHeight/8>>8); |
irsanjul | 0:cbd2824917b1 | 498 | command_xy1(offsetx, offsety); |
irsanjul | 0:cbd2824917b1 | 499 | command_xy1(width, height); |
irsanjul | 0:cbd2824917b1 | 500 | command(0x01); |
irsanjul | 0:cbd2824917b1 | 501 | #endif |
irsanjul | 0:cbd2824917b1 | 502 | } |
irsanjul | 0:cbd2824917b1 | 503 | |
irsanjul | 0:cbd2824917b1 | 504 | void Noritake_VFD_GU7000::GU7000_drawImage(unsigned x, uint8_t y, ImageMemoryArea area, unsigned long address, unsigned width, uint8_t height) { |
irsanjul | 0:cbd2824917b1 | 505 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 506 | GU7000_drawImage(x, y, area, address, (height + 7) & ~7, width, height, 0, 0); |
irsanjul | 0:cbd2824917b1 | 507 | #endif |
irsanjul | 0:cbd2824917b1 | 508 | } |
irsanjul | 0:cbd2824917b1 | 509 | |
irsanjul | 0:cbd2824917b1 | 510 | void Noritake_VFD_GU7000::print_p(const char *str) { |
irsanjul | 0:cbd2824917b1 | 511 | while (pgm_read_byte(str)) |
irsanjul | 0:cbd2824917b1 | 512 | writePort(pgm_read_byte(str++)); |
irsanjul | 0:cbd2824917b1 | 513 | } |
irsanjul | 0:cbd2824917b1 | 514 | void Noritake_VFD_GU7000::print_p(unsigned x, uint8_t y, const char *buffer, uint8_t len) { |
irsanjul | 0:cbd2824917b1 | 515 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 516 | us_command('d', 0x30); |
irsanjul | 0:cbd2824917b1 | 517 | command_xy1(x, y); |
irsanjul | 0:cbd2824917b1 | 518 | command(0); |
irsanjul | 0:cbd2824917b1 | 519 | command(len); |
irsanjul | 0:cbd2824917b1 | 520 | while (len--) |
irsanjul | 0:cbd2824917b1 | 521 | command(pgm_read_byte(buffer++)); |
irsanjul | 0:cbd2824917b1 | 522 | #endif |
irsanjul | 0:cbd2824917b1 | 523 | } |
irsanjul | 0:cbd2824917b1 | 524 | |
irsanjul | 0:cbd2824917b1 | 525 | void Noritake_VFD_GU7000::print_p(unsigned x, uint8_t y, const char *str) { |
irsanjul | 0:cbd2824917b1 | 526 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 527 | const char *end = str; |
irsanjul | 0:cbd2824917b1 | 528 | while (pgm_read_byte(end)) end++; |
irsanjul | 0:cbd2824917b1 | 529 | print_p(x, y, str, end - str); |
irsanjul | 0:cbd2824917b1 | 530 | #endif |
irsanjul | 0:cbd2824917b1 | 531 | } |
irsanjul | 0:cbd2824917b1 | 532 | |
irsanjul | 0:cbd2824917b1 | 533 | void Noritake_VFD_GU7000::GU7000_drawImage_p(unsigned width, uint8_t height, const uint8_t *data) { |
irsanjul | 0:cbd2824917b1 | 534 | if (height > NORITAKE_VFD_HEIGHT) return; |
irsanjul | 0:cbd2824917b1 | 535 | us_command('f', 0x11); |
irsanjul | 0:cbd2824917b1 | 536 | command_xy(width, height); |
irsanjul | 0:cbd2824917b1 | 537 | command((uint8_t) 1); |
irsanjul | 0:cbd2824917b1 | 538 | for (unsigned i = 0; i<(height/8)*width; i++) |
irsanjul | 0:cbd2824917b1 | 539 | command(pgm_read_byte(data+i)); |
irsanjul | 0:cbd2824917b1 | 540 | } |
irsanjul | 0:cbd2824917b1 | 541 | |
irsanjul | 0:cbd2824917b1 | 542 | void Noritake_VFD_GU7000::GU7000_drawImage_p(unsigned x, uint8_t y, unsigned width, uint8_t height, const uint8_t *data) { |
irsanjul | 0:cbd2824917b1 | 543 | #if NORITAKE_VFD_GENERATION == 'B' |
irsanjul | 0:cbd2824917b1 | 544 | us_command('d', 0x21); |
irsanjul | 0:cbd2824917b1 | 545 | command_xy1(x, y); |
irsanjul | 0:cbd2824917b1 | 546 | command_xy1(width, height); |
irsanjul | 0:cbd2824917b1 | 547 | command(0x01); |
irsanjul | 0:cbd2824917b1 | 548 | for (unsigned i = 0; i<(height/8)*width; i++) |
irsanjul | 0:cbd2824917b1 | 549 | command(pgm_read_byte(data+i)); |
irsanjul | 0:cbd2824917b1 | 550 | #endif |
irsanjul | 0:cbd2824917b1 | 551 | } |
irsanjul | 0:cbd2824917b1 | 552 | |
irsanjul | 0:cbd2824917b1 | 553 | |
irsanjul | 0:cbd2824917b1 | 554 | /** |
irsanjul | 0:cbd2824917b1 | 555 | Begin I2C Implementation for 16SCIS752 dual UART |
irsanjul | 0:cbd2824917b1 | 556 | **/ |
irsanjul | 0:cbd2824917b1 | 557 | /* |
irsanjul | 0:cbd2824917b1 | 558 | noritake_i2c::noritake_i2c(PinName sda, PinName scl): i2c(sda, scl, SC16IS752_SA5, NC, SC16IS752::Channel_A) |
irsanjul | 0:cbd2824917b1 | 559 | { |
irsanjul | 0:cbd2824917b1 | 560 | i2c.init(38400); |
irsanjul | 0:cbd2824917b1 | 561 | } |
irsanjul | 0:cbd2824917b1 | 562 | |
irsanjul | 0:cbd2824917b1 | 563 | noritake_i2c::~noritake_i2c() |
irsanjul | 0:cbd2824917b1 | 564 | { |
irsanjul | 0:cbd2824917b1 | 565 | |
irsanjul | 0:cbd2824917b1 | 566 | } |
irsanjul | 0:cbd2824917b1 | 567 | |
irsanjul | 0:cbd2824917b1 | 568 | void noritake_i2c::writePort(uint8_t data) |
irsanjul | 0:cbd2824917b1 | 569 | { |
irsanjul | 0:cbd2824917b1 | 570 | |
irsanjul | 0:cbd2824917b1 | 571 | } |
irsanjul | 0:cbd2824917b1 | 572 | |
irsanjul | 0:cbd2824917b1 | 573 | void noritake_i2c::hardReset() |
irsanjul | 0:cbd2824917b1 | 574 | { |
irsanjul | 0:cbd2824917b1 | 575 | |
irsanjul | 0:cbd2824917b1 | 576 | }*/ |