refactor(periph_ctrl): remove orphaned clk_gate_ll.h

and deprecate the legacy periph_module_xxx functions for new targets
This commit is contained in:
morris
2024-03-28 10:27:57 +08:00
parent f29351b99a
commit 8e64a59fac
13 changed files with 49 additions and 209 deletions
@@ -1,11 +1,12 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "sdkconfig.h"
#include "soc/periph_defs.h"
#ifdef __cplusplus
@@ -68,6 +69,24 @@ void periph_rcc_exit(void);
/*************************************************************************************************************
* @note The following APIs are no longer supported since ESP32P4, please use the RCC lock macros instead.
*************************************************************************************************************/
// allow the following targets to use the legacy periph_module_xyz APIs, to maintain backward compatibility,
// because periph_module_xyz is also used outside of the ESP-IDF
#if defined(CONFIG_IDF_TARGET_ESP32) || \
defined(CONFIG_IDF_TARGET_ESP32S2) || \
defined(CONFIG_IDF_TARGET_ESP32S3) || \
defined(CONFIG_IDF_TARGET_ESP32C2) || \
defined(CONFIG_IDF_TARGET_ESP32C3) || \
defined(CONFIG_IDF_TARGET_ESP32C6) || \
defined(CONFIG_IDF_TARGET_ESP32H2)
#define __PERIPH_CTRL_ALLOW_LEGACY_API
#endif
#ifdef __PERIPH_CTRL_ALLOW_LEGACY_API
#define __PERIPH_CTRL_DEPRECATE_ATTR
#else
#define __PERIPH_CTRL_DEPRECATE_ATTR __attribute__((deprecated("This function is not functional on "CONFIG_IDF_TARGET)))
#endif
/**
* @brief Enable peripheral module by un-gating the clock and de-asserting the reset signal.
*
@@ -77,6 +96,7 @@ void periph_rcc_exit(void);
* @c periph_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
__PERIPH_CTRL_DEPRECATE_ATTR
void periph_module_enable(periph_module_t periph);
/**
@@ -88,6 +108,7 @@ void periph_module_enable(periph_module_t periph);
* @c periph_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
__PERIPH_CTRL_DEPRECATE_ATTR
void periph_module_disable(periph_module_t periph);
/**
@@ -97,6 +118,7 @@ void periph_module_disable(periph_module_t periph);
*
* @note Calling this function does not enable or disable the clock for the module.
*/
__PERIPH_CTRL_DEPRECATE_ATTR
void periph_module_reset(periph_module_t periph);
/**
@@ -131,6 +153,8 @@ void wifi_module_enable(void);
*/
void wifi_module_disable(void);
#undef __PERIPH_CTRL_DEPRECATE_ATTR
#ifdef __cplusplus
}
#endif