Files
irrigation_system/software/lib/valve/Kconfig
Eduard Iten 9325fa20c8 feat(valve): Add current measurement callbacks and shell commands
This commit introduces several enhancements to the valve library.

- New weak callback functions `valve_current_open_callback` and `valve_current_close_callback` are added to allow the application to monitor the current during valve opening and closing operations.
- The `movement_timeout_handler` now correctly sets the valve state to `VALVE_STATE_OPEN` and movement to `VALVE_MOVEMENT_IDLE` upon timeout.
- New shell commands `valve open`, `valve close`, and `valve stop` are added for direct control of the valve.
- The existing setting commands are reorganized under a `valve set` subcommand, and their names are shortened (e.g., `set_open_t` to `open_t`).
- The default configuration for `LIB_MODBUS_SERVER` and `LIB_VALVE` is changed to `n`.
Signed-off-by: Eduard Iten <eduard@iten.pro>
2025-07-22 10:53:24 +02:00

46 lines
1.4 KiB
Plaintext

config LIB_VALVE
bool "Enable Valve Library"
default n
help
Enable the Valve Library.
if LIB_VALVE
config LOG_VALVE_LEVEL
int "Valve Log Level"
default 3
help
Set the log level for the Valve Library.
0 = None, 1 = Error, 2 = Warning, 3 = Info, 4 = Debug
config VALVE_INTERVALL_CURRENT_CHECK_MS
int "Interval Current Check (ms)"
default 100
help
Set the interval in milliseconds for checking the motor current
during valve operation. This is used to detect obstacles.
config VALVE_INITIAL_INTERVALL_CURRENT_CHECK_MS
int "Initial Current Check (ms)"
default 200
help
Set the initial delay in milliseconds before the first current check
after starting the valve operation. This allows the motor to stabilize.
config VALVE_OBSTACLE_THRESHOLD_OPEN_MA
int "Obstacle Threshold Open (mA)"
default 200
help
Set the current threshold in milliamps for obstacle detection
during valve opening. If the motor current exceeds this value,
an obstacle is detected and the valve stops.
config VALVE_OBSTACLE_THRESHOLD_CLOSE_MA
int "Obstacle Threshold Close (mA)"
default 200
help
Set the current threshold in milliamps for obstacle detection
during vaslve closing. If the motor current exceeds this value,
an obstacle is detected and the valve stops.
endif # LIB_VALVE