【MA35D1】如何在DTS设置GPIO上拉

qwang |浏览167次
收藏|2023/10/24 09:26

满意回答

2023/10/24 09:40

以button为例,硬件PD11浮空,用这个GPIO做按键,配置这个GPIO上拉:

        gpio_keys_test {

                compatible = "gpio-keys";

                status = "okay";

                autorepeat;


                pinctrl-names = "default";

                pinctrl-0 = <&PD11_gpio>;

                botton0 {

                        label = "Key Down";

                        linux,code = <KEY_DOWN>;

                        gpios = <&gpion 2 GPIO_ACTIVE_LOW>;

                        wakeup-source;

                };

                button1{

                        label ="Key Up";

                        linux,code = <KEY_UP>;

                        gpios = <&gpion 3 GPIO_ACTIVE_LOW>;

                        wakeup-source;

                };

                botton2 {

                        label = "Key Left";

                        linux,code = <KEY_LEFT>;

                        gpios = <&gpion 12 GPIO_ACTIVE_LOW>;

                        wakeup-source;

                };

                button3 {

                        label ="Key Right";

                        linux,code = <KEY_RIGHT>;

                        gpios = <&gpiod 11 GPIO_ACTIVE_LOW>;

                        wakeup-source;

                };

        };




        gpio_keys_test{

                PD11_gpio: pd11grp{

                        nuvoton,pins =

                                <SYS_GPD_MFPH_PD11MFP_GPIO              &pcfg_keypad>;

                };

        };


蔡芳芳

其他回答(0)
0人关注该问题
+1
 加载中...