=====> 輸出信息:
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: WM8962 Beep Generator
/dev/input/event1: gpio-keys
Select the device event number [0-1]:
選擇 gpio-keys 所對應的序號
=====> 輸入指令:
1
=====> 輸出信息:
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 116 (KEY_POWER)
Properties:
Testing ... (interrupt to exit)
按動開發板上的按鍵
Event: time 1537921332.815219, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1537921332.815219, -------------- SYN_REPORT ------------
Event: time 1537921332.985211, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1537921332.985211, -------------- SYN_REPORT ------------
Event: time 1537921335.355204, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1537921335.355204, -------------- SYN_REPORT ------------
Event: time 1537921335.535203, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1537921335.535203, -------------- SYN_REPORT ------------
Event: time 1537921337.375207, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1537921337.375207, -------------- SYN_REPORT ------------
Event: time 1537921337.535204, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1537921337.535204, -------------- SYN_REPORT ------------
測試結果
當發生按鍵時,evtest 會輸出相應的信息。
=====> 輸出信息:
Starting send data...finish
Starting receive data:
ASCII: 0x77 Character: w
ASCII: 0x77 Character: w
ASCII: 0x77 Character: w
ASCII: 0x2e Character: .
ASCII: 0x6d Character: m
ASCII: 0x79 Character: y
ASCII: 0x7a Character: z
ASCII: 0x72 Character: r
ASCII: 0x2e Character: .
ASCII: 0x63 Character: c
ASCII: 0x6f Character: o
ASCII: 0x6d Character: m
ASCII: 0x2e Character: .
ASCII: 0x63 Character: c
ASCII: 0x6e Character: n
ASCII: 0x0 Character:
測試結果
執行測試指令后,應用輸出如上類似信息即正常。
2.14 串口測試(UART5)
【測試說明】:采用串口自發自收的方式進行測試
【接口標識】:UART2/3/4/5_TTL
【系統設備】:/dev/ttymxc4
測試操作
短接串口5的發送發接收管腳(J1的16和18號管腳)
執行測試指令:
=====> 輸入指令:
/my-demo/gcc-linaro-5.3-arm/serial_test.out /dev/ttymxc4 "www.myzr.com.cn"
=====> 輸出信息:
Starting send data...finish
Starting receive data:
ASCII: 0x77 Character: w
ASCII: 0x77 Character: w
ASCII: 0x77 Character: w
ASCII: 0x2e Character: .
ASCII: 0x6d Character: m
ASCII: 0x79 Character: y
ASCII: 0x7a Character: z
ASCII: 0x72 Character: r
ASCII: 0x2e Character: .
ASCII: 0x63 Character: c
ASCII: 0x6f Character: o
ASCII: 0x6d Character: m
ASCII: 0x2e Character: .
ASCII: 0x63 Character: c
ASCII: 0x6e Character: n
ASCII: 0x0 Character:
測試結果
執行測試指令后,應用輸出如上類似信息即正常。
2.15 CAN 測試
【測試說明】:采用CAN1發送,CAN0接收的方式。
【接口標識】:CAN1,CAN2
【系統接口】:can0,can1
測試準備
將CAN1的CAN_L與CAN2的CAN_L連接。
將CAN1的CAN_H與CAN2的CAN_H連接。
測試命令
配置 CAN1(can0):
=====> 輸入指令:
ip link set can0 up type can bitrate 125000
配置 CAN2(can1):
=====> 輸入指令:
ip link set can1 up type can bitrate 125000
CAN1 (can0) 后臺接收:
=====> 輸入指令:
candump can0 &
CAN2(can1)發送數據:
=====> 輸入指令:
cansend can1 1F334455#1122334455667788