@@ -142,41 +142,43 @@ board_initialize_display(uint8_t ColorCoding)
142142 {
143143 // HAL_LTDC_Init(&hltdc_eval);
144144 // 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 );
146147 // Sets Synchronization size
147- LTDC->SSCR = ((HSA - 1 ) << 16 ) | (VSA - 1 );
148+ LTDC->SSCR = (1 << 16 ) | (1 );
148149 // Sets Accumulated Back porch
149- LTDC->BPCR = ((HSA + HBP - 1 ) << 16 ) | (VSA + VBP - 1 );
150+ LTDC->BPCR = (2 << 16 ) | (2 );
150151 // Sets Accumulated Active Width
151- LTDC->AWCR = ((HACT + HSA + HBP - 1 ) << 16 ) | (VACT + VSA + VBP - 1 );
152+ LTDC->AWCR = (202 << 16 ) | (482 );
152153 // 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 );
154155 // Sets the background color value
155156 LTDC->BCCR = 0 ;
156157 // Enable LTDC by setting LTDCEN bit
157158 LTDC->GCR |= LTDC_GCR_LTDCEN;
158159 }
159160
160- nt35510_init (ColorCoding);
161-
162161 {
163162 // HAL_LTDC_ConfigLayer()
164163 // 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
166167 // 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 );
168170 // Specifies the pixel format
169171 LTDC_Layer1->PFCR = ColorCoding;
170172 // Configures the default color values
171- LTDC_Layer1->DCCR = 0xff000000 ;
173+ LTDC_Layer1->DCCR = 0x00000000 ;
172174 // Specifies the constant alpha value
173175 LTDC_Layer1->CACR = 0xff ;
174176 // Specifies the blending factors
175- LTDC_Layer1->BFCR = 0x607 ;
177+ LTDC_Layer1->BFCR = 0x00000005U | 0x00000400U ;
176178 // 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 );
178180 // Configures the frame buffer line number
179- LTDC_Layer1->CFBLNR = VACT ;
181+ LTDC_Layer1->CFBLNR = 480 ;
180182
181183 /* Configured in display.cpp
182184 // Configures the color frame buffer start address
@@ -187,4 +189,6 @@ board_initialize_display(uint8_t ColorCoding)
187189 LTDC->SRCR = LTDC_SRCR_IMR;
188190 */
189191 }
192+
193+ nt35510_init (ColorCoding);
190194}
0 commit comments