diff --git a/boards/weact_stm32g431_core.overlay b/boards/weact_stm32g431_core.overlay new file mode 100644 index 0000000..b98182b --- /dev/null +++ b/boards/weact_stm32g431_core.overlay @@ -0,0 +1,27 @@ +/* + * Devicetree overlay for VND7050AJ on weact_stm32g431_core + */ + +/ { + aliases { + vnd7050aj = &vnd7050aj; + }; + + vnd7050aj: vnd7050aj { + compatible = "st,vnd7050aj"; + status = "okay"; + + input0-gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; + input1-gpios = <&gpiob 9 GPIO_ACTIVE_HIGH>; + select0-gpios = <&gpiob 6 GPIO_ACTIVE_HIGH>; + select1-gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>; + sense-enable-gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>; + fault-reset-gpios = <&gpiob 3 GPIO_ACTIVE_LOW>; + io-channels = <&adc1 1>; + r-sense-ohms = <1500>; + }; +}; + +&adc1 { + status = "okay"; +}; diff --git a/modules/vnd7050aj/dts/bindings/vnd7050aj.yaml b/dts/bindings/vnd7050aj.yaml similarity index 87% rename from modules/vnd7050aj/dts/bindings/vnd7050aj.yaml rename to dts/bindings/vnd7050aj.yaml index 4d2b794..70aae35 100644 --- a/modules/vnd7050aj/dts/bindings/vnd7050aj.yaml +++ b/dts/bindings/vnd7050aj.yaml @@ -18,5 +18,4 @@ properties: # Add other properties relevant to the VND7050AJ, e.g., # current-sense-gpios: # type: phandle-array - # required: false - # description: GPIO pins for current sensing + # description: GPIO pin for current sense feedback diff --git a/modules/vnd7050aj/dts/bindings/st,vnd7050aj.yaml b/modules/vnd7050aj/dts/bindings/st,vnd7050aj.yaml new file mode 100644 index 0000000..a2805cc --- /dev/null +++ b/modules/vnd7050aj/dts/bindings/st,vnd7050aj.yaml @@ -0,0 +1,56 @@ +# Copyright (c) 2024, Eduard Iten +# SPDX-License-Identifier: Apache-2.0 + +description: | + STMicroelectronics VND7050AJ dual-channel high-side driver. + This is a GPIO and ADC controlled device. + +compatible: "st,vnd7050aj" + +include: base.yaml + +properties: + input0-gpios: + type: phandle-array + required: true + description: GPIO to control output channel 0. + + input1-gpios: + type: phandle-array + required: true + description: GPIO to control output channel 1. + + select0-gpios: + type: phandle-array + required: true + description: GPIO for MultiSense selection bit 0. + + select1-gpios: + type: phandle-array + required: true + description: GPIO for MultiSense selection bit 1. + + sense-enable-gpios: + type: phandle-array + required: true + description: GPIO to enable the MultiSense output. + + fault-reset-gpios: + type: phandle-array + required: true + description: GPIO to reset a latched fault (active-low). + + io-channels: + type: phandle-array + required: true + description: | + ADC channel connected to the MultiSense pin. This should be an + io-channels property pointing to the ADC controller and channel number. + + r-sense-ohms: + type: int + required: true + description: | + Value of the external sense resistor connected from the MultiSense + pin to GND, specified in Ohms. This is critical for correct + conversion of the analog readings. diff --git a/west.yml b/west.yml new file mode 100644 index 0000000..40341aa --- /dev/null +++ b/west.yml @@ -0,0 +1,20 @@ +manifest: + self: + west-commands: scripts/west-commands.yml + + remotes: + - name: zephyrproject-rtos + url-base: https://github.com/zephyrproject-rtos + + projects: + - name: zephyr + remote: zephyrproject-rtos + revision: main + import: true + + - name: vnd7050aj + path: modules/vnd7050aj + url: . + revision: HEAD + + group-filter: [-tools]