4 #ifdef EHOUSE_DUE_SHIELD 5 pinMode(24, OUTPUT); digitalWrite(24, HIGH);
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);
72 #if defined(CTE_DUE_SHIELD) || defined(EHOUSE_DUE_SHIELD) 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);
80 REG_PIOA_CODR=0x0000C000;
81 REG_PIOD_CODR=0x0000064F;
82 REG_PIOA_SODR=(VH & 0x06)<<13;
83 (VH & 0x01) ? REG_PIOB_SODR = 0x4000000 : REG_PIOB_CODR = 0x4000000;
84 REG_PIOD_SODR=((VH & 0x78)>>3) | ((VH & 0x80)>>1);
85 pulse_low(P_WR, B_WR);
87 REG_PIOA_CODR=0x0000C000;
88 REG_PIOD_CODR=0x0000064F;
89 REG_PIOA_SODR=(VL & 0x06)<<13;
90 (VL & 0x01) ? REG_PIOB_SODR = 0x4000000 : REG_PIOB_CODR = 0x4000000;
91 REG_PIOD_SODR=((VL & 0x78)>>3) | ((VL & 0x80)>>1);
92 pulse_low(P_WR, B_WR);
96 #if defined(CTE_DUE_SHIELD) 97 REG_PIOC_CODR=0xFF1FE;
98 REG_PIOC_SODR=(VL<<1) & 0x1FE;
99 REG_PIOC_SODR=(VH<<12) & 0xFF000;
100 #elif defined(EHOUSE_DUE_SHIELD) 101 PIOC->PIO_ODSR = ((PIOC->PIO_ODSR&(~0x000FF3FC)) | ((((uint32_t)VL)<<2) | (((uint32_t)VH)<<12)));
103 REG_PIOA_CODR=0x0000C080;
104 REG_PIOC_CODR=0x0000003E;
105 REG_PIOD_CODR=0x0000064F;
106 REG_PIOA_SODR=((VH & 0x06)<<13) | ((VL & 0x40)<<1);
107 (VH & 0x01) ? REG_PIOB_SODR = 0x4000000 : REG_PIOB_CODR = 0x4000000;
108 REG_PIOC_SODR=((VL & 0x01)<<5) | ((VL & 0x02)<<3) | ((VL & 0x04)<<1) | ((VL & 0x08)>>1) | ((VL & 0x10)>>3);
109 REG_PIOD_SODR=((VH & 0x78)>>3) | ((VH & 0x80)>>1) | ((VL & 0x20)<<5) | ((VL & 0x80)<<2);
111 pulse_low(P_WR, B_WR);
119 void UTFT::_set_direction_registers(byte mode)
121 if (mode!=LATCHED_16)
123 #if defined(CTE_DUE_SHIELD) 126 REG_PIOC_OER=0x000FF1FE;
129 REG_PIOC_OER=0x000FF000;
130 #elif defined(EHOUSE_DUE_SHIELD) 133 REG_PIOC_OER=0x000FF3FC;
134 REG_PIOC_OWER=0x000FF3FC;
137 REG_PIOC_OER=0x000FF000;
139 REG_PIOA_OER=0x0000c000;
140 REG_PIOB_OER=0x04000000;
141 REG_PIOD_OER=0x0000064f;
144 REG_PIOA_OER=0x00000080;
145 REG_PIOC_OER=0x0000003e;
155 void UTFT::_fast_fill_16(
int ch,
int cl,
long pix)
159 #if defined(CTE_DUE_SHIELD) 160 REG_PIOC_CODR=0xFF1FE;
161 REG_PIOC_SODR=(cl<<1) & 0x1FE;
162 REG_PIOC_SODR=(ch<<12) & 0xFF000;
163 #elif defined(EHOUSE_DUE_SHIELD) 164 PIOC->PIO_ODSR = ((PIOC->PIO_ODSR&(~0x000FF3FC)) | ((((uint32_t)cl)<<2) | (((uint32_t)ch)<<12)));
166 REG_PIOA_CODR=0x0000C080;
167 REG_PIOC_CODR=0x0000003E;
168 REG_PIOD_CODR=0x0000064F;
169 REG_PIOA_SODR=((ch & 0x06)<<13) | ((cl & 0x40)<<1);
170 (ch & 0x01) ? REG_PIOB_SODR = 0x4000000 : REG_PIOB_CODR = 0x4000000;
171 REG_PIOC_SODR=((cl & 0x01)<<5) | ((cl & 0x02)<<3) | ((cl & 0x04)<<1) | ((cl & 0x08)>>1) | ((cl & 0x10)>>3);
172 REG_PIOD_SODR=((ch & 0x78)>>3) | ((ch & 0x80)>>1) | ((cl & 0x20)<<5) | ((cl & 0x80)<<2);
176 for (
int i=0; i<blocks; i++)
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);
190 pulse_low(P_WR, B_WR);
191 pulse_low(P_WR, B_WR);
192 pulse_low(P_WR, B_WR);
193 pulse_low(P_WR, B_WR);
196 for (
int i=0; i<(pix % 16)+1; i++)
198 pulse_low(P_WR, B_WR);
202 void UTFT::_fast_fill_8(
int ch,
long pix)
206 #if defined(CTE_DUE_SHIELD) || defined(EHOUSE_DUE_SHIELD) 207 REG_PIOC_CODR=0xFF000;
208 REG_PIOC_SODR=(ch<<12) & 0xFF000;
210 REG_PIOA_CODR=0x0000C000;
211 REG_PIOD_CODR=0x0000064F;
212 REG_PIOA_SODR=(ch & 0x06)<<13;
213 (ch & 0x01) ? REG_PIOB_SODR = 0x4000000 : REG_PIOB_CODR = 0x4000000;
214 REG_PIOD_SODR=((ch & 0x78)>>3) | ((ch & 0x80)>>1);
218 for (
int i=0; i<blocks; i++)
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);
233 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
234 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
235 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
238 for (
int i=0; i<(pix % 16)+1; i++)
240 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);