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>
This commit is contained in:
Federico Di Gregorio 2024-10-17 15:28:03 +02:00 committed by Anas Nashif
commit f8ab959d7e
5 changed files with 50 additions and 0 deletions

View file

@ -91,3 +91,15 @@
&rng {
status = "okay";
};
&usart3 {
pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11 &usart3_cts_pb13 &usart3_de_pb14>;
pinctrl-names = "default";
current-speed = <115200>;
/* The RS485 is often used with the ModBus protocol. */
modbus0 {
compatible = "zephyr,modbus-serial";
de-gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
re-gpios = <&gpiob 13 GPIO_ACTIVE_LOW>;
};
};

View file

@ -67,6 +67,8 @@ supports the following hardware features:
+-----------+------------+-------------------------------------+
| ETHERNET | on-board | eth |
+-----------+------------+-------------------------------------+
| RS485 | on-board | uart |
+-----------+------------+-------------------------------------+
The ``arduino_opta/stm32h747xx/m4`` board target
supports the following hardware features:

View file

@ -0,0 +1,12 @@
/*
* Copyright (c) 2024 DNDG srl
*
* SPDX-License-Identifier: Apache-2.0
*/
&usart3 {
modbus0 {
status = "okay";
};
status = "okay";
};

View file

@ -0,0 +1,12 @@
/*
* Copyright (c) 2024 DNDG srl
*
* SPDX-License-Identifier: Apache-2.0
*/
&usart3 {
modbus0 {
status = "okay";
};
status = "okay";
};

View file

@ -0,0 +1,12 @@
/*
* Copyright (c) 2024 DNDG srl
*
* SPDX-License-Identifier: Apache-2.0
*/
&usart3 {
modbus0 {
status = "okay";
};
status = "okay";
};