Application/Config/LCDConf_WHT.c
/**
  * @brief  Called during the initialization process in order to set up the
  *          display driver configuration
  * @param  None
  * @retval None
  */
@brief  Called during the initialization process in order to set up the
display driver configuration
@param  None
@retval None
@brief Called during the initialization process in order to set up the display driver configuration @param None @retval None
void LCD_X_Config(void) 
{
  uint32_t i;
  LCD_LL_Init();
#if (NUM_BUFFERS > 1)
    for (i = 0; i < GUI_NUM_LAYERS; i++) 
    {
      GUI_MULTIBUF_ConfigEx(i, NUM_BUFFERS);
    }
#endif
  GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER_0, COLOR_CONVERSION_0, 0, 0);
  if (LCD_GetSwapXYEx(0)) {
    LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
    LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
  } else {
    LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
    LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);
  }
#if (GUI_NUM_LAYERS > 1)
    GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER_1, COLOR_CONVERSION_1, 0, 1);
    if (LCD_GetSwapXYEx(1)) {
      LCD_SetSizeEx (1, YSIZE_PHYS, XSIZE_PHYS);
      LCD_SetVSizeEx(1, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
    } else {
      LCD_SetSizeEx (1, XSIZE_PHYS, YSIZE_PHYS);
      LCD_SetVSizeEx(1, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);
    }
#endif
  layer_prop[0].address = LCD_LAYER0_FRAME_BUFFER;
#if (GUI_NUM_LAYERS > 1)
  layer_prop[1].address = LCD_LAYER1_FRAME_BUFFER;     
#endif
  for (i = 0; i < GUI_NUM_LAYERS; i++) 
  {
    layer_prop[i].pColorConvAPI = (LCD_API_COLOR_CONV *)apColorConvAPI[i];
    layer_prop[i].pending_buffer = -1;
    LCD_SetVRAMAddrEx(i, (void *)(layer_prop[i].address));
    layer_prop[i].BytesPerPixel = LCD_GetBitsPerPixelEx(i) >> 3;
    LCD_SetDevFunc(i, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))CUSTOM_CopyBuffer);
    LCD_SetDevFunc(i, LCD_DEVFUNC_COPYRECT,   (void(*)(void))CUSTOM_CopyRect);
    if (LCD_LL_GetPixelformat(i) <= LTDC_PIXEL_FORMAT_ARGB4444) 
    {
      LCD_SetDevFunc(i, LCD_DEVFUNC_FILLRECT, (void(*)(void))CUSTOM_FillRect);
      LCD_SetDevFunc(i, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))BSP_LCD_DrawBitmap8bpp);
    }
    if (LCD_LL_GetPixelformat(i) == LTDC_PIXEL_FORMAT_RGB565) {
      LCD_SetDevFunc(i, LCD_DEVFUNC_DRAWBMP_16BPP, (void(*)(void))BSP_LCD_DrawBitmap16bpp);     
    }
  }
}
void LCD_X_Config ( void ) { uint32_t i ; LCD_LL_Init ( ) ; #if ( NUM_BUFFERS > 1 ) for ( i = 0 ; i < GUI_NUM_LAYERS ; i ++ ) { GUI_MULTIBUF_ConfigEx ( i , NUM_BUFFERS ) ; } #endif GUI_DEVICE_CreateAndLink ( DISPLAY_DRIVER_0 , COLOR_CONVERSION_0 , 0 , 0 ) ; if ( LCD_GetSwapXYEx ( 0 ) ) { LCD_SetSizeEx ( 0 , YSIZE_PHYS , XSIZE_PHYS ) ; LCD_SetVSizeEx ( 0 , YSIZE_PHYS * NUM_VSCREENS , XSIZE_PHYS ) ; } else { LCD_SetSizeEx ( 0 , XSIZE_PHYS , YSIZE_PHYS ) ; LCD_SetVSizeEx ( 0 , XSIZE_PHYS , YSIZE_PHYS * NUM_VSCREENS ) ; } #if ( GUI_NUM_LAYERS > 1 ) GUI_DEVICE_CreateAndLink ( DISPLAY_DRIVER_1 , COLOR_CONVERSION_1 , 0 , 1 ) ; if ( LCD_GetSwapXYEx ( 1 ) ) { LCD_SetSizeEx ( 1 , YSIZE_PHYS , XSIZE_PHYS ) ; LCD_SetVSizeEx ( 1 , YSIZE_PHYS * NUM_VSCREENS , XSIZE_PHYS ) ; } else { LCD_SetSizeEx ( 1 , XSIZE_PHYS , YSIZE_PHYS ) ; LCD_SetVSizeEx ( 1 , XSIZE_PHYS , YSIZE_PHYS * NUM_VSCREENS ) ; } #endif layer_prop [ 0 ] . address = LCD_LAYER0_FRAME_BUFFER ; #if ( GUI_NUM_LAYERS > 1 ) layer_prop [ 1 ] . address = LCD_LAYER1_FRAME_BUFFER ; #endif for ( i = 0 ; i < GUI_NUM_LAYERS ; i ++ ) { layer_prop [ i ] . pColorConvAPI = ( LCD_API_COLOR_CONV * ) apColorConvAPI [ i ] ; layer_prop [ i ] . pending_buffer = -1 ; LCD_SetVRAMAddrEx ( i , ( void * ) ( layer_prop [ i ] . address ) ) ; layer_prop [ i ] . BytesPerPixel = LCD_GetBitsPerPixelEx ( i ) >> 3 ; LCD_SetDevFunc ( i , LCD_DEVFUNC_COPYBUFFER , ( void ( * ) ( void ) ) CUSTOM_CopyBuffer ) ; LCD_SetDevFunc ( i , LCD_DEVFUNC_COPYRECT , ( void ( * ) ( void ) ) CUSTOM_CopyRect ) ; if ( LCD_LL_GetPixelformat ( i ) <= LTDC_PIXEL_FORMAT_ARGB4444 ) { LCD_SetDevFunc ( i , LCD_DEVFUNC_FILLRECT , ( void ( * ) ( void ) ) CUSTOM_FillRect ) ; LCD_SetDevFunc ( i , LCD_DEVFUNC_DRAWBMP_8BPP , ( void ( * ) ( void ) ) BSP_LCD_DrawBitmap8bpp ) ; } if ( LCD_LL_GetPixelformat ( i ) == LTDC_PIXEL_FORMAT_RGB565 ) { LCD_SetDevFunc ( i , LCD_DEVFUNC_DRAWBMP_16BPP , ( void ( * ) ( void ) ) BSP_LCD_DrawBitmap16bpp ) ; } } }
@brief  Called during the initialization process in order to set up the
          display driver configuration
 @param  None
 @retval None
@brief Called during the initialization process in order to set up the display driver configuration @param None @retval None
/* At first initialize use of multiple buffers on demand */ /* Set display driver and color conversion for 1st layer */ /* Set size of 1st layer */ /* Set display driver and color conversion for 2nd layer */ /* Set size of 2nd layer */ /*Initialize GUI Layer structure */ /* Setting up VRam address and custom functions for CopyBuffer-, CopyRect- and FillRect operations */ /* Set VRAM address */ /* Remember color depth for further operations */ /* Set custom functions for several operations */ /* Filling via DMA2D does only work with 16bpp or more */ /* Set up drawing routine for 16bpp bitmap using DMA2D */ /* Set up drawing routine for 16bpp bitmap using DMA2D. Makes only sense with RGB565 */