cancel
Showing results for 
Search instead for 
Did you mean: 

What is FB_Address in BSP_LCD_LayerDefaultInit ?

Mohammad Rostamian
Associate III
Posted on November 25, 2017 at 22:05

Hi, I am working in stm32f746 discovery board. I want to drive the Lcd. At initialize step, I have to use the BSP_LCD_LayerDefaultInit(uint16_t layerIndex, uint32_t FB_Address).

I dont know what  is FB_Address? 

Can any body introduce a  document to help me?

Tanks.

2 REPLIES 2
Posted on November 25, 2017 at 22:30

FB - Frame Buffer

Address within STM32 address space you are using to describe screen content. ie 0xC0000000 would be base of SDRAM in some implementations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
john doe
Lead
Posted on November 25, 2017 at 22:40

The driver is well-commented. Read the source fileSTM32Cube_FW_F7_V1.8.0/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.c

FB_Address is the address of where you put your frame buffer in memory. I don't have your exact board, but on the f769-discovery, I use the external sdram for the frame buffer.

Looks like the 746 is the same way. look in STM32Cube_FW_F7_V1.8.0/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.h and note this:

#define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)

here's how I do it on stm32f769i-discovery:

static void LCD_Config(void)
{
 uint8_t lcd_status = LCD_OK;
 uint8_t lcd_brightness[] = {OTM8009A_CMD_WRDISBV, 0xFF};
 /* LCD DSI initialization in mode Video Burst */
 /* Initialize DSI LCD */
 BSP_LCD_Init();
 while(lcd_status != LCD_OK);
 DSI_IO_WriteCmd(0, (uint8_t *)lcd_brightness);
 BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_BACKGROUND, LCD_FB_START_ADDRESS);
 /* Select the LCD Background Layer */
 BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_BACKGROUND);
 /* Clear the Background Layer */
 BSP_LCD_Clear(LCD_COLOR_BLACK);
 BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_FOREGROUND, LCD_BG_LAYER_ADDRESS);
 /* Select the LCD Foreground Layer */
 BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_FOREGROUND);
 /* Clear the Foreground Layer */
 BSP_LCD_Clear(LCD_COLOR_BLACK);
 /* Configure the transparency for foreground and background :
 Increase the transparency */
 BSP_LCD_SetTransparency(LTDC_ACTIVE_LAYER_BACKGROUND, 0);
 BSP_LCD_SetTransparency(LTDC_ACTIVE_LAYER_FOREGROUND, 255);
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

The DSI_IO_WriteCmd is just to kill the whine it makes when not at full brightness