用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
# 点屏之触摸屏驱动 ## 电阻触摸屏 Zero自带电阻触摸控制芯片ns2009,默认的内核里已经编译了该驱动。 ### 设备树节点 ~~~ &i2c0 { status = "okay"; ns2009: ns2009@48 { compatible = "nsiway,ns2009"; reg = <0x48>; }; }; ~~~ ### 触摸使用 在默认内核配置中,lradc作为event0, ns2009作为event1。 使用前先使用ts_calibrate校准触摸屏,用ts_test或者evtest测试触摸情况。 ## 电容触摸屏 群主使用过的两种电容触摸屏的配置方法如下: (引脚功能见 drivers/pinctrl/sunxi/pinctrl-sun8i-v3s.c) ~~~ &i2c0 { status = "okay"; atmel_mxt_ts@4a { compatible = "atmel,atmel_mxt_ts"; reg = <0x4a>; /*interrupt-parent = <&pio>; interrupts = <6 5 IRQ_TYPE_LEVEL_LOW>;*/ //省引脚,使用轮训方式 }; }; ~~~ ~~~ &i2c0 { status = "okay"; goodix_ctp@5d { pinctrl-names = "default"; pinctrl-0 = <&gt911_int_primo81>; compatible = "goodix,gt911"; reg = <0x5d>; interrupt-parent = <&pio>; interrupts = <1 5 IRQ_TYPE_LEVEL_HIGH>; /* PB5 */ touchscreen-swapped-x-y; }; }; &pio { gt911_int_pin: gt911_int_pin@0 { pins = "PB5"; function = "gpio_in"; }; } ~~~ 编译内核时选中对应驱动即可。