mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 03:09:16 +08:00
[doxygen] add doxygen comment for clk.c and clk.h (#9950)
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / ESP32C3 (push) Has been cancelled
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Has been cancelled
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Has been cancelled
RT-Thread BSP Static Build Check / aarch64 (push) Has been cancelled
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Has been cancelled
RT-Thread BSP Static Build Check / hpmicro (push) Has been cancelled
RT-Thread BSP Static Build Check / i386-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / llvm-arm (push) Has been cancelled
RT-Thread BSP Static Build Check / mips (push) Has been cancelled
RT-Thread BSP Static Build Check / nordic(yml) (push) Has been cancelled
RT-Thread BSP Static Build Check / nuvoton (push) Has been cancelled
RT-Thread BSP Static Build Check / nxp_renesas (push) Has been cancelled
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv-none (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv64-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / simulator (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32l4_f0_f1 (push) Has been cancelled
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / ESP32C3 (push) Has been cancelled
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Has been cancelled
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Has been cancelled
RT-Thread BSP Static Build Check / aarch64 (push) Has been cancelled
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Has been cancelled
RT-Thread BSP Static Build Check / hpmicro (push) Has been cancelled
RT-Thread BSP Static Build Check / i386-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / llvm-arm (push) Has been cancelled
RT-Thread BSP Static Build Check / mips (push) Has been cancelled
RT-Thread BSP Static Build Check / nordic(yml) (push) Has been cancelled
RT-Thread BSP Static Build Check / nuvoton (push) Has been cancelled
RT-Thread BSP Static Build Check / nxp_renesas (push) Has been cancelled
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv-none (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv64-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / simulator (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32l4_f0_f1 (push) Has been cancelled
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
Accroding to #9947 and #9424, adding doxygen comment for function in .c files and data structure, macro in .h file is a solution.For this pr, I encountered problem following situations. - rt_clk_unprepare function return value type is different from rt_clk_ops so I change type of rt_clk_unprepare and its dependencies. - clk_get function may be similar as rt_clk_unprepare but I'm not sure so not modify. - clk_release implements may be incomplete, so I just marked in comment. Signed-off-by: 1078249029 <1078249029@qq.com>
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2025 RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2022-11-26 GuEe-GUI first version
|
||||
* 2025-01-24 wumingzi add doxygen comment
|
||||
*/
|
||||
|
||||
#ifndef __CLK_H__
|
||||
@@ -16,29 +17,40 @@
|
||||
#include <ref.h>
|
||||
#include <drivers/ofw.h>
|
||||
|
||||
/**
|
||||
* @addtogroup Drivers RTTHREAD Driver
|
||||
* @defgroup clk clk
|
||||
* @brief clk driver api
|
||||
* @ingroup Drivers
|
||||
* @addtogroup clk
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define RT_CLK_NODE_OBJ_NAME "CLKNP"
|
||||
|
||||
struct rt_clk_ops;
|
||||
struct rt_reset_control_node;
|
||||
|
||||
/**
|
||||
* @brief Clk node, it is a pat of clk source or controller
|
||||
* @note Defined as the array like this if the CLK have multi out clocks:
|
||||
* @code{.c}
|
||||
* struct XYZ_single_clk
|
||||
* {
|
||||
* struct rt_clk_node parent;
|
||||
* ...
|
||||
* };
|
||||
*
|
||||
* struct XYZ_multi_clk
|
||||
* {
|
||||
* struct rt_clk_node parent[N];
|
||||
* ...
|
||||
* };
|
||||
* @endcode
|
||||
* We assume the 'N' is the max value of element in 'clock-indices' if OFW.
|
||||
*/
|
||||
struct rt_clk_node
|
||||
{
|
||||
/*
|
||||
* Defined as the array like this if if the CLK have multi out clocks:
|
||||
*
|
||||
* struct XYZ_single_clk
|
||||
* {
|
||||
* struct rt_clk_node parent;
|
||||
* ...
|
||||
* };
|
||||
*
|
||||
* struct XYZ_multi_clk
|
||||
* {
|
||||
* struct rt_clk_node parent[N];
|
||||
* ...
|
||||
* };
|
||||
* We assume the 'N' is the max value of element in 'clock-indices' if OFW.
|
||||
*/
|
||||
struct rt_object rt_parent;
|
||||
|
||||
rt_list_t list;
|
||||
@@ -62,6 +74,9 @@ struct rt_clk_node
|
||||
rt_size_t multi_clk;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Constant rate clk
|
||||
*/
|
||||
struct rt_clk_fixed_rate
|
||||
{
|
||||
struct rt_clk_node clk;
|
||||
@@ -70,6 +85,9 @@ struct rt_clk_fixed_rate
|
||||
rt_ubase_t fixed_accuracy;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Clk object, it can be clk source or controller
|
||||
*/
|
||||
struct rt_clk
|
||||
{
|
||||
struct rt_clk_node *clk_np;
|
||||
@@ -85,6 +103,9 @@ struct rt_clk
|
||||
void *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Clk array
|
||||
*/
|
||||
struct rt_clk_array
|
||||
{
|
||||
rt_size_t count;
|
||||
@@ -118,6 +139,9 @@ struct rt_clk_notifier;
|
||||
typedef rt_err_t (*rt_clk_notifier_callback)(struct rt_clk_notifier *notifier,
|
||||
rt_ubase_t msg, rt_ubase_t old_rate, rt_ubase_t new_rate);
|
||||
|
||||
/**
|
||||
* @brief Clock notifier, it containers of clock list and callback function
|
||||
*/
|
||||
struct rt_clk_notifier
|
||||
{
|
||||
rt_list_t list;
|
||||
@@ -192,4 +216,6 @@ rt_inline rt_ssize_t rt_ofw_count_of_clk(struct rt_ofw_node *clk_ofw_np)
|
||||
}
|
||||
#endif /* RT_USING_OFW */
|
||||
|
||||
#endif /* __CLK_H__ */
|
||||
/*! @}*/
|
||||
|
||||
#endif /* __CLK_H__ */
|
||||
Reference in New Issue
Block a user