Page tree
Skip to end of metadata
Go to start of metadata

PanGu开发板的LCD接口(J9)支持电容(使用I2C总线)触摸信号。

Linux系统中已经配置好了电容屏的功能,连接好LCD模块就可以使用了。


Weston系统的触摸校准

在PanGu开发板的/etc/xdg/weston/weston.ini配置文件中添加libinput。

# vi /etc/xdg/weston/weston.ini
 [...]
 [libinput]
 touchscreen_calibrator=true
 calibration_helper=/bin/echo
 [...]


然后重新启动weston

# systemctl restart weston

列出当前系统的触摸设备

# weston-touch-calibrator
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
device "/sys/devices/platform/soc/40013000.i2c/i2c-0/0-0038/input/input1/event1" - head "DPI-1"

启动触摸校验功能,参数是触摸设备的sysfs的节点文件

# weston-touch-calibrator /sys/devices/platform/soc/40012000.i2c/i2c-0/0-002a/input/input1/event1

此时会在屏幕上一次出现四个点,每点击一个会出现对号,表示校验成功。如果有错误,会在命令行中显示错误提示。



Qt系统的触摸校准

配置触摸的环境变量

export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CONFFLLE=/etc/ts.conf
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_TSEVENTTYPE=INPUT
export QT_QPA_EGLFS_TSLIB=1
export QT_QPA_EVDEV_MOUSE_PARAMETERS=/dev/input/event1
export QT_QPA_EGLFS_KMS_CONFIG=/usr/share/qt5/cursor.json
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event1,evdevmouse
export QT_QPA_EGLFS_DISABLE_INPUT=1

执行触摸校准程序

./tscalibrate

液晶显示五个坐标,依次点击后,会显示校准成功。

  • No labels