kopia lustrzana https://github.com/espressif/esp-idf
light sleep: add wifi mac sleep support for esp32s3
rodzic
366d0a724a
commit
d73a09cd8b
|
@ -81,7 +81,7 @@ menu "PHY"
|
|||
|
||||
config ESP32_PHY_MAC_BB_PD
|
||||
bool "Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled"
|
||||
depends on (IDF_TARGET_ESP32C3 && FREERTOS_USE_TICKLESS_IDLE)
|
||||
depends on ((IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) && FREERTOS_USE_TICKLESS_IDLE)
|
||||
default n
|
||||
help
|
||||
If enabled, the MAC and baseband of Wi-Fi and Bluetooth will be powered
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void ets_apb_backup_init_lock_func(void(* _apb_backup_lock)(void), void(* _apb_backup_unlock)(void));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -3,6 +3,7 @@ set(srcs "highint_hdl.S"
|
|||
"reset_reason.c"
|
||||
"system_internal.c"
|
||||
"cache_err_int.c"
|
||||
"apb_backup_dma.c"
|
||||
"../../arch/xtensa/panic_arch.c"
|
||||
"../../arch/xtensa/panic_handler_asm.S"
|
||||
"../../arch/xtensa/expression_with_stack.c"
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "soc/soc_caps.h"
|
||||
#include "esp_attr.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/portmacro.h"
|
||||
#include "esp32s3/rom/apb_backup_dma.h"
|
||||
|
||||
static portMUX_TYPE s_apb_backup_dma_mutex = portMUX_INITIALIZER_UNLOCKED;
|
||||
|
||||
static void IRAM_ATTR apb_backup_dma_lock(void)
|
||||
{
|
||||
if (xPortInIsrContext()) {
|
||||
portENTER_CRITICAL_ISR(&s_apb_backup_dma_mutex);
|
||||
} else {
|
||||
portENTER_CRITICAL(&s_apb_backup_dma_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
static void IRAM_ATTR apb_backup_dma_unlock(void)
|
||||
{
|
||||
if (xPortInIsrContext()) {
|
||||
portEXIT_CRITICAL_ISR(&s_apb_backup_dma_mutex);
|
||||
} else {
|
||||
portEXIT_CRITICAL(&s_apb_backup_dma_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
void esp_apb_backup_dma_lock_init(void)
|
||||
{
|
||||
ets_apb_backup_init_lock_func(apb_backup_dma_lock, apb_backup_dma_unlock);
|
||||
}
|
|
@ -39,6 +39,8 @@
|
|||
#define SOC_ADC_SUPPORT_RTC_CTRL (1)
|
||||
#define SOC_ADC_ARBITER_SUPPORTED (1)
|
||||
|
||||
/*-------------------------- APB BACKUP DMA CAPS -------------------------------*/
|
||||
#define SOC_APB_BACKUP_DMA (1)
|
||||
|
||||
/*-------------------------- BROWNOUT CAPS -----------------------------------*/
|
||||
#include "brownout_caps.h"
|
||||
|
|
|
@ -169,9 +169,9 @@ extern "C" {
|
|||
#define SYSTEM_WIFI_CLK_EN_REG SYSCON_WIFI_CLK_EN_REG
|
||||
/* SYSTEM_WIFI_CLK_EN : R/W ;bitpos:[31:0] ;default: 32'hfffce030 ; */
|
||||
/*description: */
|
||||
#define SYSTEM_WIFI_CLK_EN 0xFFFFFFFF
|
||||
#define SYSTEM_WIFI_CLK_EN 0x00FB9FCF
|
||||
#define SYSTEM_WIFI_CLK_EN_M ((SYSTEM_WIFI_CLK_EN_V) << (SYSTEM_WIFI_CLK_EN_S))
|
||||
#define SYSTEM_WIFI_CLK_EN_V 0xFFFFFFFF
|
||||
#define SYSTEM_WIFI_CLK_EN_V 0x00FB9FCF
|
||||
#define SYSTEM_WIFI_CLK_EN_S 0
|
||||
|
||||
/* Mask for all Wifi clock bits, 6 */
|
||||
|
|
Ładowanie…
Reference in New Issue