feat(phy): add check for required clock bits during phy enable

This commit is contained in:
liuning
2026-02-12 09:38:41 +08:00
committed by muhaidong
parent 1e1d7e687b
commit 33c463a243
20 changed files with 199 additions and 5 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -62,6 +62,18 @@ void modem_clock_module_enable(periph_module_t module);
*/
void modem_clock_module_disable(periph_module_t module);
/**
* @brief Gets the clock bitmask associated with the specified modem module.
*
* This function returns the complete set of clock-enable bits that correspond
* to @p module.
*
* @param module Target shared peripheral clock module.
*
* @return Bitmask of clock-enable bits for the given module.
*/
uint32_t modem_clock_module_bits_get(periph_module_t module);
/**
* @brief Reset the mac of modem module
*
@@ -6,6 +6,7 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "sdkconfig.h"
#include "soc/periph_defs.h"
@@ -167,6 +168,13 @@ void phy_module_enable(void);
*/
void phy_module_disable(void);
/**
* @brief Checks whether phy module has all bits in @p mask set.
*
* @return true if all bits in @p mask are set; false otherwise.
*/
bool phy_module_has_clock_bits(uint32_t mask);
#undef __PERIPH_CTRL_DEPRECATE_ATTR
#ifdef __cplusplus