Skip to content

Commit 8a63970

Browse files
iandmorriskartben
authored andcommitted
boards: mikroe: clicker_ra4m1: added mikrobus labels
Added mikrobus_i2c, mikrobus_spi and mikrobus_serial node labels to device tree board definition, allowing compatible shield boards to be used. Also added User Button 2 definition and refactored pinctrl defintions into separate file. Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
1 parent 1ffd731 commit 8a63970

File tree

2 files changed

+76
-13
lines changed

2 files changed

+76
-13
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2025 Ian Morris
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pinctrl {
8+
sci0_default: sci0_default {
9+
group1 {
10+
/* tx */
11+
psels = <RA_PSEL(RA_PSEL_SCI_0, 4, 11)>;
12+
};
13+
14+
group2 {
15+
/* rx */
16+
psels = <RA_PSEL(RA_PSEL_SCI_0, 4, 10)>;
17+
};
18+
};
19+
20+
iic1_default: iic1_default {
21+
group1 {
22+
/* SCL1 SDA1 */
23+
psels = <RA_PSEL(RA_PSEL_I2C, 2, 5)>,
24+
<RA_PSEL(RA_PSEL_I2C, 2, 6)>;
25+
drive-strength = "medium";
26+
};
27+
};
28+
29+
spi0_default: spi0_default {
30+
group1 {
31+
/* MISO MOSI RSPCK SSL */
32+
psels = <RA_PSEL(RA_PSEL_SPI, 1, 0)>,
33+
<RA_PSEL(RA_PSEL_SPI, 1, 1)>,
34+
<RA_PSEL(RA_PSEL_SPI, 1, 2)>,
35+
<RA_PSEL(RA_PSEL_SPI, 1, 3)>;
36+
};
37+
};
38+
};

boards/mikroe/clicker_ra4m1/mikroe_clicker_ra4m1.dts

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <zephyr/dt-bindings/gpio/gpio.h>
1010
#include <zephyr/dt-bindings/input/input-event-codes.h>
1111

12+
#include "mikroe_clicker_ra4m1-pinctrl.dtsi"
13+
1214
/ {
1315
model = "Mikroe Clicker RA4M1";
1416
compatible = "renesas,ra4m1", "renesas,ra";
@@ -26,6 +28,7 @@
2628
gpios = <&ioport4 9 GPIO_ACTIVE_HIGH>;
2729
label = "User LED 1";
2830
};
31+
2932
ld2: led_2 {
3033
gpios = <&ioport4 8 GPIO_ACTIVE_HIGH>;
3134
label = "User LED 2";
@@ -39,6 +42,12 @@
3942
label = "User Button 1";
4043
zephyr,code = <INPUT_KEY_0>;
4144
};
45+
46+
btn2: button_2 {
47+
gpios = <&ioport3 1 GPIO_ACTIVE_LOW>;
48+
label = "User Button 2";
49+
zephyr,code = <INPUT_KEY_1>;
50+
};
4251
};
4352

4453
mikrobus_header: mikrobus-connector {
@@ -68,19 +77,7 @@
6877
led0 = &ld1;
6978
led1 = &ld2;
7079
sw0 = &btn1;
71-
};
72-
};
73-
74-
&pinctrl {
75-
sci0_default: sci0_default {
76-
group1 {
77-
/* tx */
78-
psels = <RA_PSEL(RA_PSEL_SCI_0, 4, 11)>;
79-
};
80-
group2 {
81-
/* rx */
82-
psels = <RA_PSEL(RA_PSEL_SCI_0, 4, 10)>;
83-
};
80+
sw1 = &btn2;
8481
};
8582
};
8683

@@ -94,6 +91,25 @@
9491
};
9592
};
9693

94+
&iic1 {
95+
pinctrl-0 = <&iic1_default>;
96+
pinctrl-names = "default";
97+
#address-cells = <1>;
98+
#size-cells = <0>;
99+
clock-frequency = <DT_FREQ_K(400)>;
100+
interrupts = <10 1>, <11 1>, <12 1>, <13 1>;
101+
interrupt-names = "rxi", "txi", "tei", "eri";
102+
status = "okay";
103+
};
104+
105+
&spi0 {
106+
pinctrl-0 = <&spi0_default>;
107+
pinctrl-names = "default";
108+
interrupts = <23 1>, <24 1>, <25 1>, <26 1>;
109+
interrupt-names = "rxi", "txi", "tei", "eri";
110+
status = "okay";
111+
};
112+
97113
&ioport0 {
98114
status = "okay";
99115
};
@@ -114,6 +130,11 @@
114130
status = "okay";
115131
};
116132

133+
&port_irq6 {
134+
interrupts = <28 12>;
135+
status = "okay";
136+
};
137+
117138
&port_irq9 {
118139
interrupts = <27 12>;
119140
status = "okay";
@@ -152,3 +173,7 @@
152173
&fclk {
153174
div = <2>;
154175
};
176+
177+
mikrobus_serial: &uart0 {};
178+
mikrobus_i2c: &iic1 {};
179+
mikrobus_spi: &spi0 {};

0 commit comments

Comments
 (0)