Exemplo n.º 1
0
/**
  * @brief  LCD configuration
  * @param  None
  * @retval None
  */
static void LCD_Config(void)
{
  /* LCD Initialization */ 
  /* Two layers are used in this application but not simultaneously 
     so "LCD_MAX_PCLK" is recommended to programme the maximum PCLK = 25,16 MHz */
  BSP_LCD_Init();

  /* LCD Initialization */ 
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4));

  /* Enable the LCD */ 
  BSP_LCD_DisplayOn(); 
  
  /* Select the LCD Background Layer  */
  BSP_LCD_SelectLayer(0);

  /* Clear the Background Layer */ 
  BSP_LCD_Clear(LCD_COLOR_BLACK);  
  
  /* Select the LCD Foreground Layer  */
  BSP_LCD_SelectLayer(1);

  /* Clear the Foreground Layer */ 
  BSP_LCD_Clear(LCD_COLOR_BLACK);
  
  /* Configure the transparency for foreground and background :
     Increase the transparency */
  BSP_LCD_SetTransparency(0, 0);
  BSP_LCD_SetTransparency(1, 100);
}
Exemplo n.º 2
0
/**
  * @brief  LCD configuration.
  * @param  None
  * @retval None
  */
static void LCD_Config(void)
{
  /* LCD Initialization */ 
  BSP_LCD_Init();

  /* LCD Layers Initialization */ 
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_LayerDefaultInit(1, (LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4)));
  
  /* Enable the LCD */ 
  BSP_LCD_DisplayOn();

  /* Set LCD Background Layer  */
  BSP_LCD_SelectLayer(0);
  /* Clear the Background Layer */
  BSP_LCD_Clear(LCD_COLOR_WHITE);

  /* Set LCD Foreground Layer  */
  BSP_LCD_SelectLayer(1);
  /* Clear the Foreground Layer */ 
  BSP_LCD_Clear(LCD_COLOR_BLACK); 

  /* Configure and enable the Color Keying feature */
  BSP_LCD_SetColorKeying(1, 0); 

  /* Configure the transparency for foreground: Increase the transparency */
  BSP_LCD_SetTransparency(1, 100);
}
Exemplo n.º 3
0
/**
  * @brief  LCD configuration
  * @param  None
  * @retval None
  */
static void LCD_Config(void)
{
	uint8_t lcd_status = LCD_OK;

	/* LCD DSI initialization in mode Video Burst  */
	/* Initialize DSI LCD */
        //  BSP_LCD_InitEx(LCD_ORIENTATION_PORTRAIT); /* uncomment if Portrait orientation is needed */
        BSP_LCD_Init(); /* Uncomment if default config (landscape orientation) is needed */
        while(lcd_status != LCD_OK);
      
        BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
        BSP_LCD_LayerDefaultInit(1, LCD_BG_LAYER_ADDRESS);   

	/* Select the LCD Background Layer  */
	BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_BACKGROUND);

	/* Clear the Background Layer */
	BSP_LCD_Clear(LCD_COLOR_BLACK);

	/* 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, 100);
}
Exemplo n.º 4
0
/**
  * @brief  LCD configuration.
  * @param  None
  * @retval None
  */
static void LCD_Config(void)
{
  /* LCD Initialization */ 
  /* Two layers are used in this application simultaneously 
     so "LCD_MIN_PCLK" is recommended to programme the PCLK at 20 MHz */  
  BSP_LCD_InitEx(LCD_MIN_PCLK);
  
  /* LCD Layers Initialization */ 
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_LayerDefaultInit(1, (LCD_FB_START_ADDRESS+(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()*4)));
  
  /* Enable the LCD */ 
  BSP_LCD_DisplayOn();

  /* Set LCD Background Layer  */
  BSP_LCD_SelectLayer(0);
  /* Clear the Background Layer */
  BSP_LCD_Clear(LCD_COLOR_WHITE);

  /* Set LCD Foreground Layer  */
  BSP_LCD_SelectLayer(1);
  /* Clear the Foreground Layer */ 
  BSP_LCD_Clear(LCD_COLOR_BLACK); 

  /* Configure and enable the Color Keying feature */
  BSP_LCD_SetColorKeying(1, 0); 

  /* Configure the transparency for foreground: Increase the transparency */
  BSP_LCD_SetTransparency(1, 100);
}
Exemplo n.º 5
0
/**
  * @brief  LCD configuration.
  * @param  None
  * @retval None
  */
static void LCD_Config(void)
{
  uint8_t lcd_status = LCD_OK;


  /* LCD DSI initialization in mode Video Burst  */
  lcd_status = LCD_Init();

  if(lcd_status != LCD_OK)
  {
    Error_Handler();
  }

  /* Activate foreground and background layers */
  BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_BACKGROUND, LCD_BG_LAYER_ADDRESS);
  BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER_FOREGROUND, LCD_FG_LAYER_ADDRESS);
        
  /* Set LCD Background Layer  */
  BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_BACKGROUND);
  /* Clear the Background Layer */
  BSP_LCD_Clear(LCD_COLOR_WHITE);

  /* Set LCD Foreground Layer  */
  BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER_FOREGROUND);
  /* Clear the Foreground Layer */ 
  BSP_LCD_Clear(LCD_COLOR_BLACK); 

  /* Configure and enable the Color Keying feature */
  BSP_LCD_SetColorKeying(1, 0); 

  /* Configure the transparency for foreground: Increase the transparency */
  BSP_LCD_SetTransparency(LTDC_ACTIVE_LAYER_FOREGROUND, 100);
  
}
Exemplo n.º 6
0
/**
  * @brief  DS application Init.
  * @param  None
  * @retval None
  */
static void DynamicSwitch_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_GPIO);                 
  
  /* Configure LED1 */
  BSP_LED_Init(LED1);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* LCD Layer Initialization */
  BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS); 
  
  /* Selects the LCD Layer */
  BSP_LCD_SelectLayer(1);
  
  /* Enables the display */
  BSP_LCD_DisplayOn();
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
#ifdef USE_USB_HS 
  LCD_LOG_SetHeader((uint8_t *)" USB HS DynamicSwitch Host");
#else
  LCD_LOG_SetHeader((uint8_t *)" USB FS DynamicSwitch Host");
#endif
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start Dynamic Switch Interface */
  LCD_UsrLog("Starting DynamicSwitch Demo\n");
  LCD_UsrLog("Plug your device To Continue...\n");
}
Exemplo n.º 7
0
/**
  * @brief  CDC application Init
  * @param  None
  * @retval None
  */
static void CDC_InitApplication(void)
{
  /* Configure LED1, LED2, LED3 and LED4 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* Configure KEY Button */
  BSP_PB_Init(BUTTON_WAKEUP, BUTTON_MODE_GPIO);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_SelectLayer(0);
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS CDC Host");
  LCD_UsrLog("USB Host library started.\n"); 
    
  /* Start CDC Interface */
  USBH_UsrLog("Starting CDC Demo");
  
  Menu_Init();
}
Exemplo n.º 8
0
/**
  * @brief  MSC application Init.
  * @param  None
  * @retval None
  */
static void MSC_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);

  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);

  /* Configure LED1, LED2, LED3 and LED4 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);

  /* Initialize the LCD */
  BSP_LCD_Init();
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_SelectLayer(0);

  /* Init the LCD Log module */
  LCD_LOG_Init();

#ifdef USE_USB_HS
  LCD_LOG_SetHeader((uint8_t *)" USB OTG HS MSC Host");
#else
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
#endif

  LCD_UsrLog("USB Host library started.\n");

  /* Initialize menu and MSC process */
  USBH_UsrLog("Starting MSC Demo");
  Menu_Init();
}
Exemplo n.º 9
0
/**
  * @brief  DUALCORE application Init.
  * @param  None
  * @retval None
  */
static void DUAL_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_GPIO);                
  
  /* Configure LED1 */
  BSP_LED_Init(LED1);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* LCD Layer Initialization */
  BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS); 
  
  /* Selects the LCD Layer */
  BSP_LCD_SelectLayer(1);
  
  /* Enables the display */
  BSP_LCD_DisplayOn();
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)" USB OTG DualCore Host");
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start DualCore Interface */
  USBH_UsrLog("Initializing hardware....");
  DUAL_MenuInit(); 
}
Exemplo n.º 10
0
/**
  * @brief  MSC application Init.
  * @param  None
  * @retval None
  */
static void MSC_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_WAKEUP, BUTTON_MODE_EXTI);
      
  /* Configure LED1 */
  BSP_LED_Init(LED1);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* LCD Layer Initialization */
  BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS); 
  
  /* Select the LCD Layer */
  BSP_LCD_SelectLayer(1);
  
  /* Enable the display */
  BSP_LCD_DisplayOn();
  
  /* Initialize the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS MSC Host");
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Initialize menu and MSC process */
  Menu_Init();
}
Exemplo n.º 11
0
/**
  * @brief  DUALCORE application Init
  * @param  None
  * @retval None
  */
static void DUAL_InitApplication(void)
{
  /* Configure LED1s */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);

  /* Configure KEY Button */
  BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_GPIO);

  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);

  /* Initialize the LCD */
  BSP_LCD_Init();
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_SelectLayer(0);


  /* Init the LCD Log module */
  LCD_LOG_Init();

  LCD_LOG_SetHeader((uint8_t *)" USB OTG DualCore Host");

  LCD_UsrLog("USB Host library started.\n");

  /* Start DualCore Interface */
  USBH_UsrLog("Initializing hardware....");
  DUAL_MenuInit();
}
Exemplo n.º 12
0
void lcd_init(void) {

    BSP_LCD_Init();

    BSP_LCD_LayerDefaultInit(0, (uint32_t)LCD_FRAME_BUFFER);
    BSP_LCD_SelectLayer(0);
    BSP_LCD_Clear(LCD_COLOR_RED);
    BSP_LCD_SetBackColor(LCD_COLOR_RED);
    BSP_LCD_SetTextColor(LCD_COLOR_WHITE);

//     BSP_LCD_LayerDefaultInit(1, (uint32_t)LCD_FRAME_BUFFER + 76800);
//     BSP_LCD_SelectLayer(1);
//     BSP_LCD_Clear(LCD_COLOR_RED);
//     BSP_LCD_SetBackColor(LCD_COLOR_RED);
//     BSP_LCD_SetTextColor(LCD_COLOR_WHITE);

    BSP_LCD_SetLayerVisible(0, ENABLE);
//     BSP_LCD_SetLayerVisible(1, ENABLE);

    BSP_LCD_DisplayOn();

    for (int i = 0; i < LCD_SIZE; i ++) {
        lcd.screen[i] = ' ';
    }
    lcd.col = 0;
}
Exemplo n.º 13
0
/**
  * @brief  HID application Init.
  * @param  None
  * @retval None
  */
static void HID_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_TAMPER, BUTTON_MODE_EXTI);
  
  /* Configure LED1*/
  BSP_LED_Init(LED1);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* LCD Layer Initialization */
  BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS); 
  
  /* Select the LCD Layer */
  BSP_LCD_SelectLayer(1);
  
  /* Enable the display */
  BSP_LCD_DisplayOn();
  
  /* Initialize the LCD Log module */
  LCD_LOG_Init();
  
#ifdef USE_USB_HS 
  LCD_LOG_SetHeader((uint8_t *)" USB OTG HS HID Host");
#else
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS HID Host");
#endif
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start HID Interface */
  USBH_UsrLog("Starting HID Demo");
  HID_MenuInit();
}
Exemplo n.º 14
0
/**
  * @brief  DS application Init.
  * @param  None
  * @retval None
  */
static void DynamicSwitch_InitApplication(void)
{
  /* Configure LED1, LED2, LED3 and LED4 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* Configure KEY Button */
  BSP_PB_Init(BUTTON_WAKEUP, BUTTON_MODE_GPIO);
  
  /* Initialize the LCD */
  BSP_LCD_Init();
  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);
  BSP_LCD_SelectLayer(0);
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)" USB OTG FS DynamicSwitch Host");
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start Dynamic Switch Interface */
  LCD_UsrLog("Starting DynamicSwitch Demo\n");
  LCD_UsrLog("Plug your device To Continue...\n");
}
Exemplo n.º 15
0
/**
  * @brief  Display main demo messages
  * @param  None
  * @retval None
  */
static void Display_DemoDescription(void)
{
  char desc[50];

  /* Set LCD Foreground Layer  */
  BSP_LCD_SelectLayer(1);

  BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
  
  /* Clear the LCD */ 
  BSP_LCD_SetBackColor(LCD_COLOR_WHITE); 
  BSP_LCD_Clear(LCD_COLOR_WHITE);

  /* Set the LCD Text Color */
  BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE);  

  /* Display LCD messages */
  BSP_LCD_DisplayStringAt(0, 10, (uint8_t *)"STM32756G BSP", CENTER_MODE);
  BSP_LCD_DisplayStringAt(0, 35, (uint8_t *)"Drivers examples", CENTER_MODE);
  
  /* Draw Bitmap */
  BSP_LCD_DrawBitmap((BSP_LCD_GetXSize() - 80)/2, 65, (uint8_t *)stlogo);
  
  BSP_LCD_SetFont(&Font12);
  BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 20, (uint8_t *)"Copyright (c) STMicroelectronics 2015", CENTER_MODE);
  
  BSP_LCD_SetFont(&Font16);
  BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
  BSP_LCD_FillRect(0, BSP_LCD_GetYSize()/2 + 15, BSP_LCD_GetXSize(), 60);
  BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
  BSP_LCD_SetBackColor(LCD_COLOR_BLUE); 
  BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() / 2 + 30, (uint8_t *)"Press Tamper push-button to start :", CENTER_MODE);
  sprintf(desc,"%s example", BSP_examples[DemoIndex].DemoName);
  BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()/2 + 45, (uint8_t *)desc, CENTER_MODE);   
}
Exemplo n.º 16
0
/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  uint8_t  lcd_status = LCD_OK;
  
  /* STM32F4xx HAL library initialization:
    - Configure the Flash prefetch, instruction and Data caches
    - Systick timer is configured by default as source of time base, but user 
      can eventually implement his proper time base source (a general purpose 
      timer for example or other time source), keeping in mind that Time base 
      duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
      handled in milliseconds basis.
    - Set NVIC Group Priority to 4
    - Low Level Initialization: global MSP (MCU Support Package) initialization
  */
  HAL_Init();
  
  /* Configure the system clock to 180 MHz */
  SystemClock_Config();
  
  /* Initialize the SDRAM */
  BSP_SDRAM_Init();
  
  /* Initialize the LCD   */
  lcd_status = LCD_Init();
  OnError_Handler(lcd_status != LCD_OK); 

  /* Initialize LTDC layer 0 iused for Hint */
  BSP_LCD_LayerDefaultInit(0, LAYER0_ADDRESS);     
  BSP_LCD_SelectLayer(0); 
    
  /* Display example brief   */
  LCD_BriefDisplay();
  
  /*Draw first image */
  CopyBuffer((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240);
  pending_buffer = 0;
  
  /*Refresh the LCD display*/
  HAL_DSI_Refresh(&hdsi_eval);

  /* Infinite loop */
  while (1)
  {
    if(pending_buffer < 0)
    {
      CopyBuffer((uint32_t *)Images[ImageIndex++], (uint32_t *)LAYER0_ADDRESS, 240, 160, 320, 240);
      
      if(ImageIndex >= 2)
      {
        ImageIndex = 0;
      }
      pending_buffer = 0;
      
      HAL_DSI_Refresh(&hdsi_eval);
    }
    /* Wait some time before switching to next image */
    HAL_Delay(2000);
  }
}
Exemplo n.º 17
0
/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
 /* This sample code shows how to use STM32F4xx GPIO HAL API to toggle PG13 
     IOs (connected to LED3 on STM32F429i-Discovery board) 
    in an infinite loop.
    To proceed, 3 steps are required: */

  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();

  /* -1- Initialize LEDs mounted on Discovery board */
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* -2- Configure the system clock */
  SystemClock_Config();
  
  /* -3- Configure EXTI Line0 (connected to PA0 pin) in interrupt mode */
  EXTILine0_Config();
  
  /*##-1- Initialize the LCD #################################################*/
  /* Initialize the LCD */
  BSP_LCD_Init();

  /* Initialise the LCD Layers */
  BSP_LCD_LayerDefaultInit(1, LCD_FRAME_BUFFER);

  /* Gleich bleibende Einstellenungen am LCD-Display */
  /* Set LCD Foreground Layer  */
  BSP_LCD_SelectLayer(1);

  BSP_LCD_SetFont(&LCD_DEFAULT_FONT);

  /* Clear the LCD */ 
  BSP_LCD_SetBackColor(LCD_COLOR_WHITE); 
  BSP_LCD_Clear(LCD_COLOR_WHITE);

  /* Set the LCD Text Color */
  BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE);  

  /* Display LCD messages */
  BSP_LCD_DisplayStringAt(0, 10, (uint8_t*)"GOLF CART", CENTER_MODE);
  BSP_LCD_SetFont(&Font16);
  BSP_LCD_DisplayStringAt(0, 35, (uint8_t*)"v in km/h", CENTER_MODE);  
  
  /* Infinite loop */
  while (1)
  {
      if (uAenderung) {
        GeschwindigkeitAufLCD(uAktuelleGeschwindigkeit_zehntelkmh);  
        uAenderung = 0;
      }
  }
}
Exemplo n.º 18
0
/**
 * @brief   Main program
 * @param  None
 * @retval None
 */
int main(void)
{
  HAL_StatusTypeDef hal_status = HAL_OK;
  uint8_t  lcd_status = LCD_OK;

  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Systick timer is configured by default as source of time base, but user
         can eventually implement his proper time base source (a general purpose
         timer for example or other time source), keeping in mind that Time base
         duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
         handled in milliseconds basis.
       - Set NVIC Group Priority to 4
       - Low Level Initialization: global MSP (MCU Support Package) initialization
   */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Wait until MFX is ready after reset */
  HAL_Delay(100);

  /* Configure LED1, LED2 and LED3 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);

  /*##-1- Initialize the SDRAM  ##############################################*/
  BSP_SDRAM_Init();

  /*##-2- Initialize the LCD #################################################*/

  /* Proceed to LTDC, DSI initialization and LCD screen initialization
   * with the configuration filled in above */
  lcd_status = BSP_LCD_Init();
  LCD_LayerDefaultInit(1, (uint32_t)&aBufferResult);
  BSP_LCD_SelectLayer(1);
  
  OnError_Handler(lcd_status != LCD_OK);

  HAL_Delay(100);

  /*##-3- DMA2D configuration ################################################*/
  DMA2D_Config();

  /*##-4- Start DMA2D transfer ###############################################*/  
  hal_status = HAL_DMA2D_Start_IT(&Dma2dHandle,
      (uint32_t)LCD_COLOR_GREEN, /* Fill the DMA2D output register with this color */
      (uint32_t)&aBufferResult,    /* DMA2D output register */
      LAYER_SIZE_X,
      LAYER_SIZE_Y);
  OnError_Handler(hal_status != HAL_OK);

  while (1)
  {
    ;
  }
}
Exemplo n.º 19
0
/**
  * @brief  Audio Application Init.
  * @param  None
  * @retval None
  */
static void AUDIO_InitApplication(void)
{
  uint8_t  lcd_status = LCD_OK;

  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);              
  
  /* Configure the LED1, LED2, LED3 and LED4 */
  BSP_IO_Init();
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);
  
  /* Initialize the SDRAM */
  if (BSP_SDRAM_Init() != SDRAM_OK)
  {
    /* User can add here some code to deal with this error */
    while (1)
    {
    }
  }

  /* Initialize and start the LCD display in mode 'lcd_mode'
   *  Using LCD_FB_START_ADDRESS as frame buffer displayed contents.
   *  This buffer is modified by the BSP (draw fonts, objects depending on BSP calls).
   */

  /* Set Portrait orientation if needed, by default orientation is set to
     Landscape */
  
  /* Initialize DSI LCD */
  //  BSP_LCD_InitEx(LCD_ORIENTATION_PORTRAIT); /* uncomment if Portrait orientation is needed */
  BSP_LCD_Init(); /* Uncomment if default config (landscape orientation) is needed */
  while(lcd_status != LCD_OK);

  BSP_LCD_LayerDefaultInit(0, LCD_FB_START_ADDRESS);   
  BSP_LCD_SelectLayer(0);
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)"Audio Playback and Record Application");
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start Audio interface */
  USBH_UsrLog("Starting Audio Demo");
  
  /* Init Audio interface */
  AUDIO_PLAYER_Init();
  
  /* Start Audio interface */
  AUDIO_MenuInit();
}
Exemplo n.º 20
0
/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  uint32_t  i;
  uint32_t  *ptrLcd; 

  /* Enable the CPU Cache */
  CPU_CACHE_Enable();
	
  /* STM32F7xx HAL library initialization:
       - Configure the Flash ART accelerator on ITCM interface
       - Systick timer is configured by default as source of time base, but user 
         can eventually implement his proper time base source (a general purpose 
         timer for example or other time source), keeping in mind that Time base 
         duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
         handled in milliseconds basis.
       - Set NVIC Group Priority to 4
       - Low Level Initialization
     */
  HAL_Init();

  /* Configure the system clock to 200 MHz */
  SystemClock_Config();
  
  /*##-1- Initialise the LCD #################################################*/
  BSP_LCD_Init();

  /* Init LCD screen buffer */
  ptrLcd = (uint32_t*)(LCD_FRAME_BUFFER);
  for (i=0; i<(BSP_LCD_GetXSize()*BSP_LCD_GetYSize()); i++)
  {
    ptrLcd[i]=0;
  }

  BSP_LCD_LayerDefaultInit(1, LCD_FRAME_BUFFER);

  /* Enable the LCD */
  BSP_LCD_DisplayOn();

  /* Select the LCD Foreground layer */
  BSP_LCD_SelectLayer(1);

  /* Set active window */
  BSP_LCD_SetLayerWindow(1, xoffset, yoffset, xsize, ysize);
  
  /*##-2- Camera Initialisation and start capture ############################*/
  /* Initialize the Camera */
  BSP_CAMERA_Init(resolution);

  /* Wait 1s before Camera snapshot */
  HAL_Delay(1000);

  /* Start the Camera Capture */
  BSP_CAMERA_SnapshotStart((uint8_t *)CAMERA_FRAME_BUFFER);

  while (1)
  {
  }
}
Exemplo n.º 21
0
/**
  * @brief  This function is executed in case of error occurrence.
  * @param  None
  * @retval None
  */
static void Error_Handler(void)
{
  /* Turn LED3 on */
  BSP_LED_On(LED3);
  BSP_LCD_SelectLayer(0); 
  while(1)
  {
  }
}
Exemplo n.º 22
0
int main(void)
{
	HAL_Init();

	/* Configure the system clock */
	SystemClock_Config();

	BSP_LCD_Init();
	BSP_LCD_LayerDefaultInit(1, (uint32_t) LCD_FRAME_BUFFER);
	BSP_LCD_SetLayerVisible(1, ENABLE);

	BSP_LCD_SelectLayer(1);
	BSP_LCD_Clear(LCD_COLOR_WHITE);
	BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
	BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
	BSP_LCD_DisplayOn();

	BSP_LCD_DisplayStringAtLine(0, (uint8_t *) "Hello FreeRTOS");

	#define LED_TASK_PRIORITY ((1 + tskIDLE_PRIORITY) | portPRIVILEGE_BIT)
	#define LCD_TASK_PRIORITY ((1 + tskIDLE_PRIORITY) | portPRIVILEGE_BIT)
	#define LED_TASK_PRIORITY_LOW ((1 + tskIDLE_PRIORITY) | portPRIVILEGE_BIT)
	#define LED_TASK_PRIORITY_HIGH ((2 + tskIDLE_PRIORITY) | portPRIVILEGE_BIT)

	//xTaskCreate( (pdTASK_CODE)test_task_delay, 	"test", configMINIMAL_STACK_SIZE, 0, LED_TASK_PRIORITY, NULL);
	//xTaskCreate( (pdTASK_CODE)test_task_delay_until, 	"test", configMINIMAL_STACK_SIZE, 0, LED_TASK_PRIORITY, NULL);

	/*std::stringstream output;
	std::string outputstring;
	const char * chararray;
	output.str(std::string());
	output << "Counter: " << 0;
	outputstring = "";
	outputstring = output.str();
	chararray = "";
	chararray = outputstring.c_str();
	BSP_LCD_DisplayStringAtLine (1, (uint8_t *) chararray);*/

	//xTaskCreate( (pdTASK_CODE)led1_task, 	"led1", 256, 0, LED_TASK_PRIORITY, NULL);
	//xTaskCreate( (pdTASK_CODE)led2_task, 	"led2", 256, 0, LED_TASK_PRIORITY, NULL);
	//xTaskCreate( (pdTASK_CODE)lcd_task, 	"lcd", 256, 0, LCD_TASK_PRIORITY, NULL);

	xTaskCreate( (pdTASK_CODE)led1_task_timeslicing, 	"led1", 256, 0, LED_TASK_PRIORITY, NULL);
	xTaskCreate( (pdTASK_CODE)led2_task_timeslicing, 	"led2", 256, 0, LED_TASK_PRIORITY+1, NULL); // was LED_TASK_PRIORITY

	//job_descriptor blink1_job_descriptor = job_descriptor(1000/3, LED3);
	//xTaskCreate( (pdTASK_CODE)blink1_task, 	"led3", 256, &blink1_job_descriptor, LED_TASK_PRIORITY, NULL);

	//job_descriptor blink2_job_descriptor = job_descriptor(2000/3, LED4);
	//xTaskCreate( (pdTASK_CODE)blink2_task, 	"led4", 256, &blink2_job_descriptor, LED_TASK_PRIORITY, NULL);

	//xTaskCreate( (pdTASK_CODE)blink_task_low_priority, 	"led3", 256, 0, LED_TASK_PRIORITY_LOW, NULL);
	//xTaskCreate( (pdTASK_CODE)blink_task_high_priority, 	"led4", 256, 0, LED_TASK_PRIORITY_HIGH, NULL);

	vTaskStartScheduler ();
	return 0;
}
Exemplo n.º 23
0
Arquivo: main.c Projeto: z80/stm32f429
/**
 * @brief   Main program
 * @param  None
 * @retval None
 */
int main(void)
{
  HAL_StatusTypeDef hal_status = HAL_OK;
  uint8_t  lcd_status = LCD_OK;

  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Systick timer is configured by default as source of time base, but user
         can eventually implement his proper time base source (a general purpose
         timer for example or other time source), keeping in mind that Time base
         duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
         handled in milliseconds basis.
       - Set NVIC Group Priority to 4
       - Low Level Initialization: global MSP (MCU Support Package) initialization
   */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Wait until MFX is ready after reset */
  HAL_Delay(100);

  /* Configure LED1, LED2 and LED3 */
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED2);
  BSP_LED_Init(LED3);

  /*##-1- Initialize the LCD #################################################*/

  /* Proceed to LTDC, DSI initialization and LCD screen initialization
   * with the configuration filled in above */
  lcd_status = BSP_LCD_Init();
  LCD_LayerDefaultInit(0, (uint32_t)&ARGB8888_300x120);  //Background layer shows original image, on top of the screen
  LCD_LayerDefaultInit(1, (uint32_t)&aBufferResult);     //Forground layer shows converted image, on bottom of the screen
  BSP_LCD_SelectLayer(1);

  OnError_Handler(lcd_status != LCD_OK);

  HAL_Delay(100);

  /*##-2- DMA2D configuration ################################################*/
  DMA2D_Config();

  /*##-3- Start DMA2D transfer ###############################################*/  
  hal_status = HAL_DMA2D_Start_IT(&Dma2dHandle,
      (uint32_t)&ARGB8888_300x120, /* Input image 300x120 of format ARGB8888 (32 bpp) */
      (uint32_t)&aBufferResult,    /* Output image of same size 300x120 after conversion by PFC in ARGB4444 (16 bpp) */
      LAYER_SIZE_X,
      LAYER_SIZE_Y);
  OnError_Handler(hal_status != HAL_OK);

  while (1)
  {
    ;
  }
}
Exemplo n.º 24
0
/**
  * @brief  Audio Application Init.
  * @param  None
  * @retval None
  */
static void AUDIO_InitApplication(void)
{
  /* Configure Key Button */
  BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_EXTI);              
  
  /* Configure IO and LED1 */
  BSP_IO_Init();
  BSP_LED_Init(LED1);
  BSP_LED_Init(LED4);
 
  /* Configure Joystick in EXTI mode */
  BSP_JOY_Init(JOY_MODE_EXTI);
  
  /* Camera has to be powered down as some signals use same GPIOs between
   * I2S signals and camera bus. Camera drives its signals to low impedance
   * when powered ON. So the camera is powered off to let its signals
   * in high impedance */

  /* Camera power down sequence */
  BSP_IO_ConfigPin(RSTI_PIN, IO_MODE_OUTPUT);
  BSP_IO_ConfigPin(XSDN_PIN, IO_MODE_OUTPUT);

  /* De-assert the camera STANDBY pin (active high) */
  BSP_IO_WritePin(XSDN_PIN, BSP_IO_PIN_RESET);

  /* Assert the camera RSTI pin (active low) */
  BSP_IO_WritePin(RSTI_PIN, BSP_IO_PIN_RESET);

  /* Initialize the LCD */
  BSP_LCD_Init();
  
  /* LCD Layer Initialization */
  BSP_LCD_LayerDefaultInit(1, LCD_FB_START_ADDRESS); 
  
  /* Select the LCD Layer */
  BSP_LCD_SelectLayer(1);
  
  /* Enable the display */
  BSP_LCD_DisplayOn();
  
  /* Init the LCD Log module */
  LCD_LOG_Init();
  
  LCD_LOG_SetHeader((uint8_t *)"Audio Playback and Record Application");
  
  LCD_UsrLog("USB Host library started.\n"); 
  
  /* Start Audio interface */
  USBH_UsrLog("Starting Audio Demo");
  
  /* Init Audio interface */
  AUDIO_PLAYER_Init();
  
  /* Start Audio interface */
  AUDIO_MenuInit();
}
Exemplo n.º 25
0
/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  uint8_t  lcd_status = LCD_OK;

  /* STM32F4xx HAL library initialization:
    - Configure the Flash prefetch, instruction and Data caches
    - Systick timer is configured by default as source of time base, but user 
      can eventually implement his proper time base source (a general purpose 
      timer for example or other time source), keeping in mind that Time base 
      duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and 
      handled in milliseconds basis.
    - Set NVIC Group Priority to 4
    - Low Level Initialization: global MSP (MCU Support Package) initialization
  */
  HAL_Init();
  
  /* Configure the system clock to 180 MHz */
  SystemClock_Config();
  
  /* Initialize the LCD   */
  lcd_status = BSP_LCD_Init();
  OnError_Handler(lcd_status != LCD_OK);  
  
  BSP_LCD_LayerDefaultInit(0, LAYER0_ADDRESS);     
  BSP_LCD_SelectLayer(0); 
  
  /* Set LTDC Line Event  */
  HAL_LTDC_ProgramLineEvent(&hltdc_eval, 0);
  
  /* Display example brief   */
  LCD_BriefDisplay();
  
  /* Copy Buffer 0 into buffer 1, so only image area to be redrawn later */
  CopyBuffer((uint32_t *)Buffers[0], (uint32_t *)Buffers[1], 0, 0, 800, 480);
  
  /* Infinite loop */
  while (1)
  {
    if(pend_buffer < 0)
    {
      /* Prepare back buffer */     
      CopyBuffer((uint32_t *)Images[ImageIndex++], (uint32_t *)Buffers[1- front_buffer], 240, 160, 320, 240);
      pend_buffer = 1- front_buffer;

      if(ImageIndex >= 2)
      {
        ImageIndex = 0;
      }
  
      /* Wait some time before switching to next stage */
      HAL_Delay(2000); 
    }  

  }
}
Exemplo n.º 26
0
int main(void)
{

  HAL_Init();

  SystemClock_Config();


  MX_GPIO_Init();
  MX_ADC1_Init();
  MX_DMA2D_Init();
  MX_FMC_Init();
  MX_I2C3_Init();
  MX_LTDC_Init();
  MX_RNG_Init();
  MX_SPI5_Init();

	BSP_LCD_Init();
	BSP_LCD_LayerDefaultInit(LCD_BACKGROUND_LAYER, LCD_FRAME_BUFFER);
	BSP_LCD_LayerDefaultInit(LCD_FOREGROUND_LAYER, LCD_FRAME_BUFFER);
	BSP_LCD_SelectLayer(LCD_FOREGROUND_LAYER);
	BSP_LCD_Clear(LCD_COLOR_BLACK);
	BSP_LCD_DisplayOn();
	uint8_t Button_Value;
	GPIO_InitTypeDef GPIO_InitStruct;
  GPIO_InitStruct.Pin |= GPIO_PIN_0;
  GPIO_InitStruct.Mode = 0x00;
  GPIO_InitStruct.Pull = 0x02;
  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
	while (1)
		{
		
		for(uint16_t i = 0; i < SIZE; i+=2) {
			HAL_ADC_Start(&hadc1);
			HAL_ADC_PollForConversion(&hadc1,1000); 
			samples[i] = HAL_ADC_GetValue(&hadc1);
			samples[i+1] = 0;
			HAL_ADC_Stop(&hadc1);
		}
		
		Button_Value = HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0);
		if( Button_Value )
		{		
			fft();
			
		}
		else
		{
		
			display_samples(samples);

		}
	}
}
Exemplo n.º 27
0
Arquivo: lcd.c Projeto: david-dee/lk
/**
  * @brief  Initializes the LCD.
  * @retval LCD state
  */
uint8_t BSP_LCD_Init(void)
{
    /* Timing Configuration */
    ltdc_handle.Init.HorizontalSync = (RK043FN48H_HSYNC - 1);
    ltdc_handle.Init.VerticalSync = (RK043FN48H_VSYNC - 1);
    ltdc_handle.Init.AccumulatedHBP = (RK043FN48H_HSYNC + RK043FN48H_HBP - 1);
    ltdc_handle.Init.AccumulatedVBP = (RK043FN48H_VSYNC + RK043FN48H_VBP - 1);
    ltdc_handle.Init.AccumulatedActiveH = (RK043FN48H_HEIGHT + RK043FN48H_VSYNC + RK043FN48H_VBP - 1);
    ltdc_handle.Init.AccumulatedActiveW = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP - 1);
    ltdc_handle.Init.TotalHeigh = (RK043FN48H_HEIGHT + RK043FN48H_VSYNC + RK043FN48H_VBP + RK043FN48H_VFP - 1);
    ltdc_handle.Init.TotalWidth = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP + RK043FN48H_HFP - 1);

    /* LCD clock configuration */
    BSP_LCD_ClockConfig(&ltdc_handle, NULL);

    /* Initialize the LCD pixel width and pixel height */
    ltdc_handle.LayerCfg->ImageWidth  = RK043FN48H_WIDTH;
    ltdc_handle.LayerCfg->ImageHeight = RK043FN48H_HEIGHT;

    /* Background value */
    ltdc_handle.Init.Backcolor.Blue = 0;
    ltdc_handle.Init.Backcolor.Green = 0;
    ltdc_handle.Init.Backcolor.Red = 0;

    /* Polarity */
    ltdc_handle.Init.HSPolarity = LTDC_HSPOLARITY_AL;
    ltdc_handle.Init.VSPolarity = LTDC_VSPOLARITY_AL;
    ltdc_handle.Init.DEPolarity = LTDC_DEPOLARITY_AL;
    ltdc_handle.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
    ltdc_handle.Instance = LTDC;

    if (HAL_LTDC_GetState(&ltdc_handle) == HAL_LTDC_STATE_RESET) {
        BSP_LCD_MspInit(&ltdc_handle, NULL);
    }

    HAL_LTDC_Init(&ltdc_handle);

    /* allocate the framebuffer */
    size_t fb_size_pages = PAGE_ALIGN(RK043FN48H_WIDTH * RK043FN48H_HEIGHT * 4) / PAGE_SIZE;
    void *fb_address = novm_alloc_pages(fb_size_pages, NOVM_ARENA_SECONDARY);
    if (!fb_address)
        panic("failed to allocate framebuffer for LCD\n");

    BSP_LCD_LayerDefaultInit(0, (uint32_t)fb_address);
    BSP_LCD_SelectLayer(0);

    /* clear framebuffer */
    memset((void *)ltdc_handle.LayerCfg[active_layer].FBStartAdress, 0,
           BSP_LCD_GetXSize() * BSP_LCD_GetYSize() * BSP_LCD_PixelSize());

    /* turn the display on */
    BSP_LCD_DisplayOn();
    return LCD_OK;
}
Exemplo n.º 28
0
/**
  * @brief   Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();
  
  /* Configure the system clock to 180 MHz */
  SystemClock_Config();

  /*##-1- Disable SAI1_SDA signal ############################################*/  
  /* Note: In STM324X9I-EVAL RevB, PE6 pin is shared between data_7 of camera 
           and SAI1_SDA of codec WM8994, after power on, SAI1_SDA pin of codec WM8994 
           is in output state, thus preventing MCU from Receiving correct signal 
           from camera, so we need to configure SAI1_SDA pin of codec WM8994 
           in tri-state 
  */
  /* Initialize the Control interface of the Audio Codec */
  BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_SPEAKER, 0, 0);  
  /* ADCDAT1 is tri-stated */
  AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x200, 0);
  AUDIO_IO_Write(AUDIO_I2C_ADDRESS, 0x300, 0x6010); 
  
  /*##-2- Initialize the LCD #################################################*/
  BSP_LCD_Init();
  
  /*##-3- Initialize the LCD Layers ##########################################*/
  BSP_LCD_LayerDefaultInit(1, LCD_FRAME_BUFFER);
  
  /* Enable the LCD */
  BSP_LCD_DisplayOn();
  
  /* Select the LCD Foreground layer */
  BSP_LCD_SelectLayer(1);

  /*##-4- Camera Initialization and start capture ############################*/
  /* Initialize the Camera */
  BSP_CAMERA_Init(RESOLUTION_R480x272);
  
  /* Wait 1s before Camera snapshot */
  HAL_Delay(1000);
  
  /* Start the Camera Capture */
  BSP_CAMERA_SnapshotStart((uint8_t *)CAMERA_FRAME_BUFFER);

  /* Infinite loop */
  while (1)
  {
  }
}
Exemplo n.º 29
0
void initializeHardware() {
	HAL_Init();

	BSP_LED_Init(LED3);
	BSP_LED_Init(LED4);
	BSP_PB_Init(BUTTON_KEY, BUTTON_MODE_GPIO);

	BSP_LED_On(LED3);
	BSP_LED_Off(LED4);

	BSP_LCD_Init();
	BSP_LCD_LayerDefaultInit(LCD_BACKGROUND_LAYER, LCD_FRAME_BUFFER);
	BSP_LCD_SetLayerVisible(LCD_BACKGROUND_LAYER, ENABLE);
	BSP_LCD_SelectLayer(LCD_BACKGROUND_LAYER);
	BSP_LCD_DisplayOn();
}
Exemplo n.º 30
0
/**
  * @brief  Draws the menu.
  * @param  None
  * @retval None
  */
static void Draw_Menu(void)
{ 
  /* Set background Layer */
  BSP_LCD_SelectLayer(0);
  
/* Clear the LCD */
  BSP_LCD_Clear(LCD_COLOR_WHITE);  

  if (BSP_LCD_GetXSize() == 640)
  {  
    /* Draw color image */
    BSP_LCD_DrawBitmap(0, 0, (uint8_t *)color);
  }
  else
  {
    /* Draw color image */
    BSP_LCD_DrawBitmap(0, 0, (uint8_t *)color2);
  }
  
  /* Draw save image */
  BSP_LCD_DrawBitmap(310, (BSP_LCD_GetYSize() - 50), (uint8_t *)save);

  /* Set Black as text color */
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
  
  /* Draw working window */
  BSP_LCD_DrawRect(61, 0, (BSP_LCD_GetXSize() - 61), (BSP_LCD_GetYSize() - 60));
  BSP_LCD_DrawRect(63, 3, (BSP_LCD_GetXSize() - 66), (BSP_LCD_GetYSize() - 66));
  BSP_LCD_DrawRect(65, 5, (BSP_LCD_GetXSize() - 70), (BSP_LCD_GetYSize() - 70));
  BSP_LCD_DrawRect(67, 7, (BSP_LCD_GetXSize() - 74), (BSP_LCD_GetYSize() - 74));
  
  /* Draw size icons */
  BSP_LCD_FillRect(60, (BSP_LCD_GetYSize() - 48), 250, 48);
  BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
  BSP_LCD_FillCircle(95, (BSP_LCD_GetYSize() - 24), 20);
  BSP_LCD_FillCircle(145, (BSP_LCD_GetYSize() - 24), 15);
  BSP_LCD_FillCircle(195, (BSP_LCD_GetYSize() - 24), 10);
  BSP_LCD_FillCircle(245, (BSP_LCD_GetYSize() - 24), 5);
  BSP_LCD_FillCircle(295, (BSP_LCD_GetYSize() - 24), 2);  
  
  BSP_LCD_SetTextColor(LCD_COLOR_DARKRED);
  BSP_LCD_SetFont(&Font8);
  BSP_LCD_DisplayStringAt(360, (BSP_LCD_GetYSize() - 55), (uint8_t *)"Selected Color  Size", LEFT_MODE);  
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK); 
  BSP_LCD_FillRect(380, (BSP_LCD_GetYSize() - 40), 30, 30);  
  BSP_LCD_FillCircle(450, (BSP_LCD_GetYSize()- 24), Radius); 
}