2 void UTFT::_hw_special_init()
6 void UTFT::LCD_Writ_Bus(
char VH,
char VL,
byte mode)
11 if (display_serial_mode==SERIAL_4PIN)
17 pulse_low(P_SCL, B_SCL);
31 pulse_low(P_SCL, B_SCL);
36 pulse_low(P_SCL, B_SCL);
41 pulse_low(P_SCL, B_SCL);
46 pulse_low(P_SCL, B_SCL);
51 pulse_low(P_SCL, B_SCL);
56 pulse_low(P_SCL, B_SCL);
61 pulse_low(P_SCL, B_SCL);
66 pulse_low(P_SCL, B_SCL);
69 #if defined(USE_UNO_SHIELD_ON_MEGA)
71 PORTG |= (VH & 0x10)<<1;
73 PORTH |= (VH & 0xC0)>>3;
75 PORTE |= (VH & 0x03) + ((VH & 0x0C)<<2) + ((VH & 0x20)>>2);
76 pulse_low(P_WR, B_WR);
78 PORTG |= (VL & 0x10)<<1;
80 PORTH |= (VL & 0xC0)>>3;
82 PORTE |= (VL & 0x03) + ((VL & 0x0C)<<2) + ((VL & 0x20)>>2);
83 pulse_low(P_WR, B_WR);
86 pulse_low(P_WR, B_WR);
88 pulse_low(P_WR, B_WR);
94 pulse_low(P_WR, B_WR);
98 PORTG |= (VH & 0x10)<<1;
100 PORTH |= (VH & 0xC0)>>3;
102 PORTE |= (VH & 0x03) + ((VH & 0x0C)<<2) + ((VH & 0x20)>>2);
104 pulse_high(P_ALE, B_ALE);
107 PORTG |= (VL & 0x10)<<1;
109 PORTH |= (VL & 0xC0)>>3;
111 PORTE |= (VL & 0x03) + ((VL & 0x0C)<<2) + ((VL & 0x20)>>2);
112 pulse_low(P_WR, B_WR);
118 void UTFT::_set_direction_registers(
byte mode)
120 #if defined(USE_UNO_SHIELD_ON_MEGA)
125 if (mode!=LATCHED_16)
140 void UTFT::_fast_fill_16(
int ch,
int cl,
long pix)
142 #if defined(USE_UNO_SHIELD_ON_MEGA)
144 _fast_fill_8(ch, pix);
147 for (
int i=0; i<pix; i++)
150 PORTG |= (ch & 0x10)<<1;
152 PORTH |= (ch & 0xC0)>>3;
154 PORTE |= (ch & 0x03) + ((ch & 0x0C)<<2) + ((ch & 0x20)>>2);
155 pulse_low(P_WR, B_WR);
157 PORTG |= (cl & 0x10)<<1;
159 PORTH |= (cl & 0xC0)>>3;
161 PORTE |= (cl & 0x03) + ((cl & 0x0C)<<2) + ((cl & 0x20)>>2);
162 pulse_low(P_WR, B_WR);
172 for (
int i=0; i<blocks; i++)
174 pulse_low(P_WR, B_WR);
175 pulse_low(P_WR, B_WR);
176 pulse_low(P_WR, B_WR);
177 pulse_low(P_WR, B_WR);
178 pulse_low(P_WR, B_WR);
179 pulse_low(P_WR, B_WR);
180 pulse_low(P_WR, B_WR);
181 pulse_low(P_WR, B_WR);
182 pulse_low(P_WR, B_WR);
183 pulse_low(P_WR, B_WR);
184 pulse_low(P_WR, B_WR);
185 pulse_low(P_WR, B_WR);
186 pulse_low(P_WR, B_WR);
187 pulse_low(P_WR, B_WR);
188 pulse_low(P_WR, B_WR);
189 pulse_low(P_WR, B_WR);
192 for (
int i=0; i<(pix % 16); i++)
194 pulse_low(P_WR, B_WR);
199 void UTFT::_fast_fill_8(
int ch,
long pix)
203 #if defined(USE_UNO_SHIELD_ON_MEGA)
205 PORTG |= (ch & 0x10)<<1;
207 PORTH |= (ch & 0xC0)>>3;
209 PORTE |= (ch & 0x03) + ((ch & 0x0C)<<2) + ((ch & 0x20)>>2);
215 for (
int i=0; i<blocks; i++)
217 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
218 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
219 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
220 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
221 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
222 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
223 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
224 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
225 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
226 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
227 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
228 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
229 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
230 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
231 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
232 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
235 for (
int i=0; i<(pix % 16); i++)
237 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);