boards: nucleo_l476rg: configure serial pins from DT

usart1, usart2, usart3 pinmuxes are now configured from DT pinctrl.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
This commit is contained in:
Jeremy LOCHE 2020-10-06 15:03:14 +02:00 committed by Kumar Gala
parent 51cf148e68
commit 2e5111b36c
2 changed files with 7 additions and 12 deletions

View file

@ -43,15 +43,22 @@
};
&usart1 {
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
current-speed = <115200>;
status = "okay";
};
&usart2 {
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
current-speed = <115200>;
status = "okay";
};
&usart3 {
pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11>;
current-speed = <115200>;
};
&i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;

View file

@ -15,18 +15,6 @@
/* pin assignments for NUCLEO-L476RG board */
static const struct pin_config pinconf[] = {
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart1), okay) && CONFIG_SERIAL
{STM32_PIN_PA9, STM32L4X_PINMUX_FUNC_PA9_USART1_TX},
{STM32_PIN_PA10, STM32L4X_PINMUX_FUNC_PA10_USART1_RX},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart2), okay) && CONFIG_SERIAL
{STM32_PIN_PA2, STM32L4X_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32L4X_PINMUX_FUNC_PA3_USART2_RX},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usart3), okay) && CONFIG_SERIAL
{STM32_PIN_PB10, STM32L4X_PINMUX_FUNC_PB10_USART3_TX},
{STM32_PIN_PB11, STM32L4X_PINMUX_FUNC_PB11_USART3_RX},
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
{STM32_PIN_PB8, STM32L4X_PINMUX_FUNC_PB8_I2C1_SCL},
{STM32_PIN_PB9, STM32L4X_PINMUX_FUNC_PB9_I2C1_SDA},