20 void UTFT::LCD_Writ_Bus(
char VH,
char VL, byte mode)
25 if (display_serial_mode==SERIAL_4PIN)
31 pulse_low(P_SCL, B_SCL);
45 pulse_low(P_SCL, B_SCL);
50 pulse_low(P_SCL, B_SCL);
55 pulse_low(P_SCL, B_SCL);
60 pulse_low(P_SCL, B_SCL);
65 pulse_low(P_SCL, B_SCL);
70 pulse_low(P_SCL, B_SCL);
75 pulse_low(P_SCL, B_SCL);
80 pulse_low(P_SCL, B_SCL);
83 *(
volatile uint8_t *)(&GPIOD_PDOR) = VH;
84 pulse_low(P_WR, B_WR);
85 *(
volatile uint8_t *)(&GPIOD_PDOR) = VL;
86 pulse_low(P_WR, B_WR);
89 *(
volatile uint8_t *)(&GPIOD_PDOR) = VH;
90 GPIOB_PCOR = 0x000F000F;
91 GPIOB_PSOR = (0x0F & VL) | ((VL >> 4) << 16);
92 pulse_low(P_WR, B_WR);
97 void UTFT::_set_direction_registers(byte mode)
100 PORTD_PCR0 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
101 PORTD_PCR1 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
102 PORTD_PCR2 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
103 PORTD_PCR3 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
104 PORTD_PCR4 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
105 PORTD_PCR5 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
106 PORTD_PCR6 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
107 PORTD_PCR7 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
111 GPIOB_PDDR |= 0x000F000F;
112 PORTB_PCR0 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
113 PORTB_PCR1 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
114 PORTB_PCR2 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
115 PORTB_PCR3 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
116 PORTB_PCR16 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
117 PORTB_PCR17 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
118 PORTB_PCR18 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
119 PORTB_PCR19 = PORT_PCR_SRE | PORT_PCR_DSE | PORT_PCR_MUX(1);
122 void UTFT::_fast_fill_16(
int ch,
int cl,
long pix)
126 *(
volatile uint8_t *)(&GPIOD_PDOR) = ch;
127 GPIOB_PCOR = 0x000F000F;
128 GPIOB_PSOR = (0x0F & cl) | ((cl >> 4) << 16);
131 for (
int i=0; i<blocks; i++)
133 pulse_low(P_WR, B_WR);
134 pulse_low(P_WR, B_WR);
135 pulse_low(P_WR, B_WR);
136 pulse_low(P_WR, B_WR);
137 pulse_low(P_WR, B_WR);
138 pulse_low(P_WR, B_WR);
139 pulse_low(P_WR, B_WR);
140 pulse_low(P_WR, B_WR);
141 pulse_low(P_WR, B_WR);
142 pulse_low(P_WR, B_WR);
143 pulse_low(P_WR, B_WR);
144 pulse_low(P_WR, B_WR);
145 pulse_low(P_WR, B_WR);
146 pulse_low(P_WR, B_WR);
147 pulse_low(P_WR, B_WR);
148 pulse_low(P_WR, B_WR);
151 for (
int i=0; i<(pix % 16); i++)
153 pulse_low(P_WR, B_WR);
157 void UTFT::_fast_fill_8(
int ch,
long pix)
161 *(
volatile uint8_t *)(&GPIOD_PDOR) = ch;
164 for (
int i=0; i<blocks; i++)
166 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
167 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
168 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
169 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
170 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
171 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
172 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
173 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
174 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
175 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
176 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
177 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
178 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
179 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
180 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
181 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);
184 for (
int i=0; i<(pix % 16); i++)
186 pulse_low(P_WR, B_WR);pulse_low(P_WR, B_WR);