feat(encoder): 添加编码器模块支持
- 在CMakeLists.txt中添加encoder_module.c和encoder_event.c源文件 - 配置设备树pinctrl设置编码器引脚(QDEC_A和QDEC_B) - 在设备树中启用qdec外设并配置相关参数 - 添加atguigu厂商前缀到vendor-prefixes.txt - 创建encoder_event.h事件头文件定义编码器事件结构 - 在prj.conf中启用NRFX_QDEC和PINCTRL_DYNAMIC配置 - 实现encoder_module.c包含完整的编码器驱动逻辑 - 实现encoder_event.c处理编码器事件的发布和记录
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
aliases {
|
||||
led0 = &myled0;
|
||||
qdec0 = &qdec;
|
||||
};
|
||||
|
||||
hid_kbd: hid_kbd {
|
||||
@@ -147,6 +148,16 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qdec {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&encoder_default>;
|
||||
pinctrl-1 = <&encoder_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
led-pre = <0>;
|
||||
steps = <80>;
|
||||
nordic,period = "SAMPLEPER_1024US";
|
||||
};
|
||||
|
||||
&usbd {
|
||||
status = "okay";
|
||||
num-bidir-endpoints = <0>;
|
||||
|
||||
Reference in New Issue
Block a user