#define DATAOUT(x) GPIOB->ODR=x; // 数据输出
//////////////////////////////////////////////////////////////////////
#define DATAIN GPIOB->IDR; // 数据输入
u16 LCD_ReadPoint(u16 x,u16 y)
{
u16 r,g,b;
LCD_SetCursor(x,y);
LCD_WR_REG(0X2E);
//GPIOB->CRL=0X88888888;
//GPIOB->CRH=0X88888888; //PB8-15 éÏà-êäèë
//GPIOB->ODR=0XFF; //è«2¿êä3ö¸ß
LCD_RS_SET;
LCD_CS_CLR;
LCD_RD_SET;
opt_delay(2);
LCD_RD_CLR;
r=DATAIN;
LCD_RD_SET;
opt_delay(2);
LCD_RD_CLR;
r=DATAIN;
//LCD_RD_SET;
LCD_RD_SET;
LCD_CS_SET;
//GPIOB->CRL=0X33333333;
//GPIOB->CRH=0X33333333;
//GPIOB->ODR=0XFF;
return r;}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
u16 LCD_ReadPoint(u16 x,u16 y)
{
u16 r,g,b;
LCD_SetCursor(x,y);
LCD_WR_REG(0X2E);
GPIOB->CRL=0X88888888;
//GPIOB->CRH=0X88888888; //PB8-15 éÏà-êäèë
GPIOB->ODR=0X00FF; //è«2¿êä3ö¸ß
LCD_RS_SET;
LCD_CS_CLR;
//¶áè¡êy¾Y(¶áGRAMê±,μúò»′ÎÎa¼ù¶á)
//LCD_RD_CLR;
//opt_delay(2);
LCD_RD_SET;
opt_delay(2);
LCD_RD_CLR;
//opt_delay(2);
r=DATAIN; //êμ¼ê×ø±êÑÕé«
LCD_RD_SET;
opt_delay(2);
LCD_RD_CLR;
r=DATAIN;
//LCD_RD_SET;
LCD_RD_SET;
opt_delay(2);
LCD_RD_CLR;
g=DATAIN;
LCD_RD_SET;
opt_delay(2);
LCD_RD_CLR;
b=DATAIN;
LCD_RD_SET;
LCD_CS_SET;
GPIOB->CRL=0X33333333; //PB0-7 éÏà-êä3ö
//GPIOB->CRH=0X33333333; //PB8-15 éÏà-êä3ö
GPIOB->ODR=0X00FF; //è«2¿êä3ö¸ß
return ((r<<8)|(g<<3)|(b>>3));
一周热门 更多>