Moved Modbus register definitions from into enums within . This centralizes register definitions, improves type safety, and enhances code readability.
- : Added and to the of holding registers.
- : Removed the directive for .
- : Deleted this file as its contents are now integrated into .
Signed-off-by: Eduard Iten <eduard@iten.pro>
This commit introduces configurable obstacle detection thresholds for the valve, allowing them to be set and persisted via the Zephyr settings subsystem and controlled through the shell and Modbus tool.
- `software/lib/valve/Kconfig`: Added new Kconfig options `VALVE_OBSTACLE_THRESHOLD_OPEN_MA` and `VALVE_OBSTACLE_THRESHOLD_CLOSE_MA` for compile-time configuration and default values.
- `software/include/lib/valve.h`: Removed hardcoded defines and added API functions for setting and getting obstacle thresholds.
- `software/lib/valve/valve.c`:
- Updated `valve_work_handler` to use the new configurable obstacle thresholds.
- Integrated loading and saving of obstacle thresholds via the settings subsystem in `valve_init`.
- Implemented the new setter and getter functions for obstacle thresholds.
- Updated the `LOG_INF` message in `valve_init` to display the new obstacle threshold values.
- `software/apps/slave_node/prj.conf`: Added default values for the new Kconfig options.
- `software/lib/shell_valve/shell_valve.c`: Added new shell commands `valve set_obstacle_open` and `valve set_obstacle_close` to modify the obstacle thresholds, and updated `valve show` to display them.
- `software/tools/modbus_tool/modbus_tool.py`:
- Defined new Modbus holding registers (`REG_HOLDING_OBSTACLE_THRESHOLD_OPEN_MA`, `REG_HOLDING_OBSTACLE_THRESHOLD_CLOSE_MA`).
- Updated `poll_status` to read these new registers.
- Modified the `main_menu` to include "Set Obstacle Open" and "Set Obstacle Close" options in the settings menu, allowing users to view and modify these parameters.
- `software/lib/modbus_server/modbus_server.c`:
- Updated `holding_reg_rd` to read the new obstacle threshold registers.
- Updated `holding_reg_wr` to write to the new obstacle threshold registers.
- Removed incorrect `REG_HOLDING_END_CURRENT_THRESHOLD_OPEN_MA` and `REG_HOLDING_END_CURRENT_THRESHOLD_CLOSE_MA` cases from `input_reg_rd`.
- `software/include/lib/modbus_registers.h`: Created a new header file to centralize Modbus register definitions, which were previously hardcoded in `modbus_tool.py`.
Signed-off-by: Eduard Iten <eduard@iten.pro>
Behebt ein Problem, bei dem das Python-Tool 0 mA für die Endstromschwellenwerte anzeigte.
Die Zephyr-Anwendung definierte zuvor nur ein einzelnes Modbus-Register für den Endstromschwellenwert, während das Python-Tool separate Register für das Öffnen und Schließen erwartete.
Änderungen:
- :
- wurde in umbenannt.
- wurde als neues Register hinzugefügt.
- :
- Implementierung der Lese- und Schreib-Callbacks für und unter Verwendung der entsprechenden -Bibliotheksfunktionen.
Diese Änderungen stellen sicher, dass die Zephyr-Anwendung die Endstromschwellenwerte korrekt über Modbus bereitstellt und das Python-Tool diese Werte nun richtig lesen und schreiben kann.
- Updated Doxygen comments in header files (valve.h, fwu.h, modbus_server.h) to be consistent and in English.
- Translated German register names in docs/modbus-registers.de.md to English.
- Updated docs/concept.de.md to reflect new details on current measurement and sensors.
- Updated docs/planning.de.md to reflect completed tasks in Phase 1.
- Implemented VND7050AJ and core functionality including current and voltage measurement and end-position detection.
Added Doxygen-style comments to all C source and header files in the
and directories. This improves
code documentation and enables VSCode tooltip help.
Additionally, short inline comments were added to all global variables
for better clarity.
Adds a new `adc_sensor` library to abstract reading analog values from ADC channels. The output of this library is currently simulated.
This library is now used by the `modbus_server` to read the motor current and the main supply voltage, replacing the previous implementation. This change improves modularity by centralizing ADC-related code into a dedicated module.
The build system has been updated to include the new library.
This commit introduces application versioning, exposing version information through the Modbus server and logging it at startup.
- Add to provide version information
- Update to log the application version at startup
- Update to expose firmware version via Modbus
- Add file association for in
This commit enhances the Modbus server's configuration handling by:
- Loading saved baudrate and unit ID settings during initialization, ensuring persistence across reboots.
- Providing improved feedback during `modbus_reconfigure`, including logging for successful changes and informing the user when a device restart is required for changes to take effect.
- Saving new configuration settings even if immediate reinitialization fails, allowing them to be applied on the next boot.
This commit introduces a new Modbus input register for the system's supply voltage.
- The `modbus-registers.de.md` documentation is updated to include the `SUPPLY_VOLTAGE_MV` register at address `0x00F5` within the system block.
- The `modbus_server.h` header defines the new register.
- The `modbus_server.c` implementation provides a fixed value (12300 mV) for this register.
- The `modbus_tool.py` script is updated to read and display this new supply voltage value in the UI.
This lays the groundwork for integrating actual voltage measurements in the future.
This commit introduces a major refactoring of the project structure to align
with Zephyr's recommended multi-application and library organization.
Key changes include:
- Relocation of custom modules from 'software/modules/' to 'software/lib/'.
- Introduction of a central 'software/CMakeLists.txt' to manage application
and library subdirectories.
- Creation of new Kconfig files for 'software/' and 'software/apps/slave_node/'
to define project-wide and application-specific configurations.
- Removal of the 'gateway' and 'stm32g431_tests' applications.
- Removal of 'shell_modbus.c' and 'shell_system.c' from 'slave_node' application's
direct source files, indicating a shift towards library-based shell commands.
- Updates to 'software/apps/slave_node/CMakeLists.txt', 'prj.conf', and
'boards/bluepill_f103rb.conf' to reflect the new structure and dependencies.