一.GT9157触摸屏移植
1.在mediatek/config/sanstar82_cwet_kk/ProjectConfig.mk中
CUSTOM_KERNEL_TOUCHPANEL=GT9XX (将GT9XX驱动加载到内核中)
2.在mediatek/custom/sanstar82_cwet_kk/kernel/touchpanel/GT9XX/tpd_custom_gt9xx.h中修改固件
(1)在有厂商固件的情况下
将提供的固件代码在替换到#define CTP_GROUP1{}中
(2)如果在没有厂商的固件情况下,提供一种思路
-GT9157编程指南文件_20141023(TCL).pdf文档中有对GT9XX系列的寄存器描述
-GT9XX驱动移植说明书_for_Android_2014011401.pdf有对GT9XX系列移植说明
-android中开发者模式中"显示触摸操作"和"指纹位置"辅助调试
得到以下信息:
固件信息描述:
第2位0x74(低位),第3位0x03(高位) 0x0374代表分辨率的横屏(x)
第4位0x78(低位),第5位0x06(高位) 0x0678代表分辨率的竖屏(y)
由于没有拿到触摸屏模组厂商的固件信息,故调整了分辨率以调整触摸(非正常手段)
正常情况下分辨率为720x1280,但是由于固件中很多对一些寄存器的值不知道怎么设置
导致按照720x1280的参数设置的触摸值,实际会存在偏差,故需一点点调整
#define CTP_GROUP1{\
0x00,0x74,0x03,0x78,0x06,0x0A,0x05,0x01,0x01,0x08,0x28,0x05,0x50,0x32,\
0x03,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,\
0x2E,0x0E,0x1B,0x19,0xF4,0x0A,0x00,0x00,0x02,0xBA,0x04,0x1D,0x00,0x00,\
0x00,0x00,0x00,0x03,0x64,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x38,0x5F,0x00,0xF7,0x4A,0x3A,0xFF,\
0xFF,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x10,0x12,0x14,0x16,0x18,0x1A,0x1C,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0F,0x10,0x12,0x13,0x14,\
0x16,0x18,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x24,0x26,0x28,0x29,0x2A,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x3A,0x01\
}
二.调整虚拟按键:
KEY_BACK :返回键
KEY_HOME :home键
KEY_MENU :显示后台应用键
第一中:3个按键
#define TPD_KEY_COUNT 3 //3个虚拟按键
#define key_1 300,1350 //第一个虚拟按键位置 //auto define
#define key_2 400,1350 //第二个虚拟按键位置
#define key_3 600,1350 //第三个虚拟按键位置
#define TPD_KEYS {KEY_BACK, KEY_HOME, KEY_MENU}
#define TPD_KEYS_DIM {{key_1,120,100},{key_2,120,100},{key_3,120,100}}
120,100代表虚拟按键的宽和高
1.在mediatek/config/sanstar82_cwet_kk/ProjectConfig.mk中
CUSTOM_KERNEL_TOUCHPANEL=GT9XX (将GT9XX驱动加载到内核中)
2.在mediatek/custom/sanstar82_cwet_kk/kernel/touchpanel/GT9XX/tpd_custom_gt9xx.h中修改固件
(1)在有厂商固件的情况下
将提供的固件代码在替换到#define CTP_GROUP1{}中
(2)如果在没有厂商的固件情况下,提供一种思路
-GT9157编程指南文件_20141023(TCL).pdf文档中有对GT9XX系列的寄存器描述
-GT9XX驱动移植说明书_for_Android_2014011401.pdf有对GT9XX系列移植说明
-android中开发者模式中"显示触摸操作"和"指纹位置"辅助调试
得到以下信息:
固件信息描述:
第2位0x74(低位),第3位0x03(高位) 0x0374代表分辨率的横屏(x)
第4位0x78(低位),第5位0x06(高位) 0x0678代表分辨率的竖屏(y)
由于没有拿到触摸屏模组厂商的固件信息,故调整了分辨率以调整触摸(非正常手段)
正常情况下分辨率为720x1280,但是由于固件中很多对一些寄存器的值不知道怎么设置
导致按照720x1280的参数设置的触摸值,实际会存在偏差,故需一点点调整
#define CTP_GROUP1{\
0x00,0x74,0x03,0x78,0x06,0x0A,0x05,0x01,0x01,0x08,0x28,0x05,0x50,0x32,\
0x03,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8C,\
0x2E,0x0E,0x1B,0x19,0xF4,0x0A,0x00,0x00,0x02,0xBA,0x04,0x1D,0x00,0x00,\
0x00,0x00,0x00,0x03,0x64,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x38,0x5F,0x00,0xF7,0x4A,0x3A,0xFF,\
0xFF,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x10,0x12,0x14,0x16,0x18,0x1A,0x1C,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0F,0x10,0x12,0x13,0x14,\
0x16,0x18,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x24,0x26,0x28,0x29,0x2A,\
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
0x00,0x00,0x3A,0x01\
}
二.调整虚拟按键:
KEY_BACK :返回键
KEY_HOME :home键
KEY_MENU :显示后台应用键
第一中:3个按键
#define TPD_KEY_COUNT 3 //3个虚拟按键
#define key_1 300,1350 //第一个虚拟按键位置 //auto define
#define key_2 400,1350 //第二个虚拟按键位置
#define key_3 600,1350 //第三个虚拟按键位置
#define TPD_KEYS {KEY_BACK, KEY_HOME, KEY_MENU}
#define TPD_KEYS_DIM {{key_1,120,100},{key_2,120,100},{key_3,120,100}}
120,100代表虚拟按键的宽和高