void LCD_Clear(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color)
{
uint32_t i = 0;
/* column address control set */
LCD_ILI9341_CMD(0X2A);
LCD_ILI9341_Parameter( x >> 8 ); /* 先高8位,然后低8位 */
LCD_ILI9341_Parameter( x & 0xff ); /* column start */
LCD_ILI9341_Parameter( (x+width-1) >> 8 ); /* column end */
LCD_ILI9341_Parameter( (x+width-1) & 0xff );
/* page address control set */
LCD_ILI9341_CMD(0X2B);
LCD_ILI9341_Parameter( y >> 8 ); /* page start */
LCD_ILI9341_Parameter( y & 0xff );
LCD_ILI9341_Parameter( (y+height-1) >> 8); /* page end */
LCD_ILI9341_Parameter( (y+height-1) & 0xff);
/* memory write */
LCD_ILI9341_CMD(0x2c);
for( i=0; i < width*height; i++ )
{
LCD_WR_Data( color );
//Delay(0x0FFf);
}
}
LCD_ILI9341_Parameter( (x+width-1) >> 8 ); 为什么是(x+width)?这不是导致终点值更大了吗?
LCD_ILI9341_Parameter( (x+width-1) & 0xff ); |