fix(valve): Correct VND7050AJ initialization and pin configuration
- Initialize RST pin as active to keep VND7050AJ out of reset state - Clarify S0/S1 pins as output select pins with descriptive comments - Add initialization logging to show configured max open/close times - Ensure proper valve controller startup sequence
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# VND7050AJ Valve Controller binding
|
||||
description: VND7050AJ valve controller GPIO configuration
|
||||
|
||||
compatible: "vnd7050aj-valve-controller"
|
||||
|
||||
properties:
|
||||
in0-gpios:
|
||||
type: phandle-array
|
||||
description: GPIO for IN0 control signal
|
||||
required: true
|
||||
|
||||
in1-gpios:
|
||||
type: phandle-array
|
||||
description: GPIO for IN1 control signal
|
||||
required: true
|
||||
|
||||
rst-gpios:
|
||||
type: phandle-array
|
||||
description: GPIO for reset pin
|
||||
required: true
|
||||
|
||||
sen-gpios:
|
||||
type: phandle-array
|
||||
description: GPIO for sense enable pin
|
||||
required: true
|
||||
|
||||
s0-gpios:
|
||||
type: phandle-array
|
||||
description: GPIO for status/select 0 pin
|
||||
required: true
|
||||
|
||||
s1-gpios:
|
||||
type: phandle-array
|
||||
description: GPIO for status/select 1 pin
|
||||
required: true
|
||||
@@ -45,10 +45,13 @@ void valve_init(void)
|
||||
|
||||
gpio_pin_configure_dt(&valve_gpios.in0, GPIO_OUTPUT_INACTIVE);
|
||||
gpio_pin_configure_dt(&valve_gpios.in1, GPIO_OUTPUT_INACTIVE);
|
||||
gpio_pin_configure_dt(&valve_gpios.rst, GPIO_OUTPUT_INACTIVE);
|
||||
gpio_pin_configure_dt(&valve_gpios.rst, GPIO_OUTPUT_ACTIVE); // Keep VND7050AJ out of reset
|
||||
gpio_pin_configure_dt(&valve_gpios.sen, GPIO_OUTPUT_INACTIVE);
|
||||
gpio_pin_configure_dt(&valve_gpios.s0, GPIO_OUTPUT_INACTIVE);
|
||||
gpio_pin_configure_dt(&valve_gpios.s1, GPIO_OUTPUT_INACTIVE);
|
||||
gpio_pin_configure_dt(&valve_gpios.s0, GPIO_OUTPUT_INACTIVE); // S0 select pin - output
|
||||
gpio_pin_configure_dt(&valve_gpios.s1, GPIO_OUTPUT_INACTIVE); // S1 select pin - output
|
||||
|
||||
LOG_INF("Valve initialized: max_open=%us, max_close=%us", max_opening_time_s, max_closing_time_s);
|
||||
}
|
||||
}
|
||||
|
||||
void valve_open(void)
|
||||
|
||||
Reference in New Issue
Block a user