@@ -142,41 +142,43 @@ board_initialize_display(uint8_t ColorCoding)
142
142
{
143
143
// HAL_LTDC_Init(&hltdc_eval);
144
144
// Configures the HS, VS, DE and PC polarity
145
- LTDC->GCR = 0 ;
145
+ // sets HS Polarity and VS Polarity to active high (LTDC_HSPOLARITY_AH, LTDC_VSPOLARITY_AH)
146
+ LTDC->GCR = (1 << 31 ) | (1 << 30 );
146
147
// Sets Synchronization size
147
- LTDC->SSCR = ((HSA - 1 ) << 16 ) | (VSA - 1 );
148
+ LTDC->SSCR = (1 << 16 ) | (1 );
148
149
// Sets Accumulated Back porch
149
- LTDC->BPCR = ((HSA + HBP - 1 ) << 16 ) | (VSA + VBP - 1 );
150
+ LTDC->BPCR = (2 << 16 ) | (2 );
150
151
// Sets Accumulated Active Width
151
- LTDC->AWCR = ((HACT + HSA + HBP - 1 ) << 16 ) | (VACT + VSA + VBP - 1 );
152
+ LTDC->AWCR = (202 << 16 ) | (482 );
152
153
// Sets Total Width and Height
153
- LTDC->TWCR = ((HACT + HSA + HBP + HFP - 1 ) << 16 ) | (VACT + VSA + VBP + VFP - 1 );
154
+ LTDC->TWCR = (203 << 16 ) | (483 );
154
155
// Sets the background color value
155
156
LTDC->BCCR = 0 ;
156
157
// Enable LTDC by setting LTDCEN bit
157
158
LTDC->GCR |= LTDC_GCR_LTDCEN;
158
159
}
159
160
160
- nt35510_init (ColorCoding);
161
-
162
161
{
163
162
// HAL_LTDC_ConfigLayer()
164
163
// Configures the horizontal start and stop position
165
- LTDC_Layer1->WHPCR = ((HACT + HSA + HBP - 1 ) << 16 ) | (HSA + HBP);
164
+ LTDC_Layer1->WHPCR =
165
+ (0 + ((LTDC->BPCR & LTDC_BPCR_AHBP) >> 16 ) + 1 )
166
+ | ((200 + ((LTDC->BPCR & LTDC_BPCR_AHBP) >> 16 )) << 16 ); // tmp
166
167
// Configures the vertical start and stop position
167
- LTDC_Layer1->WVPCR = ((VACT + VSA + VBP - 1 ) << 16 ) | (VSA + VBP);
168
+ LTDC_Layer1->WVPCR = (0 + (LTDC->BPCR & LTDC_BPCR_AVBP) + 1 )
169
+ | ((480 + (LTDC->BPCR & LTDC_BPCR_AVBP)) << 16 );
168
170
// Specifies the pixel format
169
171
LTDC_Layer1->PFCR = ColorCoding;
170
172
// Configures the default color values
171
- LTDC_Layer1->DCCR = 0xff000000 ;
173
+ LTDC_Layer1->DCCR = 0x00000000 ;
172
174
// Specifies the constant alpha value
173
175
LTDC_Layer1->CACR = 0xff ;
174
176
// Specifies the blending factors
175
- LTDC_Layer1->BFCR = 0x607 ;
177
+ LTDC_Layer1->BFCR = 0x00000005U | 0x00000400U ;
176
178
// Configures the color frame buffer pitch in byte
177
- LTDC_Layer1->CFBLR = ((HACT * pixel_size) << 16 ) | ((HACT * pixel_size) + 3 );
179
+ LTDC_Layer1->CFBLR = ((800 * pixel_size) << 16 ) | ((800 * pixel_size) + 3 );
178
180
// Configures the frame buffer line number
179
- LTDC_Layer1->CFBLNR = VACT ;
181
+ LTDC_Layer1->CFBLNR = 480 ;
180
182
181
183
/* Configured in display.cpp
182
184
// Configures the color frame buffer start address
@@ -187,4 +189,6 @@ board_initialize_display(uint8_t ColorCoding)
187
189
LTDC->SRCR = LTDC_SRCR_IMR;
188
190
*/
189
191
}
192
+
193
+ nt35510_init (ColorCoding);
190
194
}
0 commit comments