GPAI 配置
驱动配置
在 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 驱动需要依赖 Thread 的 ADC 设备驱动框架,也是在 menuconfig 界面中打开:
Rt-Thread options --->
RT-Thread Components --->
Device Drivers --->
[*] Using ADC device drivers
提示:
为了简化使用,Using GPAIx 会自动打开 RT-Thread 的 ADC 设备驱动框架。
受 RTOS 环境的 API 接口限制,GPAI 控制器的周期模式、高/低电平告警功能暂未提供。
