7.4.2. 参数配置¶
7.4.2.1. 驱动配置¶
在 Luban-Lite 根目录下执行 scons --menuconfig
,进入menuconfig的功能配置界面,通道参数默认采用周期模式,采样周期为1ms,按如下选择(配置中只打开了 GPAI2和GPAI7,作为示例):
Board options --->
[*] Using GPAI
GPAI options --->
[ ] Using GPAI0
[ ] Using GPAI1
[*] Using GPAI2
[ ] Using GPAI3
[ ] Using GPAI4
[ ] Using GPAI5
[ ] Using GPAI6
[*] Using GPAI7
GPAI2 Parameter --->
GPAI7 Parameter --->
obtaning data mode (CPU interrupt mode) --->
period mode (period mode)
(1) sample period time (ms)
当使用 RT-Thread 内核的时候,GPAI 驱动需要依赖RT-Thread的 ADC 设备驱动框架,也是在menuconfig界面中打开:
Rt-Thread options --->
RT-Thread Components --->
Device Drivers --->
[*] Using ADC device drivers
小技巧
为了简化使用,Using GPAIx
会自动打开 RT-Thread 的 ADC设备驱动框架。
注解
受RTOS环境的API接口限制,GPAI 控制器的周期模式、高/低电平告警功能暂未提供。