• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ BSP_LCD_DisplayChar函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中BSP_LCD_DisplayChar函数的典型用法代码示例。如果您正苦于以下问题:C++ BSP_LCD_DisplayChar函数的具体用法?C++ BSP_LCD_DisplayChar怎么用?C++ BSP_LCD_DisplayChar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了BSP_LCD_DisplayChar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DumpReceivedData

/**
  * @brief  Displays recieved data
  * @param  data: Keyboard data to be displayed
  * @retval None
  */
static void DumpReceivedData(void)
{
  uint16_t size;
  uint8_t *ptr = CDC_RX_Buffer;
  
  size = USBH_CDC_GetLastReceivedDataSize(&hUSBHost);
  BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
  while(size--)
  {
    if((*ptr != '\n') && (*ptr != '\r'))
    { 
      if(*ptr == '\t')
      {
         BSP_LCD_DisplayChar(xPos, LINE(yLinePos), ' ');
      }
      else
      {
        BSP_LCD_DisplayChar(xPos, LINE(yLinePos), *ptr);
      }
      xPos += 7;
    }
    else if(*ptr == '\n')
    {
      yLinePos++;
      xPos = 0;
    }
    
    ptr++;
    
    if(xPos > (BSP_LCD_GetXSize() - 7))
    {
      xPos = 0;
      yLinePos++;
    }
    
    if(yLinePos > 13)
    {
      BSP_LCD_SetTextColor(LCD_COLOR_GREEN); 
      BSP_LCD_DisplayStringAtLine(15, (uint8_t *)"Use [User Key] to see more data");
      /* Key Button in polling */
      while(BSP_PB_GetState(BUTTON_KEY) != RESET)
      {
        /* Wait for User Input */
      }
      
      LCD_ClearTextZone();
      BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
      BSP_LCD_DisplayStringAtLine(3, (uint8_t *)"Receiving data ...");
      BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
      xPos = 0;
      yLinePos = 4;
    }
  }
}
开发者ID:PaxInstruments,项目名称:STM32CubeF2,代码行数:59,代码来源:cdc_receive.c


示例2: printNewRampID

void printNewRampID() {

    xSemaphoreTake(mutex_drawer, portMAX_DELAY);

    BSP_LCD_SetBackColor(LCD_COLOR_WHITE);

    if (rampSelected == 128) {
        BSP_LCD_SetTextColor(LCD_COLOR_RED);
        BSP_LCD_DisplayChar(380, 210, 'N');
    }

    else {
        BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
        BSP_LCD_DisplayChar(380, 210, '0' + rampSelected);
    }

    xSemaphoreGive(mutex_drawer);
}
开发者ID:gciotto,项目名称:workspace,代码行数:18,代码来源:prosac.c


示例3: printNewCycleID

void printNewCycleID() {

    xSemaphoreTake(mutex_drawer, portMAX_DELAY);

    BSP_LCD_SetBackColor(LCD_COLOR_WHITE);

    if (cycleSelected == 128) {

        BSP_LCD_SetTextColor(LCD_COLOR_RED);
        BSP_LCD_DisplayChar(380, 240, 'N');
    }

    else {
        BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
        BSP_LCD_DisplayChar(380, 240, '0' + cycleSelected);
    }

    xSemaphoreGive(mutex_drawer);
}
开发者ID:gciotto,项目名称:workspace,代码行数:19,代码来源:prosac.c


示例4: DumpReceivedData

/**
  * @brief  Displays received data
  * @param  data: Keyboard data to be displayed
  * @retval None
  */
static void DumpReceivedData(void)
{
  uint16_t size;
  uint8_t *ptr = CDC_RX_Buffer;
  
  size = USBH_CDC_GetLastReceivedDataSize(&hUSBHost);
  BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
  
  while(size--)
  {
    if((*ptr != '\n') && (*ptr != '\r'))
    { 
      if(*ptr == '\t')
      {
         BSP_LCD_DisplayChar(xPos, LINE(yLinePos), ' ');
      }
      else
      {
        BSP_LCD_DisplayChar(xPos, LINE(yLinePos), *ptr);
      }
      xPos += 7;
    }
    else if(*ptr == '\n')
    {
      yLinePos++;
      xPos = 0;
    }
    
    ptr++;
    
    if(xPos > (BSP_LCD_GetXSize() - 7))
    {
      xPos = 0;
      yLinePos++;
    }
    
    if(yLinePos > 13)
    {
      xPos = 0;
      yLinePos = 5;
    }
  }
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:48,代码来源:cdc_receive.c


示例5: BSP_LCD_DisplayStringAt

/**
  * @brief  Displays characters on the LCD.
  * @param  Xpos: X position (in pixel)
  * @param  Ypos: Y position (in pixel)   
  * @param  Text: Pointer to string to display on LCD
  * @param  Mode: Display mode
  *          This parameter can be one of the following values:
  *            @arg  CENTER_MODE
  *            @arg  RIGHT_MODE
  *            @arg  LEFT_MODE   
  * @retval None
  */
void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
{
  uint16_t ref_column = 1, i = 0;
  uint32_t size = 0, xsize = 0; 
  uint8_t  *ptr = Text;
  
  /* Get the text size */
  while (*ptr++) size ++ ;
  
  /* Characters number per line */
  xsize = (BSP_LCD_GetXSize()/DrawProp[ActiveLayer].pFont->Width);
  
  switch (Mode)
  {
  case CENTER_MODE:
    {
      ref_column = Xpos + ((xsize - size)* DrawProp[ActiveLayer].pFont->Width) / 2;
      break;
    }
  case LEFT_MODE:
    {
      ref_column = Xpos;
      break;
    }
  case RIGHT_MODE:
    {
      ref_column = - Xpos + ((xsize - size)*DrawProp[ActiveLayer].pFont->Width);
      break;
    }    
  default:
    {
      ref_column = Xpos;
      break;
    }
  }
  
  /* Check that the Start column is located in the screen */
  if ((ref_column < 1) || (ref_column >= 0x8000))
  {
    ref_column = 1;
  }

  /* Send the string character by character on LCD */
  while ((*Text != 0) & (((BSP_LCD_GetXSize() - (i*DrawProp[ActiveLayer].pFont->Width)) & 0xFFFF) >= DrawProp[ActiveLayer].pFont->Width))
  {
    /* Display one character on LCD */
    BSP_LCD_DisplayChar(ref_column, Ypos, *Text);
    /* Decrement the column position by 16 */
    ref_column += DrawProp[ActiveLayer].pFont->Width;
    /* Point on the next character */
    Text++;
    i++;
  }  
}
开发者ID:picohari,项目名称:intewa_stm32f7,代码行数:66,代码来源:stm32746g_discovery_lcd.c


示例6: RTC_Time_display

/**
  * @brief  Displays the current Time on the LCD.
  * @param  Line:  the Line where to display the Current time .
  *           This parameter can be one of the following values:
  *             @arg Linex: where x can be 0..9
  * @param  Color_x: specifies the Background Color.
  * @param  table: the Current time and sub second.
  * @retval None
  */
static void RTC_Time_display(uint8_t Line, uint32_t Color_x, Table_TypeDef table )
{   
  uint8_t i = 0;

  /* Initialize table */
  BSP_LCD_SetTextColor(Color_x);
  
  for(i=0; i<8; i++)
  {
    /* Display char on the LCD */
    BSP_LCD_DisplayChar((150 + (20 *i)),LINE(Line), table.tab[i]);
  }  
}
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:22,代码来源:main.c


示例7: HID_MOUSE_UpdatePosition

/**
  * @brief  Handles mouse scroll to update the mouse position on display window.
  * @param  x: USB HID Mouse X co-ordinate
  * @param  y: USB HID Mouse Y co-ordinate
  * @retval None
  */
static void HID_MOUSE_UpdatePosition(int8_t x, int8_t y)
{
  static int16_t  x_loc  = 0, y_loc  = 0; 
  static int16_t  prev_x = 5, prev_y = 1;  
  
  if((x != 0) || (y != 0)) 
  {
    x_loc += x/2;
    y_loc += y/10;

    if(y_loc > MOUSE_WINDOW_HEIGHT - 12)
    {
      y_loc = MOUSE_WINDOW_HEIGHT - 12;
    }  
    if(x_loc > MOUSE_WINDOW_WIDTH - 10)
    {
      x_loc = MOUSE_WINDOW_WIDTH - 10;
    }  
    
    if(y_loc < 2)
    {
      y_loc = 2;
    }  
    if(x_loc < 2)
    {
      x_loc = 2;
    } 
    BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
    BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
    BSP_LCD_DisplayChar(MOUSE_WINDOW_X + prev_x, MOUSE_WINDOW_Y + prev_y, 'x');   
    
    BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
    BSP_LCD_DisplayChar(MOUSE_WINDOW_X + x_loc, MOUSE_WINDOW_Y + y_loc, 'x');
    
    prev_x = x_loc;
    prev_y = y_loc;
  }
}  
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:44,代码来源:mouse.c


示例8: BSP_LCD_DisplayStringAt

/**
  * @brief  Displays characters on the LCD.
  * @param  Xpos: X position (in pixel)
  * @param  Ypos: Y position (in pixel)   
  * @param  pText: Pointer to string to display on LCD
  * @param  Mode: Display mode
  *          This parameter can be one of the following values:
  *            @arg  CENTER_MODE
  *            @arg  RIGHT_MODE
  *            @arg  LEFT_MODE   
  * @retval None
  */
void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *pText, Line_ModeTypdef Mode)
{
  uint16_t refcolumn = 1, counter = 0;
  uint32_t size = 0, xsize = 0; 
  uint8_t  *ptr = pText;
  
  /* Get the text size */
  while (*ptr++) size ++ ;
  
  /* Characters number per line */
  xsize = (BSP_LCD_GetXSize()/DrawProp.pFont->Width);
  
  switch (Mode)
  {
  case CENTER_MODE:
    {
      refcolumn = Xpos + ((xsize - size)* DrawProp.pFont->Width) / 2;
      break;
    }
  case LEFT_MODE:
    {
      refcolumn = Xpos;
      break;
    }
  case RIGHT_MODE:
    {
      refcolumn =  - Xpos + ((xsize - size)*DrawProp.pFont->Width);
      break;
    }    
  default:
    {
      refcolumn = Xpos;
      break;
    }
  }
  
  /* Send the string character by character on lCD */
  while ((*pText != 0) & (((BSP_LCD_GetXSize() - (counter*DrawProp.pFont->Width)) & 0xFFFF) >= DrawProp.pFont->Width))
  {
    /* Display one character on LCD */
    BSP_LCD_DisplayChar(refcolumn, Ypos, *pText);
    /* Decrement the column position by 16 */
    refcolumn += DrawProp.pFont->Width;
    /* Point on the next character */
    pText++;
    counter++;
  }
}
开发者ID:NjordCZ,项目名称:STM32Cube_FW_F1,代码行数:60,代码来源:stm3210c_eval_lcd.c


示例9: lcdPutChar

void lcdPutChar(char_t c)
{
    if(c == '\r')
    {
        lcdColumn = 0;
    }
    else if(c == '\n')
    {
        lcdColumn = 0;
        lcdLine++;
    }
    else if(lcdLine < 11 && lcdColumn < 30)
    {
        //Display current character
        BSP_LCD_DisplayChar(lcdColumn * 16, lcdLine * 24, c);

        //Advance the cursor position
        if(++lcdColumn >= 30)
        {
            lcdColumn = 0;
            lcdLine++;
        }
    }
}
开发者ID:miragecentury,项目名称:M2_SE_RTOS_Project,代码行数:24,代码来源:main.c


示例10: USR_KEYBRD_ProcessData

/**
  * @brief  Processes Keyboard data.
  * @param  data: Keyboard data to be displayed
  * @retval None
  */
void USR_KEYBRD_ProcessData(uint8_t data)
{
  if(data == '\n')
  {
    KeybrdCharYpos = KYBRD_FIRST_COLUMN;

    /* Increment char X position */
    KeybrdCharXpos += SMALL_FONT_LINE_WIDTH;

    if(KeybrdCharXpos > KYBRD_LAST_LINE)
    {
      LCD_LOG_ClearTextZone();
      KeybrdCharXpos = KYBRD_FIRST_LINE;
      KeybrdCharYpos = KYBRD_FIRST_COLUMN;
    }
  }
  else if(data == '\r')
  {
    /* Manage deletion of character and upadte cursor location */
    if(KeybrdCharYpos == KYBRD_FIRST_COLUMN)
    {
      /* First character of first line to be deleted */
      if(KeybrdCharXpos == KYBRD_FIRST_LINE)
      {
        KeybrdCharYpos = KYBRD_FIRST_COLUMN;
      }
      else
      {
        KeybrdCharXpos += SMALL_FONT_LINE_WIDTH;
        KeybrdCharYpos = (KYBRD_LAST_COLUMN + SMALL_FONT_COLUMN_WIDTH);
      }
    }
    else
    {
      KeybrdCharYpos += SMALL_FONT_COLUMN_WIDTH;
    }
    BSP_LCD_DisplayChar(KeybrdCharYpos, KeybrdCharXpos, ' ');
  }
  else
  {
    /* Update the cursor position on LCD */
    BSP_LCD_DisplayChar(KeybrdCharYpos, KeybrdCharXpos, data);

    /* Increment char Y position */
    KeybrdCharYpos += SMALL_FONT_COLUMN_WIDTH;

    /* Check if the Y position has reached the last column */
    if(KeybrdCharYpos == KYBRD_LAST_COLUMN)
    {
      KeybrdCharYpos = KYBRD_FIRST_COLUMN;

      /* Increment char X position */
      KeybrdCharXpos += SMALL_FONT_LINE_WIDTH;
    }

    if(KeybrdCharXpos > KYBRD_LAST_LINE)
    {
      LCD_LOG_ClearTextZone();
      KeybrdCharXpos = KYBRD_FIRST_LINE;
      /* Start New Display of the cursor position on LCD */
      BSP_LCD_DisplayChar(KeybrdCharYpos,KeybrdCharXpos, data);
    }
  }
}
开发者ID:Joe-Merten,项目名称:Stm32-Tools-Evaluation,代码行数:69,代码来源:keyboard.c


示例11: Joystick_SetCursorPosition

/**
  * @brief  Joystick cursor position
  * @param  None
  * @retval None
  */
void Joystick_SetCursorPosition(void)
{
  static uint16_t xPtr = 12;
  static uint16_t yPtr = 52;
  static uint16_t old_xPtr = 12;
  static uint16_t old_yPtr = 52;

      
      switch(JoyState)
      {
      case JOY_UP:
        if(yPtr > 52)
        {
          yPtr--;
        }
        break;     
      case JOY_DOWN:
        if(yPtr < (BSP_LCD_GetYSize() - 12 - 11))
        {
          yPtr++;
        }
        break;          
      case JOY_LEFT:
        if(xPtr > 12)
        {
          xPtr--;
        }
        break;         
      case JOY_RIGHT:
        if(xPtr < (BSP_LCD_GetXSize() - 8 - 11))
        {
          xPtr++;
        }
        break;                 
      default:
        break;           
      }
      
      BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
      BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
      
      if(JoyState == JOY_SEL)
      {
        BSP_LCD_SetTextColor(LCD_COLOR_RED);
        BSP_LCD_DisplayChar(xPtr, yPtr, 'X');
        
      }
      else if(JoyState == JOY_NONE)
      {
        BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
        BSP_LCD_DisplayChar(xPtr, yPtr, 'X');   
      }
      else
      {
        BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
        BSP_LCD_DisplayChar(old_xPtr, old_yPtr, 'X');
        BSP_LCD_SetTextColor(LCD_COLOR_BLUE); 
        BSP_LCD_DisplayChar(xPtr, yPtr, 'X');
        
        old_xPtr = xPtr;
        old_yPtr = yPtr;
      }
}
开发者ID:PaxInstruments,项目名称:STM32CubeF2,代码行数:68,代码来源:joystick.c


示例12: Draw_Menu

void Draw_Menu(void)
{
  BSP_LCD_Clear(LCD_COLOR_WHITE);
  
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
  BSP_LCD_FillRect((uint16_t)0, (uint16_t)GRID_DIVISION_V, (uint16_t)BSP_LCD_GetXSize(), (uint16_t)(BSP_LCD_GetYSize() - GRID_DIVISION_V));
  
  BSP_LCD_SetTextColor(LCD_COLOR_DARKGRAY);
  BSP_LCD_FillRect((uint16_t)(GRID_DIVISION_H * 3), (uint16_t)GRID_DIVISION_V, (uint16_t)(BSP_LCD_GetXSize() - GRID_DIVISION_H * 3), (uint16_t)(BSP_LCD_GetYSize() - GRID_DIVISION_V));
  
  BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE);
  BSP_LCD_FillRect((uint16_t)0, (uint16_t)0, (uint16_t)BSP_LCD_GetXSize(), (uint16_t)(24 * 3));
  
  BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
  
  BSP_LCD_SetBackColor(LCD_COLOR_DARKBLUE);  
  BSP_LCD_DisplayStringAt((uint16_t)0, (uint16_t)24, (uint8_t *)"calc_stm32f469i-disco", CENTER_MODE);
  
  BSP_LCD_SetBackColor(LCD_COLOR_BLACK);  
  BSP_LCD_DisplayChar((uint16_t)(KEY_7_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_7_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'7');
  BSP_LCD_DisplayChar((uint16_t)(KEY_7_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_4_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'4');
  BSP_LCD_DisplayChar((uint16_t)(KEY_7_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_1_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'1');
  BSP_LCD_DisplayChar((uint16_t)(KEY_7_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_0_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'0');  
  BSP_LCD_DisplayChar((uint16_t)(KEY_8_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_7_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'8');
  BSP_LCD_DisplayChar((uint16_t)(KEY_8_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_4_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'5');
  BSP_LCD_DisplayChar((uint16_t)(KEY_8_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_1_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'2');
  BSP_LCD_DisplayChar((uint16_t)(KEY_8_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_0_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'.');  
  BSP_LCD_DisplayChar((uint16_t)(KEY_9_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_7_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'9');
  BSP_LCD_DisplayChar((uint16_t)(KEY_9_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_4_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'6');
  BSP_LCD_DisplayChar((uint16_t)(KEY_9_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_1_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'3');
  BSP_LCD_DisplayChar((uint16_t)(KEY_9_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_0_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'=');
  
  BSP_LCD_SetBackColor(LCD_COLOR_DARKGRAY);  
  BSP_LCD_DisplayChar((uint16_t)(KEY_C_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_C_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'C');
  BSP_LCD_DisplayStringAt((uint16_t)(KEY_C_CENTER_X - 17), (uint16_t)(KEY_CE_CENTER_Y - TEXT_OFFSET_Y), (uint8_t *)"CE", LEFT_MODE);
  BSP_LCD_DisplayChar((uint16_t)(KEY_C_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_DIV_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'/');
  BSP_LCD_DisplayChar((uint16_t)(KEY_C_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_MUL_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'*');
  BSP_LCD_DisplayChar((uint16_t)(KEY_C_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_SUB_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'-');
  BSP_LCD_DisplayChar((uint16_t)(KEY_C_CENTER_X - TEXT_OFFSET_X), (uint16_t)(KEY_ADD_CENTER_Y - TEXT_OFFSET_Y), (uint8_t)'+');
  
  BSP_LCD_SetTextColor(LCD_COLOR_BLACK);
  BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
}
开发者ID:tfleong,项目名称:qpc,代码行数:43,代码来源:menu_calc.c


示例13: Joystick_demo

/**
  * @brief  Joystick demo
  * @param  None
  * @retval None
  */
void Joystick_demo(void)
{ 
  static uint16_t xPtr = 12;
  static uint16_t yPtr = 92;
  static uint16_t old_xPtr = 12;
  static uint16_t old_yPtr = 92;  
  uint8_t status = 0;
  
  Joystick_SetHint();
  
  status = BSP_JOY_Init(JOY_MODE_GPIO);
  
  if (status != IO_OK)
  {
    BSP_LCD_SetBackColor(LCD_COLOR_WHITE); 
    BSP_LCD_SetTextColor(LCD_COLOR_RED);
    BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 95, (uint8_t *)"ERROR", CENTER_MODE);
    BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize()- 80, (uint8_t *)"Joystick cannot be initialized", CENTER_MODE);
  }
  
  while (1)
  {
    if (status == IO_OK)
    {
      /* Get the Joystick State */
      JoyState = BSP_JOY_GetState();
      
      switch(JoyState)
      {
      case JOY_UP:
        if(yPtr > 92)
        {
          yPtr--;
        }
        break;     
      case JOY_DOWN:
        if(yPtr < (BSP_LCD_GetYSize() - 12 - 11))
        {
          yPtr++;
        }
        break;          
      case JOY_LEFT:
        if(xPtr > 12)
        {
          xPtr--;
        }
        break;         
      case JOY_RIGHT:
        if(xPtr < (BSP_LCD_GetXSize() - 8 - 11))
        {
          xPtr++;
        }
        break;                 
      default:
        break;           
      }
      
      BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
      BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
      
      if(JoyState == JOY_SEL)
      {
        BSP_LCD_SetTextColor(LCD_COLOR_RED);
        BSP_LCD_DisplayChar(xPtr, yPtr, 'X');
        
      }
      else if(JoyState == JOY_NONE)
      {
        BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
        BSP_LCD_DisplayChar(xPtr, yPtr, 'X');   
      }
      else
      {
        BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
        BSP_LCD_DisplayChar(old_xPtr, old_yPtr, 'X');
        BSP_LCD_SetTextColor(LCD_COLOR_BLUE); 
        BSP_LCD_DisplayChar(xPtr, yPtr, 'X');
        
        old_xPtr = xPtr;
        old_yPtr = yPtr;
      }
    }
    if(CheckForUserInput() > 0)
    {
      return;
    }
    HAL_Delay(5);
  }
}
开发者ID:z80,项目名称:stm32f429,代码行数:94,代码来源:joystick.c


示例14: BSP_LCD_DisplayStringAt

// Note modifed by CMN to use X as a coordinate, not a character position
void BSP_LCD_DisplayStringAt(uint16_t X, uint16_t Y, uint8_t *pText, Text_AlignModeTypdef mode)
{
  uint32_t fgColor;
  uint32_t bgColor;

  fgColor = BSP_LCD_GetTextColor();
  bgColor = BSP_LCD_GetBackColor();


  uint16_t refcolumn = 1, i = 0;
  uint32_t size = 0, xsize = 0; 
  uint8_t  *ptr = pText;
  
  /* Get the text size */
  while (*ptr++) size ++ ;
  
  /* Characters number per line */
  xsize = (BSP_LCD_GetXSize()/DrawProp[ActiveLayer].pFont->Width);
  
  switch (mode)
  {
  case CENTER_MODE:
    {
      refcolumn = X - ((size)* DrawProp[ActiveLayer].pFont->Width) / 2;
      break;
    }
  case LEFT_MODE:
    {
      refcolumn = X;
      break;
    }
  case RIGHT_MODE:
    {
      refcolumn = X + ((xsize - size)*DrawProp[ActiveLayer].pFont->Width);
      break;
    }
  default:
    {
      refcolumn = X;
      break;
    }
  }

  /* Send the string character by character on LCD */
  while ((*pText != 0) & (((BSP_LCD_GetXSize() - (i*DrawProp[ActiveLayer].pFont->Width)) & 0xFFFF) >= DrawProp[ActiveLayer].pFont->Width))
  {
    // inverse video
    if (*pText & 0x80)
    {
      BSP_LCD_SetTextColor(bgColor);
      BSP_LCD_SetBackColor(fgColor);
    }
    else
    {
      BSP_LCD_SetTextColor(fgColor);
      BSP_LCD_SetBackColor(bgColor);
    }
    /* Display one character on LCD */
    BSP_LCD_DisplayChar(refcolumn, Y, 0x7f & (*pText));
    /* Decrement the column position by 16 */
    refcolumn += DrawProp[ActiveLayer].pFont->Width;
    /* Point on the next character */
    pText++;
    i++;
  }  
}
开发者ID:mnowell129,项目名称:GliderScaleSystemWorkbench,代码行数:67,代码来源:stm32f429i_discovery_lcd.c


示例15: BSP_LCD_DisplayChar

void LCD_DISCO_F469NI::DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
{
  BSP_LCD_DisplayChar(Xpos, Ypos, Ascii);
}
开发者ID:cjbrigato,项目名称:RFIdea,代码行数:4,代码来源:LCD_DISCO_F469NI.cpp



注:本文中的BSP_LCD_DisplayChar函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BSP_LCD_DisplayOn函数代码示例发布时间:2022-05-30
下一篇:
C++ BSP_LCD_ClearStringLine函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap