Navigation

    全志在线开发者论坛

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

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

    MR Series
    3
    47
    13479
    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 11
      • G
        张三 LV 6 last edited by

        @lingeasy 在 D1s 哪吒开发板,电阻屏的配置方法 中说:

        2)后台运行 uinput:

        2)后台运行 uinput:我这个通过tf卡烧入的程序没法adb后台运行这个uinput有没有什么解决方法

        whycan L 2 Replies Last reply Reply Quote Share 2
        • whycan
          whycan晕哥 LV 9 @gaowei15537316965 last edited by

          @gaowei15537316965 在 D1s 哪吒开发板,电阻屏的配置方法 中说:

          没法adb后台运行这个uinput

          什么情况?

          G 2 Replies Last reply Reply Quote Share 1
          • G
            张三 LV 6 @whycan last edited by

            现在就是只有校准过之后lvgl还是不能用,我看其他博主发的需要用ts_uinput来转换真实坐标,我这个用tf卡来烧入了Ubuntu连不上adb,这个后台运行就卡住了

            1 Reply Last reply Reply Quote Share 1
            • G
              张三 LV 6 @whycan last edited by xiaowenge

              @whycan
              微信图片_20230608102852.jpg
              校准也是没问题的

              whycan 1 Reply Last reply Reply Quote Share 0
              • whycan
                whycan晕哥 LV 9 @gaowei15537316965 last edited by

                @gaowei15537316965
                如果ts_test和ts_calibrate可以用,那lvgl肯定可以用,如果不能用就检查一下代码。

                G 3 Replies Last reply Reply Quote Share 0
                • G
                  张三 LV 6 @whycan last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote Share 0
                  • G
                    张三 LV 6 @whycan last edited by

                    @whycan 晕哥ts_calibrate它不是真是坐标,不是需要ts_input来进行转换吗

                    whycan 1 Reply Last reply Reply Quote Share 0
                    • G
                      张三 LV 6 @whycan last edited by

                      @whycan LVGL只有左边那一点点可以用

                      1 Reply Last reply Reply Quote Share 0
                      • whycan
                        whycan晕哥 LV 9 @gaowei15537316965 last edited by

                        @gaowei15537316965
                        就是测试 ts_uinput转换后的event设备。

                        G 1 Reply Last reply Reply Quote Share 0
                        • G
                          张三 LV 6 @whycan last edited by

                          @whycan 意思就是还是代码的问题,和这个ts_uinput没关系吗

                          whycan 1 Reply Last reply Reply Quote Share 0
                          • whycan
                            whycan晕哥 LV 9 @gaowei15537316965 last edited by

                            @gaowei15537316965

                            用evtest测试 ts_uinput转换后的event设备。

                            evtest会显示lcd的坐标,如果evtest显示坐标值都正确,那检查lvgl配置。

                            G 2 Replies Last reply Reply Quote Share 0
                            • G
                              张三 LV 6 @whycan last edited by

                              @whycan 可以了谢谢晕哥

                              1 Reply Last reply Reply Quote Share 0
                              • G
                                张三 LV 6 @whycan last edited by

                                @whycan

                                1 Reply Last reply Reply Quote Share 1
                                • whycan
                                  whycan晕哥 LV 9 last edited by

                                  @gaowei15537316965
                                  怎么解决的呢?

                                  G 1 Reply Last reply Reply Quote Share 0
                                  • G
                                    张三 LV 6 @whycan last edited by

                                    @whycan ts_uinput -d -v 这样生成一个虚拟的evtest1,然后我去校准这个虚拟的TSLIB_TSDEVICE=/dev/input/event1 ts_calibrate 校准过之后就可以用了,不知道原理为什么,而且虚拟的复位都没有了,还得重新输入第一条指令

                                    whycan 1 Reply Last reply Reply Quote Share 1
                                    • whycan
                                      whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                      @gaowei15537316965
                                      一开始是因为没有校准对吧?

                                      重启后那个用户层event就没了。

                                      G 3 Replies Last reply Reply Quote Share 0
                                      • G
                                        张三 LV 6 @whycan last edited by

                                        @whycan 对,重启板子event1就没了,刚开始我直接输入ts_calibrate这个指令校准的

                                        1 Reply Last reply Reply Quote Share 0
                                        • G
                                          张三 LV 6 @whycan last edited by

                                          This post is deleted!
                                          1 Reply Last reply Reply Quote Share 0
                                          • G
                                            张三 LV 6 @whycan last edited by

                                            @whycan TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate我这样校准也不行,必须的有那个生成的用户层,这有啥解决的方法吗,板子重启就要重新校准

                                            whycan 1 Reply Last reply Reply Quote Share 0
                                            • whycan
                                              whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                              @gaowei15537316965

                                              只要 /etc/ 目录下面校准文件还在,就无需再校准了。

                                              G 5 Replies Last reply Reply Quote Share 0
                                              • G
                                                张三 LV 6 @whycan last edited by

                                                This post is deleted!
                                                1 Reply Last reply Reply Quote Share 0
                                                • G
                                                  张三 LV 6 @whycan last edited by

                                                  This post is deleted!
                                                  1 Reply Last reply Reply Quote Share 0
                                                  • G
                                                    张三 LV 6 @whycan last edited by

                                                    @whycan a3d08865-4704-4154-906d-fd812cf72362-image.png 这样生成一个event1,然后我校准这个event1,重启这个就没有了,还需要重新校准

                                                    1 Reply Last reply Reply Quote Share 0
                                                    • G
                                                      张三 LV 6 @whycan last edited by

                                                      @whycan 8e2fcadb-384c-4536-b11c-8701b37edf74-image.png 我这样校准运行lvgl就不行只有左边一点可以用

                                                      1 Reply Last reply Reply Quote Share 0
                                                      • G
                                                        张三 LV 6 @whycan last edited by

                                                        @whycan

                                                        这样的现象

                                                        1 Reply Last reply Reply Quote Share 0
                                                        • whycan
                                                          whycan晕哥 LV 9 last edited by

                                                          @gaowei15537316965

                                                          event1 不需要重新校准,出来已经是正确的坐标数据了,用evtest可以测试。

                                                          G 1 Reply Last reply Reply Quote Share 0
                                                          • G
                                                            张三 LV 6 @whycan last edited by

                                                            @whycan 重启过之后不重新校准还是那个样子,测试的坐标也不对evtest /dev/input/event1,想解决一下

                                                            whycan 1 Reply Last reply Reply Quote Share 0
                                                            • whycan
                                                              whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                                              @gaowei15537316965
                                                              两种可能,

                                                              ①校准文件丢失了或者被改写

                                                              ②环境变量没有把校准文件路径传给ts_uinput

                                                              G 1 Reply Last reply Reply Quote Share 0
                                                              • G
                                                                张三 LV 6 @whycan last edited by

                                                                @whycan 晕哥有没有什么办法把生成的用户层的传给event0的,还有每次校准有时候都要校准好几次才得到真实数据

                                                                whycan 1 Reply Last reply Reply Quote Share 0
                                                                • whycan
                                                                  whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                                                  @gaowei15537316965 在 D1s 哪吒开发板,电阻屏的配置方法 中说:

                                                                  用户层的传给event0的

                                                                  没有必要,而且也不能这么干吧?

                                                                  每次校准有时候都要校准好几次才得到真实数据

                                                                  可能触摸屏质量问题

                                                                  G 1 Reply Last reply Reply Quote Share 0
                                                                  • G
                                                                    张三 LV 6 @whycan last edited by

                                                                    @whycan 不传的话每次重启板子都需要重新生成,重新校准

                                                                    whycan 1 Reply Last reply Reply Quote Share 0
                                                                    • whycan
                                                                      whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                                                      @gaowei15537316965
                                                                      看下校准文件重启还在不在,校验码和重启前是不是相同的,ts_uinput有没有把校准文件的路径传进去。

                                                                      G 1 Reply Last reply Reply Quote Share 0
                                                                      • G
                                                                        张三 LV 6 @whycan last edited by

                                                                        @whycan bf1c8c15-2bf9-4e6d-bd2d-5972f6163198-image.png 重启就这一个,它的校准坐标也是不对的

                                                                        whycan 1 Reply Last reply Reply Quote Share 0
                                                                        • whycan
                                                                          whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                                                          @gaowei15537316965

                                                                          TSLIB_TSDEVICE=/dev/input/event1 TSLIB_CALIBFILE=/etc/pointercal TSLIB_CONFFILE=/etc/ts.conf TSLIB_PLUGINDIR=/lib/ts TSLIB_CONSOLEDEVICE=none TSLIB_FBDEVICE=/dev/fb0 /usr/bin/ts_test
                                                                          

                                                                          把命令都放一行上面

                                                                          G 1 Reply Last reply Reply Quote Share 0
                                                                          • G
                                                                            张三 LV 6 @whycan last edited by

                                                                            @whycan 220fc691-c206-44b7-ad5d-1b01d68d02b0-image.png 还必须先校准event0,才可以校准1,坐标才是正常的,可神奇

                                                                            whycan 1 Reply Last reply Reply Quote Share 0
                                                                            • whycan
                                                                              whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                                                              @gaowei15537316965

                                                                              event1 不用校准。

                                                                              G 2 Replies Last reply Reply Quote Share 0
                                                                              • G
                                                                                张三 LV 6 @whycan last edited by

                                                                                @whycan 不校准我试了,也不行,我怀疑是内核的问题了。

                                                                                whycan 1 Reply Last reply Reply Quote Share 0
                                                                                • G
                                                                                  张三 LV 6 @whycan last edited by

                                                                                  @whycan

                                                                                  还是左边那一点可以

                                                                                  1 Reply Last reply Reply Quote Share 0
                                                                                  • whycan
                                                                                    whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                                                                    @gaowei15537316965 在 D1s 哪吒开发板,电阻屏的配置方法 中说:

                                                                                    @whycan 不校准我试了,也不行,我怀疑是内核的问题了。

                                                                                    evtest /dev/input/event1

                                                                                    G 2 Replies Last reply Reply Quote Share 0
                                                                                    • G
                                                                                      张三 LV 6 @whycan last edited by

                                                                                      @whycan 在 D1s 哪吒开发板,电阻屏的配置方法 中说:

                                                                                      evtest /dev/input/event1

                                                                                      bd48c896-9581-45e2-9e58-a053201eb318-image.png
                                                                                      晕哥,这个坐标看着是正常

                                                                                      1 Reply Last reply Reply Quote Share 0
                                                                                      • G
                                                                                        张三 LV 6 @whycan last edited by

                                                                                        @whycan 晕哥可以了,我在写一个脚本,让他自动生成event1,我感觉就可以了,感谢晕哥

                                                                                        whycan 1 Reply Last reply Reply Quote Share 0
                                                                                        • whycan
                                                                                          whycan晕哥 LV 9 @gaowei15537316965 last edited by

                                                                                          @gaowei15537316965
                                                                                          不用谢,有问题可以继续跟帖哈。

                                                                                          1 Reply Last reply Reply Quote Share 0
                                                                                          • L
                                                                                            lingeasy LV 5 @gaowei15537316965 last edited by

                                                                                            @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
                                                                                            
                                                                                            whycan G 2 Replies Last reply Reply Quote Share 1
                                                                                            • whycan
                                                                                              whycan晕哥 LV 9 @lingeasy last edited by

                                                                                              @lingeasy
                                                                                              感谢分享!

                                                                                              1 Reply Last reply Reply Quote Share 0
                                                                                              • G
                                                                                                张三 LV 6 @lingeasy last edited by

                                                                                                @lingeasy 谢谢谢谢

                                                                                                1 Reply Last reply Reply Quote Share 0
                                                                                                • L
                                                                                                  lingeasy LV 5 last edited by

                                                                                                  最近看到使用lvgl开发的软件,使用上面的配置,可能会出现无法获取触屏释放动作的问题 ,现象如下:
                                                                                                  使用ts_test或getevent event0(系统生成的设备号)时可以正常释放;
                                                                                                  使用ts_test或getevent测试使用ts_uinput生成的设备就无法正常获取触屏释放的信号。

                                                                                                  具体成因没有去研究,但可能通过修改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
                                                                                                  
                                                                                                  1 Reply Last reply Reply Quote Share 0
                                                                                                  • 1 / 1
                                                                                                  • First post
                                                                                                    Last post

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

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