esp-idf/components/driver/include/esp_private/periph_ctrl.h
morris 16677b0d3c global: make periph enable/disable APIs private
peripheral enable/disable usually should be managed by driver itself,
so make it as espressif private APIs, not recommended for user to use it
in application code.
However, if user want to re-write the driver or ports to other platform,
this is still possible by including the header in this way:
"esp_private/peripheral_ctrl.h"
2021-11-08 10:37:47 +08:00

80 lines
2.2 KiB
C

/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "soc/periph_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enable peripheral module by un-gating the clock and de-asserting the reset signal.
*
* @param[in] periph Peripheral module
*
* @note If @c periph_module_enable() is called a number of times,
* @c periph_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void periph_module_enable(periph_module_t periph);
/**
* @brief Disable peripheral module by gating the clock and asserting the reset signal.
*
* @param[in] periph Peripheral module
*
* @note If @c periph_module_enable() is called a number of times,
* @c periph_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void periph_module_disable(periph_module_t periph);
/**
* @brief Reset peripheral module by asserting and de-asserting the reset signal.
*
* @param[in] periph Peripheral module
*
* @note Calling this function does not enable or disable the clock for the module.
*/
void periph_module_reset(periph_module_t periph);
/**
* @brief Enable Wi-Fi and BT common module
*
* @note If @c wifi_bt_common_module_enable() is called a number of times,
* @c wifi_bt_common_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void wifi_bt_common_module_enable(void);
/**
* @brief Disable Wi-Fi and BT common module
*
* @note If @c wifi_bt_common_module_enable() is called a number of times,
* @c wifi_bt_common_module_disable() has to be called the same number of times,
* in order to put the peripheral into disabled state.
*/
void wifi_bt_common_module_disable(void);
/**
* @brief Enable Wi-Fi module
*
* @note Calling this function will only enable Wi-Fi module.
*/
void wifi_module_enable(void);
/**
* @brief Disable Wi-Fi module
*
* @note Calling this function will only disable Wi-Fi module.
*/
void wifi_module_disable(void);
#ifdef __cplusplus
}
#endif