Driver for 4D Systems LCD screen with Picaso processor. Ported from 4D Systems Picaso Serial Linux Library
Dependents: Lab4_Demo_Game 4180_Final_Project
Fork of uLCD_4D_Picaso by
uLCD_4D_Picaso.cpp@1:1e8da43647e9, 2015-03-06 (annotated)
- Committer:
- admcrae
- Date:
- Fri Mar 06 00:50:49 2015 +0000
- Revision:
- 1:1e8da43647e9
- Parent:
- 0:e314f3b805ed
- Child:
- 2:ebe7029e2825
Rev. 1.1 (removed unnecessary debugging printf).
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
admcrae | 0:e314f3b805ed | 1 | /** |
admcrae | 0:e314f3b805ed | 2 | * This is a class to drive 4D systems screens with Picaso graphics processors |
admcrae | 0:e314f3b805ed | 3 | * |
admcrae | 0:e314f3b805ed | 4 | * This is a port of the 4D systems Picaso Serial Linux Library |
admcrae | 0:e314f3b805ed | 5 | * Copyright (c) 2014 4D Systems PTY Ltd, Sydney, Australia |
admcrae | 0:e314f3b805ed | 6 | * From https://github.com/4dsystems/Picaso-Serial-Linux-Library, retrieved March 5, 2015 |
admcrae | 0:e314f3b805ed | 7 | * |
admcrae | 0:e314f3b805ed | 8 | * All software in this library is provided without warranty; use at your own risk. |
admcrae | 0:e314f3b805ed | 9 | */ |
admcrae | 0:e314f3b805ed | 10 | |
admcrae | 0:e314f3b805ed | 11 | #include "mbed.h" |
admcrae | 0:e314f3b805ed | 12 | #include <string.h> |
admcrae | 0:e314f3b805ed | 13 | #include <math.h> |
admcrae | 0:e314f3b805ed | 14 | #include <ctype.h> |
admcrae | 0:e314f3b805ed | 15 | |
admcrae | 0:e314f3b805ed | 16 | #include "Picaso_Types4D.h" // defines data types used by the 4D Routines |
admcrae | 0:e314f3b805ed | 17 | #include "Picaso_const4D.h" // defines for 4dgl constants, generated by conversion of 4DGL constants to target language |
admcrae | 0:e314f3b805ed | 18 | #include "uLCD_4D_Picaso.h" |
admcrae | 0:e314f3b805ed | 19 | |
admcrae | 0:e314f3b805ed | 20 | //Error types |
admcrae | 0:e314f3b805ed | 21 | #define Err4D_OK 0 |
admcrae | 0:e314f3b805ed | 22 | #define Err4D_Timeout 1 |
admcrae | 0:e314f3b805ed | 23 | #define Err4D_NAK 2 |
admcrae | 0:e314f3b805ed | 24 | |
admcrae | 0:e314f3b805ed | 25 | |
admcrae | 0:e314f3b805ed | 26 | //Default wait time (in ms) for Serial acknowledgement |
admcrae | 0:e314f3b805ed | 27 | #define RX_MAX_WAIT_DEFAULT 2000 |
admcrae | 0:e314f3b805ed | 28 | |
admcrae | 0:e314f3b805ed | 29 | #if LCD_USING_MODSERIAL |
admcrae | 0:e314f3b805ed | 30 | //Serial port buffer sizes |
admcrae | 0:e314f3b805ed | 31 | #define TX_BUF_SIZE 256 |
admcrae | 0:e314f3b805ed | 32 | #define RX_BUF_SIZE 2048 |
admcrae | 0:e314f3b805ed | 33 | #endif |
admcrae | 0:e314f3b805ed | 34 | |
admcrae | 0:e314f3b805ed | 35 | /* |
admcrae | 0:e314f3b805ed | 36 | * Start of 4D Intrinsic Routines |
admcrae | 0:e314f3b805ed | 37 | */ |
admcrae | 0:e314f3b805ed | 38 | uLCD_4D_Picaso::uLCD_4D_Picaso(PinName tx, PinName rx, PinName reset) : |
admcrae | 0:e314f3b805ed | 39 | #if LCD_USING_MODSERIAL |
admcrae | 0:e314f3b805ed | 40 | serial(tx, rx, TX_BUF_SIZE, RX_BUF_SIZE), |
admcrae | 0:e314f3b805ed | 41 | #else |
admcrae | 0:e314f3b805ed | 42 | serial(tx, rx), |
admcrae | 0:e314f3b805ed | 43 | #endif |
admcrae | 0:e314f3b805ed | 44 | rst(reset) |
admcrae | 0:e314f3b805ed | 45 | { |
admcrae | 0:e314f3b805ed | 46 | TimeLimit4D = RX_MAX_WAIT_DEFAULT; |
admcrae | 0:e314f3b805ed | 47 | serial.baud(9600); |
admcrae | 0:e314f3b805ed | 48 | LCD_reset(); |
admcrae | 0:e314f3b805ed | 49 | gfx_Cls(); |
admcrae | 0:e314f3b805ed | 50 | } |
admcrae | 0:e314f3b805ed | 51 | |
admcrae | 0:e314f3b805ed | 52 | void uLCD_4D_Picaso::LCD_reset() { |
admcrae | 0:e314f3b805ed | 53 | rst = 0; |
admcrae | 0:e314f3b805ed | 54 | LCD_wait_ms(1); |
admcrae | 0:e314f3b805ed | 55 | rst = 1; |
admcrae | 0:e314f3b805ed | 56 | LCD_wait_ms(3000); |
admcrae | 0:e314f3b805ed | 57 | rxFlush(); |
admcrae | 0:e314f3b805ed | 58 | } |
admcrae | 0:e314f3b805ed | 59 | |
admcrae | 0:e314f3b805ed | 60 | void uLCD_4D_Picaso::LCD_wait_ms(int ms) { |
admcrae | 0:e314f3b805ed | 61 | timer.reset(); |
admcrae | 0:e314f3b805ed | 62 | timer.start(); |
admcrae | 0:e314f3b805ed | 63 | while (timer.read_ms() < ms); |
admcrae | 0:e314f3b805ed | 64 | timer.stop(); |
admcrae | 0:e314f3b805ed | 65 | return; |
admcrae | 0:e314f3b805ed | 66 | } |
admcrae | 0:e314f3b805ed | 67 | |
admcrae | 0:e314f3b805ed | 68 | void uLCD_4D_Picaso::rxFlush() { |
admcrae | 0:e314f3b805ed | 69 | while (serial.readable()) { |
admcrae | 0:e314f3b805ed | 70 | serial.getc(); |
admcrae | 0:e314f3b805ed | 71 | } |
admcrae | 0:e314f3b805ed | 72 | } |
admcrae | 0:e314f3b805ed | 73 | |
admcrae | 0:e314f3b805ed | 74 | void uLCD_4D_Picaso::WriteBytes(char *psOutput, int nCount) { |
admcrae | 0:e314f3b805ed | 75 | int i; |
admcrae | 0:e314f3b805ed | 76 | rxFlush(); |
admcrae | 0:e314f3b805ed | 77 | for (i = 0; i < nCount; ++i) { |
admcrae | 0:e314f3b805ed | 78 | while (!serial.writeable()); |
admcrae | 0:e314f3b805ed | 79 | serial.putc(psOutput[i]); |
admcrae | 0:e314f3b805ed | 80 | } |
admcrae | 0:e314f3b805ed | 81 | } |
admcrae | 0:e314f3b805ed | 82 | |
admcrae | 0:e314f3b805ed | 83 | void uLCD_4D_Picaso::WriteChars(char *psOutput) { |
admcrae | 0:e314f3b805ed | 84 | // Include NULL in output |
admcrae | 0:e314f3b805ed | 85 | WriteBytes(psOutput, strlen((char *)psOutput) + 1); |
admcrae | 0:e314f3b805ed | 86 | return; |
admcrae | 0:e314f3b805ed | 87 | } |
admcrae | 0:e314f3b805ed | 88 | |
admcrae | 0:e314f3b805ed | 89 | void uLCD_4D_Picaso::WriteWords(WORD * Source, int Size) { |
admcrae | 0:e314f3b805ed | 90 | WORD wk ; |
admcrae | 0:e314f3b805ed | 91 | int i ; |
admcrae | 0:e314f3b805ed | 92 | for (i = 0; i < Size; i++) |
admcrae | 0:e314f3b805ed | 93 | { |
admcrae | 0:e314f3b805ed | 94 | wk = *Source++ ; |
admcrae | 0:e314f3b805ed | 95 | wk = (wk >> 8) + (wk << 8) ; |
admcrae | 0:e314f3b805ed | 96 | WriteBytes((char *)&wk, 2); |
admcrae | 0:e314f3b805ed | 97 | } |
admcrae | 0:e314f3b805ed | 98 | } |
admcrae | 0:e314f3b805ed | 99 | |
admcrae | 0:e314f3b805ed | 100 | // read string from the serial port |
admcrae | 0:e314f3b805ed | 101 | // return code: |
admcrae | 0:e314f3b805ed | 102 | // >= 0 = number of characters read |
admcrae | 0:e314f3b805ed | 103 | // -1 = read failed |
admcrae | 0:e314f3b805ed | 104 | int uLCD_4D_Picaso::ReadSerPort(char *psData, int iMax) { |
admcrae | 0:e314f3b805ed | 105 | int i; |
admcrae | 0:e314f3b805ed | 106 | Error4D = Err4D_OK; |
admcrae | 0:e314f3b805ed | 107 | |
admcrae | 0:e314f3b805ed | 108 | timer.reset(); |
admcrae | 0:e314f3b805ed | 109 | timer.start(); |
admcrae | 0:e314f3b805ed | 110 | |
admcrae | 0:e314f3b805ed | 111 | for (i = 0; i < iMax; ++i) { |
admcrae | 0:e314f3b805ed | 112 | while (!serial.readable()) { |
admcrae | 0:e314f3b805ed | 113 | if (timer.read_ms() >= TimeLimit4D) { |
admcrae | 0:e314f3b805ed | 114 | Error4D = Err4D_Timeout; |
admcrae | 0:e314f3b805ed | 115 | timer.stop(); |
admcrae | 0:e314f3b805ed | 116 | return -1; |
admcrae | 0:e314f3b805ed | 117 | } |
admcrae | 0:e314f3b805ed | 118 | } |
admcrae | 0:e314f3b805ed | 119 | psData[i] = serial.getc(); |
admcrae | 0:e314f3b805ed | 120 | } |
admcrae | 0:e314f3b805ed | 121 | |
admcrae | 0:e314f3b805ed | 122 | timer.stop(); |
admcrae | 0:e314f3b805ed | 123 | return iMax; |
admcrae | 0:e314f3b805ed | 124 | } |
admcrae | 0:e314f3b805ed | 125 | |
admcrae | 0:e314f3b805ed | 126 | void uLCD_4D_Picaso::getbytes(char *data, int size) { |
admcrae | 0:e314f3b805ed | 127 | int readc; |
admcrae | 0:e314f3b805ed | 128 | readc = ReadSerPort(data, size); |
admcrae | 0:e314f3b805ed | 129 | if (readc != size) { |
admcrae | 0:e314f3b805ed | 130 | printf("LCD serial: read timeout\r\n"); |
admcrae | 0:e314f3b805ed | 131 | } |
admcrae | 0:e314f3b805ed | 132 | } |
admcrae | 0:e314f3b805ed | 133 | |
admcrae | 0:e314f3b805ed | 134 | void uLCD_4D_Picaso::GetAck(void) { |
admcrae | 0:e314f3b805ed | 135 | char readx; |
admcrae | 0:e314f3b805ed | 136 | getbytes(&readx, 1); |
admcrae | 0:e314f3b805ed | 137 | |
admcrae | 0:e314f3b805ed | 138 | if (readx != 6) { |
admcrae | 0:e314f3b805ed | 139 | Error4D = Err4D_NAK; |
admcrae | 0:e314f3b805ed | 140 | printf("LCD serial: no ACK received\r\n"); |
admcrae | 0:e314f3b805ed | 141 | } |
admcrae | 0:e314f3b805ed | 142 | return; |
admcrae | 0:e314f3b805ed | 143 | } |
admcrae | 0:e314f3b805ed | 144 | |
admcrae | 0:e314f3b805ed | 145 | |
admcrae | 0:e314f3b805ed | 146 | WORD uLCD_4D_Picaso::GetWord(void) { |
admcrae | 0:e314f3b805ed | 147 | char readx[2]; |
admcrae | 0:e314f3b805ed | 148 | getbytes(readx, 2); |
admcrae | 0:e314f3b805ed | 149 | return readx[0] << 8 | readx[1]; |
admcrae | 0:e314f3b805ed | 150 | } |
admcrae | 0:e314f3b805ed | 151 | |
admcrae | 0:e314f3b805ed | 152 | void uLCD_4D_Picaso::getString(char *outStr, int strLen) { |
admcrae | 0:e314f3b805ed | 153 | getbytes(outStr, strLen); |
admcrae | 0:e314f3b805ed | 154 | |
admcrae | 0:e314f3b805ed | 155 | // Append EOS |
admcrae | 0:e314f3b805ed | 156 | outStr[strLen] = '\0'; |
admcrae | 0:e314f3b805ed | 157 | |
admcrae | 0:e314f3b805ed | 158 | return; |
admcrae | 0:e314f3b805ed | 159 | } |
admcrae | 0:e314f3b805ed | 160 | |
admcrae | 0:e314f3b805ed | 161 | WORD uLCD_4D_Picaso::GetAckResp(void) { |
admcrae | 0:e314f3b805ed | 162 | GetAck(); |
admcrae | 0:e314f3b805ed | 163 | return GetWord(); |
admcrae | 0:e314f3b805ed | 164 | } |
admcrae | 0:e314f3b805ed | 165 | |
admcrae | 0:e314f3b805ed | 166 | WORD uLCD_4D_Picaso::WaitForAck(void) { |
admcrae | 0:e314f3b805ed | 167 | int saveTimeout = TimeLimit4D; |
admcrae | 0:e314f3b805ed | 168 | |
admcrae | 0:e314f3b805ed | 169 | // check once per minute |
admcrae | 0:e314f3b805ed | 170 | TimeLimit4D = 60 * 1000; |
admcrae | 0:e314f3b805ed | 171 | do { |
admcrae | 0:e314f3b805ed | 172 | GetAck(); |
admcrae | 0:e314f3b805ed | 173 | } while (Error4D != Err4D_OK); |
admcrae | 0:e314f3b805ed | 174 | |
admcrae | 0:e314f3b805ed | 175 | // Restore callback/timeout saves |
admcrae | 0:e314f3b805ed | 176 | TimeLimit4D = saveTimeout; |
admcrae | 0:e314f3b805ed | 177 | |
admcrae | 0:e314f3b805ed | 178 | return GetWord(); |
admcrae | 0:e314f3b805ed | 179 | } |
admcrae | 0:e314f3b805ed | 180 | |
admcrae | 0:e314f3b805ed | 181 | WORD uLCD_4D_Picaso::GetAckRes2Words(WORD * word1, WORD * word2) { |
admcrae | 0:e314f3b805ed | 182 | int Result; |
admcrae | 0:e314f3b805ed | 183 | GetAck(); |
admcrae | 0:e314f3b805ed | 184 | Result = GetWord(); |
admcrae | 0:e314f3b805ed | 185 | *word1 = GetWord(); |
admcrae | 0:e314f3b805ed | 186 | *word2 = GetWord(); |
admcrae | 0:e314f3b805ed | 187 | return Result; |
admcrae | 0:e314f3b805ed | 188 | } |
admcrae | 0:e314f3b805ed | 189 | |
admcrae | 0:e314f3b805ed | 190 | void uLCD_4D_Picaso::GetAck2Words(WORD * word1, WORD * word2) { |
admcrae | 0:e314f3b805ed | 191 | GetAck(); |
admcrae | 0:e314f3b805ed | 192 | *word1 = GetWord(); |
admcrae | 0:e314f3b805ed | 193 | *word2 = GetWord(); |
admcrae | 0:e314f3b805ed | 194 | } |
admcrae | 0:e314f3b805ed | 195 | |
admcrae | 0:e314f3b805ed | 196 | WORD uLCD_4D_Picaso::GetAckResSector(t4DSector Sector) { |
admcrae | 0:e314f3b805ed | 197 | int Result; |
admcrae | 0:e314f3b805ed | 198 | GetAck(); |
admcrae | 0:e314f3b805ed | 199 | Result = GetWord(); |
admcrae | 0:e314f3b805ed | 200 | getbytes(Sector, 512); |
admcrae | 0:e314f3b805ed | 201 | return Result; |
admcrae | 0:e314f3b805ed | 202 | } |
admcrae | 0:e314f3b805ed | 203 | |
admcrae | 0:e314f3b805ed | 204 | WORD uLCD_4D_Picaso::GetAckResStr(char * OutStr) { |
admcrae | 0:e314f3b805ed | 205 | int Result; |
admcrae | 0:e314f3b805ed | 206 | GetAck(); |
admcrae | 0:e314f3b805ed | 207 | Result = GetWord(); |
admcrae | 0:e314f3b805ed | 208 | getString(OutStr, Result); |
admcrae | 0:e314f3b805ed | 209 | return Result; |
admcrae | 0:e314f3b805ed | 210 | } |
admcrae | 0:e314f3b805ed | 211 | |
admcrae | 0:e314f3b805ed | 212 | WORD uLCD_4D_Picaso::GetAckResData(t4DByteArray OutData, WORD size) { |
admcrae | 0:e314f3b805ed | 213 | int Result; |
admcrae | 0:e314f3b805ed | 214 | GetAck(); |
admcrae | 0:e314f3b805ed | 215 | Result = GetWord(); |
admcrae | 0:e314f3b805ed | 216 | getbytes(OutData, size); |
admcrae | 0:e314f3b805ed | 217 | return Result; |
admcrae | 0:e314f3b805ed | 218 | } |
admcrae | 0:e314f3b805ed | 219 | |
admcrae | 0:e314f3b805ed | 220 | |
admcrae | 0:e314f3b805ed | 221 | void uLCD_4D_Picaso::SetThisBaudrate(uLCD_4D_Picaso::BaudRate Newrate) { |
admcrae | 0:e314f3b805ed | 222 | int nBaud; |
admcrae | 0:e314f3b805ed | 223 | |
admcrae | 0:e314f3b805ed | 224 | switch (Newrate) { |
admcrae | 0:e314f3b805ed | 225 | case BAUD_110: nBaud = 110; break; |
admcrae | 0:e314f3b805ed | 226 | case BAUD_300: nBaud = 300; break; |
admcrae | 0:e314f3b805ed | 227 | case BAUD_600: nBaud = 600; break; |
admcrae | 0:e314f3b805ed | 228 | case BAUD_1200: nBaud = 1200; break; |
admcrae | 0:e314f3b805ed | 229 | case BAUD_2400: nBaud = 2400; break; |
admcrae | 0:e314f3b805ed | 230 | case BAUD_4800: nBaud = 4800; break; |
admcrae | 0:e314f3b805ed | 231 | case BAUD_9600: nBaud = 9600; break; |
admcrae | 0:e314f3b805ed | 232 | case BAUD_14400: nBaud = 14400; break; |
admcrae | 0:e314f3b805ed | 233 | case BAUD_19200: nBaud = 19200; break; |
admcrae | 0:e314f3b805ed | 234 | case BAUD_31250: nBaud = 31250; break; |
admcrae | 0:e314f3b805ed | 235 | case BAUD_38400: nBaud = 38400; break; |
admcrae | 0:e314f3b805ed | 236 | case BAUD_56000: nBaud = 56000; break; |
admcrae | 0:e314f3b805ed | 237 | case BAUD_57600: nBaud = 57600; break; |
admcrae | 0:e314f3b805ed | 238 | case BAUD_115200: nBaud = 115200; break; |
admcrae | 0:e314f3b805ed | 239 | case BAUD_128000: nBaud = 133929; break; |
admcrae | 0:e314f3b805ed | 240 | case BAUD_256000: nBaud = 281250; break; |
admcrae | 0:e314f3b805ed | 241 | case BAUD_300000: nBaud = 312500; break; |
admcrae | 0:e314f3b805ed | 242 | case BAUD_375000: nBaud = 401786; break; |
admcrae | 0:e314f3b805ed | 243 | case BAUD_500000: nBaud = 562500; break; |
admcrae | 0:e314f3b805ed | 244 | case BAUD_600000: nBaud = 703125; break; |
admcrae | 0:e314f3b805ed | 245 | |
admcrae | 0:e314f3b805ed | 246 | default: |
admcrae | 0:e314f3b805ed | 247 | nBaud = 9600 ; |
admcrae | 0:e314f3b805ed | 248 | } |
admcrae | 0:e314f3b805ed | 249 | |
admcrae | 0:e314f3b805ed | 250 | //Need to wait for the previous command to get out before setting new baud rate. |
admcrae | 0:e314f3b805ed | 251 | //10 ms seems to work for 9600, 40 ms for 2400 |
admcrae | 0:e314f3b805ed | 252 | //Even using MODSERIAL's txIsBusy() doesn't seem to replace the need for this |
admcrae | 0:e314f3b805ed | 253 | LCD_wait_ms(40); |
admcrae | 0:e314f3b805ed | 254 | serial.baud(nBaud); |
admcrae | 0:e314f3b805ed | 255 | |
admcrae | 0:e314f3b805ed | 256 | //Wait 100ms, as specified in serial command manual |
admcrae | 0:e314f3b805ed | 257 | LCD_wait_ms(100); |
admcrae | 0:e314f3b805ed | 258 | |
admcrae | 0:e314f3b805ed | 259 | return; |
admcrae | 0:e314f3b805ed | 260 | } |
admcrae | 0:e314f3b805ed | 261 | |
admcrae | 0:e314f3b805ed | 262 | /* |
admcrae | 0:e314f3b805ed | 263 | * End Of Intrinsic 4DRoutines here |
admcrae | 0:e314f3b805ed | 264 | */ |
admcrae | 0:e314f3b805ed | 265 | |
admcrae | 0:e314f3b805ed | 266 | /* |
admcrae | 0:e314f3b805ed | 267 | * Starts of 4D Compound Routines |
admcrae | 0:e314f3b805ed | 268 | */ |
admcrae | 0:e314f3b805ed | 269 | |
admcrae | 0:e314f3b805ed | 270 | WORD uLCD_4D_Picaso::bus_In() |
admcrae | 0:e314f3b805ed | 271 | { |
admcrae | 0:e314f3b805ed | 272 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 273 | |
admcrae | 0:e314f3b805ed | 274 | towrite[0]= F_bus_In >> 8 ; |
admcrae | 0:e314f3b805ed | 275 | towrite[1]= F_bus_In ; |
admcrae | 0:e314f3b805ed | 276 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 277 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 278 | } |
admcrae | 0:e314f3b805ed | 279 | |
admcrae | 0:e314f3b805ed | 280 | void uLCD_4D_Picaso::bus_Out(WORD Bits) |
admcrae | 0:e314f3b805ed | 281 | { |
admcrae | 0:e314f3b805ed | 282 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 283 | |
admcrae | 0:e314f3b805ed | 284 | towrite[0]= F_bus_Out >> 8 ; |
admcrae | 0:e314f3b805ed | 285 | towrite[1]= F_bus_Out ; |
admcrae | 0:e314f3b805ed | 286 | towrite[2]= Bits >> 8 ; |
admcrae | 0:e314f3b805ed | 287 | towrite[3]= Bits ; |
admcrae | 0:e314f3b805ed | 288 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 289 | GetAck() ; |
admcrae | 0:e314f3b805ed | 290 | } |
admcrae | 0:e314f3b805ed | 291 | |
admcrae | 0:e314f3b805ed | 292 | WORD uLCD_4D_Picaso::bus_Read() |
admcrae | 0:e314f3b805ed | 293 | { |
admcrae | 0:e314f3b805ed | 294 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 295 | |
admcrae | 0:e314f3b805ed | 296 | towrite[0]= F_bus_Read >> 8 ; |
admcrae | 0:e314f3b805ed | 297 | towrite[1]= F_bus_Read ; |
admcrae | 0:e314f3b805ed | 298 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 299 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 300 | } |
admcrae | 0:e314f3b805ed | 301 | |
admcrae | 0:e314f3b805ed | 302 | void uLCD_4D_Picaso::bus_Set(WORD IOMap) |
admcrae | 0:e314f3b805ed | 303 | { |
admcrae | 0:e314f3b805ed | 304 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 305 | |
admcrae | 0:e314f3b805ed | 306 | towrite[0]= F_bus_Set >> 8 ; |
admcrae | 0:e314f3b805ed | 307 | towrite[1]= F_bus_Set ; |
admcrae | 0:e314f3b805ed | 308 | towrite[2]= IOMap >> 8 ; |
admcrae | 0:e314f3b805ed | 309 | towrite[3]= IOMap ; |
admcrae | 0:e314f3b805ed | 310 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 311 | GetAck() ; |
admcrae | 0:e314f3b805ed | 312 | } |
admcrae | 0:e314f3b805ed | 313 | |
admcrae | 0:e314f3b805ed | 314 | void uLCD_4D_Picaso::bus_Write(WORD Bits) |
admcrae | 0:e314f3b805ed | 315 | { |
admcrae | 0:e314f3b805ed | 316 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 317 | |
admcrae | 0:e314f3b805ed | 318 | towrite[0]= F_bus_Write >> 8 ; |
admcrae | 0:e314f3b805ed | 319 | towrite[1]= F_bus_Write ; |
admcrae | 0:e314f3b805ed | 320 | towrite[2]= Bits >> 8 ; |
admcrae | 0:e314f3b805ed | 321 | towrite[3]= Bits ; |
admcrae | 0:e314f3b805ed | 322 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 323 | GetAck() ; |
admcrae | 0:e314f3b805ed | 324 | } |
admcrae | 0:e314f3b805ed | 325 | |
admcrae | 0:e314f3b805ed | 326 | WORD uLCD_4D_Picaso::charheight(char TestChar) |
admcrae | 0:e314f3b805ed | 327 | { |
admcrae | 0:e314f3b805ed | 328 | char towrite[3] ; |
admcrae | 0:e314f3b805ed | 329 | |
admcrae | 0:e314f3b805ed | 330 | towrite[0]= F_charheight >> 8 ; |
admcrae | 0:e314f3b805ed | 331 | towrite[1]= F_charheight ; |
admcrae | 0:e314f3b805ed | 332 | towrite[2]= TestChar; |
admcrae | 0:e314f3b805ed | 333 | WriteBytes(towrite, 3) ; |
admcrae | 0:e314f3b805ed | 334 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 335 | } |
admcrae | 0:e314f3b805ed | 336 | |
admcrae | 0:e314f3b805ed | 337 | WORD uLCD_4D_Picaso::charwidth(char TestChar) |
admcrae | 0:e314f3b805ed | 338 | { |
admcrae | 0:e314f3b805ed | 339 | char towrite[3] ; |
admcrae | 0:e314f3b805ed | 340 | |
admcrae | 0:e314f3b805ed | 341 | towrite[0]= F_charwidth >> 8 ; |
admcrae | 0:e314f3b805ed | 342 | towrite[1]= F_charwidth ; |
admcrae | 0:e314f3b805ed | 343 | towrite[2]= TestChar; |
admcrae | 0:e314f3b805ed | 344 | WriteBytes(towrite, 3) ; |
admcrae | 0:e314f3b805ed | 345 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 346 | } |
admcrae | 0:e314f3b805ed | 347 | |
admcrae | 0:e314f3b805ed | 348 | WORD uLCD_4D_Picaso::file_Close(WORD Handle) |
admcrae | 0:e314f3b805ed | 349 | { |
admcrae | 0:e314f3b805ed | 350 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 351 | |
admcrae | 0:e314f3b805ed | 352 | towrite[0]= F_file_Close >> 8 ; |
admcrae | 0:e314f3b805ed | 353 | towrite[1]= F_file_Close & 0xFF; |
admcrae | 0:e314f3b805ed | 354 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 355 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 356 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 357 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 358 | } |
admcrae | 0:e314f3b805ed | 359 | |
admcrae | 0:e314f3b805ed | 360 | WORD uLCD_4D_Picaso::file_Count(char* Filename) |
admcrae | 0:e314f3b805ed | 361 | { |
admcrae | 0:e314f3b805ed | 362 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 363 | |
admcrae | 0:e314f3b805ed | 364 | towrite[0]= F_file_Count >> 8 ; |
admcrae | 0:e314f3b805ed | 365 | towrite[1]= F_file_Count ; |
admcrae | 0:e314f3b805ed | 366 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 367 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 368 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 369 | } |
admcrae | 0:e314f3b805ed | 370 | |
admcrae | 0:e314f3b805ed | 371 | WORD uLCD_4D_Picaso::file_Dir(char* Filename) |
admcrae | 0:e314f3b805ed | 372 | { |
admcrae | 0:e314f3b805ed | 373 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 374 | |
admcrae | 0:e314f3b805ed | 375 | towrite[0]= F_file_Dir >> 8 ; |
admcrae | 0:e314f3b805ed | 376 | towrite[1]= F_file_Dir ; |
admcrae | 0:e314f3b805ed | 377 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 378 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 379 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 380 | } |
admcrae | 0:e314f3b805ed | 381 | |
admcrae | 0:e314f3b805ed | 382 | WORD uLCD_4D_Picaso::file_Erase(char* Filename) |
admcrae | 0:e314f3b805ed | 383 | { |
admcrae | 0:e314f3b805ed | 384 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 385 | |
admcrae | 0:e314f3b805ed | 386 | towrite[0]= F_file_Erase >> 8 ; |
admcrae | 0:e314f3b805ed | 387 | towrite[1]= F_file_Erase & 0xFF; |
admcrae | 0:e314f3b805ed | 388 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 389 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 390 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 391 | } |
admcrae | 0:e314f3b805ed | 392 | |
admcrae | 0:e314f3b805ed | 393 | WORD uLCD_4D_Picaso::file_Error() |
admcrae | 0:e314f3b805ed | 394 | { |
admcrae | 0:e314f3b805ed | 395 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 396 | |
admcrae | 0:e314f3b805ed | 397 | towrite[0]= F_file_Error >> 8 ; |
admcrae | 0:e314f3b805ed | 398 | towrite[1]= F_file_Error & 0xFF; |
admcrae | 0:e314f3b805ed | 399 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 400 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 401 | } |
admcrae | 0:e314f3b805ed | 402 | |
admcrae | 0:e314f3b805ed | 403 | WORD uLCD_4D_Picaso::file_Exec(char* Filename, WORD ArgCount, t4DWordArray Args) |
admcrae | 0:e314f3b805ed | 404 | { |
admcrae | 0:e314f3b805ed | 405 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 406 | |
admcrae | 0:e314f3b805ed | 407 | towrite[0]= F_file_Exec >> 8 ; |
admcrae | 0:e314f3b805ed | 408 | towrite[1]= F_file_Exec & 0xFF; |
admcrae | 0:e314f3b805ed | 409 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 410 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 411 | towrite[0]= ArgCount >> 8 ; |
admcrae | 0:e314f3b805ed | 412 | towrite[1]= ArgCount ; |
admcrae | 0:e314f3b805ed | 413 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 414 | WriteWords(Args, ArgCount) ; |
admcrae | 0:e314f3b805ed | 415 | return WaitForAck() ; |
admcrae | 0:e314f3b805ed | 416 | } |
admcrae | 0:e314f3b805ed | 417 | |
admcrae | 0:e314f3b805ed | 418 | WORD uLCD_4D_Picaso::file_Exists(char* Filename) |
admcrae | 0:e314f3b805ed | 419 | { |
admcrae | 0:e314f3b805ed | 420 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 421 | |
admcrae | 0:e314f3b805ed | 422 | towrite[0]= F_file_Exists >> 8 ; |
admcrae | 0:e314f3b805ed | 423 | towrite[1]= F_file_Exists & 0xFF; |
admcrae | 0:e314f3b805ed | 424 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 425 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 426 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 427 | } |
admcrae | 0:e314f3b805ed | 428 | |
admcrae | 0:e314f3b805ed | 429 | WORD uLCD_4D_Picaso::file_FindFirst(char* Filename) |
admcrae | 0:e314f3b805ed | 430 | { |
admcrae | 0:e314f3b805ed | 431 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 432 | |
admcrae | 0:e314f3b805ed | 433 | towrite[0]= F_file_FindFirst >> 8 ; |
admcrae | 0:e314f3b805ed | 434 | towrite[1]= F_file_FindFirst & 0xFF; |
admcrae | 0:e314f3b805ed | 435 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 436 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 437 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 438 | } |
admcrae | 0:e314f3b805ed | 439 | |
admcrae | 0:e314f3b805ed | 440 | WORD uLCD_4D_Picaso::file_FindNext() |
admcrae | 0:e314f3b805ed | 441 | { |
admcrae | 0:e314f3b805ed | 442 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 443 | towrite[0]= F_file_FindNext >> 8 ; |
admcrae | 0:e314f3b805ed | 444 | towrite[1]= F_file_FindNext & 0xFF; |
admcrae | 0:e314f3b805ed | 445 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 446 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 447 | } |
admcrae | 0:e314f3b805ed | 448 | |
admcrae | 0:e314f3b805ed | 449 | char uLCD_4D_Picaso::file_GetC(WORD Handle) |
admcrae | 0:e314f3b805ed | 450 | { |
admcrae | 0:e314f3b805ed | 451 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 452 | towrite[0]= F_file_GetC >> 8 ; |
admcrae | 0:e314f3b805ed | 453 | towrite[1]= F_file_GetC & 0xFF; |
admcrae | 0:e314f3b805ed | 454 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 455 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 456 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 457 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 458 | } |
admcrae | 0:e314f3b805ed | 459 | |
admcrae | 0:e314f3b805ed | 460 | WORD uLCD_4D_Picaso::file_GetS(char* StringIn, WORD Size, WORD Handle) |
admcrae | 0:e314f3b805ed | 461 | { |
admcrae | 0:e314f3b805ed | 462 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 463 | towrite[0]= F_file_GetS >> 8 ; |
admcrae | 0:e314f3b805ed | 464 | towrite[1]= F_file_GetS & 0xFF; |
admcrae | 0:e314f3b805ed | 465 | towrite[2]= Size >> 8 ; |
admcrae | 0:e314f3b805ed | 466 | towrite[3]= Size ; |
admcrae | 0:e314f3b805ed | 467 | towrite[4]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 468 | towrite[5]= Handle ; |
admcrae | 0:e314f3b805ed | 469 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 470 | return GetAckResStr(StringIn) ; |
admcrae | 0:e314f3b805ed | 471 | } |
admcrae | 0:e314f3b805ed | 472 | |
admcrae | 0:e314f3b805ed | 473 | WORD uLCD_4D_Picaso::file_GetW(WORD Handle) |
admcrae | 0:e314f3b805ed | 474 | { |
admcrae | 0:e314f3b805ed | 475 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 476 | towrite[0]= F_file_GetW >> 8 ; |
admcrae | 0:e314f3b805ed | 477 | towrite[1]= F_file_GetW & 0xFF; |
admcrae | 0:e314f3b805ed | 478 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 479 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 480 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 481 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 482 | } |
admcrae | 0:e314f3b805ed | 483 | |
admcrae | 0:e314f3b805ed | 484 | WORD uLCD_4D_Picaso::file_Image(WORD X, WORD Y, WORD Handle) |
admcrae | 0:e314f3b805ed | 485 | { |
admcrae | 0:e314f3b805ed | 486 | char towrite[8] ; |
admcrae | 0:e314f3b805ed | 487 | towrite[0]= F_file_Image >> 8 ; |
admcrae | 0:e314f3b805ed | 488 | towrite[1]= F_file_Image & 0xFF; |
admcrae | 0:e314f3b805ed | 489 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 490 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 491 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 492 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 493 | towrite[6]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 494 | towrite[7]= Handle ; |
admcrae | 0:e314f3b805ed | 495 | WriteBytes(towrite, 8) ; |
admcrae | 0:e314f3b805ed | 496 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 497 | } |
admcrae | 0:e314f3b805ed | 498 | |
admcrae | 0:e314f3b805ed | 499 | WORD uLCD_4D_Picaso::file_Index(WORD Handle, WORD HiSize, WORD LoSize, WORD Recordnum) |
admcrae | 0:e314f3b805ed | 500 | { |
admcrae | 0:e314f3b805ed | 501 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 502 | towrite[0]= F_file_Index >> 8 ; |
admcrae | 0:e314f3b805ed | 503 | towrite[1]= F_file_Index & 0xFF; |
admcrae | 0:e314f3b805ed | 504 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 505 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 506 | towrite[4]= HiSize >> 8 ; |
admcrae | 0:e314f3b805ed | 507 | towrite[5]= HiSize ; |
admcrae | 0:e314f3b805ed | 508 | towrite[6]= LoSize >> 8 ; |
admcrae | 0:e314f3b805ed | 509 | towrite[7]= LoSize ; |
admcrae | 0:e314f3b805ed | 510 | towrite[8]= Recordnum >> 8 ; |
admcrae | 0:e314f3b805ed | 511 | towrite[9]= Recordnum ; |
admcrae | 0:e314f3b805ed | 512 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 513 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 514 | } |
admcrae | 0:e314f3b805ed | 515 | |
admcrae | 0:e314f3b805ed | 516 | WORD uLCD_4D_Picaso::file_LoadFunction(char* Filename) |
admcrae | 0:e314f3b805ed | 517 | { |
admcrae | 0:e314f3b805ed | 518 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 519 | towrite[0]= F_file_LoadFunction >> 8 ; |
admcrae | 0:e314f3b805ed | 520 | towrite[1]= F_file_LoadFunction ; |
admcrae | 0:e314f3b805ed | 521 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 522 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 523 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 524 | } |
admcrae | 0:e314f3b805ed | 525 | |
admcrae | 0:e314f3b805ed | 526 | WORD uLCD_4D_Picaso::file_LoadImageControl(char* Datname, char* GCIName, WORD Mode) |
admcrae | 0:e314f3b805ed | 527 | { |
admcrae | 0:e314f3b805ed | 528 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 529 | towrite[0]= F_file_LoadImageControl >> 8 ; |
admcrae | 0:e314f3b805ed | 530 | towrite[1]= F_file_LoadImageControl ; |
admcrae | 0:e314f3b805ed | 531 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 532 | WriteChars(Datname) ; |
admcrae | 0:e314f3b805ed | 533 | WriteChars(GCIName) ; |
admcrae | 0:e314f3b805ed | 534 | towrite[0]= Mode >> 8 ; |
admcrae | 0:e314f3b805ed | 535 | towrite[1]= Mode ; |
admcrae | 0:e314f3b805ed | 536 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 537 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 538 | } |
admcrae | 0:e314f3b805ed | 539 | |
admcrae | 0:e314f3b805ed | 540 | WORD uLCD_4D_Picaso::file_Mount() |
admcrae | 0:e314f3b805ed | 541 | { |
admcrae | 0:e314f3b805ed | 542 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 543 | towrite[0]= F_file_Mount >> 8 ; |
admcrae | 0:e314f3b805ed | 544 | towrite[1]= F_file_Mount & 0xFF; |
admcrae | 0:e314f3b805ed | 545 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 546 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 547 | } |
admcrae | 0:e314f3b805ed | 548 | |
admcrae | 0:e314f3b805ed | 549 | WORD uLCD_4D_Picaso::file_Open(char* Filename, char Mode) |
admcrae | 0:e314f3b805ed | 550 | { |
admcrae | 0:e314f3b805ed | 551 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 552 | towrite[0]= F_file_Open >> 8 ; |
admcrae | 0:e314f3b805ed | 553 | towrite[1]= F_file_Open & 0xFF; |
admcrae | 0:e314f3b805ed | 554 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 555 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 556 | towrite[0]= Mode; |
admcrae | 0:e314f3b805ed | 557 | WriteBytes(towrite, 1) ; |
admcrae | 0:e314f3b805ed | 558 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 559 | } |
admcrae | 0:e314f3b805ed | 560 | |
admcrae | 0:e314f3b805ed | 561 | WORD uLCD_4D_Picaso::file_PlayWAV(char* Filename) |
admcrae | 0:e314f3b805ed | 562 | { |
admcrae | 0:e314f3b805ed | 563 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 564 | towrite[0]= F_file_PlayWAV >> 8 ; |
admcrae | 0:e314f3b805ed | 565 | towrite[1]= F_file_PlayWAV & 0xFF; |
admcrae | 0:e314f3b805ed | 566 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 567 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 568 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 569 | } |
admcrae | 0:e314f3b805ed | 570 | |
admcrae | 0:e314f3b805ed | 571 | WORD uLCD_4D_Picaso::file_PutC(char Character, WORD Handle) |
admcrae | 0:e314f3b805ed | 572 | { |
admcrae | 0:e314f3b805ed | 573 | char towrite[5] ; |
admcrae | 0:e314f3b805ed | 574 | towrite[0]= F_file_PutC >> 8 ; |
admcrae | 0:e314f3b805ed | 575 | towrite[1]= F_file_PutC ; |
admcrae | 0:e314f3b805ed | 576 | towrite[2]= Character; |
admcrae | 0:e314f3b805ed | 577 | towrite[3]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 578 | towrite[4]= Handle ; |
admcrae | 0:e314f3b805ed | 579 | WriteBytes(towrite, 5) ; |
admcrae | 0:e314f3b805ed | 580 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 581 | } |
admcrae | 0:e314f3b805ed | 582 | |
admcrae | 0:e314f3b805ed | 583 | WORD uLCD_4D_Picaso::file_PutS(char * StringOut, WORD Handle) |
admcrae | 0:e314f3b805ed | 584 | { |
admcrae | 0:e314f3b805ed | 585 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 586 | towrite[0]= F_file_PutS >> 8 ; |
admcrae | 0:e314f3b805ed | 587 | towrite[1]= F_file_PutS & 0xFF; |
admcrae | 0:e314f3b805ed | 588 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 589 | WriteChars(StringOut) ; |
admcrae | 0:e314f3b805ed | 590 | towrite[0]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 591 | towrite[1]= Handle ; |
admcrae | 0:e314f3b805ed | 592 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 593 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 594 | } |
admcrae | 0:e314f3b805ed | 595 | |
admcrae | 0:e314f3b805ed | 596 | WORD uLCD_4D_Picaso::file_PutW(WORD Word, WORD Handle) |
admcrae | 0:e314f3b805ed | 597 | { |
admcrae | 0:e314f3b805ed | 598 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 599 | towrite[0]= F_file_PutW >> 8 ; |
admcrae | 0:e314f3b805ed | 600 | towrite[1]= F_file_PutW & 0xFF; |
admcrae | 0:e314f3b805ed | 601 | towrite[2]= Word >> 8 ; |
admcrae | 0:e314f3b805ed | 602 | towrite[3]= Word ; |
admcrae | 0:e314f3b805ed | 603 | towrite[4]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 604 | towrite[5]= Handle ; |
admcrae | 0:e314f3b805ed | 605 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 606 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 607 | } |
admcrae | 0:e314f3b805ed | 608 | |
admcrae | 0:e314f3b805ed | 609 | WORD uLCD_4D_Picaso::file_Read(t4DByteArray Data, WORD Size, WORD Handle) |
admcrae | 0:e314f3b805ed | 610 | { |
admcrae | 0:e314f3b805ed | 611 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 612 | towrite[0]= F_file_Read >> 8 ; |
admcrae | 0:e314f3b805ed | 613 | towrite[1]= F_file_Read & 0xFF; |
admcrae | 0:e314f3b805ed | 614 | towrite[2]= Size >> 8 ; |
admcrae | 0:e314f3b805ed | 615 | towrite[3]= Size ; |
admcrae | 0:e314f3b805ed | 616 | towrite[4]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 617 | towrite[5]= Handle ; |
admcrae | 0:e314f3b805ed | 618 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 619 | return GetAckResData(Data,Size) ; |
admcrae | 0:e314f3b805ed | 620 | } |
admcrae | 0:e314f3b805ed | 621 | |
admcrae | 0:e314f3b805ed | 622 | WORD uLCD_4D_Picaso::file_Rewind(WORD Handle) |
admcrae | 0:e314f3b805ed | 623 | { |
admcrae | 0:e314f3b805ed | 624 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 625 | towrite[0]= F_file_Rewind >> 8 ; |
admcrae | 0:e314f3b805ed | 626 | towrite[1]= F_file_Rewind & 0xFF; |
admcrae | 0:e314f3b805ed | 627 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 628 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 629 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 630 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 631 | } |
admcrae | 0:e314f3b805ed | 632 | |
admcrae | 0:e314f3b805ed | 633 | WORD uLCD_4D_Picaso::file_Run(char * Filename, WORD ArgCount, t4DWordArray Args) |
admcrae | 0:e314f3b805ed | 634 | { |
admcrae | 0:e314f3b805ed | 635 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 636 | towrite[0]= F_file_Run >> 8 ; |
admcrae | 0:e314f3b805ed | 637 | towrite[1]= F_file_Run & 0xFF; |
admcrae | 0:e314f3b805ed | 638 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 639 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 640 | towrite[0]= ArgCount >> 8 ; |
admcrae | 0:e314f3b805ed | 641 | towrite[1]= ArgCount ; |
admcrae | 0:e314f3b805ed | 642 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 643 | WriteWords(Args, ArgCount) ; |
admcrae | 0:e314f3b805ed | 644 | return WaitForAck() ; |
admcrae | 0:e314f3b805ed | 645 | } |
admcrae | 0:e314f3b805ed | 646 | |
admcrae | 0:e314f3b805ed | 647 | WORD uLCD_4D_Picaso::file_ScreenCapture(WORD X, WORD Y, WORD Width, WORD Height, WORD Handle) |
admcrae | 0:e314f3b805ed | 648 | { |
admcrae | 0:e314f3b805ed | 649 | char towrite[12] ; |
admcrae | 0:e314f3b805ed | 650 | towrite[0]= F_file_ScreenCapture >> 8 ; |
admcrae | 0:e314f3b805ed | 651 | towrite[1]= F_file_ScreenCapture & 0xFF; |
admcrae | 0:e314f3b805ed | 652 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 653 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 654 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 655 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 656 | towrite[6]= Width >> 8 ; |
admcrae | 0:e314f3b805ed | 657 | towrite[7]= Width ; |
admcrae | 0:e314f3b805ed | 658 | towrite[8]= Height >> 8 ; |
admcrae | 0:e314f3b805ed | 659 | towrite[9]= Height ; |
admcrae | 0:e314f3b805ed | 660 | towrite[10]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 661 | towrite[11]= Handle ; |
admcrae | 0:e314f3b805ed | 662 | WriteBytes(towrite, 12) ; |
admcrae | 0:e314f3b805ed | 663 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 664 | } |
admcrae | 0:e314f3b805ed | 665 | |
admcrae | 0:e314f3b805ed | 666 | WORD uLCD_4D_Picaso::file_Seek(WORD Handle, WORD HiWord, WORD LoWord) |
admcrae | 0:e314f3b805ed | 667 | { |
admcrae | 0:e314f3b805ed | 668 | char towrite[8] ; |
admcrae | 0:e314f3b805ed | 669 | towrite[0]= F_file_Seek >> 8 ; |
admcrae | 0:e314f3b805ed | 670 | towrite[1]= F_file_Seek & 0xFF; |
admcrae | 0:e314f3b805ed | 671 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 672 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 673 | towrite[4]= HiWord >> 8 ; |
admcrae | 0:e314f3b805ed | 674 | towrite[5]= HiWord ; |
admcrae | 0:e314f3b805ed | 675 | towrite[6]= LoWord >> 8 ; |
admcrae | 0:e314f3b805ed | 676 | towrite[7]= LoWord ; |
admcrae | 0:e314f3b805ed | 677 | WriteBytes(towrite, 8) ; |
admcrae | 0:e314f3b805ed | 678 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 679 | } |
admcrae | 0:e314f3b805ed | 680 | |
admcrae | 0:e314f3b805ed | 681 | WORD uLCD_4D_Picaso::file_Size(WORD Handle, WORD * HiWord, WORD * LoWord) |
admcrae | 0:e314f3b805ed | 682 | { |
admcrae | 0:e314f3b805ed | 683 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 684 | towrite[0]= F_file_Size >> 8 ; |
admcrae | 0:e314f3b805ed | 685 | towrite[1]= F_file_Size ; |
admcrae | 0:e314f3b805ed | 686 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 687 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 688 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 689 | return GetAckRes2Words(HiWord,LoWord) ; |
admcrae | 0:e314f3b805ed | 690 | } |
admcrae | 0:e314f3b805ed | 691 | |
admcrae | 0:e314f3b805ed | 692 | WORD uLCD_4D_Picaso::file_Tell(WORD Handle, WORD * HiWord, WORD * LoWord) |
admcrae | 0:e314f3b805ed | 693 | { |
admcrae | 0:e314f3b805ed | 694 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 695 | towrite[0]= F_file_Tell >> 8 ; |
admcrae | 0:e314f3b805ed | 696 | towrite[1]= F_file_Tell ; |
admcrae | 0:e314f3b805ed | 697 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 698 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 699 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 700 | return GetAckRes2Words(HiWord,LoWord) ; |
admcrae | 0:e314f3b805ed | 701 | } |
admcrae | 0:e314f3b805ed | 702 | |
admcrae | 0:e314f3b805ed | 703 | void uLCD_4D_Picaso::file_Unmount() |
admcrae | 0:e314f3b805ed | 704 | { |
admcrae | 0:e314f3b805ed | 705 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 706 | |
admcrae | 0:e314f3b805ed | 707 | towrite[0]= F_file_Unmount >> 8 ; |
admcrae | 0:e314f3b805ed | 708 | towrite[1]= F_file_Unmount & 0xFF; |
admcrae | 0:e314f3b805ed | 709 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 710 | GetAck() ; |
admcrae | 0:e314f3b805ed | 711 | } |
admcrae | 0:e314f3b805ed | 712 | |
admcrae | 0:e314f3b805ed | 713 | WORD uLCD_4D_Picaso::file_Write(WORD Size, t4DByteArray Source, WORD Handle) |
admcrae | 0:e314f3b805ed | 714 | { |
admcrae | 0:e314f3b805ed | 715 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 716 | towrite[0]= F_file_Write >> 8 ; |
admcrae | 0:e314f3b805ed | 717 | towrite[1]= F_file_Write ; |
admcrae | 0:e314f3b805ed | 718 | towrite[2]= Size >> 8 ; |
admcrae | 0:e314f3b805ed | 719 | towrite[3]= Size ; |
admcrae | 0:e314f3b805ed | 720 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 721 | WriteBytes(Source, Size) ; |
admcrae | 0:e314f3b805ed | 722 | towrite[0]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 723 | towrite[1]= Handle ; |
admcrae | 0:e314f3b805ed | 724 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 725 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 726 | } |
admcrae | 0:e314f3b805ed | 727 | |
admcrae | 0:e314f3b805ed | 728 | WORD uLCD_4D_Picaso::gfx_BevelShadow(WORD Value) |
admcrae | 0:e314f3b805ed | 729 | { |
admcrae | 0:e314f3b805ed | 730 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 731 | towrite[0]= F_gfx_BevelShadow >> 8 ; |
admcrae | 0:e314f3b805ed | 732 | towrite[1]= F_gfx_BevelShadow ; |
admcrae | 0:e314f3b805ed | 733 | towrite[2]= Value >> 8 ; |
admcrae | 0:e314f3b805ed | 734 | towrite[3]= Value ; |
admcrae | 0:e314f3b805ed | 735 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 736 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 737 | } |
admcrae | 0:e314f3b805ed | 738 | |
admcrae | 0:e314f3b805ed | 739 | WORD uLCD_4D_Picaso::gfx_BevelWidth(WORD Value) |
admcrae | 0:e314f3b805ed | 740 | { |
admcrae | 0:e314f3b805ed | 741 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 742 | towrite[0]= F_gfx_BevelWidth >> 8 ; |
admcrae | 0:e314f3b805ed | 743 | towrite[1]= F_gfx_BevelWidth ; |
admcrae | 0:e314f3b805ed | 744 | towrite[2]= Value >> 8 ; |
admcrae | 0:e314f3b805ed | 745 | towrite[3]= Value ; |
admcrae | 0:e314f3b805ed | 746 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 747 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 748 | } |
admcrae | 0:e314f3b805ed | 749 | |
admcrae | 0:e314f3b805ed | 750 | WORD uLCD_4D_Picaso::gfx_BGcolour(WORD Color) |
admcrae | 0:e314f3b805ed | 751 | { |
admcrae | 0:e314f3b805ed | 752 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 753 | towrite[0]= F_gfx_BGcolour >> 8 ; |
admcrae | 0:e314f3b805ed | 754 | towrite[1]= F_gfx_BGcolour ; |
admcrae | 0:e314f3b805ed | 755 | towrite[2]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 756 | towrite[3]= Color ; |
admcrae | 0:e314f3b805ed | 757 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 758 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 759 | } |
admcrae | 0:e314f3b805ed | 760 | |
admcrae | 0:e314f3b805ed | 761 | void uLCD_4D_Picaso::gfx_Button(WORD Up, WORD x, WORD y, WORD buttonColour, WORD txtColour, WORD font, WORD txtWidth, WORD txtHeight, char * text) |
admcrae | 0:e314f3b805ed | 762 | { |
admcrae | 0:e314f3b805ed | 763 | char towrite[18] ; |
admcrae | 0:e314f3b805ed | 764 | towrite[0]= F_gfx_Button >> 8 ; |
admcrae | 0:e314f3b805ed | 765 | towrite[1]= F_gfx_Button ; |
admcrae | 0:e314f3b805ed | 766 | towrite[2]= Up >> 8 ; |
admcrae | 0:e314f3b805ed | 767 | towrite[3]= Up ; |
admcrae | 0:e314f3b805ed | 768 | towrite[4]= x >> 8 ; |
admcrae | 0:e314f3b805ed | 769 | towrite[5]= x ; |
admcrae | 0:e314f3b805ed | 770 | towrite[6]= y >> 8 ; |
admcrae | 0:e314f3b805ed | 771 | towrite[7]= y ; |
admcrae | 0:e314f3b805ed | 772 | towrite[8]= buttonColour >> 8 ; |
admcrae | 0:e314f3b805ed | 773 | towrite[9]= buttonColour ; |
admcrae | 0:e314f3b805ed | 774 | towrite[10]= txtColour >> 8 ; |
admcrae | 0:e314f3b805ed | 775 | towrite[11]= txtColour ; |
admcrae | 0:e314f3b805ed | 776 | towrite[12]= font >> 8 ; |
admcrae | 0:e314f3b805ed | 777 | towrite[13]= font ; |
admcrae | 0:e314f3b805ed | 778 | towrite[14]= txtWidth >> 8 ; |
admcrae | 0:e314f3b805ed | 779 | towrite[15]= txtWidth ; |
admcrae | 0:e314f3b805ed | 780 | towrite[16]= txtHeight >> 8 ; |
admcrae | 0:e314f3b805ed | 781 | towrite[17]= txtHeight ; |
admcrae | 0:e314f3b805ed | 782 | WriteBytes(towrite, 18) ; |
admcrae | 0:e314f3b805ed | 783 | WriteChars( text) ; |
admcrae | 0:e314f3b805ed | 784 | GetAck() ; |
admcrae | 0:e314f3b805ed | 785 | } |
admcrae | 0:e314f3b805ed | 786 | |
admcrae | 0:e314f3b805ed | 787 | void uLCD_4D_Picaso::gfx_ChangeColour(WORD OldColor, WORD NewColor) |
admcrae | 0:e314f3b805ed | 788 | { |
admcrae | 0:e314f3b805ed | 789 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 790 | |
admcrae | 0:e314f3b805ed | 791 | towrite[0]= F_gfx_ChangeColour >> 8 ; |
admcrae | 0:e314f3b805ed | 792 | towrite[1]= F_gfx_ChangeColour ; |
admcrae | 0:e314f3b805ed | 793 | towrite[2]= OldColor >> 8 ; |
admcrae | 0:e314f3b805ed | 794 | towrite[3]= OldColor ; |
admcrae | 0:e314f3b805ed | 795 | towrite[4]= NewColor >> 8 ; |
admcrae | 0:e314f3b805ed | 796 | towrite[5]= NewColor ; |
admcrae | 0:e314f3b805ed | 797 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 798 | GetAck() ; |
admcrae | 0:e314f3b805ed | 799 | } |
admcrae | 0:e314f3b805ed | 800 | |
admcrae | 0:e314f3b805ed | 801 | void uLCD_4D_Picaso::gfx_Circle(WORD X, WORD Y, WORD Radius, WORD Color) |
admcrae | 0:e314f3b805ed | 802 | { |
admcrae | 0:e314f3b805ed | 803 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 804 | |
admcrae | 0:e314f3b805ed | 805 | towrite[0]= F_gfx_Circle >> 8 ; |
admcrae | 0:e314f3b805ed | 806 | towrite[1]= F_gfx_Circle ; |
admcrae | 0:e314f3b805ed | 807 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 808 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 809 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 810 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 811 | towrite[6]= Radius >> 8 ; |
admcrae | 0:e314f3b805ed | 812 | towrite[7]= Radius ; |
admcrae | 0:e314f3b805ed | 813 | towrite[8]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 814 | towrite[9]= Color ; |
admcrae | 0:e314f3b805ed | 815 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 816 | GetAck() ; |
admcrae | 0:e314f3b805ed | 817 | } |
admcrae | 0:e314f3b805ed | 818 | |
admcrae | 0:e314f3b805ed | 819 | void uLCD_4D_Picaso::gfx_CircleFilled(WORD X, WORD Y, WORD Radius, WORD Color) |
admcrae | 0:e314f3b805ed | 820 | { |
admcrae | 0:e314f3b805ed | 821 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 822 | |
admcrae | 0:e314f3b805ed | 823 | towrite[0]= F_gfx_CircleFilled >> 8 ; |
admcrae | 0:e314f3b805ed | 824 | towrite[1]= F_gfx_CircleFilled ; |
admcrae | 0:e314f3b805ed | 825 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 826 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 827 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 828 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 829 | towrite[6]= Radius >> 8 ; |
admcrae | 0:e314f3b805ed | 830 | towrite[7]= Radius ; |
admcrae | 0:e314f3b805ed | 831 | towrite[8]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 832 | towrite[9]= Color ; |
admcrae | 0:e314f3b805ed | 833 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 834 | GetAck() ; |
admcrae | 0:e314f3b805ed | 835 | } |
admcrae | 0:e314f3b805ed | 836 | |
admcrae | 0:e314f3b805ed | 837 | void uLCD_4D_Picaso::gfx_Clipping(WORD OnOff) |
admcrae | 0:e314f3b805ed | 838 | { |
admcrae | 0:e314f3b805ed | 839 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 840 | |
admcrae | 0:e314f3b805ed | 841 | towrite[0]= F_gfx_Clipping >> 8 ; |
admcrae | 0:e314f3b805ed | 842 | towrite[1]= F_gfx_Clipping ; |
admcrae | 0:e314f3b805ed | 843 | towrite[2]= OnOff >> 8 ; |
admcrae | 0:e314f3b805ed | 844 | towrite[3]= OnOff ; |
admcrae | 0:e314f3b805ed | 845 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 846 | GetAck() ; |
admcrae | 0:e314f3b805ed | 847 | } |
admcrae | 0:e314f3b805ed | 848 | |
admcrae | 0:e314f3b805ed | 849 | void uLCD_4D_Picaso::gfx_ClipWindow(WORD X1, WORD Y1, WORD X2, WORD Y2) |
admcrae | 0:e314f3b805ed | 850 | { |
admcrae | 0:e314f3b805ed | 851 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 852 | |
admcrae | 0:e314f3b805ed | 853 | towrite[0]= F_gfx_ClipWindow >> 8 ; |
admcrae | 0:e314f3b805ed | 854 | towrite[1]= F_gfx_ClipWindow ; |
admcrae | 0:e314f3b805ed | 855 | towrite[2]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 856 | towrite[3]= X1 ; |
admcrae | 0:e314f3b805ed | 857 | towrite[4]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 858 | towrite[5]= Y1 ; |
admcrae | 0:e314f3b805ed | 859 | towrite[6]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 860 | towrite[7]= X2 ; |
admcrae | 0:e314f3b805ed | 861 | towrite[8]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 862 | towrite[9]= Y2 ; |
admcrae | 0:e314f3b805ed | 863 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 864 | GetAck() ; |
admcrae | 0:e314f3b805ed | 865 | } |
admcrae | 0:e314f3b805ed | 866 | |
admcrae | 0:e314f3b805ed | 867 | void uLCD_4D_Picaso::gfx_Cls() |
admcrae | 0:e314f3b805ed | 868 | { |
admcrae | 0:e314f3b805ed | 869 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 870 | towrite[0]= F_gfx_Cls >> 8 ; |
admcrae | 0:e314f3b805ed | 871 | towrite[1]= F_gfx_Cls ; |
admcrae | 0:e314f3b805ed | 872 | WriteBytes(towrite, 2); |
admcrae | 0:e314f3b805ed | 873 | GetAck(); |
admcrae | 0:e314f3b805ed | 874 | } |
admcrae | 0:e314f3b805ed | 875 | |
admcrae | 0:e314f3b805ed | 876 | WORD uLCD_4D_Picaso::gfx_Contrast(WORD Contrast) |
admcrae | 0:e314f3b805ed | 877 | { |
admcrae | 0:e314f3b805ed | 878 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 879 | towrite[0]= F_gfx_Contrast >> 8 ; |
admcrae | 0:e314f3b805ed | 880 | towrite[1]= F_gfx_Contrast ; |
admcrae | 0:e314f3b805ed | 881 | towrite[2]= Contrast >> 8 ; |
admcrae | 0:e314f3b805ed | 882 | towrite[3]= Contrast ; |
admcrae | 0:e314f3b805ed | 883 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 884 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 885 | } |
admcrae | 0:e314f3b805ed | 886 | |
admcrae | 0:e314f3b805ed | 887 | void uLCD_4D_Picaso::gfx_Ellipse(WORD X, WORD Y, WORD Xrad, WORD Yrad, WORD Color) |
admcrae | 0:e314f3b805ed | 888 | { |
admcrae | 0:e314f3b805ed | 889 | char towrite[12] ; |
admcrae | 0:e314f3b805ed | 890 | towrite[0]= F_gfx_Ellipse >> 8 ; |
admcrae | 0:e314f3b805ed | 891 | towrite[1]= F_gfx_Ellipse ; |
admcrae | 0:e314f3b805ed | 892 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 893 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 894 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 895 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 896 | towrite[6]= Xrad >> 8 ; |
admcrae | 0:e314f3b805ed | 897 | towrite[7]= Xrad ; |
admcrae | 0:e314f3b805ed | 898 | towrite[8]= Yrad >> 8 ; |
admcrae | 0:e314f3b805ed | 899 | towrite[9]= Yrad ; |
admcrae | 0:e314f3b805ed | 900 | towrite[10]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 901 | towrite[11]= Color ; |
admcrae | 0:e314f3b805ed | 902 | WriteBytes(towrite, 12) ; |
admcrae | 0:e314f3b805ed | 903 | GetAck() ; |
admcrae | 0:e314f3b805ed | 904 | } |
admcrae | 0:e314f3b805ed | 905 | |
admcrae | 0:e314f3b805ed | 906 | void uLCD_4D_Picaso::gfx_EllipseFilled(WORD X, WORD Y, WORD Xrad, WORD Yrad, WORD Color) |
admcrae | 0:e314f3b805ed | 907 | { |
admcrae | 0:e314f3b805ed | 908 | char towrite[12] ; |
admcrae | 0:e314f3b805ed | 909 | towrite[0]= F_gfx_EllipseFilled >> 8 ; |
admcrae | 0:e314f3b805ed | 910 | towrite[1]= F_gfx_EllipseFilled ; |
admcrae | 0:e314f3b805ed | 911 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 912 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 913 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 914 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 915 | towrite[6]= Xrad >> 8 ; |
admcrae | 0:e314f3b805ed | 916 | towrite[7]= Xrad ; |
admcrae | 0:e314f3b805ed | 917 | towrite[8]= Yrad >> 8 ; |
admcrae | 0:e314f3b805ed | 918 | towrite[9]= Yrad ; |
admcrae | 0:e314f3b805ed | 919 | towrite[10]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 920 | towrite[11]= Color ; |
admcrae | 0:e314f3b805ed | 921 | WriteBytes(towrite, 12) ; |
admcrae | 0:e314f3b805ed | 922 | GetAck() ; |
admcrae | 0:e314f3b805ed | 923 | } |
admcrae | 0:e314f3b805ed | 924 | |
admcrae | 0:e314f3b805ed | 925 | WORD uLCD_4D_Picaso::gfx_FrameDelay(WORD Msec) |
admcrae | 0:e314f3b805ed | 926 | { |
admcrae | 0:e314f3b805ed | 927 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 928 | towrite[0]= F_gfx_FrameDelay >> 8 ; |
admcrae | 0:e314f3b805ed | 929 | towrite[1]= F_gfx_FrameDelay ; |
admcrae | 0:e314f3b805ed | 930 | towrite[2]= Msec >> 8 ; |
admcrae | 0:e314f3b805ed | 931 | towrite[3]= Msec ; |
admcrae | 0:e314f3b805ed | 932 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 933 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 934 | } |
admcrae | 0:e314f3b805ed | 935 | |
admcrae | 0:e314f3b805ed | 936 | WORD uLCD_4D_Picaso::gfx_Get(WORD Mode) |
admcrae | 0:e314f3b805ed | 937 | { |
admcrae | 0:e314f3b805ed | 938 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 939 | towrite[0]= F_gfx_Get >> 8 ; |
admcrae | 0:e314f3b805ed | 940 | towrite[1]= F_gfx_Get ; |
admcrae | 0:e314f3b805ed | 941 | towrite[2]= Mode >> 8 ; |
admcrae | 0:e314f3b805ed | 942 | towrite[3]= Mode ; |
admcrae | 0:e314f3b805ed | 943 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 944 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 945 | } |
admcrae | 0:e314f3b805ed | 946 | |
admcrae | 0:e314f3b805ed | 947 | WORD uLCD_4D_Picaso::gfx_GetPixel(WORD X, WORD Y) |
admcrae | 0:e314f3b805ed | 948 | { |
admcrae | 0:e314f3b805ed | 949 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 950 | towrite[0]= F_gfx_GetPixel >> 8 ; |
admcrae | 0:e314f3b805ed | 951 | towrite[1]= F_gfx_GetPixel ; |
admcrae | 0:e314f3b805ed | 952 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 953 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 954 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 955 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 956 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 957 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 958 | } |
admcrae | 0:e314f3b805ed | 959 | |
admcrae | 0:e314f3b805ed | 960 | void uLCD_4D_Picaso::gfx_Line(WORD X1, WORD Y1, WORD X2, WORD Y2, WORD Color) |
admcrae | 0:e314f3b805ed | 961 | { |
admcrae | 0:e314f3b805ed | 962 | char towrite[12] ; |
admcrae | 0:e314f3b805ed | 963 | towrite[0]= F_gfx_Line >> 8 ; |
admcrae | 0:e314f3b805ed | 964 | towrite[1]= F_gfx_Line ; |
admcrae | 0:e314f3b805ed | 965 | towrite[2]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 966 | towrite[3]= X1 ; |
admcrae | 0:e314f3b805ed | 967 | towrite[4]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 968 | towrite[5]= Y1 ; |
admcrae | 0:e314f3b805ed | 969 | towrite[6]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 970 | towrite[7]= X2 ; |
admcrae | 0:e314f3b805ed | 971 | towrite[8]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 972 | towrite[9]= Y2 ; |
admcrae | 0:e314f3b805ed | 973 | towrite[10]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 974 | towrite[11]= Color ; |
admcrae | 0:e314f3b805ed | 975 | WriteBytes(towrite, 12) ; |
admcrae | 0:e314f3b805ed | 976 | GetAck() ; |
admcrae | 0:e314f3b805ed | 977 | } |
admcrae | 0:e314f3b805ed | 978 | |
admcrae | 0:e314f3b805ed | 979 | WORD uLCD_4D_Picaso::gfx_LinePattern(WORD Pattern) |
admcrae | 0:e314f3b805ed | 980 | { |
admcrae | 0:e314f3b805ed | 981 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 982 | towrite[0]= F_gfx_LinePattern >> 8 ; |
admcrae | 0:e314f3b805ed | 983 | towrite[1]= F_gfx_LinePattern ; |
admcrae | 0:e314f3b805ed | 984 | towrite[2]= Pattern >> 8 ; |
admcrae | 0:e314f3b805ed | 985 | towrite[3]= Pattern ; |
admcrae | 0:e314f3b805ed | 986 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 987 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 988 | } |
admcrae | 0:e314f3b805ed | 989 | |
admcrae | 0:e314f3b805ed | 990 | void uLCD_4D_Picaso::gfx_LineTo(WORD X, WORD Y) |
admcrae | 0:e314f3b805ed | 991 | { |
admcrae | 0:e314f3b805ed | 992 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 993 | towrite[0]= F_gfx_LineTo >> 8 ; |
admcrae | 0:e314f3b805ed | 994 | towrite[1]= F_gfx_LineTo ; |
admcrae | 0:e314f3b805ed | 995 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 996 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 997 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 998 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 999 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1000 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1001 | } |
admcrae | 0:e314f3b805ed | 1002 | |
admcrae | 0:e314f3b805ed | 1003 | void uLCD_4D_Picaso::gfx_MoveTo(WORD X, WORD Y) |
admcrae | 0:e314f3b805ed | 1004 | { |
admcrae | 0:e314f3b805ed | 1005 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1006 | towrite[0]= F_gfx_MoveTo >> 8 ; |
admcrae | 0:e314f3b805ed | 1007 | towrite[1]= F_gfx_MoveTo ; |
admcrae | 0:e314f3b805ed | 1008 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 1009 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 1010 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 1011 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 1012 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1013 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1014 | } |
admcrae | 0:e314f3b805ed | 1015 | |
admcrae | 0:e314f3b805ed | 1016 | WORD uLCD_4D_Picaso::gfx_Orbit(WORD Angle, WORD Distance, WORD * Xdest, WORD * Ydest) |
admcrae | 0:e314f3b805ed | 1017 | { |
admcrae | 0:e314f3b805ed | 1018 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1019 | towrite[0]= F_gfx_Orbit >> 8 ; |
admcrae | 0:e314f3b805ed | 1020 | towrite[1]= F_gfx_Orbit ; |
admcrae | 0:e314f3b805ed | 1021 | towrite[2]= Angle >> 8 ; |
admcrae | 0:e314f3b805ed | 1022 | towrite[3]= Angle ; |
admcrae | 0:e314f3b805ed | 1023 | towrite[4]= Distance >> 8 ; |
admcrae | 0:e314f3b805ed | 1024 | towrite[5]= Distance ; |
admcrae | 0:e314f3b805ed | 1025 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1026 | GetAck2Words(Xdest,Ydest) ; |
admcrae | 0:e314f3b805ed | 1027 | return 0 ; |
admcrae | 0:e314f3b805ed | 1028 | } |
admcrae | 0:e314f3b805ed | 1029 | |
admcrae | 0:e314f3b805ed | 1030 | WORD uLCD_4D_Picaso::gfx_OutlineColour(WORD Color) |
admcrae | 0:e314f3b805ed | 1031 | { |
admcrae | 0:e314f3b805ed | 1032 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1033 | towrite[0]= F_gfx_OutlineColour >> 8 ; |
admcrae | 0:e314f3b805ed | 1034 | towrite[1]= F_gfx_OutlineColour ; |
admcrae | 0:e314f3b805ed | 1035 | towrite[2]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1036 | towrite[3]= Color ; |
admcrae | 0:e314f3b805ed | 1037 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1038 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1039 | } |
admcrae | 0:e314f3b805ed | 1040 | |
admcrae | 0:e314f3b805ed | 1041 | void uLCD_4D_Picaso::gfx_Panel(WORD Raised, WORD X, WORD Y, WORD Width, WORD Height, WORD Color) |
admcrae | 0:e314f3b805ed | 1042 | { |
admcrae | 0:e314f3b805ed | 1043 | char towrite[14] ; |
admcrae | 0:e314f3b805ed | 1044 | towrite[0]= F_gfx_Panel >> 8 ; |
admcrae | 0:e314f3b805ed | 1045 | towrite[1]= F_gfx_Panel ; |
admcrae | 0:e314f3b805ed | 1046 | towrite[2]= Raised >> 8 ; |
admcrae | 0:e314f3b805ed | 1047 | towrite[3]= Raised ; |
admcrae | 0:e314f3b805ed | 1048 | towrite[4]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 1049 | towrite[5]= X ; |
admcrae | 0:e314f3b805ed | 1050 | towrite[6]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 1051 | towrite[7]= Y ; |
admcrae | 0:e314f3b805ed | 1052 | towrite[8]= Width >> 8 ; |
admcrae | 0:e314f3b805ed | 1053 | towrite[9]= Width ; |
admcrae | 0:e314f3b805ed | 1054 | towrite[10]= Height >> 8 ; |
admcrae | 0:e314f3b805ed | 1055 | towrite[11]= Height ; |
admcrae | 0:e314f3b805ed | 1056 | towrite[12]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1057 | towrite[13]= Color ; |
admcrae | 0:e314f3b805ed | 1058 | WriteBytes(towrite, 14) ; |
admcrae | 0:e314f3b805ed | 1059 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1060 | } |
admcrae | 0:e314f3b805ed | 1061 | |
admcrae | 0:e314f3b805ed | 1062 | void uLCD_4D_Picaso::gfx_Polygon(WORD n, t4DWordArray Xvalues, t4DWordArray Yvalues, WORD Color) |
admcrae | 0:e314f3b805ed | 1063 | { |
admcrae | 0:e314f3b805ed | 1064 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1065 | towrite[0]= F_gfx_Polygon >> 8 ; |
admcrae | 0:e314f3b805ed | 1066 | towrite[1]= F_gfx_Polygon ; |
admcrae | 0:e314f3b805ed | 1067 | towrite[2]= n >> 8 ; |
admcrae | 0:e314f3b805ed | 1068 | towrite[3]= n ; |
admcrae | 0:e314f3b805ed | 1069 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1070 | WriteWords(Xvalues, n) ; |
admcrae | 0:e314f3b805ed | 1071 | WriteWords(Yvalues, n) ; |
admcrae | 0:e314f3b805ed | 1072 | towrite[0]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1073 | towrite[1]= Color ; |
admcrae | 0:e314f3b805ed | 1074 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1075 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1076 | } |
admcrae | 0:e314f3b805ed | 1077 | |
admcrae | 0:e314f3b805ed | 1078 | void uLCD_4D_Picaso::gfx_PolygonFilled(WORD n, t4DWordArray Xvalues, t4DWordArray Yvalues, WORD Color) |
admcrae | 0:e314f3b805ed | 1079 | { |
admcrae | 0:e314f3b805ed | 1080 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1081 | towrite[0]= F_gfx_PolygonFilled >> 8 ; |
admcrae | 0:e314f3b805ed | 1082 | towrite[1]= F_gfx_PolygonFilled ; |
admcrae | 0:e314f3b805ed | 1083 | towrite[2]= n >> 8 ; |
admcrae | 0:e314f3b805ed | 1084 | towrite[3]= n ; |
admcrae | 0:e314f3b805ed | 1085 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1086 | WriteWords(Xvalues, n) ; |
admcrae | 0:e314f3b805ed | 1087 | WriteWords(Yvalues, n) ; |
admcrae | 0:e314f3b805ed | 1088 | towrite[0]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1089 | towrite[1]= Color ; |
admcrae | 0:e314f3b805ed | 1090 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1091 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1092 | } |
admcrae | 0:e314f3b805ed | 1093 | |
admcrae | 0:e314f3b805ed | 1094 | void uLCD_4D_Picaso::gfx_Polyline(WORD n, t4DWordArray Xvalues, t4DWordArray Yvalues, WORD Color) |
admcrae | 0:e314f3b805ed | 1095 | { |
admcrae | 0:e314f3b805ed | 1096 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1097 | towrite[0]= F_gfx_Polyline >> 8 ; |
admcrae | 0:e314f3b805ed | 1098 | towrite[1]= F_gfx_Polyline ; |
admcrae | 0:e314f3b805ed | 1099 | towrite[2]= n >> 8 ; |
admcrae | 0:e314f3b805ed | 1100 | towrite[3]= n ; |
admcrae | 0:e314f3b805ed | 1101 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1102 | WriteWords(Xvalues, n) ; |
admcrae | 0:e314f3b805ed | 1103 | WriteWords(Yvalues, n) ; |
admcrae | 0:e314f3b805ed | 1104 | towrite[0]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1105 | towrite[1]= Color ; |
admcrae | 0:e314f3b805ed | 1106 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1107 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1108 | } |
admcrae | 0:e314f3b805ed | 1109 | |
admcrae | 0:e314f3b805ed | 1110 | void uLCD_4D_Picaso::gfx_PutPixel(WORD X, WORD Y, WORD Color) |
admcrae | 0:e314f3b805ed | 1111 | { |
admcrae | 0:e314f3b805ed | 1112 | char towrite[8] ; |
admcrae | 0:e314f3b805ed | 1113 | towrite[0]= F_gfx_PutPixel >> 8 ; |
admcrae | 0:e314f3b805ed | 1114 | towrite[1]= F_gfx_PutPixel ; |
admcrae | 0:e314f3b805ed | 1115 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 1116 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 1117 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 1118 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 1119 | towrite[6]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1120 | towrite[7]= Color ; |
admcrae | 0:e314f3b805ed | 1121 | WriteBytes(towrite, 8) ; |
admcrae | 0:e314f3b805ed | 1122 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1123 | } |
admcrae | 0:e314f3b805ed | 1124 | |
admcrae | 0:e314f3b805ed | 1125 | void uLCD_4D_Picaso::gfx_Rectangle(WORD X1, WORD Y1, WORD X2, WORD Y2, WORD Color) |
admcrae | 0:e314f3b805ed | 1126 | { |
admcrae | 0:e314f3b805ed | 1127 | char towrite[12] ; |
admcrae | 0:e314f3b805ed | 1128 | towrite[0]= F_gfx_Rectangle >> 8 ; |
admcrae | 0:e314f3b805ed | 1129 | towrite[1]= F_gfx_Rectangle ; |
admcrae | 0:e314f3b805ed | 1130 | towrite[2]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1131 | towrite[3]= X1 ; |
admcrae | 0:e314f3b805ed | 1132 | towrite[4]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1133 | towrite[5]= Y1 ; |
admcrae | 0:e314f3b805ed | 1134 | towrite[6]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1135 | towrite[7]= X2 ; |
admcrae | 0:e314f3b805ed | 1136 | towrite[8]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1137 | towrite[9]= Y2 ; |
admcrae | 0:e314f3b805ed | 1138 | towrite[10]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1139 | towrite[11]= Color ; |
admcrae | 0:e314f3b805ed | 1140 | WriteBytes(towrite, 12) ; |
admcrae | 0:e314f3b805ed | 1141 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1142 | } |
admcrae | 0:e314f3b805ed | 1143 | |
admcrae | 0:e314f3b805ed | 1144 | void uLCD_4D_Picaso::gfx_RectangleFilled(WORD X1, WORD Y1, WORD X2, WORD Y2, WORD Color) |
admcrae | 0:e314f3b805ed | 1145 | { |
admcrae | 0:e314f3b805ed | 1146 | char towrite[12] ; |
admcrae | 0:e314f3b805ed | 1147 | towrite[0]= F_gfx_RectangleFilled >> 8 ; |
admcrae | 0:e314f3b805ed | 1148 | towrite[1]= F_gfx_RectangleFilled ; |
admcrae | 0:e314f3b805ed | 1149 | towrite[2]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1150 | towrite[3]= X1 ; |
admcrae | 0:e314f3b805ed | 1151 | towrite[4]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1152 | towrite[5]= Y1 ; |
admcrae | 0:e314f3b805ed | 1153 | towrite[6]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1154 | towrite[7]= X2 ; |
admcrae | 0:e314f3b805ed | 1155 | towrite[8]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1156 | towrite[9]= Y2 ; |
admcrae | 0:e314f3b805ed | 1157 | towrite[10]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1158 | towrite[11]= Color ; |
admcrae | 0:e314f3b805ed | 1159 | WriteBytes(towrite, 12) ; |
admcrae | 0:e314f3b805ed | 1160 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1161 | } |
admcrae | 0:e314f3b805ed | 1162 | |
admcrae | 0:e314f3b805ed | 1163 | void uLCD_4D_Picaso::gfx_ScreenCopyPaste(WORD Xs, WORD Ys, WORD Xd, WORD Yd, WORD Width, WORD Height) |
admcrae | 0:e314f3b805ed | 1164 | { |
admcrae | 0:e314f3b805ed | 1165 | char towrite[14] ; |
admcrae | 0:e314f3b805ed | 1166 | towrite[0]= F_gfx_ScreenCopyPaste >> 8 ; |
admcrae | 0:e314f3b805ed | 1167 | towrite[1]= F_gfx_ScreenCopyPaste ; |
admcrae | 0:e314f3b805ed | 1168 | towrite[2]= Xs >> 8 ; |
admcrae | 0:e314f3b805ed | 1169 | towrite[3]= Xs ; |
admcrae | 0:e314f3b805ed | 1170 | towrite[4]= Ys >> 8 ; |
admcrae | 0:e314f3b805ed | 1171 | towrite[5]= Ys ; |
admcrae | 0:e314f3b805ed | 1172 | towrite[6]= Xd >> 8 ; |
admcrae | 0:e314f3b805ed | 1173 | towrite[7]= Xd ; |
admcrae | 0:e314f3b805ed | 1174 | towrite[8]= Yd >> 8 ; |
admcrae | 0:e314f3b805ed | 1175 | towrite[9]= Yd ; |
admcrae | 0:e314f3b805ed | 1176 | towrite[10]= Width >> 8 ; |
admcrae | 0:e314f3b805ed | 1177 | towrite[11]= Width ; |
admcrae | 0:e314f3b805ed | 1178 | towrite[12]= Height >> 8 ; |
admcrae | 0:e314f3b805ed | 1179 | towrite[13]= Height ; |
admcrae | 0:e314f3b805ed | 1180 | WriteBytes(towrite, 14) ; |
admcrae | 0:e314f3b805ed | 1181 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1182 | } |
admcrae | 0:e314f3b805ed | 1183 | |
admcrae | 0:e314f3b805ed | 1184 | WORD uLCD_4D_Picaso::gfx_ScreenMode(WORD ScreenMode) |
admcrae | 0:e314f3b805ed | 1185 | { |
admcrae | 0:e314f3b805ed | 1186 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1187 | |
admcrae | 0:e314f3b805ed | 1188 | towrite[0]= F_gfx_ScreenMode >> 8 ; |
admcrae | 0:e314f3b805ed | 1189 | towrite[1]= F_gfx_ScreenMode ; |
admcrae | 0:e314f3b805ed | 1190 | towrite[2]= ScreenMode >> 8 ; |
admcrae | 0:e314f3b805ed | 1191 | towrite[3]= ScreenMode ; |
admcrae | 0:e314f3b805ed | 1192 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1193 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1194 | } |
admcrae | 0:e314f3b805ed | 1195 | |
admcrae | 0:e314f3b805ed | 1196 | void uLCD_4D_Picaso::gfx_Set(WORD Func, WORD Value) |
admcrae | 0:e314f3b805ed | 1197 | { |
admcrae | 0:e314f3b805ed | 1198 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1199 | |
admcrae | 0:e314f3b805ed | 1200 | towrite[0]= F_gfx_Set >> 8 ; |
admcrae | 0:e314f3b805ed | 1201 | towrite[1]= F_gfx_Set ; |
admcrae | 0:e314f3b805ed | 1202 | towrite[2]= Func >> 8 ; |
admcrae | 0:e314f3b805ed | 1203 | towrite[3]= Func ; |
admcrae | 0:e314f3b805ed | 1204 | towrite[4]= Value >> 8 ; |
admcrae | 0:e314f3b805ed | 1205 | towrite[5]= Value ; |
admcrae | 0:e314f3b805ed | 1206 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1207 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1208 | } |
admcrae | 0:e314f3b805ed | 1209 | |
admcrae | 0:e314f3b805ed | 1210 | void uLCD_4D_Picaso::gfx_SetClipRegion() |
admcrae | 0:e314f3b805ed | 1211 | { |
admcrae | 0:e314f3b805ed | 1212 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1213 | |
admcrae | 0:e314f3b805ed | 1214 | towrite[0]= F_gfx_SetClipRegion >> 8 ; |
admcrae | 0:e314f3b805ed | 1215 | towrite[1]= F_gfx_SetClipRegion ; |
admcrae | 0:e314f3b805ed | 1216 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1217 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1218 | } |
admcrae | 0:e314f3b805ed | 1219 | |
admcrae | 0:e314f3b805ed | 1220 | WORD uLCD_4D_Picaso::gfx_Slider(WORD Mode, WORD X1, WORD Y1, WORD X2, WORD Y2, WORD Color, WORD Scale, WORD Value) |
admcrae | 0:e314f3b805ed | 1221 | { |
admcrae | 0:e314f3b805ed | 1222 | char towrite[18] ; |
admcrae | 0:e314f3b805ed | 1223 | |
admcrae | 0:e314f3b805ed | 1224 | towrite[0]= F_gfx_Slider >> 8 ; |
admcrae | 0:e314f3b805ed | 1225 | towrite[1]= F_gfx_Slider ; |
admcrae | 0:e314f3b805ed | 1226 | towrite[2]= Mode >> 8 ; |
admcrae | 0:e314f3b805ed | 1227 | towrite[3]= Mode ; |
admcrae | 0:e314f3b805ed | 1228 | towrite[4]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1229 | towrite[5]= X1 ; |
admcrae | 0:e314f3b805ed | 1230 | towrite[6]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1231 | towrite[7]= Y1 ; |
admcrae | 0:e314f3b805ed | 1232 | towrite[8]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1233 | towrite[9]= X2 ; |
admcrae | 0:e314f3b805ed | 1234 | towrite[10]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1235 | towrite[11]= Y2 ; |
admcrae | 0:e314f3b805ed | 1236 | towrite[12]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1237 | towrite[13]= Color ; |
admcrae | 0:e314f3b805ed | 1238 | towrite[14]= Scale >> 8 ; |
admcrae | 0:e314f3b805ed | 1239 | towrite[15]= Scale ; |
admcrae | 0:e314f3b805ed | 1240 | towrite[16]= Value >> 8 ; |
admcrae | 0:e314f3b805ed | 1241 | towrite[17]= Value ; |
admcrae | 0:e314f3b805ed | 1242 | WriteBytes(towrite, 18) ; |
admcrae | 0:e314f3b805ed | 1243 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1244 | } |
admcrae | 0:e314f3b805ed | 1245 | |
admcrae | 0:e314f3b805ed | 1246 | WORD uLCD_4D_Picaso::gfx_Transparency(WORD OnOff) |
admcrae | 0:e314f3b805ed | 1247 | { |
admcrae | 0:e314f3b805ed | 1248 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1249 | |
admcrae | 0:e314f3b805ed | 1250 | towrite[0]= F_gfx_Transparency >> 8 ; |
admcrae | 0:e314f3b805ed | 1251 | towrite[1]= F_gfx_Transparency ; |
admcrae | 0:e314f3b805ed | 1252 | towrite[2]= OnOff >> 8 ; |
admcrae | 0:e314f3b805ed | 1253 | towrite[3]= OnOff ; |
admcrae | 0:e314f3b805ed | 1254 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1255 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1256 | } |
admcrae | 0:e314f3b805ed | 1257 | |
admcrae | 0:e314f3b805ed | 1258 | WORD uLCD_4D_Picaso::gfx_TransparentColour(WORD Color) |
admcrae | 0:e314f3b805ed | 1259 | { |
admcrae | 0:e314f3b805ed | 1260 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1261 | |
admcrae | 0:e314f3b805ed | 1262 | towrite[0]= F_gfx_TransparentColour >> 8 ; |
admcrae | 0:e314f3b805ed | 1263 | towrite[1]= F_gfx_TransparentColour ; |
admcrae | 0:e314f3b805ed | 1264 | towrite[2]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1265 | towrite[3]= Color ; |
admcrae | 0:e314f3b805ed | 1266 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1267 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1268 | } |
admcrae | 0:e314f3b805ed | 1269 | |
admcrae | 0:e314f3b805ed | 1270 | void uLCD_4D_Picaso::gfx_Triangle(WORD X1, WORD Y1, WORD X2, WORD Y2, WORD X3, WORD Y3, WORD Color) |
admcrae | 0:e314f3b805ed | 1271 | { |
admcrae | 0:e314f3b805ed | 1272 | char towrite[16] ; |
admcrae | 0:e314f3b805ed | 1273 | |
admcrae | 0:e314f3b805ed | 1274 | towrite[0]= F_gfx_Triangle >> 8 ; |
admcrae | 0:e314f3b805ed | 1275 | towrite[1]= F_gfx_Triangle ; |
admcrae | 0:e314f3b805ed | 1276 | towrite[2]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1277 | towrite[3]= X1 ; |
admcrae | 0:e314f3b805ed | 1278 | towrite[4]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1279 | towrite[5]= Y1 ; |
admcrae | 0:e314f3b805ed | 1280 | towrite[6]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1281 | towrite[7]= X2 ; |
admcrae | 0:e314f3b805ed | 1282 | towrite[8]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1283 | towrite[9]= Y2 ; |
admcrae | 0:e314f3b805ed | 1284 | towrite[10]= X3 >> 8 ; |
admcrae | 0:e314f3b805ed | 1285 | towrite[11]= X3 ; |
admcrae | 0:e314f3b805ed | 1286 | towrite[12]= Y3 >> 8 ; |
admcrae | 0:e314f3b805ed | 1287 | towrite[13]= Y3 ; |
admcrae | 0:e314f3b805ed | 1288 | towrite[14]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1289 | towrite[15]= Color ; |
admcrae | 0:e314f3b805ed | 1290 | WriteBytes(towrite, 16) ; |
admcrae | 0:e314f3b805ed | 1291 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1292 | } |
admcrae | 0:e314f3b805ed | 1293 | |
admcrae | 0:e314f3b805ed | 1294 | void uLCD_4D_Picaso::gfx_TriangleFilled(WORD X1, WORD Y1, WORD X2, WORD Y2, WORD X3, WORD Y3, WORD Color) |
admcrae | 0:e314f3b805ed | 1295 | { |
admcrae | 0:e314f3b805ed | 1296 | char towrite[16] ; |
admcrae | 0:e314f3b805ed | 1297 | towrite[0]= F_gfx_TriangleFilled >> 8 ; |
admcrae | 0:e314f3b805ed | 1298 | towrite[1]= F_gfx_TriangleFilled ; |
admcrae | 0:e314f3b805ed | 1299 | towrite[2]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1300 | towrite[3]= X1 ; |
admcrae | 0:e314f3b805ed | 1301 | towrite[4]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1302 | towrite[5]= Y1 ; |
admcrae | 0:e314f3b805ed | 1303 | towrite[6]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1304 | towrite[7]= X2 ; |
admcrae | 0:e314f3b805ed | 1305 | towrite[8]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1306 | towrite[9]= Y2 ; |
admcrae | 0:e314f3b805ed | 1307 | towrite[10]= X3 >> 8 ; |
admcrae | 0:e314f3b805ed | 1308 | towrite[11]= X3 ; |
admcrae | 0:e314f3b805ed | 1309 | towrite[12]= Y3 >> 8 ; |
admcrae | 0:e314f3b805ed | 1310 | towrite[13]= Y3 ; |
admcrae | 0:e314f3b805ed | 1311 | towrite[14]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1312 | towrite[15]= Color ; |
admcrae | 0:e314f3b805ed | 1313 | WriteBytes(towrite, 16) ; |
admcrae | 0:e314f3b805ed | 1314 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1315 | } |
admcrae | 0:e314f3b805ed | 1316 | |
admcrae | 0:e314f3b805ed | 1317 | WORD uLCD_4D_Picaso::img_ClearAttributes(WORD Handle, WORD Index, WORD Value) |
admcrae | 0:e314f3b805ed | 1318 | { |
admcrae | 0:e314f3b805ed | 1319 | char towrite[8] ; |
admcrae | 0:e314f3b805ed | 1320 | towrite[0]= F_img_ClearAttributes >> 8 ; |
admcrae | 0:e314f3b805ed | 1321 | towrite[1]= F_img_ClearAttributes & 0xFF; |
admcrae | 0:e314f3b805ed | 1322 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1323 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1324 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1325 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1326 | towrite[6]= Value >> 8 ; |
admcrae | 0:e314f3b805ed | 1327 | towrite[7]= Value ; |
admcrae | 0:e314f3b805ed | 1328 | WriteBytes(towrite, 8) ; |
admcrae | 0:e314f3b805ed | 1329 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1330 | } |
admcrae | 0:e314f3b805ed | 1331 | |
admcrae | 0:e314f3b805ed | 1332 | WORD uLCD_4D_Picaso::img_Darken(WORD Handle, WORD Index) |
admcrae | 0:e314f3b805ed | 1333 | { |
admcrae | 0:e314f3b805ed | 1334 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1335 | towrite[0]= F_img_Darken >> 8 ; |
admcrae | 0:e314f3b805ed | 1336 | towrite[1]= F_img_Darken & 0xFF; |
admcrae | 0:e314f3b805ed | 1337 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1338 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1339 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1340 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1341 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1342 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1343 | } |
admcrae | 0:e314f3b805ed | 1344 | |
admcrae | 0:e314f3b805ed | 1345 | WORD uLCD_4D_Picaso::img_Disable(WORD Handle, WORD Index) |
admcrae | 0:e314f3b805ed | 1346 | { |
admcrae | 0:e314f3b805ed | 1347 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1348 | towrite[0]= F_img_Disable >> 8 ; |
admcrae | 0:e314f3b805ed | 1349 | towrite[1]= F_img_Disable & 0xFF; |
admcrae | 0:e314f3b805ed | 1350 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1351 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1352 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1353 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1354 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1355 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1356 | } |
admcrae | 0:e314f3b805ed | 1357 | |
admcrae | 0:e314f3b805ed | 1358 | WORD uLCD_4D_Picaso::img_Enable(WORD Handle, WORD Index) |
admcrae | 0:e314f3b805ed | 1359 | { |
admcrae | 0:e314f3b805ed | 1360 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1361 | towrite[0]= F_img_Enable >> 8 ; |
admcrae | 0:e314f3b805ed | 1362 | towrite[1]= F_img_Enable & 0xFF; |
admcrae | 0:e314f3b805ed | 1363 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1364 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1365 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1366 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1367 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1368 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1369 | } |
admcrae | 0:e314f3b805ed | 1370 | |
admcrae | 0:e314f3b805ed | 1371 | WORD uLCD_4D_Picaso::img_GetWord(WORD Handle, WORD Index, WORD Offset ) |
admcrae | 0:e314f3b805ed | 1372 | { |
admcrae | 0:e314f3b805ed | 1373 | char towrite[8] ; |
admcrae | 0:e314f3b805ed | 1374 | towrite[0]= F_img_GetWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1375 | towrite[1]= F_img_GetWord & 0xFF; |
admcrae | 0:e314f3b805ed | 1376 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1377 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1378 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1379 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1380 | towrite[6]= Offset >> 8 ; |
admcrae | 0:e314f3b805ed | 1381 | towrite[7]= Offset ; |
admcrae | 0:e314f3b805ed | 1382 | WriteBytes(towrite, 8) ; |
admcrae | 0:e314f3b805ed | 1383 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1384 | } |
admcrae | 0:e314f3b805ed | 1385 | |
admcrae | 0:e314f3b805ed | 1386 | WORD uLCD_4D_Picaso::img_Lighten(WORD Handle, WORD Index) |
admcrae | 0:e314f3b805ed | 1387 | { |
admcrae | 0:e314f3b805ed | 1388 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1389 | towrite[0]= F_img_Lighten >> 8 ; |
admcrae | 0:e314f3b805ed | 1390 | towrite[1]= F_img_Lighten & 0xFF; |
admcrae | 0:e314f3b805ed | 1391 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1392 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1393 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1394 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1395 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1396 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1397 | } |
admcrae | 0:e314f3b805ed | 1398 | |
admcrae | 0:e314f3b805ed | 1399 | WORD uLCD_4D_Picaso::img_SetAttributes(WORD Handle, WORD Index, WORD Value) |
admcrae | 0:e314f3b805ed | 1400 | { |
admcrae | 0:e314f3b805ed | 1401 | char towrite[8] ; |
admcrae | 0:e314f3b805ed | 1402 | |
admcrae | 0:e314f3b805ed | 1403 | towrite[0]= F_img_SetAttributes >> 8 ; |
admcrae | 0:e314f3b805ed | 1404 | towrite[1]= F_img_SetAttributes & 0xFF; |
admcrae | 0:e314f3b805ed | 1405 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1406 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1407 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1408 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1409 | towrite[6]= Value >> 8 ; |
admcrae | 0:e314f3b805ed | 1410 | towrite[7]= Value ; |
admcrae | 0:e314f3b805ed | 1411 | WriteBytes(towrite, 8) ; |
admcrae | 0:e314f3b805ed | 1412 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1413 | } |
admcrae | 0:e314f3b805ed | 1414 | |
admcrae | 0:e314f3b805ed | 1415 | WORD uLCD_4D_Picaso::img_SetPosition(WORD Handle, WORD Index, WORD Xpos, WORD Ypos) |
admcrae | 0:e314f3b805ed | 1416 | { |
admcrae | 0:e314f3b805ed | 1417 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 1418 | |
admcrae | 0:e314f3b805ed | 1419 | towrite[0]= F_img_SetPosition >> 8 ; |
admcrae | 0:e314f3b805ed | 1420 | towrite[1]= F_img_SetPosition & 0xFF; |
admcrae | 0:e314f3b805ed | 1421 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1422 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1423 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1424 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1425 | towrite[6]= Xpos >> 8 ; |
admcrae | 0:e314f3b805ed | 1426 | towrite[7]= Xpos ; |
admcrae | 0:e314f3b805ed | 1427 | towrite[8]= Ypos >> 8 ; |
admcrae | 0:e314f3b805ed | 1428 | towrite[9]= Ypos ; |
admcrae | 0:e314f3b805ed | 1429 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 1430 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1431 | } |
admcrae | 0:e314f3b805ed | 1432 | |
admcrae | 0:e314f3b805ed | 1433 | WORD uLCD_4D_Picaso::img_SetWord(WORD Handle, WORD Index, WORD Offset , WORD Word) |
admcrae | 0:e314f3b805ed | 1434 | { |
admcrae | 0:e314f3b805ed | 1435 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 1436 | |
admcrae | 0:e314f3b805ed | 1437 | towrite[0]= F_img_SetWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1438 | towrite[1]= F_img_SetWord & 0xFF; |
admcrae | 0:e314f3b805ed | 1439 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1440 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1441 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1442 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1443 | towrite[6]= Offset >> 8 ; |
admcrae | 0:e314f3b805ed | 1444 | towrite[7]= Offset ; |
admcrae | 0:e314f3b805ed | 1445 | towrite[8]= Word >> 8 ; |
admcrae | 0:e314f3b805ed | 1446 | towrite[9]= Word ; |
admcrae | 0:e314f3b805ed | 1447 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 1448 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1449 | } |
admcrae | 0:e314f3b805ed | 1450 | |
admcrae | 0:e314f3b805ed | 1451 | WORD uLCD_4D_Picaso::img_Show(WORD Handle, WORD Index) |
admcrae | 0:e314f3b805ed | 1452 | { |
admcrae | 0:e314f3b805ed | 1453 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1454 | towrite[0]= F_img_Show >> 8 ; |
admcrae | 0:e314f3b805ed | 1455 | towrite[1]= F_img_Show & 0xFF; |
admcrae | 0:e314f3b805ed | 1456 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1457 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1458 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1459 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1460 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1461 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1462 | } |
admcrae | 0:e314f3b805ed | 1463 | |
admcrae | 0:e314f3b805ed | 1464 | WORD uLCD_4D_Picaso::img_Touched(WORD Handle, WORD Index) |
admcrae | 0:e314f3b805ed | 1465 | { |
admcrae | 0:e314f3b805ed | 1466 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1467 | towrite[0]= F_img_Touched >> 8 ; |
admcrae | 0:e314f3b805ed | 1468 | towrite[1]= F_img_Touched & 0xFF; |
admcrae | 0:e314f3b805ed | 1469 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1470 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1471 | towrite[4]= Index >> 8 ; |
admcrae | 0:e314f3b805ed | 1472 | towrite[5]= Index ; |
admcrae | 0:e314f3b805ed | 1473 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1474 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1475 | } |
admcrae | 0:e314f3b805ed | 1476 | |
admcrae | 0:e314f3b805ed | 1477 | WORD uLCD_4D_Picaso::media_Flush() |
admcrae | 0:e314f3b805ed | 1478 | { |
admcrae | 0:e314f3b805ed | 1479 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1480 | towrite[0]= F_media_Flush >> 8 ; |
admcrae | 0:e314f3b805ed | 1481 | towrite[1]= F_media_Flush ; |
admcrae | 0:e314f3b805ed | 1482 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1483 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1484 | } |
admcrae | 0:e314f3b805ed | 1485 | |
admcrae | 0:e314f3b805ed | 1486 | void uLCD_4D_Picaso::media_Image(WORD X, WORD Y) |
admcrae | 0:e314f3b805ed | 1487 | { |
admcrae | 0:e314f3b805ed | 1488 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1489 | |
admcrae | 0:e314f3b805ed | 1490 | towrite[0]= F_media_Image >> 8 ; |
admcrae | 0:e314f3b805ed | 1491 | towrite[1]= F_media_Image ; |
admcrae | 0:e314f3b805ed | 1492 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 1493 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 1494 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 1495 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 1496 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1497 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1498 | } |
admcrae | 0:e314f3b805ed | 1499 | |
admcrae | 0:e314f3b805ed | 1500 | WORD uLCD_4D_Picaso::media_Init() |
admcrae | 0:e314f3b805ed | 1501 | { |
admcrae | 0:e314f3b805ed | 1502 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1503 | |
admcrae | 0:e314f3b805ed | 1504 | towrite[0]= F_media_Init >> 8 ; |
admcrae | 0:e314f3b805ed | 1505 | towrite[1]= F_media_Init ; |
admcrae | 0:e314f3b805ed | 1506 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1507 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1508 | } |
admcrae | 0:e314f3b805ed | 1509 | |
admcrae | 0:e314f3b805ed | 1510 | WORD uLCD_4D_Picaso::media_RdSector(t4DSector SectorIn) |
admcrae | 0:e314f3b805ed | 1511 | { |
admcrae | 0:e314f3b805ed | 1512 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1513 | |
admcrae | 0:e314f3b805ed | 1514 | towrite[0]= F_media_RdSector >> 8 ; |
admcrae | 0:e314f3b805ed | 1515 | towrite[1]= F_media_RdSector ; |
admcrae | 0:e314f3b805ed | 1516 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1517 | return GetAckResSector(SectorIn) ; |
admcrae | 0:e314f3b805ed | 1518 | } |
admcrae | 0:e314f3b805ed | 1519 | |
admcrae | 0:e314f3b805ed | 1520 | WORD uLCD_4D_Picaso::media_ReadByte() |
admcrae | 0:e314f3b805ed | 1521 | { |
admcrae | 0:e314f3b805ed | 1522 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1523 | towrite[0]= F_media_ReadByte >> 8 ; |
admcrae | 0:e314f3b805ed | 1524 | towrite[1]= F_media_ReadByte ; |
admcrae | 0:e314f3b805ed | 1525 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1526 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1527 | } |
admcrae | 0:e314f3b805ed | 1528 | |
admcrae | 0:e314f3b805ed | 1529 | WORD uLCD_4D_Picaso::media_ReadWord() |
admcrae | 0:e314f3b805ed | 1530 | { |
admcrae | 0:e314f3b805ed | 1531 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1532 | towrite[0]= F_media_ReadWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1533 | towrite[1]= F_media_ReadWord ; |
admcrae | 0:e314f3b805ed | 1534 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1535 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1536 | } |
admcrae | 0:e314f3b805ed | 1537 | |
admcrae | 0:e314f3b805ed | 1538 | void uLCD_4D_Picaso::media_SetAdd(WORD HiWord, WORD LoWord) |
admcrae | 0:e314f3b805ed | 1539 | { |
admcrae | 0:e314f3b805ed | 1540 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1541 | |
admcrae | 0:e314f3b805ed | 1542 | towrite[0]= F_media_SetAdd >> 8 ; |
admcrae | 0:e314f3b805ed | 1543 | towrite[1]= F_media_SetAdd ; |
admcrae | 0:e314f3b805ed | 1544 | towrite[2]= HiWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1545 | towrite[3]= HiWord ; |
admcrae | 0:e314f3b805ed | 1546 | towrite[4]= LoWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1547 | towrite[5]= LoWord ; |
admcrae | 0:e314f3b805ed | 1548 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1549 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1550 | } |
admcrae | 0:e314f3b805ed | 1551 | |
admcrae | 0:e314f3b805ed | 1552 | void uLCD_4D_Picaso::media_SetSector(WORD HiWord, WORD LoWord) |
admcrae | 0:e314f3b805ed | 1553 | { |
admcrae | 0:e314f3b805ed | 1554 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1555 | |
admcrae | 0:e314f3b805ed | 1556 | towrite[0]= F_media_SetSector >> 8 ; |
admcrae | 0:e314f3b805ed | 1557 | towrite[1]= F_media_SetSector ; |
admcrae | 0:e314f3b805ed | 1558 | towrite[2]= HiWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1559 | towrite[3]= HiWord ; |
admcrae | 0:e314f3b805ed | 1560 | towrite[4]= LoWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1561 | towrite[5]= LoWord ; |
admcrae | 0:e314f3b805ed | 1562 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1563 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1564 | } |
admcrae | 0:e314f3b805ed | 1565 | |
admcrae | 0:e314f3b805ed | 1566 | void uLCD_4D_Picaso::media_Video(WORD X, WORD Y) |
admcrae | 0:e314f3b805ed | 1567 | { |
admcrae | 0:e314f3b805ed | 1568 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1569 | |
admcrae | 0:e314f3b805ed | 1570 | towrite[0]= F_media_Video >> 8 ; |
admcrae | 0:e314f3b805ed | 1571 | towrite[1]= F_media_Video ; |
admcrae | 0:e314f3b805ed | 1572 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 1573 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 1574 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 1575 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 1576 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1577 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1578 | } |
admcrae | 0:e314f3b805ed | 1579 | |
admcrae | 0:e314f3b805ed | 1580 | void uLCD_4D_Picaso::media_VideoFrame(WORD X, WORD Y, WORD Framenumber) |
admcrae | 0:e314f3b805ed | 1581 | { |
admcrae | 0:e314f3b805ed | 1582 | char towrite[8] ; |
admcrae | 0:e314f3b805ed | 1583 | |
admcrae | 0:e314f3b805ed | 1584 | towrite[0]= F_media_VideoFrame >> 8 ; |
admcrae | 0:e314f3b805ed | 1585 | towrite[1]= F_media_VideoFrame ; |
admcrae | 0:e314f3b805ed | 1586 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 1587 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 1588 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 1589 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 1590 | towrite[6]= Framenumber >> 8 ; |
admcrae | 0:e314f3b805ed | 1591 | towrite[7]= Framenumber ; |
admcrae | 0:e314f3b805ed | 1592 | WriteBytes(towrite, 8) ; |
admcrae | 0:e314f3b805ed | 1593 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1594 | } |
admcrae | 0:e314f3b805ed | 1595 | |
admcrae | 0:e314f3b805ed | 1596 | WORD uLCD_4D_Picaso::media_WriteByte(WORD Byte) |
admcrae | 0:e314f3b805ed | 1597 | { |
admcrae | 0:e314f3b805ed | 1598 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1599 | |
admcrae | 0:e314f3b805ed | 1600 | towrite[0]= F_media_WriteByte >> 8 ; |
admcrae | 0:e314f3b805ed | 1601 | towrite[1]= F_media_WriteByte ; |
admcrae | 0:e314f3b805ed | 1602 | towrite[2]= Byte >> 8 ; |
admcrae | 0:e314f3b805ed | 1603 | towrite[3]= Byte ; |
admcrae | 0:e314f3b805ed | 1604 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1605 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1606 | } |
admcrae | 0:e314f3b805ed | 1607 | |
admcrae | 0:e314f3b805ed | 1608 | WORD uLCD_4D_Picaso::media_WriteWord(WORD Word) |
admcrae | 0:e314f3b805ed | 1609 | { |
admcrae | 0:e314f3b805ed | 1610 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1611 | |
admcrae | 0:e314f3b805ed | 1612 | towrite[0]= F_media_WriteWord >> 8 ; |
admcrae | 0:e314f3b805ed | 1613 | towrite[1]= F_media_WriteWord ; |
admcrae | 0:e314f3b805ed | 1614 | towrite[2]= Word >> 8 ; |
admcrae | 0:e314f3b805ed | 1615 | towrite[3]= Word ; |
admcrae | 0:e314f3b805ed | 1616 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1617 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1618 | } |
admcrae | 0:e314f3b805ed | 1619 | |
admcrae | 0:e314f3b805ed | 1620 | WORD uLCD_4D_Picaso::media_WrSector(t4DSector SectorOut) |
admcrae | 0:e314f3b805ed | 1621 | { |
admcrae | 0:e314f3b805ed | 1622 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1623 | |
admcrae | 0:e314f3b805ed | 1624 | towrite[0]= F_media_WrSector >> 8 ; |
admcrae | 0:e314f3b805ed | 1625 | towrite[1]= F_media_WrSector ; |
admcrae | 0:e314f3b805ed | 1626 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1627 | WriteBytes(SectorOut, 512) ; |
admcrae | 0:e314f3b805ed | 1628 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1629 | } |
admcrae | 0:e314f3b805ed | 1630 | |
admcrae | 0:e314f3b805ed | 1631 | WORD uLCD_4D_Picaso::mem_Free(WORD Handle) |
admcrae | 0:e314f3b805ed | 1632 | { |
admcrae | 0:e314f3b805ed | 1633 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1634 | |
admcrae | 0:e314f3b805ed | 1635 | towrite[0]= F_mem_Free >> 8 ; |
admcrae | 0:e314f3b805ed | 1636 | towrite[1]= F_mem_Free & 0xFF; |
admcrae | 0:e314f3b805ed | 1637 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 1638 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 1639 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1640 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1641 | } |
admcrae | 0:e314f3b805ed | 1642 | |
admcrae | 0:e314f3b805ed | 1643 | WORD uLCD_4D_Picaso::mem_Heap() |
admcrae | 0:e314f3b805ed | 1644 | { |
admcrae | 0:e314f3b805ed | 1645 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1646 | |
admcrae | 0:e314f3b805ed | 1647 | towrite[0]= F_mem_Heap >> 8 ; |
admcrae | 0:e314f3b805ed | 1648 | towrite[1]= F_mem_Heap & 0xFF; |
admcrae | 0:e314f3b805ed | 1649 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1650 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1651 | } |
admcrae | 0:e314f3b805ed | 1652 | |
admcrae | 0:e314f3b805ed | 1653 | WORD uLCD_4D_Picaso::peekM(WORD Address) |
admcrae | 0:e314f3b805ed | 1654 | { |
admcrae | 0:e314f3b805ed | 1655 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1656 | |
admcrae | 0:e314f3b805ed | 1657 | towrite[0]= F_peekM >> 8 ; |
admcrae | 0:e314f3b805ed | 1658 | towrite[1]= F_peekM ; |
admcrae | 0:e314f3b805ed | 1659 | towrite[2]= Address >> 8 ; |
admcrae | 0:e314f3b805ed | 1660 | towrite[3]= Address ; |
admcrae | 0:e314f3b805ed | 1661 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1662 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1663 | } |
admcrae | 0:e314f3b805ed | 1664 | |
admcrae | 0:e314f3b805ed | 1665 | WORD uLCD_4D_Picaso::pin_HI(WORD Pin) |
admcrae | 0:e314f3b805ed | 1666 | { |
admcrae | 0:e314f3b805ed | 1667 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1668 | |
admcrae | 0:e314f3b805ed | 1669 | towrite[0]= F_pin_HI >> 8 ; |
admcrae | 0:e314f3b805ed | 1670 | towrite[1]= F_pin_HI ; |
admcrae | 0:e314f3b805ed | 1671 | towrite[2]= Pin >> 8 ; |
admcrae | 0:e314f3b805ed | 1672 | towrite[3]= Pin ; |
admcrae | 0:e314f3b805ed | 1673 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1674 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1675 | } |
admcrae | 0:e314f3b805ed | 1676 | |
admcrae | 0:e314f3b805ed | 1677 | WORD uLCD_4D_Picaso::pin_LO(WORD Pin) |
admcrae | 0:e314f3b805ed | 1678 | { |
admcrae | 0:e314f3b805ed | 1679 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1680 | |
admcrae | 0:e314f3b805ed | 1681 | towrite[0]= F_pin_LO >> 8 ; |
admcrae | 0:e314f3b805ed | 1682 | towrite[1]= F_pin_LO ; |
admcrae | 0:e314f3b805ed | 1683 | towrite[2]= Pin >> 8 ; |
admcrae | 0:e314f3b805ed | 1684 | towrite[3]= Pin ; |
admcrae | 0:e314f3b805ed | 1685 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1686 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1687 | } |
admcrae | 0:e314f3b805ed | 1688 | |
admcrae | 0:e314f3b805ed | 1689 | WORD uLCD_4D_Picaso::pin_Read(WORD Pin) |
admcrae | 0:e314f3b805ed | 1690 | { |
admcrae | 0:e314f3b805ed | 1691 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1692 | |
admcrae | 0:e314f3b805ed | 1693 | towrite[0]= F_pin_Read >> 8 ; |
admcrae | 0:e314f3b805ed | 1694 | towrite[1]= F_pin_Read ; |
admcrae | 0:e314f3b805ed | 1695 | towrite[2]= Pin >> 8 ; |
admcrae | 0:e314f3b805ed | 1696 | towrite[3]= Pin ; |
admcrae | 0:e314f3b805ed | 1697 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1698 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1699 | } |
admcrae | 0:e314f3b805ed | 1700 | |
admcrae | 0:e314f3b805ed | 1701 | WORD uLCD_4D_Picaso::pin_Set(WORD Mode, WORD Pin) |
admcrae | 0:e314f3b805ed | 1702 | { |
admcrae | 0:e314f3b805ed | 1703 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1704 | |
admcrae | 0:e314f3b805ed | 1705 | towrite[0]= F_pin_Set >> 8 ; |
admcrae | 0:e314f3b805ed | 1706 | towrite[1]= F_pin_Set ; |
admcrae | 0:e314f3b805ed | 1707 | towrite[2]= Mode >> 8 ; |
admcrae | 0:e314f3b805ed | 1708 | towrite[3]= Mode ; |
admcrae | 0:e314f3b805ed | 1709 | towrite[4]= Pin >> 8 ; |
admcrae | 0:e314f3b805ed | 1710 | towrite[5]= Pin ; |
admcrae | 0:e314f3b805ed | 1711 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1712 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1713 | } |
admcrae | 0:e314f3b805ed | 1714 | |
admcrae | 0:e314f3b805ed | 1715 | void uLCD_4D_Picaso::pokeM(WORD Address, WORD WordValue) |
admcrae | 0:e314f3b805ed | 1716 | { |
admcrae | 0:e314f3b805ed | 1717 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1718 | |
admcrae | 0:e314f3b805ed | 1719 | towrite[0]= F_pokeM >> 8 ; |
admcrae | 0:e314f3b805ed | 1720 | towrite[1]= F_pokeM ; |
admcrae | 0:e314f3b805ed | 1721 | towrite[2]= Address >> 8 ; |
admcrae | 0:e314f3b805ed | 1722 | towrite[3]= Address ; |
admcrae | 0:e314f3b805ed | 1723 | towrite[4]= WordValue >> 8 ; |
admcrae | 0:e314f3b805ed | 1724 | towrite[5]= WordValue ; |
admcrae | 0:e314f3b805ed | 1725 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1726 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1727 | } |
admcrae | 0:e314f3b805ed | 1728 | |
admcrae | 0:e314f3b805ed | 1729 | void uLCD_4D_Picaso::putCH(WORD WordChar) |
admcrae | 0:e314f3b805ed | 1730 | { |
admcrae | 0:e314f3b805ed | 1731 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1732 | |
admcrae | 0:e314f3b805ed | 1733 | towrite[0]= F_putCH >> 8 ; |
admcrae | 0:e314f3b805ed | 1734 | towrite[1]= F_putCH ; |
admcrae | 0:e314f3b805ed | 1735 | towrite[2]= WordChar >> 8 ; |
admcrae | 0:e314f3b805ed | 1736 | towrite[3]= WordChar ; |
admcrae | 0:e314f3b805ed | 1737 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1738 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1739 | } |
admcrae | 0:e314f3b805ed | 1740 | |
admcrae | 0:e314f3b805ed | 1741 | WORD uLCD_4D_Picaso::putStr(char * InString) |
admcrae | 0:e314f3b805ed | 1742 | { |
admcrae | 0:e314f3b805ed | 1743 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1744 | |
admcrae | 0:e314f3b805ed | 1745 | towrite[0]= F_putstr >> 8 ; |
admcrae | 0:e314f3b805ed | 1746 | towrite[1]= F_putstr ; |
admcrae | 0:e314f3b805ed | 1747 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1748 | WriteChars(InString) ; |
admcrae | 0:e314f3b805ed | 1749 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1750 | } |
admcrae | 0:e314f3b805ed | 1751 | |
admcrae | 0:e314f3b805ed | 1752 | void uLCD_4D_Picaso::snd_BufSize(WORD Bufsize) |
admcrae | 0:e314f3b805ed | 1753 | { |
admcrae | 0:e314f3b805ed | 1754 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1755 | |
admcrae | 0:e314f3b805ed | 1756 | towrite[0]= F_snd_BufSize >> 8 ; |
admcrae | 0:e314f3b805ed | 1757 | towrite[1]= F_snd_BufSize & 0xFF; |
admcrae | 0:e314f3b805ed | 1758 | towrite[2]= Bufsize >> 8 ; |
admcrae | 0:e314f3b805ed | 1759 | towrite[3]= Bufsize ; |
admcrae | 0:e314f3b805ed | 1760 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1761 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1762 | } |
admcrae | 0:e314f3b805ed | 1763 | |
admcrae | 0:e314f3b805ed | 1764 | void uLCD_4D_Picaso::snd_Continue() |
admcrae | 0:e314f3b805ed | 1765 | { |
admcrae | 0:e314f3b805ed | 1766 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1767 | |
admcrae | 0:e314f3b805ed | 1768 | towrite[0]= F_snd_Continue >> 8 ; |
admcrae | 0:e314f3b805ed | 1769 | towrite[1]= F_snd_Continue & 0xFF; |
admcrae | 0:e314f3b805ed | 1770 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1771 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1772 | } |
admcrae | 0:e314f3b805ed | 1773 | |
admcrae | 0:e314f3b805ed | 1774 | void uLCD_4D_Picaso::snd_Pause() |
admcrae | 0:e314f3b805ed | 1775 | { |
admcrae | 0:e314f3b805ed | 1776 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1777 | |
admcrae | 0:e314f3b805ed | 1778 | towrite[0]= F_snd_Pause >> 8 ; |
admcrae | 0:e314f3b805ed | 1779 | towrite[1]= F_snd_Pause & 0xFF; |
admcrae | 0:e314f3b805ed | 1780 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1781 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1782 | } |
admcrae | 0:e314f3b805ed | 1783 | |
admcrae | 0:e314f3b805ed | 1784 | WORD uLCD_4D_Picaso::snd_Pitch(WORD Pitch) |
admcrae | 0:e314f3b805ed | 1785 | { |
admcrae | 0:e314f3b805ed | 1786 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1787 | |
admcrae | 0:e314f3b805ed | 1788 | towrite[0]= F_snd_Pitch >> 8 ; |
admcrae | 0:e314f3b805ed | 1789 | towrite[1]= F_snd_Pitch & 0xFF; |
admcrae | 0:e314f3b805ed | 1790 | towrite[2]= Pitch >> 8 ; |
admcrae | 0:e314f3b805ed | 1791 | towrite[3]= Pitch ; |
admcrae | 0:e314f3b805ed | 1792 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1793 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1794 | } |
admcrae | 0:e314f3b805ed | 1795 | |
admcrae | 0:e314f3b805ed | 1796 | WORD uLCD_4D_Picaso::snd_Playing() |
admcrae | 0:e314f3b805ed | 1797 | { |
admcrae | 0:e314f3b805ed | 1798 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1799 | |
admcrae | 0:e314f3b805ed | 1800 | towrite[0]= F_snd_Playing >> 8 ; |
admcrae | 0:e314f3b805ed | 1801 | towrite[1]= F_snd_Playing & 0xFF; |
admcrae | 0:e314f3b805ed | 1802 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1803 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1804 | } |
admcrae | 0:e314f3b805ed | 1805 | |
admcrae | 0:e314f3b805ed | 1806 | void uLCD_4D_Picaso::snd_Stop() |
admcrae | 0:e314f3b805ed | 1807 | { |
admcrae | 0:e314f3b805ed | 1808 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 1809 | |
admcrae | 0:e314f3b805ed | 1810 | towrite[0]= F_snd_Stop >> 8 ; |
admcrae | 0:e314f3b805ed | 1811 | towrite[1]= F_snd_Stop & 0xFF; |
admcrae | 0:e314f3b805ed | 1812 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 1813 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1814 | } |
admcrae | 0:e314f3b805ed | 1815 | |
admcrae | 0:e314f3b805ed | 1816 | void uLCD_4D_Picaso::snd_Volume(WORD Volume) |
admcrae | 0:e314f3b805ed | 1817 | { |
admcrae | 0:e314f3b805ed | 1818 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1819 | |
admcrae | 0:e314f3b805ed | 1820 | towrite[0]= F_snd_Volume >> 8 ; |
admcrae | 0:e314f3b805ed | 1821 | towrite[1]= F_snd_Volume & 0xFF; |
admcrae | 0:e314f3b805ed | 1822 | towrite[2]= Volume >> 8 ; |
admcrae | 0:e314f3b805ed | 1823 | towrite[3]= Volume ; |
admcrae | 0:e314f3b805ed | 1824 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1825 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1826 | } |
admcrae | 0:e314f3b805ed | 1827 | |
admcrae | 0:e314f3b805ed | 1828 | WORD uLCD_4D_Picaso::sys_Sleep(WORD Units) |
admcrae | 0:e314f3b805ed | 1829 | { |
admcrae | 0:e314f3b805ed | 1830 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1831 | |
admcrae | 0:e314f3b805ed | 1832 | towrite[0]= F_sys_Sleep >> 8 ; |
admcrae | 0:e314f3b805ed | 1833 | towrite[1]= F_sys_Sleep & 0xFF; |
admcrae | 0:e314f3b805ed | 1834 | towrite[2]= Units >> 8 ; |
admcrae | 0:e314f3b805ed | 1835 | towrite[3]= Units ; |
admcrae | 0:e314f3b805ed | 1836 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1837 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1838 | } |
admcrae | 0:e314f3b805ed | 1839 | |
admcrae | 0:e314f3b805ed | 1840 | void uLCD_4D_Picaso::touch_DetectRegion(WORD X1, WORD Y1, WORD X2, WORD Y2) |
admcrae | 0:e314f3b805ed | 1841 | { |
admcrae | 0:e314f3b805ed | 1842 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 1843 | |
admcrae | 0:e314f3b805ed | 1844 | towrite[0]= F_touch_DetectRegion >> 8 ; |
admcrae | 0:e314f3b805ed | 1845 | towrite[1]= F_touch_DetectRegion & 0xFF; |
admcrae | 0:e314f3b805ed | 1846 | towrite[2]= X1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1847 | towrite[3]= X1 ; |
admcrae | 0:e314f3b805ed | 1848 | towrite[4]= Y1 >> 8 ; |
admcrae | 0:e314f3b805ed | 1849 | towrite[5]= Y1 ; |
admcrae | 0:e314f3b805ed | 1850 | towrite[6]= X2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1851 | towrite[7]= X2 ; |
admcrae | 0:e314f3b805ed | 1852 | towrite[8]= Y2 >> 8 ; |
admcrae | 0:e314f3b805ed | 1853 | towrite[9]= Y2 ; |
admcrae | 0:e314f3b805ed | 1854 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 1855 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1856 | } |
admcrae | 0:e314f3b805ed | 1857 | |
admcrae | 0:e314f3b805ed | 1858 | WORD uLCD_4D_Picaso::touch_Get(WORD Mode) |
admcrae | 0:e314f3b805ed | 1859 | { |
admcrae | 0:e314f3b805ed | 1860 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1861 | |
admcrae | 0:e314f3b805ed | 1862 | towrite[0]= F_touch_Get >> 8 ; |
admcrae | 0:e314f3b805ed | 1863 | towrite[1]= F_touch_Get & 0xFF; |
admcrae | 0:e314f3b805ed | 1864 | towrite[2]= Mode >> 8 ; |
admcrae | 0:e314f3b805ed | 1865 | towrite[3]= Mode ; |
admcrae | 0:e314f3b805ed | 1866 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1867 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1868 | } |
admcrae | 0:e314f3b805ed | 1869 | |
admcrae | 0:e314f3b805ed | 1870 | void uLCD_4D_Picaso::touch_Set(WORD Mode) |
admcrae | 0:e314f3b805ed | 1871 | { |
admcrae | 0:e314f3b805ed | 1872 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1873 | |
admcrae | 0:e314f3b805ed | 1874 | towrite[0]= F_touch_Set >> 8 ; |
admcrae | 0:e314f3b805ed | 1875 | towrite[1]= F_touch_Set & 0xFF; |
admcrae | 0:e314f3b805ed | 1876 | towrite[2]= Mode >> 8 ; |
admcrae | 0:e314f3b805ed | 1877 | towrite[3]= Mode ; |
admcrae | 0:e314f3b805ed | 1878 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1879 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1880 | } |
admcrae | 0:e314f3b805ed | 1881 | |
admcrae | 0:e314f3b805ed | 1882 | WORD uLCD_4D_Picaso::txt_Attributes(WORD Attribs) |
admcrae | 0:e314f3b805ed | 1883 | { |
admcrae | 0:e314f3b805ed | 1884 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1885 | |
admcrae | 0:e314f3b805ed | 1886 | towrite[0]= F_txt_Attributes >> 8 ; |
admcrae | 0:e314f3b805ed | 1887 | towrite[1]= F_txt_Attributes ; |
admcrae | 0:e314f3b805ed | 1888 | towrite[2]= Attribs >> 8 ; |
admcrae | 0:e314f3b805ed | 1889 | towrite[3]= Attribs ; |
admcrae | 0:e314f3b805ed | 1890 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1891 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1892 | } |
admcrae | 0:e314f3b805ed | 1893 | |
admcrae | 0:e314f3b805ed | 1894 | WORD uLCD_4D_Picaso::txt_BGcolour(WORD Color) |
admcrae | 0:e314f3b805ed | 1895 | { |
admcrae | 0:e314f3b805ed | 1896 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1897 | |
admcrae | 0:e314f3b805ed | 1898 | towrite[0]= F_txt_BGcolour >> 8 ; |
admcrae | 0:e314f3b805ed | 1899 | towrite[1]= F_txt_BGcolour ; |
admcrae | 0:e314f3b805ed | 1900 | towrite[2]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1901 | towrite[3]= Color ; |
admcrae | 0:e314f3b805ed | 1902 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1903 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1904 | } |
admcrae | 0:e314f3b805ed | 1905 | |
admcrae | 0:e314f3b805ed | 1906 | WORD uLCD_4D_Picaso::txt_Bold(WORD Bold) |
admcrae | 0:e314f3b805ed | 1907 | { |
admcrae | 0:e314f3b805ed | 1908 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1909 | |
admcrae | 0:e314f3b805ed | 1910 | towrite[0]= F_txt_Bold >> 8 ; |
admcrae | 0:e314f3b805ed | 1911 | towrite[1]= F_txt_Bold ; |
admcrae | 0:e314f3b805ed | 1912 | towrite[2]= Bold >> 8 ; |
admcrae | 0:e314f3b805ed | 1913 | towrite[3]= Bold ; |
admcrae | 0:e314f3b805ed | 1914 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1915 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1916 | } |
admcrae | 0:e314f3b805ed | 1917 | |
admcrae | 0:e314f3b805ed | 1918 | WORD uLCD_4D_Picaso::txt_FGcolour(WORD Color) |
admcrae | 0:e314f3b805ed | 1919 | { |
admcrae | 0:e314f3b805ed | 1920 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1921 | |
admcrae | 0:e314f3b805ed | 1922 | towrite[0]= F_txt_FGcolour >> 8 ; |
admcrae | 0:e314f3b805ed | 1923 | towrite[1]= F_txt_FGcolour ; |
admcrae | 0:e314f3b805ed | 1924 | towrite[2]= Color >> 8 ; |
admcrae | 0:e314f3b805ed | 1925 | towrite[3]= Color ; |
admcrae | 0:e314f3b805ed | 1926 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1927 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1928 | } |
admcrae | 0:e314f3b805ed | 1929 | |
admcrae | 0:e314f3b805ed | 1930 | WORD uLCD_4D_Picaso::txt_FontID(WORD FontNumber) |
admcrae | 0:e314f3b805ed | 1931 | { |
admcrae | 0:e314f3b805ed | 1932 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1933 | |
admcrae | 0:e314f3b805ed | 1934 | towrite[0]= F_txt_FontID >> 8 ; |
admcrae | 0:e314f3b805ed | 1935 | towrite[1]= F_txt_FontID ; |
admcrae | 0:e314f3b805ed | 1936 | towrite[2]= FontNumber >> 8 ; |
admcrae | 0:e314f3b805ed | 1937 | towrite[3]= FontNumber ; |
admcrae | 0:e314f3b805ed | 1938 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1939 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1940 | } |
admcrae | 0:e314f3b805ed | 1941 | |
admcrae | 0:e314f3b805ed | 1942 | WORD uLCD_4D_Picaso::txt_Height(WORD Multiplier) |
admcrae | 0:e314f3b805ed | 1943 | { |
admcrae | 0:e314f3b805ed | 1944 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1945 | |
admcrae | 0:e314f3b805ed | 1946 | towrite[0]= F_txt_Height >> 8 ; |
admcrae | 0:e314f3b805ed | 1947 | towrite[1]= F_txt_Height ; |
admcrae | 0:e314f3b805ed | 1948 | towrite[2]= Multiplier >> 8 ; |
admcrae | 0:e314f3b805ed | 1949 | towrite[3]= Multiplier ; |
admcrae | 0:e314f3b805ed | 1950 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1951 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1952 | } |
admcrae | 0:e314f3b805ed | 1953 | |
admcrae | 0:e314f3b805ed | 1954 | WORD uLCD_4D_Picaso::txt_Inverse(WORD Inverse) |
admcrae | 0:e314f3b805ed | 1955 | { |
admcrae | 0:e314f3b805ed | 1956 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1957 | |
admcrae | 0:e314f3b805ed | 1958 | towrite[0]= F_txt_Inverse >> 8 ; |
admcrae | 0:e314f3b805ed | 1959 | towrite[1]= F_txt_Inverse ; |
admcrae | 0:e314f3b805ed | 1960 | towrite[2]= Inverse >> 8 ; |
admcrae | 0:e314f3b805ed | 1961 | towrite[3]= Inverse ; |
admcrae | 0:e314f3b805ed | 1962 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1963 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1964 | } |
admcrae | 0:e314f3b805ed | 1965 | |
admcrae | 0:e314f3b805ed | 1966 | WORD uLCD_4D_Picaso::txt_Italic(WORD Italic) |
admcrae | 0:e314f3b805ed | 1967 | { |
admcrae | 0:e314f3b805ed | 1968 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1969 | |
admcrae | 0:e314f3b805ed | 1970 | towrite[0]= F_txt_Italic >> 8 ; |
admcrae | 0:e314f3b805ed | 1971 | towrite[1]= F_txt_Italic ; |
admcrae | 0:e314f3b805ed | 1972 | towrite[2]= Italic >> 8 ; |
admcrae | 0:e314f3b805ed | 1973 | towrite[3]= Italic ; |
admcrae | 0:e314f3b805ed | 1974 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 1975 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 1976 | } |
admcrae | 0:e314f3b805ed | 1977 | |
admcrae | 0:e314f3b805ed | 1978 | void uLCD_4D_Picaso::txt_MoveCursor(WORD Line, WORD Column) |
admcrae | 0:e314f3b805ed | 1979 | { |
admcrae | 0:e314f3b805ed | 1980 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 1981 | |
admcrae | 0:e314f3b805ed | 1982 | towrite[0]= F_txt_MoveCursor >> 8 ; |
admcrae | 0:e314f3b805ed | 1983 | towrite[1]= F_txt_MoveCursor ; |
admcrae | 0:e314f3b805ed | 1984 | towrite[2]= Line >> 8 ; |
admcrae | 0:e314f3b805ed | 1985 | towrite[3]= Line ; |
admcrae | 0:e314f3b805ed | 1986 | towrite[4]= Column >> 8 ; |
admcrae | 0:e314f3b805ed | 1987 | towrite[5]= Column ; |
admcrae | 0:e314f3b805ed | 1988 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 1989 | GetAck() ; |
admcrae | 0:e314f3b805ed | 1990 | } |
admcrae | 0:e314f3b805ed | 1991 | |
admcrae | 0:e314f3b805ed | 1992 | WORD uLCD_4D_Picaso::txt_Opacity(WORD TransparentOpaque) |
admcrae | 0:e314f3b805ed | 1993 | { |
admcrae | 0:e314f3b805ed | 1994 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 1995 | |
admcrae | 0:e314f3b805ed | 1996 | towrite[0]= F_txt_Opacity >> 8 ; |
admcrae | 0:e314f3b805ed | 1997 | towrite[1]= F_txt_Opacity ; |
admcrae | 0:e314f3b805ed | 1998 | towrite[2]= TransparentOpaque >> 8 ; |
admcrae | 0:e314f3b805ed | 1999 | towrite[3]= TransparentOpaque ; |
admcrae | 0:e314f3b805ed | 2000 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2001 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2002 | } |
admcrae | 0:e314f3b805ed | 2003 | |
admcrae | 0:e314f3b805ed | 2004 | void uLCD_4D_Picaso::txt_Set(WORD Func, WORD Value) |
admcrae | 0:e314f3b805ed | 2005 | { |
admcrae | 0:e314f3b805ed | 2006 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 2007 | |
admcrae | 0:e314f3b805ed | 2008 | towrite[0]= F_txt_Set >> 8 ; |
admcrae | 0:e314f3b805ed | 2009 | towrite[1]= F_txt_Set ; |
admcrae | 0:e314f3b805ed | 2010 | towrite[2]= Func >> 8 ; |
admcrae | 0:e314f3b805ed | 2011 | towrite[3]= Func ; |
admcrae | 0:e314f3b805ed | 2012 | towrite[4]= Value >> 8 ; |
admcrae | 0:e314f3b805ed | 2013 | towrite[5]= Value ; |
admcrae | 0:e314f3b805ed | 2014 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 2015 | GetAck() ; |
admcrae | 0:e314f3b805ed | 2016 | } |
admcrae | 0:e314f3b805ed | 2017 | |
admcrae | 0:e314f3b805ed | 2018 | WORD uLCD_4D_Picaso::txt_Underline(WORD Underline) |
admcrae | 0:e314f3b805ed | 2019 | { |
admcrae | 0:e314f3b805ed | 2020 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2021 | |
admcrae | 0:e314f3b805ed | 2022 | towrite[0]= F_txt_Underline >> 8 ; |
admcrae | 0:e314f3b805ed | 2023 | towrite[1]= F_txt_Underline ; |
admcrae | 0:e314f3b805ed | 2024 | towrite[2]= Underline >> 8 ; |
admcrae | 0:e314f3b805ed | 2025 | towrite[3]= Underline ; |
admcrae | 0:e314f3b805ed | 2026 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2027 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2028 | } |
admcrae | 0:e314f3b805ed | 2029 | |
admcrae | 0:e314f3b805ed | 2030 | WORD uLCD_4D_Picaso::txt_Width(WORD Multiplier) |
admcrae | 0:e314f3b805ed | 2031 | { |
admcrae | 0:e314f3b805ed | 2032 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2033 | |
admcrae | 0:e314f3b805ed | 2034 | towrite[0]= F_txt_Width >> 8 ; |
admcrae | 0:e314f3b805ed | 2035 | towrite[1]= F_txt_Width ; |
admcrae | 0:e314f3b805ed | 2036 | towrite[2]= Multiplier >> 8 ; |
admcrae | 0:e314f3b805ed | 2037 | towrite[3]= Multiplier ; |
admcrae | 0:e314f3b805ed | 2038 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2039 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2040 | } |
admcrae | 0:e314f3b805ed | 2041 | |
admcrae | 0:e314f3b805ed | 2042 | WORD uLCD_4D_Picaso::txt_Wrap(WORD Position) |
admcrae | 0:e314f3b805ed | 2043 | { |
admcrae | 0:e314f3b805ed | 2044 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2045 | |
admcrae | 0:e314f3b805ed | 2046 | towrite[0]= F_txt_Wrap >> 8 ; |
admcrae | 0:e314f3b805ed | 2047 | towrite[1]= F_txt_Wrap ; |
admcrae | 0:e314f3b805ed | 2048 | towrite[2]= Position >> 8 ; |
admcrae | 0:e314f3b805ed | 2049 | towrite[3]= Position ; |
admcrae | 0:e314f3b805ed | 2050 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2051 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2052 | } |
admcrae | 0:e314f3b805ed | 2053 | |
admcrae | 0:e314f3b805ed | 2054 | WORD uLCD_4D_Picaso::txt_Xgap(WORD Pixels) |
admcrae | 0:e314f3b805ed | 2055 | { |
admcrae | 0:e314f3b805ed | 2056 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2057 | |
admcrae | 0:e314f3b805ed | 2058 | towrite[0]= F_txt_Xgap >> 8 ; |
admcrae | 0:e314f3b805ed | 2059 | towrite[1]= F_txt_Xgap ; |
admcrae | 0:e314f3b805ed | 2060 | towrite[2]= Pixels >> 8 ; |
admcrae | 0:e314f3b805ed | 2061 | towrite[3]= Pixels ; |
admcrae | 0:e314f3b805ed | 2062 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2063 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2064 | } |
admcrae | 0:e314f3b805ed | 2065 | |
admcrae | 0:e314f3b805ed | 2066 | WORD uLCD_4D_Picaso::txt_Ygap(WORD Pixels) |
admcrae | 0:e314f3b805ed | 2067 | { |
admcrae | 0:e314f3b805ed | 2068 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2069 | |
admcrae | 0:e314f3b805ed | 2070 | towrite[0]= F_txt_Ygap >> 8 ; |
admcrae | 0:e314f3b805ed | 2071 | towrite[1]= F_txt_Ygap ; |
admcrae | 0:e314f3b805ed | 2072 | towrite[2]= Pixels >> 8 ; |
admcrae | 0:e314f3b805ed | 2073 | towrite[3]= Pixels ; |
admcrae | 0:e314f3b805ed | 2074 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2075 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2076 | } |
admcrae | 0:e314f3b805ed | 2077 | |
admcrae | 0:e314f3b805ed | 2078 | WORD uLCD_4D_Picaso::file_CallFunction(WORD Handle, WORD ArgCount, t4DWordArray Args) |
admcrae | 0:e314f3b805ed | 2079 | { |
admcrae | 0:e314f3b805ed | 2080 | char towrite[6] ; |
admcrae | 0:e314f3b805ed | 2081 | |
admcrae | 0:e314f3b805ed | 2082 | towrite[0]= F_file_CallFunction >> 8 ; |
admcrae | 0:e314f3b805ed | 2083 | towrite[1]= F_file_CallFunction ; |
admcrae | 0:e314f3b805ed | 2084 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 2085 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 2086 | towrite[4]= ArgCount >> 8 ; |
admcrae | 0:e314f3b805ed | 2087 | towrite[5]= ArgCount ; |
admcrae | 0:e314f3b805ed | 2088 | WriteBytes(towrite, 6) ; |
admcrae | 0:e314f3b805ed | 2089 | WriteWords(Args, ArgCount) ; |
admcrae | 0:e314f3b805ed | 2090 | return WaitForAck() ; |
admcrae | 0:e314f3b805ed | 2091 | } |
admcrae | 0:e314f3b805ed | 2092 | |
admcrae | 0:e314f3b805ed | 2093 | WORD uLCD_4D_Picaso::sys_GetModel(char * ModelStr) |
admcrae | 0:e314f3b805ed | 2094 | { |
admcrae | 0:e314f3b805ed | 2095 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 2096 | |
admcrae | 0:e314f3b805ed | 2097 | towrite[0]= F_sys_GetModel >> 8 ; |
admcrae | 0:e314f3b805ed | 2098 | towrite[1]= F_sys_GetModel ; |
admcrae | 0:e314f3b805ed | 2099 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 2100 | return GetAckResStr(ModelStr) ; |
admcrae | 0:e314f3b805ed | 2101 | } |
admcrae | 0:e314f3b805ed | 2102 | |
admcrae | 0:e314f3b805ed | 2103 | WORD uLCD_4D_Picaso::sys_GetVersion() |
admcrae | 0:e314f3b805ed | 2104 | { |
admcrae | 0:e314f3b805ed | 2105 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 2106 | |
admcrae | 0:e314f3b805ed | 2107 | towrite[0]= F_sys_GetVersion >> 8 ; |
admcrae | 0:e314f3b805ed | 2108 | towrite[1]= F_sys_GetVersion ; |
admcrae | 0:e314f3b805ed | 2109 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 2110 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2111 | } |
admcrae | 0:e314f3b805ed | 2112 | |
admcrae | 0:e314f3b805ed | 2113 | WORD uLCD_4D_Picaso::sys_GetPmmC() |
admcrae | 0:e314f3b805ed | 2114 | { |
admcrae | 0:e314f3b805ed | 2115 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 2116 | |
admcrae | 0:e314f3b805ed | 2117 | towrite[0]= F_sys_GetPmmC >> 8 ; |
admcrae | 0:e314f3b805ed | 2118 | towrite[1]= F_sys_GetPmmC ; |
admcrae | 0:e314f3b805ed | 2119 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 2120 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2121 | } |
admcrae | 0:e314f3b805ed | 2122 | |
admcrae | 0:e314f3b805ed | 2123 | WORD uLCD_4D_Picaso::writeString(WORD Handle, char * StringOut) |
admcrae | 0:e314f3b805ed | 2124 | { |
admcrae | 0:e314f3b805ed | 2125 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2126 | |
admcrae | 0:e314f3b805ed | 2127 | towrite[0]= F_writeString >> 8 ; |
admcrae | 0:e314f3b805ed | 2128 | towrite[1]= F_writeString ; |
admcrae | 0:e314f3b805ed | 2129 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 2130 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 2131 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2132 | WriteChars(StringOut) ; |
admcrae | 0:e314f3b805ed | 2133 | return GetAckResp() ; |
admcrae | 0:e314f3b805ed | 2134 | } |
admcrae | 0:e314f3b805ed | 2135 | |
admcrae | 0:e314f3b805ed | 2136 | WORD uLCD_4D_Picaso::readString(WORD Handle, char * StringIn) |
admcrae | 0:e314f3b805ed | 2137 | { |
admcrae | 0:e314f3b805ed | 2138 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2139 | |
admcrae | 0:e314f3b805ed | 2140 | towrite[0]= F_readString >> 8 ; |
admcrae | 0:e314f3b805ed | 2141 | towrite[1]= F_readString ; |
admcrae | 0:e314f3b805ed | 2142 | towrite[2]= Handle >> 8 ; |
admcrae | 0:e314f3b805ed | 2143 | towrite[3]= Handle ; |
admcrae | 0:e314f3b805ed | 2144 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2145 | return GetAckResStr(StringIn) ; |
admcrae | 0:e314f3b805ed | 2146 | } |
admcrae | 0:e314f3b805ed | 2147 | |
admcrae | 0:e314f3b805ed | 2148 | void uLCD_4D_Picaso::blitComtoDisplay(WORD X, WORD Y, WORD Width, WORD Height, t4DByteArray Pixels) |
admcrae | 0:e314f3b805ed | 2149 | { |
admcrae | 0:e314f3b805ed | 2150 | char towrite[10] ; |
admcrae | 0:e314f3b805ed | 2151 | |
admcrae | 0:e314f3b805ed | 2152 | towrite[0]= F_blitComtoDisplay >> 8 ; |
admcrae | 0:e314f3b805ed | 2153 | towrite[1]= F_blitComtoDisplay ; |
admcrae | 0:e314f3b805ed | 2154 | towrite[2]= X >> 8 ; |
admcrae | 0:e314f3b805ed | 2155 | towrite[3]= X ; |
admcrae | 0:e314f3b805ed | 2156 | towrite[4]= Y >> 8 ; |
admcrae | 0:e314f3b805ed | 2157 | towrite[5]= Y ; |
admcrae | 0:e314f3b805ed | 2158 | towrite[6]= Width >> 8 ; |
admcrae | 0:e314f3b805ed | 2159 | towrite[7]= Width ; |
admcrae | 0:e314f3b805ed | 2160 | towrite[8]= Height >> 8 ; |
admcrae | 0:e314f3b805ed | 2161 | towrite[9]= Height ; |
admcrae | 0:e314f3b805ed | 2162 | WriteBytes(towrite, 10) ; |
admcrae | 0:e314f3b805ed | 2163 | WriteBytes(Pixels, Width*Height*2) ; |
admcrae | 0:e314f3b805ed | 2164 | GetAck() ; |
admcrae | 0:e314f3b805ed | 2165 | } |
admcrae | 0:e314f3b805ed | 2166 | |
admcrae | 0:e314f3b805ed | 2167 | WORD uLCD_4D_Picaso::file_FindFirstRet(char * Filename, char * StringIn) |
admcrae | 0:e314f3b805ed | 2168 | { |
admcrae | 0:e314f3b805ed | 2169 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 2170 | |
admcrae | 0:e314f3b805ed | 2171 | towrite[0]= F_file_FindFirstRet >> 8 ; |
admcrae | 0:e314f3b805ed | 2172 | towrite[1]= F_file_FindFirstRet ; |
admcrae | 0:e314f3b805ed | 2173 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 2174 | WriteChars(Filename) ; |
admcrae | 0:e314f3b805ed | 2175 | return GetAckResStr(StringIn) ; |
admcrae | 0:e314f3b805ed | 2176 | } |
admcrae | 0:e314f3b805ed | 2177 | |
admcrae | 0:e314f3b805ed | 2178 | WORD uLCD_4D_Picaso::file_FindNextRet(char * StringIn) |
admcrae | 0:e314f3b805ed | 2179 | { |
admcrae | 0:e314f3b805ed | 2180 | char towrite[2] ; |
admcrae | 0:e314f3b805ed | 2181 | |
admcrae | 0:e314f3b805ed | 2182 | towrite[0]= F_file_FindNextRet >> 8 ; |
admcrae | 0:e314f3b805ed | 2183 | towrite[1]= F_file_FindNextRet ; |
admcrae | 0:e314f3b805ed | 2184 | WriteBytes(towrite, 2) ; |
admcrae | 0:e314f3b805ed | 2185 | return GetAckResStr(StringIn) ; |
admcrae | 0:e314f3b805ed | 2186 | } |
admcrae | 0:e314f3b805ed | 2187 | |
admcrae | 0:e314f3b805ed | 2188 | void uLCD_4D_Picaso::setbaudWait(uLCD_4D_Picaso::BaudRate Newrate) |
admcrae | 0:e314f3b805ed | 2189 | { |
admcrae | 0:e314f3b805ed | 2190 | char towrite[4] ; |
admcrae | 0:e314f3b805ed | 2191 | |
admcrae | 0:e314f3b805ed | 2192 | towrite[0]= F_setbaudWait >> 8 ; |
admcrae | 0:e314f3b805ed | 2193 | towrite[1]= F_setbaudWait ; |
admcrae | 0:e314f3b805ed | 2194 | towrite[2]= Newrate >> 8 ; |
admcrae | 0:e314f3b805ed | 2195 | towrite[3]= Newrate ; |
admcrae | 0:e314f3b805ed | 2196 | WriteBytes(towrite, 4) ; |
admcrae | 0:e314f3b805ed | 2197 | //printf("Baud command: %2x%2x%2x%2x\r\n", towrite[0], towrite[1], towrite[2], towrite[3]); |
admcrae | 0:e314f3b805ed | 2198 | SetThisBaudrate(Newrate) ; // change this systems baud rate to match new display rate, ACK is 100ms away |
admcrae | 0:e314f3b805ed | 2199 | GetAck() ; |
admcrae | 0:e314f3b805ed | 2200 | } |
admcrae | 0:e314f3b805ed | 2201 | |
admcrae | 0:e314f3b805ed | 2202 | /* |
admcrae | 0:e314f3b805ed | 2203 | * Conpound 4D Routines Ends here |
admcrae | 0:e314f3b805ed | 2204 | */ |
admcrae | 0:e314f3b805ed | 2205 |