docs: Add Doxygen comments to library files

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.
This commit is contained in:
2025-07-08 15:48:13 +02:00
parent c9b0f38576
commit bc327acc41
10 changed files with 427 additions and 31 deletions

View File

@@ -1,8 +1,26 @@
/**
* @file shell_modbus.c
* @brief Provides shell commands for Modbus and valve configuration.
*
* This file implements a set of commands for the Zephyr shell to allow
* runtime configuration of the Modbus server (baudrate, slave ID) and the
* valve (max opening/closing times). The settings are persisted to non-volatile
* storage.
*/
#include <zephyr/shell/shell.h>
#include <stdlib.h>
#include <lib/modbus_server.h>
#include <lib/valve.h>
/**
* @brief Shell command to set the Modbus baudrate.
*
* @param sh The shell instance.
* @param argc Argument count.
* @param argv Argument values.
* @return 0 on success, -EINVAL on error.
*/
static int cmd_modbus_set_baud(const struct shell *sh, size_t argc, char **argv)
{
if (argc != 2) {
@@ -40,6 +58,14 @@ static int cmd_modbus_set_baud(const struct shell *sh, size_t argc, char **argv)
return 0;
}
/**
* @brief Shell command to set the Modbus slave ID.
*
* @param sh The shell instance.
* @param argc Argument count.
* @param argv Argument values.
* @return 0 on success, -EINVAL on error.
*/
static int cmd_modbus_set_id(const struct shell *sh, size_t argc, char **argv)
{
if (argc != 2) {
@@ -63,6 +89,14 @@ static int cmd_modbus_set_id(const struct shell *sh, size_t argc, char **argv)
return 0;
}
/**
* @brief Shell command to set the valve's maximum opening time.
*
* @param sh The shell instance.
* @param argc Argument count.
* @param argv Argument values.
* @return 0 on success, -EINVAL on error.
*/
static int cmd_valve_set_open_time(const struct shell *sh, size_t argc, char **argv)
{
if (argc != 2) {
@@ -77,6 +111,14 @@ static int cmd_valve_set_open_time(const struct shell *sh, size_t argc, char **a
return 0;
}
/**
* @brief Shell command to set the valve's maximum closing time.
*
* @param sh The shell instance.
* @param argc Argument count.
* @param argv Argument values.
* @return 0 on success, -EINVAL on error.
*/
static int cmd_valve_set_close_time(const struct shell *sh, size_t argc, char **argv)
{
if (argc != 2) {
@@ -91,6 +133,14 @@ static int cmd_valve_set_close_time(const struct shell *sh, size_t argc, char **
return 0;
}
/**
* @brief Shell command to show the current configuration.
*
* @param sh The shell instance.
* @param argc Argument count.
* @param argv Argument values.
* @return 0 on success.
*/
static int cmd_config_show(const struct shell *sh, size_t argc, char **argv)
{
shell_print(sh, "Current Modbus Configuration:");