Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    D1s 哪吒开发板,电阻屏的配置方法

    D1系列-RISC-V
    1
    1
    136
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lingeasy LV 5 last edited by

      在配置D1s的RTP(电阻屏)出现了不少问题,现将需要配置的部分和大家分享一下,有出现问题的,可以按照如下方法来试一下。
      1、【tslib-env.sh】配置运行环境

      # 路径:package\libs\tslib\files\tslib-env.sh
      #! /bin/sh
      
      export TSLIB_CALIBFILE=/etc/pointercal	# 指定触摸屏校准文件 pintercal 的存放位置 
      export TSLIB_CONFFILE=/etc/ts.conf		# 指定 TSLIB 配置文件的位置
      export TSLIB_PLUGINDIR=/usr/lib/ts		# 指定触摸屏插件所在路径
      export TSLIB_CONSOLEDEVICE=none			# 设定控制台设备为 none ,否则默认为 /dev/tty ,这样可以避免出现“open consoledevice: No such file or directory KDSETMODE: Bad file descriptor ” 的错误 
      export TSLIB_FBDEVICE=/dev/fb0			# 指定帧缓冲设备 
      export TSLIB_TSDEVICE=/dev/input/event0	 # 指定触屏设备
      

      2、【ts.conf】配置

      # 路径:package\libs\tslib\files\ts.conf
      # Uncomment if you wish to use the one-wire linux input layer S70/A70...
      
      # module_raw one_wire_ts_input
      
      # Uncomment if you wish to use the linux input layer event interface
      module_raw input
      
      # Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
      # module_raw collie
      
      # Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
      # module_raw corgi
      
      # Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
      # module_raw ucb1x00
      
      # Uncomment if you're using an HP iPaq h3600 or similar
      # module_raw h3600
      
      # Uncomment if you're using a Hitachi Webpad
      # module_raw mk712
      
      # Uncomment if you're using an IBM Arctic II
      # module_raw arctic2
      
      module pthres pmin=1
      module variance delta=30
      module dejitter delta=100
      module linear
      

      3、【config-5.4】配置,开始相关的驱动

      # 路径:/device/config/chips/d1s/configs/nezha/linux-5.4/config-5.4
      CONFIG_TOUCHSCREEN_SUN4I=y
      

      4、【sun4i-ts.c】配置,解决按下1秒触发和拖到卡顿的问题

      // 路径:lichee/linux-5.4/drivers/input/touchscreen/sun4i-ts.c
      // 修改前
      if (of_device_is_compatible(np, "allwinner,sun8i-ts"))
          writel(ADC_FIRST_DLY(0x1) | ADC_FIRST_DLY_MODE(0x1)
              | ADC_CLK_DIV(0x2) | FS_DIV(2) | T_ACQ(5),
              ts->base + TP_CTRL0);
      // 修改后
      if (of_device_is_compatible(np, "allwinner,sun8i-ts"))
      	writel(ADC_FIRST_DLY(0xf) | ADC_FIRST_DLY_MODE(1)
      		| ADC_CLK_DIV(2) | FS_DIV(6) | T_ACQ(63),
      		ts->base + TP_CTRL0);
      

      5、【测试的方法】

      # 1)用这个先生成校准文件:
      TSLIB_CONSOLEDEVICE=none TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
      # 2)后台运行 uinput:
      TSLIB_CONSOLEDEVICE=none TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_uinput
      # 3)前台执行 测试:
      TSLIB_CONSOLEDEVICE=none TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/eventX ts_test
      
      1 Reply Last reply Reply Quote Share 3
      • 1 / 1
      • First post
        Last post

      Copyright © 2022 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策