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

C++ LCD_SetCursor函数代码示例

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

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



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

示例1: LCDD_DrawLine

/*
 * \brief Draw a line on LCD, horizontal and vertical line are supported.
 *
 * \param x         X-coordinate of line start.
 * \param y         Y-coordinate of line start.
 * \param length    line length.
 * \param direction line direction: 0 - horizontal, 1 - vertical.
 * \param color     Pixel color.
 */
void LCDD_DrawLine(
    uint32_t x,
    uint32_t y,
    uint32_t length,
    uint32_t direction,
    uint32_t color)
{
    uint32_t i = 0;

    LCD_SetCursor(x, y);

    if(direction == DIRECTION_HLINE) {
        LCD_WriteRAM_Prepare();
        for(i = 0; i < length; i++) {
            LCD_WriteRAM(color);
        }
    }
    else {
        for(i = 0; i < length; i++) {
            LCD_WriteRAM_Prepare();
            LCD_WriteRAM(color);
            y++;
            LCD_SetCursor(x, y);
        }
    }
}
开发者ID:gabrielleLQX,项目名称:Downloads,代码行数:35,代码来源:draw.c


示例2: main

/*******************************************************************************
*  ??????                                                                *
*******************************************************************************/
void main()
{
     OSCCON     = 0b01110010 ;   // ???????8??????
     OPTION_REG = 0b00000000 ;   // ????I/O???????????????
     ANSELA     = 0b00000000 ;   // ??????????????????I/O??????
     TRISA      = 0b00000110 ;   // ???RA1(SCL)/RA2(SDA)????(RA3?????)
     WPUA       = 0b00000000 ;   // RA1/RA2???????????????
     PORTA      = 0b00000000 ;   // ????????(??LOW???)

     RA4 = 0;
     __delay_ms(500);
     RA4 = 1;
     __delay_ms(500);

     int i = 0;
     // ?????????(????100KHz)
     InitI2C_Master(1) ;

     // ??????????????
     // ICON OFF,??????(0-63),VDD=3.3V???,LCD?8???
     LCD_Init(LCD_NOT_ICON,32,LCD_VDD3V,8) ;

     while(1)
     {
         if(RA4 == 0)
             i++;
         LCD_SetCursor(0,0) ;        // ?????????
         LCD_Puts("-JP7FKF-") ;
         LCD_SetCursor(0,1) ;        // ?????????
         LCD_Putc(i+0x30) ;
     }
}
开发者ID:JP7FKF,项目名称:PIC_Project_MPLABX,代码行数:35,代码来源:main.c


示例3: LCD_DrawChar

/*******************************************************************************
* Function Name  : LCD_DrawChar
* Description    : Draws a character on LCD.
* Input          : - Xpos: the Line where to display the character shape.
*                    This parameter can be one of the following values:
*                       - Linex: where x can be 0..9
*                  - Ypos: start column address.
*                  - c: pointer to the character data.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_DrawChar(u8 Xpos, u16 Ypos, uc16 *c)
{
  u32 index = 0, i = 0;
  u8 Xaddress = 0;

  Xaddress = Xpos;

  LCD_SetCursor(Xaddress, Ypos);

  for(index = 0; index < 24; index++)
  {
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    for(i = 0; i < 16; i++)
    {
      if((c[index] & (1 << i)) == 0x00)
      {
        LCD_WriteRAM(BackColor);
      }
      else
      {
        LCD_WriteRAM(TextColor);
      }
    }
    Xaddress++;
    LCD_SetCursor(Xaddress, Ypos);
  }
}
开发者ID:HelloYym,项目名称:EmbeddedSystemCourse,代码行数:38,代码来源:lcd.c


示例4: LCD_DrawLine

/*******************************************************************************
* Function Name  : LCD_DrawLine
* Description    : Displays a line.
* Input          : - Xpos: specifies the X position.
*                  - Ypos: specifies the Y position.
*                  - Length: line length.
*                  - Direction: line direction.
*                    This parameter can be one of the following values: Vertical
*                    or Horizontal.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_DrawLine(u8 Xpos, u16 Ypos, u16 Length, u8 Direction)
{
  u32 i = 0;

  LCD_SetCursor(Xpos, Ypos);

  if(Direction == Horizontal)
  {
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    for(i = 0; i < Length; i++)
    {
      LCD_WriteRAM(TextColor);
    }
  }
  else
  {
    for(i = 0; i < Length; i++)
    {
      LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
      LCD_WriteRAM(TextColor);
      Xpos++;
      LCD_SetCursor(Xpos, Ypos);
    }
  }
}
开发者ID:HelloYym,项目名称:EmbeddedSystemCourse,代码行数:37,代码来源:lcd.c


示例5: LCD_DrawChar

/**
  * @brief  Draws a character on LCD.
  * @param  Xpos: the Line where to display the character shape.
  * @param  Ypos: start column address.
  * @param  c: pointer to the character data.
  * @retval None
  */
void LCD_DrawChar(uint8_t Xpos, uint16_t Ypos, const uint16_t *c)
{
  uint32_t index = 0, i = 0;
  uint8_t Xaddress = 0;
   
  Xaddress = Xpos;
  
  LCD_SetCursor(Xaddress, Ypos);
  
  for(index = 0; index < 24; index++)
  {
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    for(i = 0; i < 16; i++)
    {
      if((c[index] & (1 << i)) == 0x00)
      {
        LCD_WriteRAM(BackColor);
      }
      else
      {
        LCD_WriteRAM(TextColor);
      }
    }   
    LCD_CtrlLinesWrite(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, Bit_SET); 
    Xaddress++;
    LCD_SetCursor(Xaddress, Ypos);
  }
}
开发者ID:phungyen,项目名称:stm32f10x_stdperiph_lib,代码行数:35,代码来源:stm3210c_eval_lcd.c


示例6: display

void display(void) {
    ss = RTC_Read(0x00);
    mm = RTC_Read(0x01);
    hh = RTC_Read(0x02);
    EE = RTC_Read(0x03);
    DD = RTC_Read(0x04);
    MM = RTC_Read(0x05);
    YY = RTC_Read(0x06);
    LCD_SetCursor(0, 0); // 表示位置を設定する
    LCD_Putc(YY / 16 + '0');
    LCD_Putc(YY % 16 + '0');
    LCD_Putc('/');
    LCD_Putc(MM / 16 + '0');
    LCD_Putc(MM % 16 + '0');
    LCD_Putc('/');
    LCD_Putc(DD / 16 + '0');
    LCD_Putc(DD % 16 + '0');
    LCD_SetCursor(0, 1); // 表示位置を設定する
    LCD_Putc(hh / 16 + '0');
    LCD_Putc(hh % 16 + '0');
    LCD_Putc(':');
    LCD_Putc(mm / 16 + '0');
    LCD_Putc(mm % 16 + '0');
    LCD_Putc('-');
    LCD_Putc(ss / 16 + '0');
    LCD_Putc(ss % 16 + '0');
}
开发者ID:kerikun11,项目名称:MPLABXProjects,代码行数:27,代码来源:PIC16F1827-I2C_LCD_RTC01.c


示例7: LCD_Clear

/**
  * @brief  Clears the hole LCD.
  * @param  Color: the color of the background.
  * @retval None
  */
void LCD_Clear(uint16_t Color)
{
  uint32_t index = 0;

  if(LCDType == LCD_HX8347D)
  {
    LCD_SetCursor(0, 0);
  }
  else
  {
    LCD_SetCursor(0, 319);
  }  
 
  /* Prepare to write GRAM */
  LCD_WriteRAM_Prepare();
  
  for(index = 0; index < (uint32_t)320*240; index++)
  {
    LCD_WriteRAM(Color);
  }
  
  /* Wait until a data is sent(not busy), before config /CS HIGH */
  while (SPI_I2S_GetFlagStatus(LCD_SPI, SPI_I2S_FLAG_BSY) != RESET);
  LCD_CtrlLinesWrite(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, Bit_SET);  
}
开发者ID:clarenceliu,项目名称:Mplib,代码行数:30,代码来源:stm32303c_eval_lcd.c


示例8: LCD_DisplayTime

void LCD_DisplayTime(unsigned char hr,unsigned char min, unsigned char sec)
{
	uint8_t d_hour, d_min, d_sec;
	uint8_t digit0=0, digit1=0, digit2=0;
	
	d_hour = bcd2dec(hr);
	d_min = bcd2dec(min);
	d_sec = bcd2dec(sec);
	
	if ( Time_Format == 1 )		// 12 hour format
	{
		LCD_SetCursor(1,14);
		
		if (d_hour >12)
		{
			d_hour -= 12;
			LCD_Printf("PM");	
		}
		else
		{
			if ( d_hour == 0)	// time is 12 AM
			{
				d_hour = 12;
			}
			LCD_Printf("AM");
		}		
	}	
		
	if ( Display_Style == 1)	// both date and time are displayed in this style
	{		
		LCD_GoToLine(1);
		LCD_Printf("    %2d:%2d:%2d",d_hour,d_min,d_sec);		
	}	
	else		// only date is displayed, so display big numbers
	{
		digit1 = d_hour/10;
		digit0= d_hour%10;
		LCD_DisplayBigNum(digit1,0);  //display hour
		LCD_DisplayBigNum(digit0,3);
		
		// set colon
		LCD_SetCursor(1,6);
		lcd_DataWrite(0xA5);
		LCD_SetCursor(2,6);
		lcd_DataWrite(0xA5);
		  
		//display min  
		digit1 = d_min/10;
		digit0= d_min%10;
		LCD_DisplayBigNum(digit1,7);  
		LCD_DisplayBigNum(digit0,10);
		
		//display sec
		LCD_SetCursor(2,14);
		LCD_Printf("%2x",sec);	
	}	
}
开发者ID:ExploreEmbedded,项目名称:Explore-Time-DIY-11003,代码行数:57,代码来源:Clock.c


示例9: Lcd_SetBox

/**********************************************
函数名:Lcd块选函数
功能:选定Lcd上指定的矩形区域

注意:xStart和 yStart随着屏幕的旋转而改变,位置是矩形框的四个角

入口参数:xStart x方向的起始点
          ySrart y方向的终止点
          xLong 要选定矩形的x方向长度
          yLong  要选定矩形的y方向长度
返回值:无
***********************************************/
void Lcd_SetBox(unsigned int xStart,unsigned int yStart,unsigned int xLong,unsigned int yLong)
{
  
#if ID_AM==000    
	LCD_SetCursor(xStart+xLong-1,312-yStart+yLong-1);

#elif ID_AM==001
	LCD_SetCursor(xStart+xLong-1,312-yStart+yLong-1);
     
#elif ID_AM==010
	LCD_SetCursor(xStart,312-yStart+yLong-1);
     
#elif ID_AM==011 
	LCD_SetCursor(xStart,312-yStart+yLong-1);
     
#elif ID_AM==100
	LCD_SetCursor(xStart+xLong-1,312-yStart);     
     
#elif ID_AM==101
	LCD_SetCursor(xStart+xLong-1,312-yStart);     
     
#elif ID_AM==110
	LCD_SetCursor(xStart,312-yStart); 
     
#elif ID_AM==111
	LCD_SetCursor(xStart,312-yStart);  
     
#endif
     
	LCD_WR_REG(0x0050,xStart);//水平 GRAM起始位置
	LCD_WR_REG(0x0051,xStart+xLong-1);//水平GRAM终止位置
	LCD_WR_REG(0x0052,312-yStart);//垂直GRAM起始位置
	LCD_WR_REG(0x0053,312-yStart+yLong-1);//垂直GRAM终止位置 
}
开发者ID:epffpe,项目名称:Atmel,代码行数:46,代码来源:lcd.c


示例10: LCD_DrawCircle2

void LCD_DrawCircle2(u8 Xpos, u16 Ypos, u16 Radius)
{
  s32  D;/* Decision Variable */
  u32  CurX;/* Current X Value */
  u32  CurY;/* Current Y Value */

  D = 3 - (Radius << 1);
  CurX = 0;
  CurY = Radius;

  while (CurX <= CurY)
  {
    LCD_SetCursor(Xpos + CurX, Ypos + CurY);
 
      LCD_WriteRAMWord(BackColor);

 
    LCD_SetCursor(Xpos + CurX, Ypos - CurY);

      LCD_WriteRAMWord(BackColor);

    LCD_SetCursor(Xpos - CurX, Ypos + CurY);

      LCD_WriteRAMWord(BackColor);

    LCD_SetCursor(Xpos - CurX, Ypos - CurY);

      LCD_WriteRAMWord(BackColor);

    LCD_SetCursor(Xpos + CurY, Ypos + CurX);
    
    
      LCD_WriteRAMWord(BackColor);

    LCD_SetCursor(Xpos + CurY, Ypos - CurX);

      LCD_WriteRAMWord(BackColor);
  

    LCD_SetCursor(Xpos - CurY, Ypos + CurX);

      LCD_WriteRAMWord(BackColor);

    LCD_SetCursor(Xpos - CurY, Ypos - CurX);

      LCD_WriteRAMWord(BackColor);

    if (D < 0)
    {
      D += (CurX << 2) + 6;
    }
    else
    {
      D += ((CurX - CurY) << 2) + 10;
      CurY--;
    }
    CurX++;
  }
}
开发者ID:hulongchuan,项目名称:hulongchuan,代码行数:59,代码来源:lcd.c


示例11: DCMI_Start

//DCMI,启动传输
void DCMI_Start(void)
{  
  	LCD_SetCursor(0,0);  
	LCD_WriteRAM_Prepare();		//开始写入GRAM
	DMA2_Stream1->CR|=1<<0;		//开启DMA2,Stream1 
	DCMI->CR|=1<<0; 			//DCMI捕获使能  
}
开发者ID:zhougd,项目名称:usb_sound_card,代码行数:8,代码来源:dcmi.c


示例12: SetDisplayWindow

/**
  * @brief  Sets display window.
  * @param  LayerIndex: layer index
  * @param  Xpos: LCD X position
  * @param  Ypos: LCD Y position
  * @param  Width: LCD window width
  * @param  Height: LCD window height
  * @retval None
  */
static void SetDisplayWindow(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
{
  uint32_t value = 0;

  LCD_WriteReg(SSD2119_H_RAM_START_REG, Xpos);

  if ((Xpos+Width) >= LCD_PIXEL_WIDTH) {
    LCD_WriteReg(SSD2119_H_RAM_END_REG, LCD_PIXEL_WIDTH-1);
  } else {
    LCD_WriteReg(SSD2119_H_RAM_END_REG, Xpos+Width);
  }

  if ((Ypos+Height) >= LCD_PIXEL_HEIGHT) {
    value = (LCD_PIXEL_HEIGHT-1) << 8;
  } else {
    value = (Ypos+Height) << 8;
  }
  value |= Xpos;
  LCD_WriteReg(SSD2119_V_RAM_POS_REG, value);
  LCD_SetCursor(Xpos, Ypos);

//  /********************************************************************//**
//  * @brief for stm324fxG Eval EmWin
//  **********************************************************************/
//  /* Horizontal GRAM Start Address */
//  LCD_WriteReg(SSD2119_H_RAM_START_REG, (Ypos));
//  /* Horizontal GRAM End Address */
//  LCD_WriteReg(SSD2119_H_RAM_END_REG, (Ypos + Height - 1));
//
//  value = (LCD_PIXEL_WIDTH - Xpos - 1) << 8;    // End addr
//  value |= (LCD_PIXEL_WIDTH - Xpos - Width);  // Begin Addr
//  /* Vertical GRAM Start and End Address */
//  LCD_WriteReg(SSD2119_V_RAM_POS_REG, value);
}
开发者ID:glocklueng,项目名称:STM32F4-Dev,代码行数:43,代码来源:stm32f4_discovery_lcd.c


示例13: LCD_SetDisplayWindow

/**
  * @brief  Sets a display window
  * @param  Xpos: specifies the X buttom left position.
  * @param  Ypos: specifies the Y buttom left position.
  * @param  Height: display window height.
  * @param  Width: display window width.
  * @retval None
  */
void LCD_SetDisplayWindow(uint8_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width)
{ 
  /* Horizontal GRAM Start Address */
  if(Xpos >= Height)
  {
    LCD_WriteReg(R80, (Xpos - Height + 1));
  }
  else
  {
    LCD_WriteReg(R80, 0);
  }
  /* Horizontal GRAM End Address */
  LCD_WriteReg(R81, Xpos);
  /* Vertical GRAM Start Address */
  if(Ypos >= Width)
  {
    LCD_WriteReg(R82, (Ypos - Width + 1));
  }  
  else
  {
    LCD_WriteReg(R82, 0);
  }
  /* Vertical GRAM End Address */
  LCD_WriteReg(R83, Ypos);
  LCD_SetCursor(Xpos, Ypos);
}
开发者ID:phungyen,项目名称:stm32f10x_stdperiph_lib,代码行数:34,代码来源:stm3210c_eval_lcd.c


示例14: LCD_Clear

/**
  * @brief  Clears the hole LCD.
  * @param  Color: the color of the background.
  * @retval None
  */
void LCD_Clear(uint16_t Color)
{
	uint32_t index = 0;

	if (LCD_ID == LCD_HX8347D) {
		LCD_SetCursor(0x00, 0x0000);
	} else {
		LCD_SetCursor(0x00, 0x013F);
	}

	/* Prepare to write GRAM */
	LCD_WriteRAM_Prepare();
	for (index = 0; index < 76800; index++) {
		LCD->LCD_RAM = Color;
	}
}
开发者ID:suxiaocheng,项目名称:stm32_usb_hid,代码行数:21,代码来源:stm3210e_eval_lcd.c


示例15: showhanzi32

//在指定位置显示一个汉字(32*32大小)
void showhanzi32(unsigned int x,unsigned int y,unsigned char index)	
{  
	unsigned char i,j,k;
	const unsigned char *temp=hanzi32;    
	temp+=index*128;	
	for(j=0;j<32;j++)
	{
		LCD_SetCursor(x,y+j);
		LCD_WriteRAM_Prepare();	//开始写入GRAM
		for(k=0;k<4;k++)
		{
			for(i=0;i<8;i++)
			{ 		     
			 	if((*temp&(1<<i))!=0)
				{
					LCD_WR_DATA(POINT_COLOR);
				} 
				else
				{
					LCD_WR_DATA(BACK_COLOR);
				}   
			}
			temp++;
		}
	 }
}													  
开发者ID:uestc-maddog,项目名称:cubeMXLCD,代码行数:27,代码来源:lcd.c


示例16: DrawClear_iLine

/*******************************************************************************
* Function Name  : DrawClear_iLine
* Description    : отрисовка или очистка одной линии при линейной интерполяции
* Input          : X0pos, Y0pos, X1pos, Y1pos, clear
* Return         : None
*******************************************************************************/
static __inline void DrawClear_iLine(uint16_t X0pos, uint16_t Y0pos, uint16_t Y1pos, DrawState NewDrawState)
{ 	
	uint16_t clrColor;    
	uint16_t i, j;
	uint16_t tmpY;
	
	if(Y1pos < Y0pos){ tmpY = Y0pos; Y0pos = Y1pos; Y1pos = tmpY; }   

	if(Y1pos - Y0pos == 0) j = 1;
	else j = Y1pos - Y0pos;

	Set_LCD_CS();
	LCD_SetCursor(X0pos,Y0pos);        // Установка курсора в нужную позицию
	
	if(NewDrawState == CLEAR)
	{
		for (i = 0; i < j; i++)
		{
			/* Проверяем на совпадение координат очистки с сеткой, если совпало то очищаем цветом сетки */
			clrColor = Verify_Grid_Match(X0pos, Y0pos);
					
			LCD_PutPixel(clrColor);           // очистить точку на установленной позиции
			Y0pos++;
		}
	}
	else	// if(NewDrawState == DRAW)
	{
		for (i = 0; i < j; i++)	LCD_PutPixel(pINFO->Color);		// Нарисовать точку на установленной позиции
	}

	Reset_LCD_CS();
}
开发者ID:assets1975,项目名称:neil-scope3,代码行数:38,代码来源:Processing_and_output.c


示例17: Clear_OLD_Data_MIN_MAX

/*******************************************************************************
* Function Name  : Clear_OLD_Data_MIN_MAX
* Description    : очистка, режим максимумов/минимумов
* Input          : None
* Return         : None
*******************************************************************************/
static void Clear_OLD_Data_MIN_MAX(uint16_t X0, uint16_t X1)
{
	uint16_t cnt_, point = X0 - leftLimit, tmL, Length, clrColor;
	uint16_t num = (X1 - X0) * 2;
	
	/* Очищаем старую осциллограмму */

	Set_LCD_CS();

	for (cnt_ = (point * 2); cnt_ < num; cnt_ += 2)
	{			    
		if(pINFO->OldData_PointsFlag[point] == ENABLE)
		{
			LCD_SetCursor(point + leftLimit + 1, pINFO->visDATA[cnt_]);
			
			Length = fabs(pINFO->visDATA[cnt_+1] - pINFO->visDATA[cnt_]);
			if((Length < 1) || (Length > 190)) Length = 1;
			tmL = 0;
			
			/* очищаем линию от минимума до максимума */
			while(tmL++ != Length)
			{				
				/* Проверяем на совпадение координат очистки с сеткой, если совпало то очищаем цветом сетки */
				clrColor = Verify_Grid_Match(point + leftLimit + 1, pINFO->visDATA[cnt_] + tmL - 1);
					 
				LCD_PutPixel(clrColor);				
			}
		}
		pINFO->OldData_PointsFlag[point] = DISABLE;		  
		point++;		  		 
	}
	Reset_LCD_CS();
}
开发者ID:assets1975,项目名称:neil-scope3,代码行数:39,代码来源:Processing_and_output.c


示例18: DrawClear_MAXMIN_Line

/*******************************************************************************
* Function Name  : DrawClear_iLine
* Description    : отрисовка или очистка одной линии при линейной интерполяции
* Input          : X0pos, Y0pos, X1pos, Y1pos, clear
* Return         : None
*******************************************************************************/
static __inline void DrawClear_MAXMIN_Line(uint16_t X0pos, uint16_t Y0pos, uint16_t Y1pos, DrawState NewDrawState)
{
	uint16_t tmL = 0, tmpY;
	uint16_t clrColor;			// цвет очистки
	int16_t Length;				// длинна линни для отрисовки/очистки

	if(Y1pos < Y0pos){ tmpY = Y0pos; Y0pos = Y1pos; Y1pos = tmpY; }

	Set_LCD_CS();	//  установить низкий уровень CS LCD
					// используем "низкоуровневый" доступ к ЖК для макс. скорости

	LCD_SetCursor(X0pos, Y0pos);

	Length = Y1pos - Y0pos;
	if((Length <= 0) || (Length > 190)) Length = 1;

	if(NewDrawState == CLEAR)
	{
		while(tmL++ != Length)	// очищаем линию от минимума до максимума
		{
			/* Проверяем на совпадение координат очистки с сеткой, если совпало то очищаем цветом сетки */
			clrColor = Verify_Grid_Match(X0pos, Y0pos + tmL - 1);
			LCD_PutPixel(clrColor);
		}
	}
	else	// if(NewDrawState == DRAW)
	{
		while(tmL++ != Length) LCD_PutPixel(pINFO->Color);		// Нарисовать точку на установленной позиции
	}

	Reset_LCD_CS();
}
开发者ID:assets1975,项目名称:neil-scope3,代码行数:38,代码来源:Processing_and_output.c


示例19: LCD_WriteBMP

/**
  * @brief  Displays a bitmap picture loaded in the internal Flash.
  * @param  BmpAddress: Bmp picture address in the internal Flash.
  * @retval None
  */
static void LCD_WriteBMP(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp)
{
  uint32_t index = 0, size = 0;
  /* Read bitmap size */
  size = *(__IO uint16_t *) (pbmp + 2);
  size |= (*(__IO uint16_t *) (pbmp + 4)) << 16;
  /* Get bitmap data address offset */
  index = *(__IO uint16_t *) (pbmp + 10);
  index |= (*(__IO uint16_t *) (pbmp + 12)) << 16;
  size = (size - index)/2;
  pbmp += index;
  /* Set GRAM write direction and BGR = 1 */
  /* I/D=00 (Horizontal : decrement, Vertical : decrement) */
  /* AM=1 (address is updated in vertical writing direction) */
  LCD_WriteReg(SSD2119_ENTRY_MODE_REG, ENTRY_MODE_BMP);

  LCD_SetCursor(Xpos, Ypos);

  LCD_WriteRAM_Prepare();

  for(index = 0; index < size; index++)
  {
    LCD_WriteRAM(*(__IO uint16_t *)pbmp);
    pbmp += 2;
  }

  /* Set GRAM write direction and BGR = 1 */
  /* I/D = 01 (Horizontal : increment, Vertical : decrement) */
  /* AM = 1 (address is updated in vertical writing direction) */
  LCD_WriteReg(SSD2119_ENTRY_MODE_REG, ENTRY_MODE_DEFAULT);
}
开发者ID:glocklueng,项目名称:STM32F4-Dev,代码行数:36,代码来源:stm32f4_discovery_lcd.c


示例20: LCD_Clear

void LCD_Clear(uint16_t color) {
    uint32_t index = 0;
    LCD_SetCursor(0x00, 0x00);
    LCD_WriteRAM_Prepare();
    for(index = 0; index <76800; index++){
        LCD_RAM = color;
    }
}
开发者ID:candrian,项目名称:SSD1289,代码行数:8,代码来源:SSD1289.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LCD_SetFont函数代码示例发布时间:2022-05-30
下一篇:
C++ LCD_PrintString函数代码示例发布时间: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