/**
  * @brief  LCD demo Simple Shapes
  * @param  None
  * @retval None
  */
static void LCD_Show_FeatureSimpleShapes(void)
{
  Point Points[]  = {{20, 150}, {80, 150}, {80, 200}};
  Point Points2[] = {{100, 150}, {160, 150}, {160, 200}};

  /* Draw misc Shapes inside rectangle area below */
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
  BSP_LCD_DrawRect(20, 100, 60 , 40);

  /* Clear internal of rectangle area before display */
  BSP_LCD_FillRect(100, 100, 60 , 40);

  BSP_LCD_SetTextColor(LCD_COLOR_GRAY);
  BSP_LCD_DrawCircle(BSP_LCD_GetXSize() - 120, 120, 20);
  BSP_LCD_FillCircle(BSP_LCD_GetXSize() - 40, 120, 20);

  BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
  BSP_LCD_DrawPolygon(Points, 3);
  BSP_LCD_FillPolygon(Points2, 3);

  BSP_LCD_SetTextColor(LCD_COLOR_RED);
  BSP_LCD_DrawEllipse(BSP_LCD_GetXSize() - 120, 170, 30, 20);
  BSP_LCD_FillEllipse(BSP_LCD_GetXSize() - 50, 170, 30, 20);

  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
  BSP_LCD_DrawHLine(20, BSP_LCD_GetYSize() - 30, BSP_LCD_GetXSize() / 5);
  BSP_LCD_DrawLine (BSP_LCD_GetXSize() - 150, BSP_LCD_GetYSize() - 20, BSP_LCD_GetXSize() - 20, BSP_LCD_GetYSize() - 50);
  BSP_LCD_DrawLine (BSP_LCD_GetXSize() - 150, BSP_LCD_GetYSize() - 50, BSP_LCD_GetXSize() - 20, BSP_LCD_GetYSize() - 20);
}
Beispiel #2
0
/**
  * @brief  Show LCD Features
  * @param  feature : feature index
  * @retval None
  */
static void LCD_Show_Feature(uint8_t feature)
{
  Point Points[]= {{20, 70}, {60, 70}, {60, 100}};
  Point Points2[]= {{80, 70}, {120, 70}, {120, 100}};
  
  BSP_LCD_SetBackColor(LCD_COLOR_WHITE);  
  BSP_LCD_SetTextColor(LCD_COLOR_WHITE);    
  BSP_LCD_FillRect(0, 60, BSP_LCD_GetXSize(), BSP_LCD_GetYSize()- 40);
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);

  switch (feature)
  {
  case 0:
    /* Text Feature */
    BSP_LCD_SetFont(&Font24);
    BSP_LCD_DisplayStringAt(14, 80, (uint8_t *)"Font24", LEFT_MODE); 
    BSP_LCD_SetFont(&Font20);
    BSP_LCD_DisplayStringAt(0, 105, (uint8_t *)"Font20", CENTER_MODE); 
    BSP_LCD_SetFont(&Font16);
    BSP_LCD_DisplayStringAt(14, 130, (uint8_t *)"Font16", RIGHT_MODE); 
    break;
    
  case 1:
    /* Draw misc. Shapes part 1*/
    BSP_LCD_SetTextColor(LCD_COLOR_BLACK); 
    BSP_LCD_DrawRect(20, 70, 40 , 20);
    BSP_LCD_FillRect(70, 70, 40 , 20); 
    
    BSP_LCD_SetTextColor(LCD_COLOR_BLUE); 
    BSP_LCD_DrawCircle(40, 120, 20);
    BSP_LCD_FillCircle(90, 120, 20);
     
    BSP_LCD_SetTextColor(LCD_COLOR_RED); 
    BSP_LCD_DrawLine (20, 70, 20+40 , 70+20);
    BSP_LCD_DrawLine (20, 70+20, 20+40 , 70);
    BSP_LCD_DrawHLine(20, 120, 40);
    BSP_LCD_DrawVLine(40, 100, 40);
    break;
 
  case 2:
    /* Draw misc. Shapes part 2*/
    BSP_LCD_SetTextColor(LCD_COLOR_GREEN); 
    BSP_LCD_DrawPolygon(Points, 3);
    BSP_LCD_FillPolygon(Points2, 3);
    
    BSP_LCD_SetTextColor(LCD_COLOR_RED); 
    BSP_LCD_DrawEllipse(BSP_LCD_GetXSize() - 100, 110, 20, 30);
    BSP_LCD_FillEllipse(BSP_LCD_GetXSize() - 40, 110, 20, 30);
    break;
  
  case 3:
    /* Draw Bitmap */
    BSP_LCD_DrawBitmap(20, 70, (uint8_t *)stlogo);
    HAL_Delay(200);
    break;
  }
}
Beispiel #3
0
/**
  * @brief  Show LCD Features
  * @param  feature : feature index
  * @retval None
  */
static void LCD_Show_Feature(uint8_t feature)
{
  Point Points[] = {{20, 150}, {80, 150}, {80, 200}};
  Point Points2[] = {{100, 150}, {160, 150}, {160, 200}};

  BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
  BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
  BSP_LCD_FillRect(12, 92, BSP_LCD_GetXSize() - 24, BSP_LCD_GetYSize() - 104);
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);

  switch (feature)
  {
    case 0:
      /* Text Feature */

      BSP_LCD_DisplayStringAt(14, 100, (uint8_t *)"Left aligned Text", LEFT_MODE);
      BSP_LCD_DisplayStringAt(0, 115, (uint8_t *)"Center aligned Text", CENTER_MODE);
      BSP_LCD_DisplayStringAt(14, 130, (uint8_t *)"Right aligned Text", RIGHT_MODE);
      BSP_LCD_SetFont(&Font24);
      BSP_LCD_DisplayStringAt(14, 180, (uint8_t *)"Font24", LEFT_MODE);
      BSP_LCD_SetFont(&Font20);
      BSP_LCD_DisplayStringAt(BSP_LCD_GetXSize() / 2 - 20, 180, (uint8_t *)"Font20", LEFT_MODE);
      BSP_LCD_SetFont(&Font16);
      BSP_LCD_DisplayStringAt(BSP_LCD_GetXSize() - 80, 184, (uint8_t *)"Font16", LEFT_MODE);
      break;

    case 1:

      /* Draw misc. Shapes */
      BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
      BSP_LCD_DrawRect(20, 100, 60 , 40);
      BSP_LCD_FillRect(100, 100, 60 , 40);

      BSP_LCD_SetTextColor(LCD_COLOR_GRAY);
      BSP_LCD_DrawCircle(BSP_LCD_GetXSize() - 120, 120, 20);
      BSP_LCD_FillCircle(BSP_LCD_GetXSize() - 40, 120, 20);

      BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
      BSP_LCD_DrawPolygon(Points, 3);
      BSP_LCD_FillPolygon(Points2, 3);

      BSP_LCD_SetTextColor(LCD_COLOR_RED);
      BSP_LCD_DrawEllipse(BSP_LCD_GetXSize() - 120, 170, 30, 20);
      BSP_LCD_FillEllipse(BSP_LCD_GetXSize() - 50, 170, 30, 20);

      BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
      BSP_LCD_DrawHLine(20, BSP_LCD_GetYSize() - 30, BSP_LCD_GetXSize() / 5);
      BSP_LCD_DrawLine (BSP_LCD_GetXSize() - 150, BSP_LCD_GetYSize() - 20, BSP_LCD_GetXSize() - 20, BSP_LCD_GetYSize() - 50);
      BSP_LCD_DrawLine (BSP_LCD_GetXSize() - 150, BSP_LCD_GetYSize() - 50, BSP_LCD_GetXSize() - 20, BSP_LCD_GetYSize() - 20);
      break;

    case 2:
      /* Draw Bitmap */
      BSP_LCD_DrawBitmap(20, 100, (uint8_t *)stlogo);
      HAL_Delay(100);

      BSP_LCD_DrawBitmap(BSP_LCD_GetXSize() / 2 - 40, 100, (uint8_t *)stlogo);
      HAL_Delay(100);

      BSP_LCD_DrawBitmap(BSP_LCD_GetXSize() - 100, 100, (uint8_t *)stlogo);
      HAL_Delay(100);

      BSP_LCD_DrawBitmap(20, BSP_LCD_GetYSize() - 80, (uint8_t *)stlogo);
      HAL_Delay(100);

      BSP_LCD_DrawBitmap(BSP_LCD_GetXSize() / 2 - 40, BSP_LCD_GetYSize() - 80, (uint8_t *)stlogo);
      HAL_Delay(100);

      BSP_LCD_DrawBitmap(BSP_LCD_GetXSize() - 100, BSP_LCD_GetYSize() - 80, (uint8_t *)stlogo);
      HAL_Delay(100);
      break;

    default :
      break;
  }
}
Beispiel #4
0
/**
  * @brief  Show LCD Features
  * @param  feature : feature index
  * @retval None
  */
static void LCD_Show_Feature(uint8_t feature)
{
  Point Points[]= {{5, 108}, {29, 108}, {29, 132}};
  Point Points2[]= {{36, 108}, {60, 108}, {60, 132}};
  
  BSP_LCD_SetBackColor(LCD_COLOR_WHITE);  
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);

  switch (feature)
  {
  case 0:
    /* Text alignement Feature */
    BSP_LCD_SetFont(&Font12);
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 70, (uint8_t *)"Left Text", LEFT_MODE);
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 45, (uint8_t *)"Center Text", CENTER_MODE);
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 20, (uint8_t *)"Right Text", RIGHT_MODE);
    break;
    
  case 1:
    /* Text Font Feature */
    BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
    BSP_LCD_FillRect(4, 84, BSP_LCD_GetXSize() - 8, BSP_LCD_GetYSize()- 88);
    BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
    BSP_LCD_SetFont(&Font24);
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 75, (uint8_t *)"Font24", CENTER_MODE);
    BSP_LCD_SetFont(&Font20);
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 57, (uint8_t *)"Font20", CENTER_MODE);
    BSP_LCD_SetFont(&Font16);
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 41, (uint8_t *)"Font16", CENTER_MODE);
    BSP_LCD_SetFont(&Font12);    
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 26, (uint8_t *)"Font12", CENTER_MODE);
    BSP_LCD_SetFont(&Font8);    
    BSP_LCD_DisplayStringAt(4, BSP_LCD_GetYSize()- 13, (uint8_t *)"Font8", CENTER_MODE);
    break;
    
  case 2:
    /* Draw misc. Shapes Feature */
    BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
    BSP_LCD_FillRect(4, 84, BSP_LCD_GetXSize() - 8, BSP_LCD_GetYSize()- 88);
    
    BSP_LCD_SetTextColor(LCD_COLOR_BLACK); 
    BSP_LCD_DrawRect(5, 88, 25, 13);
    BSP_LCD_FillRect(36, 88, 25, 13); 
    
    BSP_LCD_SetTextColor(LCD_COLOR_GREEN); 
    BSP_LCD_DrawPolygon(Points, 3);
    BSP_LCD_FillPolygon(Points2, 3);
    
    BSP_LCD_SetTextColor(LCD_COLOR_MAGENTA); 
    BSP_LCD_DrawCircle(80, 97, 12);
    BSP_LCD_FillCircle(110, 97, 12);
        
    BSP_LCD_SetTextColor(LCD_COLOR_RED); 
    BSP_LCD_DrawEllipse(80, 130, 8, 16);
    BSP_LCD_FillEllipse(110, 130, 8, 16);
    
    BSP_LCD_SetTextColor(LCD_COLOR_BLACK); 
    BSP_LCD_DrawHLine(75, BSP_LCD_GetYSize() - 9, BSP_LCD_GetXSize() / 3);
    BSP_LCD_DrawLine(5, 154, 60, 136);
    BSP_LCD_DrawLine(5, 136, 60, 154);
    break;
    
//  case 3:
//    /* Draw Bitmap */
//    BSP_LCD_DrawBitmap(20, 100, (uint8_t *)stlogo);
//    HAL_Delay(500);
//    
//    BSP_LCD_DrawBitmap(BSP_LCD_GetXSize()/2 - 40, 100, (uint8_t *)stlogo);
//    HAL_Delay(500);    
//    
//    BSP_LCD_DrawBitmap(BSP_LCD_GetXSize()-100, 100, (uint8_t *)stlogo);
//    HAL_Delay(500);
//
//    BSP_LCD_DrawBitmap(20, BSP_LCD_GetYSize()- 80, (uint8_t *)stlogo);
//    HAL_Delay(500);
//    
//    BSP_LCD_DrawBitmap(BSP_LCD_GetXSize()/2 - 40, BSP_LCD_GetYSize()- 80, (uint8_t *)stlogo);
//    HAL_Delay(500);     
//
//    BSP_LCD_DrawBitmap(BSP_LCD_GetXSize()-100, BSP_LCD_GetYSize()- 80, (uint8_t *)stlogo);
//    HAL_Delay(500);    
//    break;
    
  default:
    break;
  }
}
Beispiel #5
0
void LCD_DISCO_F469NI::DrawPolygon(pPoint Points, uint16_t PointCount)
{
  BSP_LCD_DrawPolygon(Points, PointCount);
}