From 5bbefb89d79f5720c3c98cead7cd4ba4eff180bc Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Sat, 9 May 2015 18:34:52 +0200 Subject: [PATCH] LTDC_BPCR --- platform/stm32f429/init_lcd.c | 14 ++++++++------ platform/stm32f429/registers/ltdc.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/platform/stm32f429/init_lcd.c b/platform/stm32f429/init_lcd.c index 1bd448537..235c37d91 100644 --- a/platform/stm32f429/init_lcd.c +++ b/platform/stm32f429/init_lcd.c @@ -196,17 +196,19 @@ static void init_rgb_timings() { /*- HSYNC and VSYNC Width: Horizontal and Vertical Synchronization width configured by programming a value of HSYNC Width - 1 and VSYNC Width - 1 in the LTDC_SSCR register. */ - LTDC_SSCR = LTDC_VSH(lcd_panel_hsync-1) | LTDC_HSW(lcd_panel_vsync-1); -#if 0 + LTDC_SSCR = + LTDC_VSH(lcd_panel_vsync-1) | + LTDC_HSW(lcd_panel_hsync-1); + /*– HBP and VBP: Horizontal and Vertical Synchronization back porch width configured by programming the accumulated value HSYNC Width + HBP - 1 and the accumulated value VSYNC Width + VBP - 1 in the LTDC_BPCR register. */ - long * LTDC_BPCR = (long *)(LCD_TFT_BASE + 0x0C); - set_ltdc_register(LTDC_BPCR, - lcd_panel_hsync+lcd_panel_hbp-1, - lcd_panel_vsync+lcd_panel_vbp-1); + LTDC_BPCR = + LTDC_AVBP(lcd_panel_vsync+lcd_panel_vbp-1) | + LTDC_AHBP(lcd_panel_hsync+lcd_panel_hbp-1); +#if 0 /*– Active Width and Active Height: The Active Width and Active Height are configured by programming the accumulated value HSYNC Width + HBP + Active Width - 1 and the accumulated value VSYNC Width + VBP + Active Height - 1 in the LTDC_AWCR register (only up to 1024x768 is supported). */ diff --git a/platform/stm32f429/registers/ltdc.h b/platform/stm32f429/registers/ltdc.h index 9d6947020..fd9b42a60 100644 --- a/platform/stm32f429/registers/ltdc.h +++ b/platform/stm32f429/registers/ltdc.h @@ -24,8 +24,10 @@ #define LOW_BIT_AVBP 0 #define HIGH_BIT_AVBP 10 +#define LTDC_AVBP(v) REGISTER_FIELD_VALUE(AVBP, v) #define LOW_BIT_AHBP 15 #define HIGH_BIT_AHBP 27 +#define LTDC_AHBP(v) REGISTER_FIELD_VALUE(AHBP, v) #if 0 extern LTDC_BPCR_t * LTDC_BPCR;