pm: cleanup Doxygen groups and inclusion

- Add a new `subsys_pm` group, part of `subsys`
- Improve group naming
- Include conditional code using __DOXYGEN__, it allows to have better
  control of inclusion.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-10-29 11:10:49 +02:00 committed by Carles Cufí
commit 4daf285c8c
6 changed files with 31 additions and 26 deletions

View file

@ -512,14 +512,16 @@ API Reference
Power Management Hook Interface Power Management Hook Interface
=============================== ===============================
.. doxygengroup:: power_management_hook_interface .. doxygengroup:: subsys_pm_sys_hooks
System Power Management APIs System Power Management APIs
============================ ============================
.. doxygengroup:: system_power_management_api .. doxygengroup:: subsys_pm_sys
Device Power Management APIs Device Power Management APIs
============================ ============================
.. doxygengroup:: device_power_management_api .. doxygengroup:: subsys_pm_device
.. doxygengroup:: subsys_pm_device_runtime

View file

@ -16,9 +16,8 @@ extern "C" {
/** /**
* @brief Device Power Management API * @brief Device Power Management API
* * @defgroup subsys_pm_device Device
* @defgroup device_power_management_api Device Power Management API * @ingroup subsys_pm
* @ingroup power_management_api
* @{ * @{
*/ */
@ -90,7 +89,7 @@ typedef int (*pm_device_action_cb_t)(const struct device *dev,
* @brief Device PM info * @brief Device PM info
*/ */
struct pm_device { struct pm_device {
#ifdef CONFIG_PM_DEVICE_RUNTIME #if defined(CONFIG_PM_DEVICE_RUNTIME) || defined(__DOXYGEN__)
/** Pointer to the device */ /** Pointer to the device */
const struct device *dev; const struct device *dev;
/** Lock to synchronize the get/put operations */ /** Lock to synchronize the get/put operations */
@ -183,7 +182,7 @@ int pm_device_state_set(const struct device *dev,
int pm_device_state_get(const struct device *dev, int pm_device_state_get(const struct device *dev,
enum pm_device_state *state); enum pm_device_state *state);
#ifdef CONFIG_PM_DEVICE #if defined(CONFIG_PM_DEVICE) || defined(__DOXYGEN__)
/** /**
* @brief Indicate that the device is in the middle of a transaction * @brief Indicate that the device is in the middle of a transaction
* *
@ -231,7 +230,7 @@ static inline void pm_device_busy_set(const struct device *dev) {}
static inline void pm_device_busy_clear(const struct device *dev) {} static inline void pm_device_busy_clear(const struct device *dev) {}
static inline bool pm_device_is_any_busy(void) { return false; } static inline bool pm_device_is_any_busy(void) { return false; }
static inline bool pm_device_is_busy(const struct device *dev) { return false; } static inline bool pm_device_is_busy(const struct device *dev) { return false; }
#endif #endif /* CONFIG_PM_DEVICE */
__deprecated static inline void device_busy_set(const struct device *dev) __deprecated static inline void device_busy_set(const struct device *dev)
{ {

View file

@ -15,8 +15,9 @@ extern "C" {
#endif #endif
/** /**
* @defgroup runtime_power_management_api Device Runtime Power Management API * @brief Device Runtime Power Management API
* @ingroup power_management_api * @defgroup subsys_pm_device_runtime Device Runtime
* @ingroup subsys_pm
* @{ * @{
*/ */

View file

@ -18,16 +18,17 @@ extern "C" {
#endif #endif
/** /**
* @defgroup power_management_api Power Management * @brief System and device power management
* @defgroup subsys_pm Power Management (PM)
* @ingroup subsys
* @{ * @{
* @} * @}
*/ */
/** /**
* @brief System Power Management API * @brief System Power Management API
* * @defgroup subsys_pm_sys System
* @defgroup system_power_management_api System Power Management API * @ingroup subsys_pm
* @ingroup power_management_api
* @{ * @{
*/ */
@ -63,7 +64,7 @@ struct pm_notifier {
void (*state_exit)(enum pm_state state); void (*state_exit)(enum pm_state state);
}; };
#ifdef CONFIG_PM #if defined(CONFIG_PM) || defined(__DOXYGEN__)
/** /**
* @brief Force usage of given power state. * @brief Force usage of given power state.
* *
@ -105,10 +106,9 @@ int pm_notifier_unregister(struct pm_notifier *notifier);
*/ */
/** /**
* @brief System Power Management Constraint API * @brief System Power Management Constraints API
* * @defgroup subsys_pm_sys_constraint Constraints
* @defgroup system_power_management_constraint_api Constraint API * @ingroup subsys_pm_sys
* @ingroup power_management_api
* @{ * @{
*/ */
@ -155,10 +155,9 @@ bool pm_constraint_get(enum pm_state state);
*/ */
/** /**
* @brief Power Management Hooks * @brief System Power Management Hooks
* * @defgroup subsys_pm_sys_hooks Hooks
* @defgroup power_management_hook_interface Power Management Hooks * @ingroup subsys_pm_sys
* @ingroup power_management_api
* @{ * @{
*/ */

View file

@ -13,6 +13,8 @@
extern "C" { extern "C" {
#endif #endif
/** @cond INTERNAL_HIDDEN */
/** /**
* @brief Function to get the next PM state * @brief Function to get the next PM state
* *
@ -26,6 +28,7 @@ extern "C" {
*/ */
struct pm_state_info pm_policy_next_state(int32_t ticks); struct pm_state_info pm_policy_next_state(int32_t ticks);
/** @endcond */
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -15,8 +15,9 @@ extern "C" {
#endif #endif
/** /**
* @defgroup pm_states Power Management States * @brief System Power Management States
* @ingroup power_management_api * @defgroup subsys_pm_states States
* @ingroup subsys_pm
* @{ * @{
*/ */