General code and comment cleanup
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* One relay channel consists of 2 output relays, hence 2 GPIO pins are required for each relay channel.
|
||||
* This module provides an API to control the relay channels, specifically to drive bipolar motors.
|
||||
* It also provides APIs to control the direction of the relay channel, bipolar motors in mind.
|
||||
* To prevent mechanical strain on the motor, the component automatically manages direction changes
|
||||
* To prevent mechanical strain on the motor, the component automatically manages direction changes
|
||||
* with a configurable inertia delay, protecting it from abrupt reversals.
|
||||
* The STOP command overrides any other command and clears the pending command if any.
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ void relay_chn_destroy(void);
|
||||
|
||||
/**
|
||||
* @brief Register a channel state change listener.
|
||||
*
|
||||
*
|
||||
* @param listener A function that implements relay_chn_state_listener_t interface.
|
||||
*
|
||||
* @return
|
||||
@@ -58,7 +58,7 @@ esp_err_t relay_chn_register_listener(relay_chn_state_listener_t listener);
|
||||
|
||||
/**
|
||||
* @brief Unregister a channel state change listener.
|
||||
*
|
||||
*
|
||||
* @param listener A function that implements relay_chn_state_listener_t interface.
|
||||
*/
|
||||
void relay_chn_unregister_listener(relay_chn_state_listener_t listener);
|
||||
@@ -151,8 +151,8 @@ void relay_chn_ctl_run_reverse_all(void);
|
||||
/**
|
||||
* @brief Stops the relay channel specified by the channel ID.
|
||||
*
|
||||
* This function stops the operation of the relay channel identified by the
|
||||
* provided channel ID. It is typically used to turn off or disable the relay
|
||||
* This function stops the operation of the relay channel identified by the
|
||||
* provided channel ID. It is typically used to turn off or disable the relay
|
||||
* channel.
|
||||
*
|
||||
* @param chn_id The ID of the relay channel to stop.
|
||||
@@ -162,7 +162,7 @@ void relay_chn_stop(uint8_t chn_id);
|
||||
/**
|
||||
* @brief Commands all configured relay channels to stop.
|
||||
*
|
||||
* This function iterates through all configured relay channels and issues a command
|
||||
* This function iterates through all configured relay channels and issues a command
|
||||
* to each to stop any ongoing movement.
|
||||
*/
|
||||
void relay_chn_ctl_stop_all(void);
|
||||
@@ -181,7 +181,7 @@ void relay_chn_flip_direction(uint8_t chn_id);
|
||||
/**
|
||||
* @brief Flips the logical direction of all configured relay channels.
|
||||
*
|
||||
* This function iterates through all configured relay channels and swaps the
|
||||
* This function iterates through all configured relay channels and swaps the
|
||||
* physical GPIO pins assigned to the forward and reverse directions for each.
|
||||
*/
|
||||
void relay_chn_ctl_flip_direction_all(void);
|
||||
@@ -215,7 +215,7 @@ esp_err_t relay_chn_ctl_get_direction_all(relay_chn_direction_t *directions);
|
||||
* @brief Get the run limit for the specified channel
|
||||
*
|
||||
* @param chn_id The ID of the relay channel to query.
|
||||
*
|
||||
*
|
||||
* @return The run limit value for the relevant channel if the channel ID is valid.
|
||||
* 0 if the channel ID is invalid.
|
||||
*/
|
||||
@@ -235,8 +235,8 @@ esp_err_t relay_chn_ctl_get_run_limit_all(uint16_t *limits_sec);
|
||||
|
||||
/**
|
||||
* @brief Set the run limit for the specified channel
|
||||
*
|
||||
* Sets the time limit in seconds for the specified channel. It will not proceed
|
||||
*
|
||||
* Sets the time limit in seconds for the specified channel. It will not proceed
|
||||
* if the channel ID is invalid.
|
||||
* If the limit_sec value is lesser than the CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC,
|
||||
* the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC.
|
||||
@@ -358,8 +358,8 @@ void relay_chn_tilt_set_sensitivity(uint8_t chn_id, uint8_t sensitivity);
|
||||
* The new sensitivities are persisted in NVS if enabled.
|
||||
*
|
||||
* @param sensitivities Pointer to an array containing the desired tilt sensitivities.
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: Success
|
||||
* - ESP_ERR_INVALID_ARG: When sensitivities parameter is NULL
|
||||
*/
|
||||
@@ -459,7 +459,7 @@ void relay_chn_flip_direction(void);
|
||||
* @brief Get the direction of the relay channel.
|
||||
*
|
||||
* This function retrieves the direction configuration of a relay channel.
|
||||
*
|
||||
*
|
||||
* @return The direction of the relay channel as a value of type
|
||||
* relay_chn_direction_t.
|
||||
*/
|
||||
@@ -468,15 +468,15 @@ relay_chn_direction_t relay_chn_get_direction(void);
|
||||
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT
|
||||
/**
|
||||
* @brief Get the run limit for the channel
|
||||
*
|
||||
*
|
||||
* @return The run limit value for the channel.
|
||||
*/
|
||||
uint16_t relay_chn_get_run_limit(void);
|
||||
|
||||
/**
|
||||
* @brief Set the run limit for the channel
|
||||
*
|
||||
* Sets the time limit in seconds for the channel. It will not proceed
|
||||
*
|
||||
* Sets the time limit in seconds for the channel. It will not proceed
|
||||
* if the channel ID is invalid.
|
||||
* If the limit_sec value is lesser than the CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC,
|
||||
* the value will be set to CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* SPDX-FileCopyrightText: 2025 Kozmotronik Tech
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*
|
||||
* An adapter header to expose the appropriate API functions to the public API
|
||||
* depending on the CONFIG_RELAY_CHN_COUNT value which determines single or multi mode.
|
||||
*/
|
||||
@@ -15,7 +15,7 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @brief Register a channel state change listener.
|
||||
*
|
||||
*
|
||||
* @param listener A function that implements relay_chn_state_listener_t interface.
|
||||
*
|
||||
* @return
|
||||
@@ -28,7 +28,7 @@ extern esp_err_t relay_chn_notify_add_listener(relay_chn_state_listener_t listen
|
||||
|
||||
/**
|
||||
* @brief Unregister a channel state change listener.
|
||||
*
|
||||
*
|
||||
* @param listener A function that implements relay_chn_state_listener_t interface.
|
||||
*/
|
||||
extern void relay_chn_notify_remove_listener(relay_chn_state_listener_t listener);
|
||||
@@ -60,7 +60,7 @@ extern relay_chn_state_t relay_chn_ctl_get_state(uint8_t chn_id);
|
||||
* to hold `CONFIG_RELAY_CHN_COUNT` elements.
|
||||
*
|
||||
* @param states Pointer to an array where the states will be stored.
|
||||
*
|
||||
*
|
||||
* @return ESP_OK on success, ESP_ERR_INVALID_ARG if `states` is NULL.
|
||||
*/
|
||||
extern esp_err_t relay_chn_ctl_get_state_all(relay_chn_state_t *states);
|
||||
@@ -127,7 +127,7 @@ extern void relay_chn_ctl_flip_direction(uint8_t chn_id);
|
||||
/**
|
||||
* @brief Flips the logical direction of all configured relay channels.
|
||||
*
|
||||
* This function iterates through all configured relay channels and swaps the
|
||||
* This function iterates through all configured relay channels and swaps the
|
||||
* physical GPIO pins assigned to the forward and reverse directions for each.
|
||||
*/
|
||||
extern void relay_chn_ctl_flip_direction_all(void);
|
||||
@@ -222,7 +222,7 @@ static inline esp_err_t relay_chn_get_direction_all(relay_chn_direction_t *direc
|
||||
* @brief Get the run limit for the specified channel
|
||||
*
|
||||
* @param chn_id The ID of the relay channel to query.
|
||||
*
|
||||
*
|
||||
* @return The run limit value for the relevant channel if the channel ID is valid.
|
||||
* 0 if the channel ID is invalid.
|
||||
*/
|
||||
@@ -380,7 +380,7 @@ static inline relay_chn_direction_t relay_chn_get_direction(void)
|
||||
#if CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT
|
||||
/**
|
||||
* @brief Get the run limit for the channel
|
||||
*
|
||||
*
|
||||
* @return The run limit value for the channel.
|
||||
*/
|
||||
extern uint16_t relay_chn_ctl_get_run_limit(void);
|
||||
|
||||
Reference in New Issue
Block a user