Skip to content

Commit b0f4cf6

Browse files
zeonchewnashif
authored andcommitted
boards: ambiq: add user button
Added user button for apollo4p_blue_kxr_evb and apollo4p_evb Signed-off-by: Chew Zeh Yang <[email protected]>
1 parent fc8d942 commit b0f4cf6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

boards/ambiq/apollo4p_blue_kxr_evb/apollo4p_blue_kxr_evb.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/dts-v1/;
22
#include <ambiq/ambiq_apollo4p_blue.dtsi>
3+
#include <zephyr/dt-bindings/input/input-event-codes.h>
34

45
#include "apollo4p_blue_kxr_evb-pinctrl.dtsi"
56

@@ -45,13 +46,18 @@
4546

4647
buttons {
4748
compatible = "gpio-keys";
49+
polling-mode;
4850
button0: button_0 {
4951
gpios = <&gpio0_31 17 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
5052
label = "BTN0";
53+
zephyr,code = <INPUT_KEY_0>;
54+
status = "okay";
5155
};
5256
button1: button_1 {
5357
gpios = <&gpio0_31 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
5458
label = "BTN1";
59+
zephyr,code = <INPUT_KEY_1>;
60+
status = "okay";
5561
};
5662
};
5763
};

boards/ambiq/apollo4p_evb/apollo4p_evb.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/dts-v1/;
22
#include <ambiq/ambiq_apollo4p.dtsi>
3+
#include <zephyr/dt-bindings/input/input-event-codes.h>
34

45
#include "apollo4p_evb-pinctrl.dtsi"
56

@@ -45,13 +46,18 @@
4546

4647
buttons {
4748
compatible = "gpio-keys";
49+
polling-mode;
4850
button0: button_0 {
4951
gpios = <&gpio0_31 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
5052
label = "BTN0";
53+
zephyr,code = <INPUT_KEY_0>;
54+
status = "okay";
5155
};
5256
button1: button_1 {
5357
gpios = <&gpio0_31 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
5458
label = "BTN1";
59+
zephyr,code = <INPUT_KEY_1>;
60+
status = "okay";
5561
};
5662
};
5763
};

0 commit comments

Comments
 (0)