-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcommandDiscriptions.txt
executable file
·248 lines (199 loc) · 8.47 KB
/
commandDiscriptions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
// ------------------------- Command description -------------------- //
All examples presented as byte array, which transferred FROM
host to sGPU by UART interface;
First byte ALWAS command code byte!
Variables like "uint16_t x" must be splited by two bytes: "byte1 x, byte2 x",
or sGPU get command data wrong and nothing will work!
If You using gpu_gfx API, it will made transformation automatically.
// ------------------ Base ------------------ //
FLL_SCR - code: 0x01
func: tftFillScreen(uint16_t color);
Fill screen by giving colour.
Example: "FLL_SCR, byte1 color, byte2 color".
DRW_PIXEL - code: 0x03
func: tftDrawPixel(int16_t x, int16_t y, uint16_t color);
Draw pixel with color at x and y positions;
Example: "DRW_PIXEL, byte1 x, byte2 x, byte3 y, byte4 y, byte5 color, byte6 color".
// ------------- Primitives/GFX ------------- //
FLL_RECT - code: 0x04
func: tftFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
Draw filled rectangle at x and y positions, with width and height;
Example: "FLL_RECT, byte1 x, byte2 x, byte3 y, byte4 y,
byte5 w, byte6 w, byte7 h, byte8 h,
byte9 color, byte10 color".
DRW_RECT - code: 0x05
func: tftDrawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
Draw rectangle at x and y positions;
Example: "DRW_RECT, byte1 x, byte2 x, byte3 y, byte4 y,
byte5 w, byte6 w, byte7 h, byte8 h,
byte9 color, byte10 color".
DRW_ROUND_RECT - code: 0x06
func: drawRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color);
Draw rounded rectangle on x and y positions;
Example: "DRW_ROUND_RECT, byte1 x, byte2 x, byte3 y, byte4 y,
byte5 w, byte6 w, byte7 h, byte8 h,
byte9 r, byte10 r,
byte11 color, byte12 color".
FLL_ROUND_RECT - code: 0x07
func: fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t r, uint16_t color);
Draw filled rounded rectangle on x and y positions;
Example: "FLL_ROUND_RECT, byte1 x, byte2 x, byte3 y, byte4 y,
byte5 w, byte6 w, byte7 h, byte8 h,
byte9 r, byte10 r,
byte11 color, byte12 color".
DRW_LINE - code: 0x08
func: tftDrawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
Draw line from x0 and y0 positions to x1 and y1 positions;
Example: "DRW_LINE, byte1 x0, byte2 x0, byte3 y0, byte4 y0,
byte5 x1, byte6 x1, byte7 y1, byte8 y1,
byte10 color, byte11 color".
DRW_V_LINE - code: 0x09
func: tftDrawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
Draw vertical line on x and y positions with height;
Example: "DRW_V_LINE, byte1 x, byte2 x, byte3 y, byte4 y,
byte5 h, byte6 h, byte7 color, byte8 color".
DRW_H_LINE - code: 0x0A
func: tftDrawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
Draw horizontal line on x and y positions with width;
Example: "DRW_H_LINE, byte1 x, byte2 x, byte3 y, byte4 y,
byte5 w, byte6 w, byte7 color, byte8 color".
DRW_CIRCLE - code: 0x0B
func: drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
Draw circle on x and y positions with radius;
Example: "DRW_CIRCLE, byte1 x0, byte2 x0, byte3 y0, byte4 y0,
byte5 r, byte6 r, byte7 color, byte8 color".
FLL_CIRCLE - code: 0x0C
func: fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
Draw filled circle on x and y positions with radius;
Example: "FLL_CIRCLE, byte1 x0, byte2 x0, byte3 y0, byte4 y0,
byte5 r, byte6 r, byte7 color, byte8 color".
DRW_TRINGLE - code: 0x0D
func: drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
Draw triangle on x and y positions;
Example: "DRW_TRINGLE, byte1 x0, byte2 x0, byte3 y0, byte4 y0,
byte5 x1, byte6 x1, byte7 y1, byte8 y1,
byte9 x2, byte10 x2, byte11 y2, byte12 y2,
byte13 color, byte14 color".
FLL_TRINGLE - code: 0x0E
func: fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
Draw filled triangle on x and y positions;
Example: "DRW_TRINGLE, byte1 x0, byte2 x0, byte3 y0, byte4 y0,
byte5 x1, byte6 x1, byte7 y1, byte8 y1,
byte9 x2, byte10 x2, byte11 y2, byte12 y2,
byte13 color, byte14 color".
GET_RESOLUTION - code: 0x0F //
retun 4 bytes of LCD resolution;
2 bytes of height and 2 bytes of width;
Example: "GET_RESOLUTION".
// --------------- Font/Print --------------- //
DRW_CHAR - code: 0x10
func: drawChar(int16_t x, int16_t y, uint8_t c, uint16_t fgcolor, uint16_t bgcolor, uint8_t size);
draw single char gliph at x and y position, with given colors and size;
Example: "DRW_CHAR, byte1 x0, byte2 x0, byte3 y0, byte4 y0,
byte5 fgcolor1, byte6 fgcolor2, byte7 bgcolor1, byte7 bgcolor2,
byte8 char, byte9 size".
DRW_PRNT - code: 0x11
func: print();
Example: "DRW_PRNT, ".
DRW_PRNT_C - code: 0x12
func: printChar();
Example: "DRW_PRNT_C, ".
DRW_PRNT_POS_C - code: 0x13
func: printCharPos();
Example: "DRW_PRNT_POS_C, ".
SET_CURSOR - code: 0x14
func: setCursor();
Example: "SET_CURSOR, ".
SET_TXT_CR - code: 0x15
func: setTextColor();
Example: "SET_TXT_CR, ".
SET_TXT_CR_BG - code: 0x16
func: setTextColorBG();
Example: "SET_TXT_CR_BG, ".
SET_TXT_SIZE - code: 0x17
func: setTextSize();
Example: "SET_TXT_SIZE, ".
SET_TXT_WRAP - code: 0x18
func: setTextWrap();
Example: "SET_TXT_WRAP, ".
SET_TXT_437 - code: 0x19
func: cp437();
Example: "SET_TXT_437, ".
// ---------------- Low Level --------------- //
SET_ADR_WIN - code: 0x20
set addr windows where TFT will draw pixels;
func: tftSetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
Example: "SET_ADR_WIN, byte1 x0, byte2 x0, byte3 y0, byte4 y0,
byte5 x1, byte6 x1, byte7 y1, byte8 y1,".
SET_ROTATION - code: 0x21
func: tftSetRotation();
Example: "SET_ROTATION, ".
SET_SCRL_AREA - code: 0x22
func: tftSetScrollArea();
Example: "SET_SCRL_AREA, ".
WRT_CMD - code: 0x23
send byte cmd direct to TFT display;
func: writeCommand(uint8_t cmd);
Example: "WRT_CMD, byte1 cmd".
WRT_DATA - code: 0x24
send byte data direct to TFT display;
func: writeData(uint8_t data);
Example: "WRT_DATA, byte1 data".
WRT_DATA_U16 - code: 0x25
send word data direct to TFT display;
func: writeWordData(uint16_t data);
Example: "WRT_DATA_U16, byte1 data, byte2 data".
SET_V_SCRL_ADR - code: 0x26
func: tftScrollAddress();
Example: "SET_V_SCRL_ADR, ".
SET_SLEEP - code: 0x27
func: tftSetSleep();
Example: "SET_SLEEP, ".
SET_IDLE - code: 0x28
func: tftSetIdleMode();
Example: "SET_IDLE, ".
SET_BRIGHTNES - code: 0x29
set brightness level from 0 to 255;
func: tftSetDispBrightness(uint8_t level);
Example: "SET_BRIGHTNES, byte1 level".
SET_INVERTION - code: 0x2A
enable or disable inversion mode;
func: tftSetInvertion(uint8_t state);
Example: "SET_INVERTION, byte1 state".
MAK_SCRL - code: 0x2C
func: tftScroll();
Example: "MAK_SCRL, ".
MAK_SCRL_SMTH - code: 0x2D
func: tftScrollSmooth();
Example: "MAK_SCRL_SMTH, ".
PSH_CR - code: 0x2E
push color directly to TFT display;
func: tftPushColor(uint16_t color);
Example: "PSH_CR, byte1 color, byte2 color".
// ------------------- Tile ----------------- //
LDD_TLE_8 - code: 0x30
Load tile with 8x8 size from SD card
func: SDLoadTileFromSet8x8(uint8_t *tileSetArrName, uint8_t tileSetW, uint8_t ramTileNum, uint8_t tileNum);
First sequence:
Example: "LDD_TLE_8, byte1 arrNameSize, byte2 tileSetW, byte3 ramTileBase, byte4 tileNum";
Second sequence:
Example: "file name byte array";
LDD_TLES_8 - code: 0x31
Load tiles with 8x8 size from SD card
func: SDLoadTileSet8x8(uint8_t *tileSetArrName, uint8_t tileSetW, uint8_t ramTileBase, uint8_t tileMax);
First sequence:
Example: "LDD_TLES_8, byte1 arrNameSize, byte2 tileSetW, byte3 ramTileBase, byte4 tileMax";
Second sequence:
Example: "file name byte array";
LDD_TLES_RG_8 - code: 0x32
Load region of tiles with 8x8 size from SD card
func: SDLoadRegionOfTileSet8x8(uint8_t *tileSetArrName, uint8_t tileSetW, uint8_t ramTileBase, uint8_t tileMin, uint8_t tileMax);
First sequence:
Example: "LDD_TLES_RG_8, byte1 arrNameSize, byte2 tileSetW, byte3 ramTileBase, byte4 tileMin, byte5 tileMax";
Second sequence:
Example: "file name byte array";
DRW_TLE_8_POS - code: 0x33
Draw tile with 8x8 size on TFT screen
func: drawTile8x8(int16_t posX, int16_t posY, uint8_t tileNum);
Example: "DRW_TLE_8_POS, byte1 x0, byte2 x0, byte3 y0, byte4 y0, byte5 tileNum".
// ----------------- Sprite ----------------- //