请教下,stm32驱动 LTDC 屏 的层设置 2层后会花瓶 ?

2019-12-30 19:27发布

请教下,stm32驱动 LTDC 屏 的层设置 2层后会花瓶 ?

层设置代码如下:
static void BSP_LTDC_LayerInit(void)
{
  LTDC_LayerCfgTypeDef pLayerCfg;
  LTDC_LayerCfgTypeDef pLayerCfg1;

  // 配置本层的窗口边界,注意这些参数是包含HBP HSW VBP VSW的     
  pLayerCfg.WindowX0 = 0;
  pLayerCfg.WindowX1 = LCD_PIXEL_WIDTH;
  pLayerCfg.WindowY0 = 0;
  pLayerCfg.WindowY1 = LCD_PIXEL_HEIGHT;
  pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB888;
  pLayerCfg.Alpha = 255;
  pLayerCfg.Alpha0 = 0;
  pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;  //LTDC_BLENDING_FACTOR1_CA;
  pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;  //LTDC_BLENDING_FACTOR2_CA;
  pLayerCfg.FBStartAdress = LCD_FRAME_BUFFER_LAYER0;
  pLayerCfg.ImageWidth = LCD_PIXEL_WIDTH;
  pLayerCfg.ImageHeight = LCD_PIXEL_HEIGHT;
  pLayerCfg.Backcolor.Blue = 0;
  pLayerCfg.Backcolor.Green = 0;
  pLayerCfg.Backcolor.Red = 0;
  HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, LCD_BACKGROUND_LAYER) ;
//  __HAL_LTDC_RELOAD_CONFIG(&hltdc);
  CurrentFrameBuffer = LCD_FRAME_BUFFER_LAYER0;
  CurrentLayer       = LCD_BACKGROUND_LAYER;   
  
  BSP_LTDC_Clear(LCD_COLOR_BLUE);  
  
  /* 配置本层的窗口边界,注意这些参数是包含HBP HSW VBP VSW的 */   
  pLayerCfg1.WindowX0 = 0;
  pLayerCfg1.WindowX1 = LCD_PIXEL_WIDTH;
  pLayerCfg1.WindowY0 = 0;
  pLayerCfg1.WindowY1 = LCD_PIXEL_HEIGHT;
  pLayerCfg1.PixelFormat = LTDC_PIXEL_FORMAT_RGB888;
  pLayerCfg1.Alpha = 255;
  pLayerCfg1.Alpha0 = 0;
  pLayerCfg1.BlendingFactor1 = LTDC_BLENDING_FACTOR1_PAxCA;  //LTDC_BLENDING_FACTOR1_CA;
  pLayerCfg1.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA;  //LTDC_BLENDING_FACTOR2_CA;
  pLayerCfg1.FBStartAdress = LCD_FRAME_BUFFER_LAYER1;
  pLayerCfg1.ImageWidth = LCD_PIXEL_WIDTH;
  pLayerCfg1.ImageHeight = LCD_PIXEL_HEIGHT;
  pLayerCfg1.Backcolor.Blue = 0;
  pLayerCfg1.Backcolor.Green = 0;
  pLayerCfg1.Backcolor.Red = 0;
  HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg1, LCD_FOREGROUND_LAYER) ;
  
  CurrentFrameBuffer = LCD_FRAME_BUFFER_LAYER1;
  CurrentLayer       = LCD_FOREGROUND_LAYER;  

//  __HAL_LTDC_RELOAD_CONFIG(&hltdc);
   BSP_LTDC_Clear(LCD_COLOR_GREEN);  
}

屏幕显示效果如下:
0022.png (758.19 KB, 下载次数: 0) 下载附件 2017-3-5 14:40 上传





如果单独使用一层时,显示完全正常









0条回答

一周热门 更多>