| /* |
| * Copyright (c) 2025 Filip Stojanovic <filipembedded@gmail.com> |
| * |
| * SPDX-License-Identifier: Apache-2.0 |
| */ |
| |
| /dts-v1/; |
| #include <st/h5/stm32h523Xe.dtsi> |
| #include <st/h5/stm32h523retx-pinctrl.dtsi> |
| #include <zephyr/dt-bindings/input/input-event-codes.h> |
| |
| / { |
| model = "WeAct Studio Black Pill STM32H523 Board"; |
| compatible = "weact,blackpill-h523ce"; |
| |
| chosen { |
| zephyr,console = &usart1; |
| zephyr,shell-uart = &usart1; |
| zephyr,sram = &sram1; |
| zephyr,flash = &flash0; |
| }; |
| |
| leds { |
| compatible = "gpio-leds"; |
| |
| user_led: led { |
| gpios = <&gpioc 13 GPIO_ACTIVE_LOW>; |
| label = "User LED"; |
| }; |
| }; |
| |
| gpio_keys { |
| compatible = "gpio-keys"; |
| |
| user_button: button { |
| label = "KEY"; |
| gpios = <&gpioa 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; |
| zephyr,code = <INPUT_KEY_0>; |
| }; |
| }; |
| |
| aliases { |
| led0 = &user_led; |
| sw0 = &user_button; |
| volt-sensor0 = &vref; |
| volt-sensor1 = &vbat; |
| }; |
| }; |
| |
| &timers3 { |
| status = "okay"; |
| st,prescaler = <24>; |
| |
| pwm3: pwm { |
| status = "okay"; |
| pinctrl-0 = <&tim3_ch3_pb0 &tim3_ch4_pb1>; |
| pinctrl-names = "default"; |
| }; |
| }; |
| |
| &usart1 { |
| pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; |
| pinctrl-names = "default"; |
| status = "okay"; |
| current-speed = <115200>; |
| }; |
| |
| &i2c1 { |
| pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>; |
| pinctrl-names = "default"; |
| status = "okay"; |
| clock-frequency = <I2C_BITRATE_FAST>; |
| }; |
| |
| &spi1 { |
| pinctrl-0 = <&spi1_sck_pa5 &spi1_nss_pa4 &spi1_miso_pa6 &spi1_mosi_pa7>; |
| pinctrl-names = "default"; |
| status = "okay"; |
| }; |
| |
| &rtc { |
| clocks = <&rcc STM32_CLOCK(APB3, 21)>, <&rcc STM32_SRC_LSE RTC_SEL(1)>; |
| status = "okay"; |
| }; |
| |
| zephyr_udc0: &usb { |
| pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>; |
| pinctrl-names = "default"; |
| status = "okay"; |
| }; |
| |
| &adc1 { |
| clocks = <&rcc STM32_CLOCK(AHB2, 10)>, <&rcc STM32_SRC_HCLK ADCDAC_SEL(0)>; |
| pinctrl-0 = <&adc1_inp1_pa1>; |
| pinctrl-names = "default"; |
| st,adc-clock-source = "ASYNC"; |
| st,adc-prescaler = <8>; |
| status = "okay"; |
| }; |
| |
| &clk_lsi { |
| status = "okay"; |
| }; |
| |
| &clk_lse { |
| status = "okay"; |
| }; |
| |
| &clk_hsi { |
| status = "okay"; |
| }; |
| |
| &clk_hsi48 { |
| status = "okay"; |
| }; |
| |
| &clk_hse { |
| status = "okay"; |
| clock-frequency = <DT_FREQ_M(8)>; |
| }; |
| |
| &rcc { |
| clocks = <&pll>; |
| clock-frequency = <DT_FREQ_M(240)>; |
| ahb-prescaler = <1>; |
| apb1-prescaler = <1>; |
| apb2-prescaler = <1>; |
| apb3-prescaler = <1>; |
| }; |
| |
| &pll { |
| div-m = <1>; |
| mul-n = <60>; |
| div-p = <2>; |
| div-q = <2>; |
| div-r = <2>; |
| clocks = <&clk_hse>; |
| status = "okay"; |
| }; |
| |
| &vref { |
| status = "okay"; |
| }; |
| |
| &vbat { |
| status = "okay"; |
| }; |
| |
| &iwdg { |
| status = "okay"; |
| }; |
| |
| &rng { |
| status = "okay"; |
| }; |