如题,最近在移植gt911的驱动到f1c100s上,跑的xboot;
拷贝xboot主线z11s上的gt911的驱动/src/arch/arm32/mach-z11s/driver/ts-gt911.c 到f1c100s的目录中/src/arch/arm32/mach-f1c100s/driver/
,然后修改设备树文件sast-kk131.json:
加上:
"i2c-f1c100s@0x01c27800": {
"clock-name": "link-i2c2",
"clock-frequency": 400000,
"reset": 82,
"sda-gpio": 129,
"sda-gpio-config": 4,
"scl-gpio": 128,
"scl-gpio-config": 4
},
"ts-gt911@0": {
"i2c-bus": "i2c-f1c100s.2",
"slave-address": 20,
"interrupt-gpio": 137,
"interrupt-gpio-config": 6,
"reset-gpio": 138,
"reset-gpio-config": 1
},
复位脚和中断脚用的是:PE10和PE9;iic用的是PE0和PE1;
设备树这样改不知道可以了吗?
要不要类似下面这样加上中断的定义?:
"irq-f1c100s-gpio@0x01f02a40": {
"interrupt-base": 128,
"interrupt-count": 6,
"interrupt-parent": 40
},
要加上的话,interrupt-base、interrupt-count、interrupt-parent不知道代表什么含义,中断号吗?
另外不知道怎么在应用程序中读取坐标值,请路过的大神指点一二
最近编辑记录 岁月快快快 (2022-02-09 18:05:17)
离线
只要关心这个配置,填如GPIO编号即可,中断号无需关心,系统会通过gpio_to_irq来获取具体的中断号
"interrupt-gpio": 137,
"interrupt-gpio-config": 6,
"reset-gpio": 138,
"reset-gpio-config": 1
GPIO 编号如下:
#define F1C100S_GPIOA0 (0)
#define F1C100S_GPIOA1 (1)
#define F1C100S_GPIOA2 (2)
#define F1C100S_GPIOA3 (3)
#define F1C100S_GPIOC0 (64)
#define F1C100S_GPIOC1 (65)
#define F1C100S_GPIOC2 (66)
#define F1C100S_GPIOC3 (67)
#define F1C100S_GPIOD0 (96)
#define F1C100S_GPIOD1 (97)
#define F1C100S_GPIOD2 (98)
#define F1C100S_GPIOD3 (99)
#define F1C100S_GPIOD4 (100)
#define F1C100S_GPIOD5 (101)
#define F1C100S_GPIOD6 (102)
#define F1C100S_GPIOD7 (103)
#define F1C100S_GPIOD8 (104)
#define F1C100S_GPIOD9 (105)
#define F1C100S_GPIOD10 (106)
#define F1C100S_GPIOD11 (107)
#define F1C100S_GPIOD12 (108)
#define F1C100S_GPIOD13 (109)
#define F1C100S_GPIOD14 (110)
#define F1C100S_GPIOD15 (111)
#define F1C100S_GPIOD16 (112)
#define F1C100S_GPIOD17 (113)
#define F1C100S_GPIOD18 (114)
#define F1C100S_GPIOD19 (115)
#define F1C100S_GPIOD20 (116)
#define F1C100S_GPIOD21 (117)
#define F1C100S_GPIOE0 (128)
#define F1C100S_GPIOE1 (129)
#define F1C100S_GPIOE2 (130)
#define F1C100S_GPIOE3 (131)
#define F1C100S_GPIOE4 (132)
#define F1C100S_GPIOE5 (133)
#define F1C100S_GPIOE6 (134)
#define F1C100S_GPIOE7 (135)
#define F1C100S_GPIOE8 (136)
#define F1C100S_GPIOE9 (137)
#define F1C100S_GPIOE10 (138)
#define F1C100S_GPIOE11 (139)
#define F1C100S_GPIOE12 (140)
#define F1C100S_GPIOF0 (160)
#define F1C100S_GPIOF1 (161)
#define F1C100S_GPIOF2 (162)
#define F1C100S_GPIOF3 (163)
#define F1C100S_GPIOF4 (164)
#define F1C100S_GPIOF5 (165)
离线
"irq-f1c100s-gpio@0x01f02a40": {
"interrupt-base": 128,
"interrupt-count": 6,
"interrupt-parent": 40
},要加上的话,interrupt-base、interrupt-count、interrupt-parent不知道代表什么含义,中断号吗?
这种更不需要关心了,这个给系统里的所有可中断的gpio,都注册一个中断,并生成中断号
离线
@xboot
get,还有个问题,在应用程序中要调哪个接口来读取坐标值呢
离线
参考 cmd-event.c
离线
参考 cmd-event.c
get,多谢大佬
最近编辑记录 岁月快快快 (2022-02-10 14:50:57)
离线
大佬,请问你驱动成功了吗?我现在是启动log里面看到gt911已经检测到了,但是进到window里面还是没能触摸,想问一下你是怎么解决的。
离线