Skip to content

Commit 372db55

Browse files
committed
boards: renesas ra: Make ek_ra4m3 manually testable using push buttons
Add port IRQ's, `gpio-keys` for board push buttons and proper aliases in order to make GPIO IRQs manually testable (eg. using sample/basic/buttons) Only ioport0 port IRQs are provided for now, as those connected to board physical buttons. Signed-off-by: Piotr Rak <[email protected]>
1 parent 73b7a6c commit 372db55

File tree

2 files changed

+54
-8
lines changed

2 files changed

+54
-8
lines changed

boards/renesas/ek_ra4m3/ek_ra4m3.dts

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77
/dts-v1/;
88

99
#include <zephyr/dt-bindings/gpio/gpio.h>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
1012
#include "ek_ra4m3_common.dtsi"
1113

1214
/ {
13-
model = "Renesas ek-ra4m3 board";
15+
model = "Renesas EK-RA4M3 board";
1416

1517
chosen {
1618
zephyr,sram = &sram0;
17-
zephyr,flash = &flash0;
18-
zephyr,code-partition = &code_partition;
19-
};
19+
zephyr,flash = &flash0;
20+
zephyr,code-partition = &code_partition;
21+
};
2022

2123
leds {
2224
compatible = "gpio-leds";
@@ -32,14 +34,32 @@
3234
gpios = <&ioport4 0 GPIO_ACTIVE_HIGH>;
3335
label = "LED3 (Red)";
3436
};
35-
};
37+
};
38+
39+
buttons {
40+
compatible = "gpio-keys";
41+
42+
button0: button_0 {
43+
gpios = <&ioport0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
44+
label = "Push button switch 0";
45+
zephyr,code = <INPUT_KEY_0>;
46+
};
47+
button1: button_1 {
48+
gpios = <&ioport0 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
49+
label = "Push button switch 1";
50+
zephyr,code = <INPUT_KEY_1>;
51+
};
52+
};
3653

3754
aliases {
3855
led0 = &led_0;
56+
led1 = &led_1;
3957
led-blue = &led_0;
4058
led-green = &led_1;
4159
led-red = &led_2;
42-
};
60+
sw0 = &button0;
61+
sw1 = &button1;
62+
};
4363
};
4464

4565
&flash0 {
@@ -52,14 +72,18 @@
5272
label = "code";
5373
reg = <0x00000000 0x4C000>;
5474
read-only;
55-
};
56-
};
75+
};
76+
};
5777
};
5878

5979
&fcu {
6080
status = "okay";
6181
};
6282

83+
&ioport0 {
84+
status = "okay";
85+
};
86+
6387
&ioport4 {
6488
status = "okay";
6589
};

dts/arm/renesas/ra/ra4m-cm33-common.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,28 @@
3434
compatible = "renesas,ra-gpio";
3535
reg = <0x40080000 0x20>;
3636

37+
interrupts = <RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ6>,
38+
<RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ7>,
39+
<RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ8>,
40+
<RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ9>,
41+
<RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ10>,
42+
<RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ11>,
43+
<RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ12>,
44+
<RA_ICU_IRQ_UNSPECIFIED 0 RA_ICU_PORT_IRQ13>;
45+
46+
interrupt-names = "port-irq6", "port-irq7", "port-irq8",
47+
"port-irq9", "port-irq10", "port-irq11",
48+
"port-irq12" , "port-irq13";
49+
50+
port-irq6-pins = <0>;
51+
port-irq7-pins = <1>;
52+
port-irq8-pins = <2>;
53+
port-irq9-pins = <4>;
54+
port-irq10-pins = <5>;
55+
port-irq11-pins = <6>;
56+
port-irq12-pins = <8>;
57+
port-irq13-pins = <9>;
58+
3759
gpio-controller;
3860
#gpio-cells = <2>;
3961
ngpios = <16>;

0 commit comments

Comments
 (0)