示例#1
0
/*******************************************************************************
* 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);
    }
  }
}
示例#2
0
/*******************************************************************************
* 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);
  }
}
示例#3
0
/*
 * \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);
        }
    }
}
/**
  * @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);
  }
}
示例#5
0
/*******************************************************************************
* Function Name  : dis_baiye
* Description    : display the picture as the type of baiye windows
* author         :zhangxianyuan
* Input          : - file: pointer to the source file name
*                  - line: assert_param error line source number
* Output         : None
* Return         : None
*******************************************************************************/
void dis_baiye(void) 
{	
	int i, j, m, n, x;  
	unsigned int dd;   	  
 //	address_set(0, 0, 239, 319);
//	LCD_Clear(White);
	for(j = 0; j <= 60; j++)
	{	
 		for(m = 0; m < 4 ;m++)
		{
		 	if(m % 2 == 1)
		 	{
			 	x = 1;
		 	}	
			for(n = 0; n< 2; n++)
			{
				address_set(60 * m + j,160 * n + 80 * x,60 * m + j, 160 * n + 80 + 80 * x);
				for(i = 320 * (60 * m + j) + 160 * n + 80 * x; i < 320 *(60 * m + j) + 160 * n + 80 + 80 * x; i++)
			 	{
				 	dd = (0x00 | gImage_111[i * 2 + 1]) << 8;
				  	dd = dd | gImage_111[ i * 2];
				  	LCD_WriteRAM(dd);
			  	}
				    	  
			}
			x = 0;
		 }
    	 Delay(5000);
	}

	for(j = 0;j <= 60; j++)
	{	
		 for(m = 0; m < 4; m++)
		 {
		 	if(m % 2 == 0)
		 	{
			 	x = 1;
		 	}	
			for(n = 0; n < 2; n++)
			{
				address_set(60 * (m + 1) - j, 160 * n + 80 * x, 60 * (m + 1) - j, 160 * n + 80 + 80 * x);
				for(i = 320 * (60 * (m + 1) - j) + 160 * n + 80 * x; i < 320 * (60 * (m + 1) - j) + 160 * n + 80 + 80 * x; i++)
			 	{
				 	dd = (0x00 | gImage_111[i * 2 + 1]) << 8;
				  	dd = dd|gImage_111[i * 2];
				  	LCD_WriteRAM(dd);
			  	}    	  
			}
			x = 0;
		   }
    	   Delay(10000);
	}
}
示例#6
0
/*******************************************************************************
* Function Name  : LCD_WriteBMP
* Description    : Displays a bitmap picture loaded in the internal Flash.
* Input          : - BmpAddress: Bmp picture address in the internal Flash.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_WriteBMP(u32 BmpAddress)
{
  u32 index = 0, size = 0;

  /* Read bitmap size */
  size = *(vu16 *) (BmpAddress + 2);
  size |= (*(vu16 *) (BmpAddress + 4)) << 16;

  /* Get bitmap data address offset */
  index = *(vu16 *) (BmpAddress + 10);
  index |= (*(vu16 *) (BmpAddress + 12)) << 16;

  size = (size - index)/2;

  BmpAddress += 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(R3, 0x1008);

  LCD_WriteRAM_Prepare();

  for(index = 0; index < size; index++)
  {
    LCD_WriteRAM(*(vu16 *)BmpAddress);
    BmpAddress += 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(R3, 0x1018);
}
/**
  * @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);
}
示例#8
0
/**
* @brief  Show_Image 
*         Displays BMP image
* @param  None
* @retval None
*/
static void Show_Image(void)
{
  uint16_t i = 0;
  uint16_t numOfReadBytes = 0;
  FRESULT res; 

  LCD_SetDisplayWindow(0, 0, 320, 240);
  LCD_WriteReg(SSD2119_ENTRY_MODE_REG, ENTRY_MODE_BMP);
  LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */

  /* Bypass Bitmap header */ 
  f_lseek (&file, 54);
  
  while (HCD_IsDeviceConnected(&USB_OTG_Core))
  {
    res = f_read(&file, Image_Buf, IMAGE_BUFFER_SIZE, (void *)&numOfReadBytes);
    if ((numOfReadBytes == 0) || (res != FR_OK)) {
      /*EOF or Error*/ 
      LCD_WriteReg(SSD2119_ENTRY_MODE_REG, ENTRY_MODE_DEFAULT);		
      break; 
    }
    for (i = 0 ; i < IMAGE_BUFFER_SIZE; i+= 2) {
      LCD_WriteRAM(Image_Buf[i+1] << 8 | Image_Buf[i]); 
    } 
  }
}
示例#9
0
文件: main.c 项目: Andy46/OV7670-VHDL
int main(void)
{

    static unsigned long TimerCnt = 0;
    static unsigned int temp7670 = 0;					 
	u16 value,val,val1,val2;
	
	Demo_Init();
    ili9320_Initializtion();
    ili9320_Clear(0xffff);
    delay_ms(100);
 	ili9320_SetCursor(0,0);
    LCD_WriteReg(0x0050, 0);
    LCD_WriteReg(0x0052, 0);
    LCD_WriteReg(0x0051, 239);
    LCD_WriteReg(0x0053, 319);
    LCD_WriteRAM_Prepare(); // ©╙от╢Ф
	//delay_ms(10);   
	
	while(1!=OV7670_init());	
    while(1) 
    {
        TimerCnt = 0;
        temp7670 = 0;
        CLK_init_ON(); // OV7670 XCLK ©╙
        while(value & 0x0800)    value = GPIOC->IDR;   // Vsync=H    
        while((~value) & 0x0800) value = GPIOC->IDR;   // Vhync=L 
        
        CLK_init_OFF(); //OV7670 XCLK ╧ь
		while(TimerCnt < 76800)
        {
			XCLK_L; 
            XCLK_H;
			value = GPIOC->IDR;
			temp7670 ++;
            
			if(value & 0x0100) // HREF = H ||(LCD_PCLK_STATE)
            {	
			  	 //value = GPIOC->IDR;
			  	 //display[TimerCnt]=value; 
			  
			   if((temp7670 == 1))// ╦ъвж╫з||(value & 0x0200) ||(LCD_PCLK_STATE) 
                {
                  	val1=value& 0x00ff;

                }
                else // ╣мвж╫з	 if((temp7670 != 1)||(LCD_PCLK_STATE))  
                {
                   	val2= value<<8  ; 	 //
					val =ili9320_BGR2RGB(val1 |val2);
                    temp7670 = 0;
                    LCD_WriteRAM(val); //TFT GRAM йЩ╬щ
                    TimerCnt ++;
                }
            } 
		
				
		}
  }  
}
示例#10
0
/***********************************************************************
  * @brief  Just do dispaly the data in ram.
  * @param  None
  * @retval None
************************************************************************/
static void LCD_SC_DoDisp(void)
{   
    LCD_WriteRAM(LCD_RAMRegister_0, lcd_ram.com0);
    LCD_WriteRAM(LCD_RAMRegister_1, (uint8_t)(lcd_ram.com0 >> 8));
	
	LCD_WriteRAM(LCD_RAMRegister_3, lcd_ram.com1 << 4);
    LCD_WriteRAM(LCD_RAMRegister_4, (uint8_t)(lcd_ram.com1 >> 4));
	LCD_WriteRAM(LCD_RAMRegister_5, (uint8_t)(lcd_ram.com1 >> 12));
	
	LCD_WriteRAM(LCD_RAMRegister_7, lcd_ram.com2);
    LCD_WriteRAM(LCD_RAMRegister_8, (uint8_t)(lcd_ram.com2 >> 8));
	
	LCD_WriteRAM(LCD_RAMRegister_10, lcd_ram.com3 << 4);
    LCD_WriteRAM(LCD_RAMRegister_11, (uint8_t)(lcd_ram.com3 >> 4));
	LCD_WriteRAM(LCD_RAMRegister_12, (uint8_t)(lcd_ram.com3 >> 12));
}
示例#11
0
/**
 * LCD写字符子程序
 */
void lcd_wr_pixel(unsigned int a, unsigned int b, unsigned int e)    
// X, Y,颜色
{
	LCD_WriteReg(0x20, a);
    LCD_WriteReg(0x21, b);
	LCD_WriteRAM(e);
}
示例#12
0
文件: lcd.c 项目: peterliu2/FreeRTOS
/*******************************************************************************
* Function Name  : LCD_DrawBMP
* Description    : Displays a bitmap picture loaded in the SPI Flash.
* Input          : - BmpAddress: Bmp picture address in the SPI Flash.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_DrawBMP(uc16 *BmpAddress)
{
    u32 i = 0, size = 0;

    /* Read bitmap size */
    size = BmpAddress[1] | (BmpAddress[2] << 16);

    /* get bitmap data address offset */
    i = BmpAddress[5] | (BmpAddress[6] << 16);

    size = (size - i)/2;

    BmpAddress += i/2;
    /* 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(R3, 0x1008);

    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */

    /* Read bitmap data from SPI Flash and send them to LCD */
    for(i = 0; i < size; i++) {
        LCD_WriteRAM(BmpAddress[i]);
    }

    LCD_CtrlLinesWrite(GPIOB, CtrlPin_NCS, Bit_SET);

    /* 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(R3, 0x1018);
}
示例#13
0
void LCD_PutPixel_HX8347A(uint16_t x, uint16_t y)
{
	LCD_SetWindow(x, y, x, y);
	LCD_WriteRAM_Prepare();
	LCD_WriteRAM(TextColor>>16);
	LCD_WriteRAM(TextColor);
}
示例#14
0
/**
  * @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);  
}
示例#15
0
/*******************************************************************************
* Function Name  : LCD_WriteRAMWord
* Description    : Writes 1 word to the LCD RAM.
* Input          : - RGB_Code: the pixel color in RGB mode (5-6-5).
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_WriteRAMWord(u16 RGB_Code)
{
  LCD_WriteRAM_Prepare();

  LCD_WriteRAM(RGB_Code);
  
  LCD_WriteRAM_Ready();
}
示例#16
0
文件: lcd.c 项目: peterliu2/FreeRTOS
/*******************************************************************************
* Function Name  : LCD_WriteRAMWord
* Description    : Writes 1 word to the LCD RAM.
* Input          : - RGB_Code: the pixel color in RGB mode (5-6-5).
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_WriteRAMWord(u16 RGB_Code)
{
    LCD_WriteRAM_Prepare();

    LCD_WriteRAM(RGB_Code);

    LCD_CtrlLinesWrite(GPIOB, CtrlPin_NCS, Bit_SET);
}
示例#17
0
/*******************************************************************************
* Function Name  : LCD_DrawCircle
* Description    : Displays a circle.
* Input          : - Xpos: specifies the X position.
*                  - Ypos: specifies the Y position.
*                  - Height: display rectangle height.
*                  - Width: display rectangle width.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_DrawCircle(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_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    LCD_SetCursor(Xpos + CurX, Ypos - CurY);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    LCD_SetCursor(Xpos - CurX, Ypos + CurY);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    LCD_SetCursor(Xpos - CurX, Ypos - CurY);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    LCD_SetCursor(Xpos + CurY, Ypos + CurX);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    LCD_SetCursor(Xpos + CurY, Ypos - CurX);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    LCD_SetCursor(Xpos - CurY, Ypos + CurX);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    LCD_SetCursor(Xpos - CurY, Ypos - CurX);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
    LCD_WriteRAM(TextColor);

    if (D < 0)
    {
      D += (CurX << 2) + 6;
    }
    else
    {
      D += ((CurX - CurY) << 2) + 10;
      CurY--;
    }
    CurX++;
  }
}
示例#18
0
/**
 * \brief Draw a pixel on LCD of given color.
 *
 * \param x  X-coordinate of pixel.
 * \param y  Y-coordinate of pixel.
 * \param color  Pixel color.
 */
void LCDD_DrawPixel(
    uint32_t x,
    uint32_t y,
    uint32_t color)
{
    LCD_SetCursor(x, y);
    LCD_WriteRAM_Prepare();
    LCD_WriteRAM(color);
}
示例#19
0
void LCD_DrawChar_HX8347A(uint16_t Xpos, uint16_t Ypos, uint16_t codeChar)
{
	uint32_t index = 0, i = 0, numByte, width, bitCounter, ptrByte;
	// Symbol width
	if (codeChar > LCD_Currentfonts->NumSymb) codeChar = 0;
	if (LCD_Currentfonts->Width)
	{
		width = LCD_Currentfonts->Width;
		LCD_SetWindow(Xpos, Ypos, Xpos+width-1, Ypos+LCD_Currentfonts->Height-1);
	}
	else
	{
		width = LCD_Currentfonts->tableSymbWidth[codeChar];
		LCD_SetWindow(Xpos, Ypos, Xpos+width+LCD_Currentfonts->SymbolSpace-1, Ypos+LCD_Currentfonts->Height-1);
	}
	numByte = LCD_Currentfonts->Height * ((width+7)/8);

	LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
	// Draw Char
	for(index = 0; index < numByte; index++)
	{
		bitCounter = 0;
		for(i = 0; i < width; i++)
		{

			if (bitCounter > 7)
			{
				bitCounter = 0;
				index++;
			}
			ptrByte = LCD_Currentfonts->table[LCD_Currentfonts->tableSymbIndex[codeChar]+index];
			if(ptrByte & (1<<bitCounter))
			{
				LCD_WriteRAM(TextColor>>16);
				LCD_WriteRAM(TextColor);
			}
			else
			{
				LCD_WriteRAM(BackColor>>16);
				LCD_WriteRAM(BackColor);
			}
			bitCounter++;
		}
示例#20
0
文件: lcd.c 项目: peterliu2/FreeRTOS
/*******************************************************************************
* Function Name  : LCD_DrawMonoPict
* Description    : Displays a monocolor picture.
* Input          : - Pict: pointer to the picture array.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_DrawMonoPict(uc32 *Pict)
{
    u32 index = 0, i = 0;

    LCD_SetCursor(0, 319);
    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */

    for(index = 0; index < 2400; index++) {
        for(i = 0; i < 32; i++) {
            if((Pict[index] & (1 << i)) == 0x00) {
                LCD_WriteRAM(BackColor);
            } else {
                LCD_WriteRAM(TextColor);
            }
        }
    }
    LCD_CtrlLinesWrite(GPIOB, CtrlPin_NCS, Bit_SET);

}
示例#21
0
/**
  * @brief  Displays a monocolor picture.
  * @param  Pict: pointer to the picture array.
  * @retval None
  */
void LCD_DrawMonoPict(const uint32_t *Pict)
{
  uint32_t index = 0, i = 0;
  LCD_SetCursor(0, 319); 
  LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
  for(index = 0; index < 2400; index++)
  {
    for(i = 0; i < 32; i++)
    {
      if((Pict[index] & (1 << i)) == 0x00)
      {
        LCD_WriteRAM(BackColor);
      }
      else
      {
        LCD_WriteRAM(TextColor);
      }
    }
  }
}
/**
  * @brief  Displays a mono-color picture.
  * @param  Pict: pointer to the picture array.
  * @retval None
  */
void BSP_LCD_DrawMonoPict(const uint32_t *Pict)
{
  uint32_t index = 0, i = 0;
  LCD_SetCursor(0, (LCD_PIXEL_WIDTH - 1));
  LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
  for(index = 0; index < 2400; index++)
  {
    for(i = 0; i < 32; i++)
    {
      if((Pict[index] & (1 << i)) == 0x00)
      {
        LCD_WriteRAM(DrawProp.BackColor);
      }
      else
      {
        LCD_WriteRAM(DrawProp.TextColor);
      }
    }
  }
}
示例#23
0
/**
 * \brief Fills the given LCD buffer with a particular color.
 *
 * \param color  Fill color.
 */
void LCDD_Fill(uint32_t color)
{
    uint32_t i;

    LCD_SetCursor(0, 0);
    LCD_WriteRAM_Prepare();
    for (i = 0; i < (BOARD_LCD_WIDTH * BOARD_LCD_HEIGHT); i++) {

        LCD_WriteRAM(color);
    }
}
示例#24
0
/*******************************************************************************
* Function Name  : LCD_DrawRect
* Description    : Displays a rectangle.
* Input          : - Xpos: specifies the X position.
*                  - Ypos: specifies the Y position.
*                  - Height: display rectangle height.
*                  - Width: display rectangle width.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_DrawRectFill(u8 Xpos, u16 Ypos, u8 Width, u16 Height,u16 fill){
  u8 j;
  LCD_SetDisplayWindow(Xpos,Ypos,Width,Height);

  LCD_WriteRAM_Prepare();
   for(Height=Height;Height>0;Height--)
     for(j=Width;j>0;j--)
        LCD_WriteRAM(fill);
  LCD_WriteRAM_Ready();
  LCD_WindowModeDisable();
}
示例#25
0
//------------------------------------------------------------------------------
/// Sets the specified pixel to the given color.
/// !!! Only works in 24-bits packed mode for now. !!!
/// \param pBuffer  LCD buffer to draw on.
/// \param x  X-coordinate of pixel.
/// \param y  Y-coordinate of pixel.
/// \param color  Pixel color.
//------------------------------------------------------------------------------
void LCDD_DrawPixel(
    void *pBuffer,
    unsigned int x,
    unsigned int y,
    unsigned int color)
{
    unsigned short color16 = RGB24ToRGB16(color);

    LCD_SetCursor(pBuffer, x, y);
    LCD_WriteRAM_Prepare(pBuffer);
    LCD_WriteRAM(pBuffer, color16);
}
示例#26
0
/**
  * @brief  Clears the whole LCD.
  * @param  Color: the color of the background.
  * @retval None
  */
void LCD_Clear(uint16_t Color)
{
  uint32_t index = 0;
  
  LCD_SetCursor(0x00, 0x0000);
  LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
  for(index = 0; index < 76800; index++)
  {
    LCD_WriteRAM(Color);
  }
  LCD_CtrlLinesWrite(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, Bit_SET);   
}
示例#27
0
/*******************************************************************************
* Function Name  : show_picture
* Description    : show one picture
* author         :wangxiaotao
* Input          : - file: pointer to the source file name
*                  - line: assert_param error line source number
* Output         : None
* Return         : None
*******************************************************************************/
void show_picture(const unsigned char *p)
{
	int i;
	unsigned int dd;
	address_set(0,0,239,319);
    for(i=0;i<320*240;i++)
	 {
		  dd=(0x00 | p[i * 2 + 1])<<8;
		  dd=dd | p[i * 2];
		  LCD_WriteRAM(dd);
	 }
}
示例#28
0
文件: lcd.c 项目: jwfjia123/stm32-SD-
void LCD_Char(u16 Xpos, u16 Ypos, u8 Ascii, u16 color)
{
	const u16 *c;
  	u16 Xaddr=0; 
  	u32 index=0,i=0;
					 
  	Xaddr=Xpos;
	c=&Efont->table[(Ascii-32)*Efont->Height]; 
  	LCD_Cursor(Xaddr, Ypos);  
  	for(index=0;index<Efont->Height;index++)
  	{
    	LCD_REG=0x22;//WriteRAM_Prepare
    	for(i=0;i<Efont->Width;i++)
    	{  
			if((((c[index]&((0x80<<((Efont->Width/12)*8))>>i))==0x00)&&(Efont->Width<=12))
			||(((c[index]&(0x1<<i))==0x00)&&(Efont->Width>12)))LCD_WriteRAM(BLUE);
      		else LCD_WriteRAM(color); 
    	}
    	Xaddr++;
    	LCD_Cursor(Xaddr, Ypos);
  	}
示例#29
0
文件: lcd.c 项目: jwfjia123/stm32-SD-
void LCD_Fill(u16 x1, u16 y1, u16 x2, u16 y2, u16 color)
{          
	u16 i,j;
	u16 xlen=0;

	xlen=y2-y1+1;	   
	for(i=x1;i<=x2;i++)
	{
	 	LCD_Cursor(i,y2);
		LCD_REG=0x22;      	  
		for(j=0;j<xlen;j++)LCD_WriteRAM(color); 	  
	}						  	    
}  
示例#30
0
/*******************************************************************************
* Function Name  : LCD_DrawMonoPict
* Description    : Displays a monocolor picture.
* Input          : - Pict: pointer to the picture array.
* Output         : None
* Return         : None
*******************************************************************************/
void LCD_DrawMonoPict(uc8 *Pict)
{
  u32 index = 0, i = 0;

  //LCD_SetCursor(0, 0);

    LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */

  for(index = 0; index < (6040); index++)
  {
    for(i = 0; i < 8; i++)
    {
      if((Pict[index] & (1 << i)) == 0x00) {
        LCD_WriteRAM(BackColor);
      }
      else {
        LCD_WriteRAM(TextColor);
      }
    }
  }
  LCD_WriteRAM_Ready();
}