diff --git a/software/apps/slave_node/boards/weact_stm32g431_core.overlay b/software/apps/slave_node/boards/weact_stm32g431_core.overlay index 897a9c1..c29720d 100644 --- a/software/apps/slave_node/boards/weact_stm32g431_core.overlay +++ b/software/apps/slave_node/boards/weact_stm32g431_core.overlay @@ -1,9 +1,50 @@ +/ { + vnd7050aj { + compatible = "gpio-leds"; // Using generic GPIO compatible + status = "okay"; + + // VND7050AJ GPIO pin definitions + in0-gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; // IN0 (PB7) - Input 0 control signal + in1-gpios = <&gpiob 9 GPIO_ACTIVE_HIGH>; // IN1 (PB9) - Input 1 control signal + rst-gpios = <&gpiob 3 GPIO_ACTIVE_HIGH>; // RST (PB3) - Reset pin for VND7050AJ + sen-gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>; // SEN (PB4) - Sense Enable for current monitoring + s0-gpios = <&gpiob 6 GPIO_ACTIVE_HIGH>; // S0 (PB6) - Status/Select 0 output from VND7050AJ + s1-gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>; // S1 (PB5) - Status/Select 1 output from VND7050AJ + }; +}; + &usart1 { modbus0 { compatible = "zephyr,modbus-serial"; status = "okay"; }; status = "okay"; - pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; + pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; // PA9=TX, PA10=RX for Modbus communication pinctrl-names = "default"; }; + +&adc1 { // ADC1 wird für PA0 verwendet + status = "okay"; // ADC1 aktivieren + pinctrl-0 = <&adc1_in1_pa0>; // Pinmux für PA0 als ADC1_IN1 + pinctrl-names = "default"; + st,adc-clock-source = "SYNC"; + st,adc-prescaler = <4>; + #address-cells = <1>; + #size-cells = <0>; + + // Definition des ADC-Kanals für MULTISENSE (PA0) + channel@1 { // ADC1_IN1 ist Kanal 1 + reg = <1>; // Kanalnummer + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + }; +}; + +&pinctrl { + // Pinmux für PA0 als ADC1_IN1 (Analogmodus) + adc1_in1_pa0: adc1_in1_pa0 { + pinmux = ; // PA0 in den Analogmodus setzen + }; +}; \ No newline at end of file