7.3.4. 测试指南¶
7.3.4.2. test_gpai 测试¶
在打开test_gpai的编译后,板子上可直接运行test_gpai命令:
aic /> test_gpai -h
Compile time: Jul 21 2023 09:21:53
Usage: test_gpai [options]:
-c, --channel Select one channel in [0, 7], default is 0
-t, --voltage Input standard voltage, default is 3
-h, --help
Example: test_gpai -c 4 -t 3
7.3.4.3. ADC读取测试¶
ADC数据的读取可以使用shell命令 test_gpai
,每次可读取某一个通道中的当前数据。
aic /> test_gpai -c 4
GPAI ch4: 2432
GPAI ch4-voltage: 1.78 #未设置标准电压时,采用默认电压3V进行计算
aic /> test_gpai -c 0
[W] hal_gpai_ch_is_valid()320 Ch0 is unavailable! # GPAI0通道没有打开
aic /> test_gpai -c 4 -t 6
GPAI ch4: 2432
GPAI ch4-voltage: 3.56
aic /> test_gpai -t 6
Please select a channel first #设置标准电压前,需通过-c选择通道