Skip to content

Commit f8ab959

Browse files
fogzotnashif
authored andcommitted
boards: opta: RS485 support
This set of changes enables the RS485 hardware connected to usart3 and provides some overlays that allow for easily running the modbus rtu_client and rtu_server samples on Opta. Signed-off-by: Federico Di Gregorio <fog@dndg.it>
1 parent 32309f8 commit f8ab959

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

boards/arduino/opta/arduino_opta-common.dtsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,15 @@
9191
&rng {
9292
status = "okay";
9393
};
94+
95+
&usart3 {
96+
pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11 &usart3_cts_pb13 &usart3_de_pb14>;
97+
pinctrl-names = "default";
98+
current-speed = <115200>;
99+
/* The RS485 is often used with the ModBus protocol. */
100+
modbus0 {
101+
compatible = "zephyr,modbus-serial";
102+
de-gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
103+
re-gpios = <&gpiob 13 GPIO_ACTIVE_LOW>;
104+
};
105+
};

boards/arduino/opta/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ supports the following hardware features:
6767
+-----------+------------+-------------------------------------+
6868
| ETHERNET | on-board | eth |
6969
+-----------+------------+-------------------------------------+
70+
| RS485 | on-board | uart |
71+
+-----------+------------+-------------------------------------+
7072

7173
The ``arduino_opta/stm32h747xx/m4`` board target
7274
supports the following hardware features:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2024 DNDG srl
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&usart3 {
8+
modbus0 {
9+
status = "okay";
10+
};
11+
status = "okay";
12+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2024 DNDG srl
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&usart3 {
8+
modbus0 {
9+
status = "okay";
10+
};
11+
status = "okay";
12+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2024 DNDG srl
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&usart3 {
8+
modbus0 {
9+
status = "okay";
10+
};
11+
status = "okay";
12+
};

0 commit comments

Comments
 (0)