讯为itop4412开发板触摸屏调试
2017-01-05 18:15
323 查看
由于不同触摸屏的xy坐标会有不同,有时候xy坐标需要反过来。下面的代码会告诉你怎样调整xy坐标。
代码分析
驱动位置:drivers/input/touchscreen/ft5x06_ts.c
代码分析
驱动位置:drivers/input/touchscreen/ft5x06_ts.c
static int __init ft5x0x_ts_init(void) { int ret; int type; type = get_lcd_type(); #if 1 //TP1_EN //printk("==%s: TP1_EN==\n", __FUNCTION__); ret = gpio_request(EXYNOS4_GPL0(2), "TP1_EN"); if (ret) { printk(KERN_ERR "failed to request TP1_EN for " "I2C control\n"); //return err; } gpio_direction_output(EXYNOS4_GPL0(2), 1); s3c_gpio_cfgpin(EXYNOS4_GPL0(2), S3C_GPIO_OUTPUT); gpio_free(EXYNOS4_GPL0(2)); mdelay(5); #endif #if 1 printk("==%s: reset==\n", __FUNCTION__); ret = gpio_request(EXYNOS4_GPX0(3), "GPX0_3"); if (ret) { gpio_free(EXYNOS4_GPX0(3)); ret = gpio_request(EXYNOS4_GPX0(3), "GPX0_3"); if(ret) { printk("ft5xox: Failed to request GPX0_3 \n"); } } gpio_direction_output(EXYNOS4_GPX0(3), 0); mdelay(200); gpio_direction_output(EXYNOS4_GPX0(3), 1); s3c_gpio_cfgpin(EXYNOS4_GPX0(3), S3C_GPIO_OUTPUT); gpio_free(EXYNOS4_GPX0(3)); msleep(300); #endif //type = get_lcd_type(); if(0x00 == type) //9.7 { TOUCH_MAX_X = 1024; TOUCH_MAX_Y = 768; #ifdef CONFIG_VT //for Ubuntu touch_size = 1; scal_xy = 1; #else touch_size = 0; scal_xy = 1; #endif } else if(0x01 == type) //7.0 { #ifdef CONFIG_VT //for Ubuntu TOUCH_MAX_X = 800;//1280; TOUCH_MAX_Y = 1280;//800; scal_xy = 1; touch_size = 0; #else touch_size = 1;//0; swap_xy ===》在这里控制触摸屏的xy坐标翻转 #endif } else if(0x02 == type) //4.3 { ; } if(1 == touch_size) { swap_xy = 1; } else { swap_xy = 0; } return i2c_add_driver(&ft5x0x_ts_driver); }
相关文章推荐
- 迅为iTOP-4412开发板以NFS方式调试应用程序
- [转载]在iTOP-4412开发板上调试helloworld应用
- 在iTOP-4412开发板上调试helloworld应用
- itop4412之tf卡拷贝文件到开发板
- 迅为iTOP-4412开发板Ubuntu烧写方法
- 基于迅为itop4412开发板的4G模块SIM7100的拨号上网的实现
- 物联网初学者智能家居必备迅为iTOP-4412开发板
- 迅为iTOP-4412开发板在 Ubuntu 下使用WIFI
- 讯为iTOP4412开发板ARM-linux 使用USB转串口工具PL2303
- 嵌入式开发板的学习步骤-基于iTOP-4412开发板
- 嵌入式开发 iTOP-4412 迅为开发板ANROID系统的烧写方法分享
- 移植linux3.7.4系统到itop4412开发板记录
- 讯为iTOP4412开发板ARM-linux 使用OPENCV调用USB摄像头
- 【迅为推荐】适合新手学习的arm开发板-iTOP-4412开发板
- 1、iTOP-4412开发板使用之初体验[多图]
- 嵌入式开发板 iTOP-4412开发板 初学之选ARM开发板!提供技术支持!
- iTop-4412_开发板Linux编程之TFTP服务器学习笔记
- 迅为iTOP-4412开发板开机测试、电源、拨码开关、进不去uboot模式问题
- [迅为开发板资料分享]iTOP-4412开发板LCD的屏幕驱动
- 基于飞思卡尔i.MX 6Quad Sabrelite开发板的触摸屏调试