Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页
    1. Home
    2. lingeasy
    3. Best
    L
    • Profile
    • Following 1
    • Followers 0
    • my integral 1586
    • Topics 9
    • Posts 30
    • Best 3
    • Groups 0

    Best posts made by lingeasy

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

      在配置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
      
      posted in D1系列-RISC-V
      L
      lingeasy
    • Reply: D1s调试rtp,触控屏,电阻屏出现open consoledevice: No such file or directory

      @whycan 已经解决了,看到在别一个帖子里面的说明
      修改“lichee/linux-5.4/drivers/input/touchscreen/sun4i-ts.c”文件中相关内容
      【原内容】

      	writel(ADC_CLK_SEL(0) | ADC_CLK_DIV(2) | FS_DIV(7) | T_ACQ(63),
      	       ts->base + TP_CTRL0);
      	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);
      

      【修改后】

      	writel(ADC_CLK_SEL(0) | ADC_CLK_DIV(2) | FS_DIV(7) | T_ACQ(63),
      	       ts->base + TP_CTRL0);
      	if (of_device_is_compatible(np, "allwinner,sun8i-ts"))
      		writel(ADC_FIRST_DLY(0xf) | ADC_FIRST_DLY_MODE(0x1)
      			| ADC_CLK_DIV(0x2) | FS_DIV(6) | T_ACQ(63),
      			ts->base + TP_CTRL0);
      
      posted in D1系列-RISC-V
      L
      lingeasy
    • Reply: D1s 哪吒开发板,电阻屏的配置方法

      @gaowei15537316965
      开机启动的时候增加这个的初始化代码应该就可以解决这个问题。

      #!/bin/sh
      
      # 判断是否已经校准了屏幕
      if [ ! -f "/etc/pointercal" ]; then
      TSLIB_CONSOLEDEVICE=none TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
      sleep 1
      fi
      
      # event2是所使用测试硬件使用“ts_uinput ”配置后生成的
      if [ ! -e "/dev/input/event2" ]; then
      TSLIB_CONSOLEDEVICE=none TSLIB_FBDEVICE=/dev/fb0 TSLIB_TSDEVICE=/dev/input/event0 ts_uinput &
      sleep 1
      fi
      
      posted in D1系列-RISC-V
      L
      lingeasy
    • 1 / 1