This commit is contained in:
2025-06-20 18:41:50 +02:00
parent a4aeaa5f91
commit d36f3b85b4
5 changed files with 153 additions and 36 deletions

View File

@@ -5,13 +5,14 @@
*/
/dts-v1/;
#include <st/f1/stm32f1.dtsi>
#include <st/f1/stm32f103Xb.dtsi>
#include <st/f1/stm32f103r(8-b)tx-pinctrl.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Iten engineering Valve Node";
compatible = "iten,valve-node", "st,stm32f103rb";
compatible = "st,stm32f103rb";
can_loopback0: can_loopback0 {
status = "disabled";
@@ -24,7 +25,6 @@
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,canbus = &can1;
//zephyr,canbus = &can_loopback0;
};
leds: leds {
@@ -71,19 +71,10 @@
sw0 = &user_button;
watchdog0 = &iwdg;
die-temp0 = &die_temp;
adc-motor-current = &motor_current_channel;
adc-vref = &vref_channel;
};
zephyr,user {
motoropen: motor_open {
gpios = <&gpiob 13 0>;
label = "Motor Open";
};
fake: fake {
gpios = <&gpiob 11 GPIO_PULL_UP>;
label = "CAN RX pullup";
};
};
};
&clk_lsi {
@@ -107,7 +98,7 @@
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <1>;
adc-prescaler = <2>;
adc-prescaler = <6>;
};
&usart1 {
@@ -125,7 +116,6 @@
modbus0 {
compatible = "zephyr,modbus-serial";
status = "okay";
//de-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
};
};
@@ -148,14 +138,33 @@
&rtc {
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
status = "okay";
};
&adc1 {
pinctrl-0 = <&adc1_in0_pa0>;
pinctrl-0 = <&adc_pb1_pins>;
pinctrl-names = "default";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
motor_current_channel: channel@9 {
reg = <0x9>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_VDD_1";
zephyr,acquisition-time = <49159>;
zephyr,resolution = <12>;
};
vref_channel: channel@11 { /* 17 dezimal = 11 hex */
reg = <0x11>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_VDD_1";
zephyr,acquisition-time = <49159>;
zephyr,resolution = <12>;
};
};
&die_temp {
@@ -172,7 +181,6 @@
#address-cells = <1>;
#size-cells = <1>;
/* Set 2KB of storage at the end of 128KB flash */
storage_partition: partition@1f800 {
label = "storage";
reg = <0x0001f800 DT_SIZE_K(2)>;
@@ -184,9 +192,15 @@
pinctrl-0 = <&can_rx_pa11 &can_tx_pa12>;
pinctrl-names = "default";
status= "okay";
bus-speed = <125000>;
bitrate = <125000>;
};
&exti {
status = "okay";
};
&pinctrl {
adc_pb1_pins: adc_pb1_pins {
pinmux = <STM32F1_PINMUX('B', 1, ANALOG, NO_REMAP)>;
};
};