uint LCD_Get_Point(uint x, uint y)
{
u16 R=0, G=0, B=0 ;
u16 temp;
LCD_ILI9341_CMD(0X2A); //设置X坐标地址
LCD_ILI9341_Parameter((240-y)>>8); //开始X
LCD_ILI9341_Parameter(240-y); //开始X
LCD_ILI9341_CMD(0X2B); //设置Y坐标地址
LCD_ILI9341_Parameter(x>>8); //开始Y
LCD_ILI9341_Parameter(x); //开始Y
LCD_ILI9341_CMD(0x2E);
R =(*(__IO u16 *) (Bank1_LCD_D)); //delay_us(100); /*FIRST READ OUT DUMMY DATA*/
R =(*(__IO u16 *) (Bank1_LCD_D)); //delay_us(100);/*READ OUT RED DATA */
B =(*(__IO u16 *) (Bank1_LCD_D));// delay_us(100); /*READ OUT BLUE DATA*/
G =(*(__IO u16 *) (Bank1_LCD_D));// delay_us(100); /*READ OUT GREEN DATA*/
temp=(((R>>11)<<11) | ((G>>10)<<5) | (B>>11)) ;
return (temp);
} |