feat(slave): Implement VND7050AJ and core valve functionality; docs: Update German documentation and project plan
- 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.
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
*/
|
||||
|
||||
#include <app_version.h>
|
||||
#include <lib/adc_sensor.h>
|
||||
#include <lib/fwu.h>
|
||||
#include <lib/modbus_server.h>
|
||||
#include <lib/valve.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/misc/vnd7050aj/vnd7050aj.h>
|
||||
#include <zephyr/drivers/uart.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
@@ -148,10 +148,10 @@ static int input_reg_rd(uint16_t addr, uint16_t *reg) {
|
||||
*reg = (valve_get_movement() << 8) | (valve_get_state() & 0xFF);
|
||||
break;
|
||||
case REG_INPUT_MOTOR_OPEN_CURRENT_MA:
|
||||
*reg = adc_sensor_get_current_open_ma();
|
||||
*reg = (uint16_t)valve_get_opening_current();
|
||||
break;
|
||||
case REG_INPUT_MOTOR_CLOSE_CURRENT_MA:
|
||||
*reg = adc_sensor_get_current_close_ma();
|
||||
*reg = (uint16_t)valve_get_closing_current();
|
||||
break;
|
||||
case REG_INPUT_UPTIME_SECONDS_LOW:
|
||||
*reg = (uint16_t)(uptime_s & 0xFFFF);
|
||||
@@ -160,7 +160,7 @@ static int input_reg_rd(uint16_t addr, uint16_t *reg) {
|
||||
*reg = (uint16_t)(uptime_s >> 16);
|
||||
break;
|
||||
case REG_INPUT_SUPPLY_VOLTAGE_MV:
|
||||
*reg = adc_sensor_get_voltage_mv();
|
||||
*reg = (uint16_t)valve_get_vnd_voltage();
|
||||
break;
|
||||
case REG_INPUT_FWU_LAST_CHUNK_CRC:
|
||||
*reg = fwu_get_last_chunk_crc();
|
||||
@@ -190,13 +190,6 @@ static struct modbus_user_callbacks mbs_cbs = {
|
||||
int modbus_server_init(void) {
|
||||
k_timer_init(&watchdog_timer, watchdog_timer_handler, NULL);
|
||||
|
||||
// Initialize ADC sensor
|
||||
int ret = adc_sensor_init();
|
||||
if (ret < 0) {
|
||||
LOG_ERR("Failed to initialize ADC sensor: %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Load saved settings
|
||||
uint32_t saved_baudrate = 19200;
|
||||
uint8_t saved_unit_id = 1;
|
||||
|
||||
Reference in New Issue
Block a user