2 void UTFT::_hw_special_init()
9 void UTFT::LCD_Writ_Bus(
char VH,
char VL,
byte mode)
14 if (display_serial_mode==SERIAL_4PIN)
20 pulse_low(P_SCL, B_SCL);
34 pulse_low(P_SCL, B_SCL);
39 pulse_low(P_SCL, B_SCL);
44 pulse_low(P_SCL, B_SCL);
49 pulse_low(P_SCL, B_SCL);
54 pulse_low(P_SCL, B_SCL);
59 pulse_low(P_SCL, B_SCL);
64 pulse_low(P_SCL, B_SCL);
69 pulse_low(P_SCL, B_SCL);
73 REG_PIOC_CODR=0xFF000;
74 REG_PIOC_SODR=(VH<<12) & 0xFF000;
75 pulse_low(P_WR, B_WR);
76 REG_PIOC_CODR=0xFF000;
77 REG_PIOC_SODR=(VL<<12) & 0xFF000;
78 pulse_low(P_WR, B_WR);
82 REG_PIOB_CODR=0x4000000;
86 REG_PIOB_SODR=(VH<<26) & 0x4000000;
88 REG_PIOA_SODR=(VH<<13) & 0x4000;
90 REG_PIOA_SODR=(VH<<13) & 0x8000;
92 REG_PIOD_SODR=(VH>>3) & 0x01;
94 REG_PIOD_SODR=(VH>>3) & 0x02;
96 REG_PIOD_SODR=(VH>>3) & 0x04;
98 REG_PIOD_SODR=(VH>>3) & 0x08;
100 REG_PIOD_SODR=(VH>>1) & 0x40;
101 pulse_low(P_WR, B_WR);
103 REG_PIOA_CODR=0xc000;
104 REG_PIOB_CODR=0x4000000;
107 REG_PIOB_SODR=(VL<<26) & 0x4000000;
109 REG_PIOA_SODR=(VL<<13) & 0x4000;
111 REG_PIOA_SODR=(VL<<13) & 0x8000;
113 REG_PIOD_SODR=(VL>>3) & 0x01;
115 REG_PIOD_SODR=(VL>>3) & 0x02;
117 REG_PIOD_SODR=(VL>>3) & 0x04;
119 REG_PIOD_SODR=(VL>>3) & 0x08;
121 REG_PIOD_SODR=(VL>>1) & 0x40;
122 pulse_low(P_WR, B_WR);
126 #ifdef CTE_DUE_SHIELD
127 REG_PIOC_CODR=0xFF1FE;
128 REG_PIOC_SODR=(VL<<1) & 0x1FE;
129 REG_PIOC_SODR=(VH<<12) & 0xFF000;
132 REG_PIOA_CODR=0xc080;
133 REG_PIOB_CODR=0x4000000;
138 REG_PIOC_SODR=(VL<<5) & 0x20;
140 REG_PIOC_SODR=(VL<<3) & 0x10;
142 REG_PIOC_SODR=(VL<<1) & 0x08;
144 REG_PIOC_SODR=(VL>>1) & 0x04;
146 REG_PIOC_SODR=(VL>>3) & 0x02;
148 REG_PIOD_SODR=(VL<<5) & 0x400;
150 REG_PIOA_SODR=(VL<<1) & 0x80;
152 REG_PIOD_SODR=(VL<<2) & 0x200;
154 REG_PIOB_SODR=(VH<<26) & 0x4000000;
156 REG_PIOA_SODR=(VH<<13) & 0x4000;
158 REG_PIOA_SODR=(VH<<13) & 0x8000;
160 REG_PIOD_SODR=(VH>>3) & 0x01;
162 REG_PIOD_SODR=(VH>>3) & 0x02;
164 REG_PIOD_SODR=(VH>>3) & 0x04;
166 REG_PIOD_SODR=(VH>>3) & 0x08;
168 REG_PIOD_SODR=(VH>>1) & 0x40;
170 pulse_low(P_WR, B_WR);
178 void UTFT::_set_direction_registers(
byte mode)
180 if (mode!=LATCHED_16)
182 #ifdef CTE_DUE_SHIELD
185 REG_PIOC_OER=0x000FF1FE;
188 REG_PIOC_OER=0x000FF000;
190 REG_PIOA_OER=0x0000c000;
191 REG_PIOB_OER=0x40000000;
192 REG_PIOD_OER=0x00000064f;
195 REG_PIOA_OER=0x00000080;
196 REG_PIOC_OER=0x0000003e;
206 void UTFT::_fast_fill_16(
int ch,
int cl,
long pix)
210 #ifdef CTE_DUE_SHIELD
211 REG_PIOC_CODR=0xFF1FE;
212 REG_PIOC_SODR=(cl<<1) & 0x1FE;
213 REG_PIOC_SODR=(ch<<12) & 0xFF000;
216 REG_PIOA_CODR=0xc080;
217 REG_PIOB_CODR=0x4000000;
222 REG_PIOC_SODR=(cl<<5) & 0x20;
224 REG_PIOC_SODR=(cl<<3) & 0x10;
226 REG_PIOC_SODR=(cl<<1) & 0x08;
228 REG_PIOC_SODR=(cl>>1) & 0x04;
230 REG_PIOC_SODR=(cl>>3) & 0x02;
232 REG_PIOD_SODR=(cl<<5) & 0x400;
234 REG_PIOA_SODR=(cl<<1) & 0x80;
236 REG_PIOD_SODR=(cl<<2) & 0x200;
238 REG_PIOB_SODR=(ch<<26) & 0x4000000;
240 REG_PIOA_SODR=(ch<<13) & 0x4000;
242 REG_PIOA_SODR=(ch<<13) & 0x8000;
244 REG_PIOD_SODR=(ch>>3) & 0x01;
246 REG_PIOD_SODR=(ch>>3) & 0x02;
248 REG_PIOD_SODR=(ch>>3) & 0x04;
250 REG_PIOD_SODR=(ch>>3) & 0x08;
252 REG_PIOD_SODR=(ch>>1) & 0x40;
256 for (
int i=0; i<blocks; i++)
258 pulse_low(P_WR, B_WR);
259 pulse_low(P_WR, B_WR);
260 pulse_low(P_WR, B_WR);
261 pulse_low(P_WR, B_WR);
262 pulse_low(P_WR, B_WR);
263 pulse_low(P_WR, B_WR);
264 pulse_low(P_WR, B_WR);
265 pulse_low(P_WR, B_WR);
266 pulse_low(P_WR, B_WR);
267 pulse_low(P_WR, B_WR);
268 pulse_low(P_WR, B_WR);
269 pulse_low(P_WR, B_WR);
270 pulse_low(P_WR, B_WR);
271 pulse_low(P_WR, B_WR);
272 pulse_low(P_WR, B_WR);
273 pulse_low(P_WR, B_WR);
276 for (
int i=0; i<(pix % 16); i++)
278 pulse_low(P_WR, B_WR);
282 void UTFT::_fast_fill_8(
int ch,
long pix)
286 #ifdef CTE_DUE_SHIELD
287 REG_PIOC_CODR=0xFF000;
288 REG_PIOC_SODR=(ch<<12) & 0xFF000;
291 REG_PIOA_CODR=0xc000;
292 REG_PIOB_CODR=0x4000000;
296 REG_PIOB_SODR=(ch<<26) & 0x4000000;
298 REG_PIOA_SODR=(ch<<13) & 0x4000;
300 REG_PIOA_SODR=(ch<<13) & 0x8000;
302 REG_PIOD_SODR=(ch>>3) & 0x01;
304 REG_PIOD_SODR=(ch>>3) & 0x02;
306 REG_PIOD_SODR=(ch>>3) & 0x04;
308 REG_PIOD_SODR=(ch>>3) & 0x08;
310 REG_PIOD_SODR=(ch>>1) & 0x40;
314 for (
int i=0; i<blocks; i++)
316 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
317 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
318 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
319 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
320 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
321 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
322 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
323 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
324 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
325 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
326 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
327 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
328 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
329 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
330 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
331 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
334 for (
int i=0; i<(pix % 16); i++)
336 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);