Edit online

测试指南

测试环境

硬件
  • 带触屏功能的屏幕

  • 带 RTP 接口的开发板

  • USB Type-C 数据线,用于给开发板供电、烧写

  • USB 转串口的线,用于连接开发板的调试串口

  • 手写笔,可以更方便精准的点击 RTP

软件
  • PC 端的串口终端软件,用于 PC 和开发板进行串口通信

  • test_rtp_draw 测试程序

  • test_rtp_adc 测试程序

软件配置

配置 test_rtp_draw
  1. Luban-Lite 根目录下执行 scons --menuconfig,进入 menuconfig 的功能配置界面,按如下选择:
    Drivers options  --->
        Drivers examples  --->
            [*] Enable RTP driver test command
  2. 当使用 lvgl 时会占用 RTP 设备,导致执行 test_rtp_draw 会上报 Failed to open aic-rtp device,需关闭 lvgl 配置:
    Application options  --->
        [ ] ArtInChip LVGL demo  ---> # 关闭 LVGL demo
配置 test_rtp_adc
  1. Luban-Lite 根目录下执行 scons --menuconfig,进入 menuconfig 的功能配置界面,按如下选择:
    Board options  --->
      [*] Using GPAI
        GPAI options  --->
            [ ] Using GPAI0
            [ ] Using GPAI1
            [ ] Using GPAI2
            [ ] Using GPAI3
            [ ] Using GPAI4
            [ ] Using GPAI5
            [ ] Using GPAI6
            [ ] Using GPAI7
            [*] Using rtp channels as ADC
  2. 需先进行 RTP 模块配置,再进行 GPAI 配置,才会看到 Using RTP channels as ADC。若想测试 test_rtp_draw, 则需要关掉 Using RTP channels as ADC
    Drivers options  --->
        Drivers examples  --->
            [*] Enable RTP driver test command

RTOS 环境

  • test_rtp_draw 测试
    在打开 test_rtp_draw 的编译后,板子上可直接运行 test_rtp_draw 命令:
    test_rtp_draw -h
    Usage: test_rtp_draw [options]:
         -c, --calibrate    Platform the screen calibration
         -p, --points       Set the points for drawing, defalut is 1000
         -d, --draw         Draw the shape
         -h, --help
    
    示例:
    test_rtp_draw -c
  • RTP 校准测试

    RTP 校准测试可以使用 shell 命令 test_rtp_draw-c

    test_rtp_draw -c
    Top left : X=50Y=50
    Calibration: X=958, Y=90
    Top right : X=974Y=50
    Calibration: X=69, Y=86
    Bot right : X=974Y=550
    Calibration: X=61, Y=526
    Bot left : X=50Y=550
    Calibration: X=876, Y=535
    Center : X=512Y=300
    Calibration: X=522, Y=303
  • RTP 画点测试

    RTP 画点测试可以使用 shell 命令 test_rtp_draw-d

    test_rtp_draw -d
    Event type : down, Press : 617  # Event type事件类型(down:按压事件,up:抬起事件),Press压感值
    0: X 240/3299, Y 325/2924       # 画点序数: X 坐标/ADC值, Y 坐标/ADC值
    Event type : down, Press : 653
    1: X 232/3324, Y 333/2963
    Event type : down, Press : 670
    2: X 254/3256, Y 328/2933
    Event type : down, Press : 706
    3: X 245/3282, Y 319/2899
    Event type : up, Press : 0
    Event type : up, Press: too light # 按压力度过轻,力度小于所配置压感过滤力度,请重新按压
  • test_rtp_adc测试

    若使用 RTP 通道进行 ADC 单次采样或电阻屏电阻自测,可以使用 shell 命令 test_rtp_adc

    使用 test_rtp_adc 命令,需要遵循 test_rtp_adc 配置。
    test_rtp_adc -h
    Usage: test_rtp_adc [options]:
        -r, --read <chan>  # 选择下面CHAN-ID对应通道作为ADC采样通道
        -t, --voltage\t\tModify default voltage # 配置ADC基准参考电压
        -n, --number\t\tSet the number of samples # 配置采样点数
        -g, --get\t\tGet the panel resistance # 获取电阻屏电阻
        -s, --show\t\tshow saved resistance values # 打印所保存的电阻值
        -h, --help
        Example1: test_rtp_adc -r 1 -n 10 -t 3.3
        Example2: test_rtp_adc -g
        Example3: test_rtp_adc -s
        CHAN-ID:
            [0] Y-
            [1] X-
            [2] Y+
            [3] X+
    test_rtp_adc -r 1 -n 2 -t 3.3
    [0] ch1: 1764    # [采样点序数] ch通道号 : ADC值
    voltage:1.4792 v # ADC对应电压值
    [1] ch1: 1764
    voltage:1.4792 v
    test_rtp_adc -g
    === First Measurement ===
    [0] ch0: 633, voltage: 0.4637 v
    [1] ch0: 634, voltage: 0.4644 v
    [2] ch0: 634, voltage: 0.4644 v
    ...
    Rx = 240 Ω, Ry = 685 Ω
    test_rtp_adc -s
    === Saved Resistance Values ===
    ...
    Rx = 240 Ω
    Ry = 685 Ω

裸机环境

  • test_rtp_draw 测试
    RTP 校准测试可以使用 shell 命令 test_rtp_draw
    test_rtp_draw
    Compile time: Jun  3 2024 09:33:21
    Usage: test_rtp_draw [options]
    test_rtp_draw calibrate            : Platform the screen calibration
    test_rtp_draw set <points_number>  : Set the points for drawing, defalut is 1000
    test_rtp_draw draw                 : Draw the shape
    test_rtp_draw help                 : Get this help
    示例:
    test_rtp_draw set 100
  • RTP 校准测试

    RTP 校准测试可以使用 shell 命令 test_rtp_draw calibrate

    test_rtp_draw calibrate
    Top left : X=50Y=50
    Calibration: X=958, Y=90
    Top right : X=974Y=50
    Calibration: X=69, Y=86
    Bot right : X=974Y=550
    Calibration: X=61, Y=526
    Bot left : X=50Y=550
    Calibration: X=876, Y=535
    Center : X=512Y=300
    Calibration: X=522, Y=303
  • RTP 画点测试
    RTP 画点测试可以使用 shell 命令 test_rtp_draw draw
    test_rtp_draw draw
    [I] test_get_fb_info()83 Screen width: 1024, height: 600
    [I] rtp_draw()419 Try to read 1000 points from RTP ...
    Event type : down, Press 54 # Event type事件类型(down:按压事件,up:抬起事件
    0: X 598/1702, Y 268/2263  # 画点序数: X 坐标/ADC值, Y 坐标/ADC值 Press压感值
    Event type : down, Press : 94
    1: X 584/1759, Y 156/3028
    Event type : up, Press : 0 # 事件类型:抬起
    Event type : up, Press: too light # 按压力度过轻,力度小于所配置压感过滤力度,请重新按压