⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 touch.c

📁 SPI INTERFACE驱动 IC为1289的TFT显示屏
💻 C
字号:
/**************************************************************************************
* 名    称: 
* 功    能: 
* 参    数: 
* 返 回 值: 
*
* 修改历史:
*   版本    日期     作者     
*   ----------------------------------------------------
*   1.0   2008.8.13  孙逸洁       www.http://shop35330111.taobao.com
**************************************************************************************/
void touch_Init(void)
{
    touch_CS=1;
    touch_DCLK=1;
    touch_DIN=1;
}
/**************************************************************************************
* 名    称: 
* 功    能: 
* 参    数: 
* 返 回 值: 
*
* 修改历史:
*   版本    日期     作者     
*   ----------------------------------------------------
*   1.0   2008.8.13  孙逸洁       www.http://shop35330111.taobao.com
**************************************************************************************/ 
uint read_trouch (unsigned char cmd) 
{
	uint temp=0;
    uchar i;
	touch_CS=0;

	spi_send(cmd);		//命令
	temp=spi_send(0);	//读数
	i=spi_send(0);
	temp<<=8;
	temp|=i;
	temp>>=3;			 //读数据前有一个空脉冲

	touch_CS=1;
	return temp;
}
/**************************************************************************************
* 名    称: 
* 功    能: 
* 参    数: 
* 返 回 值: 
*
* 修改历史:
*   版本    日期     作者     
*   ----------------------------------------------------
*   1.0   2008.8.13  孙逸洁       www.http://shop35330111.taobao.com
**************************************************************************************/
 void touch_GetAdXY(uint *x,uint *y) 
{
	*x=read_trouch(CHX);   
    *y=read_trouch(CHY);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -