Skip to content

Commit 405efb3

Browse files
soburifabiobaltieri
authored andcommitted
boards: m5stack: cores3: Add mbus and grove connector
Adding M-Bus and Grove connector and also add configuration for related peripherals. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent 855e583 commit 405efb3

File tree

4 files changed

+137
-0
lines changed

4 files changed

+137
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
grove_header: grove_header {
8+
compatible = "grove-header";
9+
#gpio-cells = <2>;
10+
gpio-map-mask = <0xffffffff 0xffffffc0>;
11+
gpio-map-pass-thru = <0 0x3f>;
12+
gpio-map = <0 0 &gpio0 1 0>,
13+
<1 0 &gpio0 2 0>;
14+
};
15+
};
16+
17+
grove_i2c: &i2c1 {};
18+
grove_uart: &uart2 {};

boards/m5stack/m5stack_cores3/m5stack_cores3-pinctrl.dtsi

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,28 @@
2020
};
2121
};
2222

23+
uart1_default: uart1_default {
24+
group1 {
25+
pinmux = <UART1_TX_GPIO17>;
26+
output-high;
27+
};
28+
group2 {
29+
pinmux = <UART1_RX_GPIO18>;
30+
bias-pull-up;
31+
};
32+
};
33+
34+
uart2_default: uart2_default {
35+
group1 {
36+
pinmux = <UART2_TX_GPIO2>;
37+
output-high;
38+
};
39+
group2 {
40+
pinmux = <UART2_RX_GPIO1>;
41+
bias-pull-up;
42+
};
43+
};
44+
2345
spim2_default: spim2_default {
2446
group1 {
2547
pinmux = <SPIM2_MISO_GPIO35>,
@@ -40,4 +62,21 @@
4062
output-high;
4163
};
4264
};
65+
66+
i2c1_default: i2c1_default {
67+
group1 {
68+
pinmux = <I2C1_SCL_GPIO1>,
69+
<I2C1_SDA_GPIO2>;
70+
bias-pull-up;
71+
drive-open-drain;
72+
output-high;
73+
};
74+
};
75+
76+
twai_default: twai_default {
77+
group1 {
78+
pinmux = <TWAI_TX_GPIO7>,
79+
<TWAI_RX_GPIO6>;
80+
};
81+
};
4382
};

boards/m5stack/m5stack_cores3/m5stack_cores3_procpu_common.dtsi

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <espressif/esp32s3/esp32s3_wroom_n16r8.dtsi>
88
#include <espressif/partitions_0x0_amp.dtsi>
99
#include "m5stack_cores3-pinctrl.dtsi"
10+
#include "m5stack_mbus_connectors.dtsi"
11+
#include "grove_connectors.dtsi"
1012

1113
/ {
1214
chosen {
@@ -19,7 +21,11 @@
1921
};
2022

2123
aliases {
24+
uart-0 = &uart0;
25+
uart-1 = &uart1;
26+
uart-2 = &uart2;
2227
i2c-0 = &i2c0;
28+
i2c-1 = &i2c1;
2329
watchdog0 = &wdt0;
2430
};
2531
};
@@ -35,25 +41,65 @@
3541
pinctrl-names = "default";
3642
};
3743

44+
&uart1 {
45+
status = "okay";
46+
current-speed = <115200>;
47+
pinctrl-0 = <&uart1_default>;
48+
pinctrl-names = "default";
49+
};
50+
51+
&uart2 {
52+
status = "disabled";
53+
current-speed = <115200>;
54+
pinctrl-0 = <&uart2_default>;
55+
pinctrl-names = "default";
56+
};
57+
58+
&gpio0 {
59+
status = "okay";
60+
};
61+
62+
&gpio1 {
63+
status = "okay";
64+
};
65+
3866
&i2c0 {
3967
status = "okay";
4068
clock-frequency = <I2C_BITRATE_STANDARD>;
4169
pinctrl-0 = <&i2c0_default>;
4270
pinctrl-names = "default";
4371
};
4472

73+
&i2c1 {
74+
status = "okay";
75+
clock-frequency = <I2C_BITRATE_STANDARD>;
76+
pinctrl-0 = <&i2c1_default>;
77+
pinctrl-names = "default";
78+
};
79+
4580
&spi2 {
81+
status = "okay";
4682
#address-cells = <1>;
4783
#size-cells = <0>;
4884
status = "okay";
4985
pinctrl-0 = <&spim2_default>;
5086
pinctrl-names = "default";
5187
};
5288

89+
&twai {
90+
status = "disabled";
91+
pinctrl-0 = <&twai_default>;
92+
pinctrl-names = "default";
93+
};
94+
5395
&wdt0 {
5496
status = "okay";
5597
};
5698

99+
&trng0 {
100+
status = "okay";
101+
};
102+
57103
&esp32_bt_hci {
58104
status = "okay";
59105
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
m5stack_mbus_header: m5stack_mbus_connector {
8+
compatible = "m5stack,mbus-header";
9+
#gpio-cells = <2>;
10+
gpio-map-mask = <0xffffffff 0xffffffc0>;
11+
gpio-map-pass-thru = <0 0x3f>;
12+
gpio-map = /* GND */ <1 0 &gpio 10 0>, /* ADC */
13+
/* GND */ <3 0 &gpio 8 0>, /* PB_IN */
14+
/* GND */ /* RESET/EN */
15+
/* MOSI */ <6 0 &gpio 37 0>, <7 0 &gpio 5 0>, /* GPIO */
16+
/* MISO */ <8 0 &gpio 35 0>, <9 0 &gpio 9 0>, /* PB_OUT */
17+
/* SCK */ <10 0 &gpio 36 0>, /* 3.3V */
18+
/* RXD0 */ <12 0 &gpio 44 0>, <13 0 &gpio 43 0>, /* TXD0 */
19+
/* PC_RX */ <14 0 &gpio 18 0>, <15 0 &gpio 17 0>, /* PC_TX */
20+
/* intSDA */ <16 0 &gpio 12 0>, <17 0 &gpio 11 0>, /* intSCL */
21+
/* PA_SDA */ <18 0 &gpio 2 0>, <19 0 &gpio 1 0>, /* PA_SCL */
22+
/* GPIO */ <20 0 &gpio 6 0>, <21 0 &gpio 7 0>, /* GPIO */
23+
/* I2S_DOUT */ <22 0 &gpio 13 0>, <23 0 &gpio 0 0>, /* I2S_LRCK */
24+
/* NC */ <25 0 &gpio 3 0>; /* I2S_DIN */
25+
/* NC */ /* 5V */
26+
/* NC */ /* BAT */
27+
};
28+
};
29+
30+
m5stack_mbus_i2c0: &i2c0 {};
31+
m5stack_mbus_i2c1: &i2c1 {};
32+
m5stack_mbus_uart0: &uart0 {};
33+
m5stack_mbus_uart1: &uart1 {};
34+
m5stack_mbus_spi: &spi2 {};

0 commit comments

Comments
 (0)