LRADC

LRADC

位置:开发板 20Pin 扩展引脚arrow-up-right 1 号脚

  • 低速率ADC(LRADC)

  • 6位分辨率

  • 采样率高达2 kHz

  • 支持保持键和通用键

  • 支持正常、继续和单一工作模式

  • 电源电压: 1.8 V,功率参考电压: 1.35 V,模拟输入,检测电压范围:0~LEVELB(最大值为1.266 V)

硬件注意事项

​ K5 目前 LRADC 为 SOC 直接引出引脚,ADC电路设计需要上拉电压,接入到 LRADC 最高不超过 1.266 V 。

dts

LRADC 模块的设备树配置位于 longan 的内核目录 longan/device/config/chips/a133/configs/c3/board.dts

linux 路径为 device/config/chips/a133/configs/c3/board.dts

sunxi_keyboard: keyboard {
    compatible = "allwinner,keyboard_1350mv";
	status = "okay"; /* 使能该节点 */
	key_cnt = <5>; /* 键值数量 */
	keyo = <115 115>; /*根据实际情况,左边115是电压,单位为mV,右边115为该电压对应的键值*/
	keyl = <235 114>;
	key2 = <330 139>;
	key3 = <420 28>;
	key4 = <520 102>;
};

键值可参考:

longan/kernel/linux-4.9/include/dt-bindings/input/linux-event-codes.h

调试

proc

确认查看 LRADC 的数据上报节点

getevent

查看linux是否上报Input事件

Last updated