mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-19 23:45:28 +02:00
feat(lp-core): added support for using ETM events as wake-up source
This commit is contained in:
@@ -92,6 +92,24 @@ static inline void lp_aon_ll_inform_wakeup_type(bool dslp)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the flag that marks whether LP CPU is awakened by ETM
|
||||
*
|
||||
* @return Return true if lpcore is woken up by soc_etm
|
||||
*/
|
||||
static inline bool lp_aon_ll_get_lpcore_etm_wakeup_flag(void)
|
||||
{
|
||||
return REG_GET_BIT(LP_AON_LPCORE_REG, LP_AON_LPCORE_ETM_WAKEUP_FLAG);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the flag that marks whether LP CPU is awakened by soc_etm
|
||||
*/
|
||||
static inline void lp_aon_ll_clear_lpcore_etm_wakeup_flag(void)
|
||||
{
|
||||
REG_SET_BIT(LP_AON_LPCORE_REG, LP_AON_LPCORE_ETM_WAKEUP_FLAG_CLR);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -148,6 +148,15 @@ static inline void lp_core_ll_request_sleep(void)
|
||||
PMU.lp_ext.pwr1.sleep_req = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the ETM wakeup interrupt sources on the LP core
|
||||
*
|
||||
*/
|
||||
static inline void lp_core_ll_clear_etm_wakeup_status(void)
|
||||
{
|
||||
LP_SYS.sys_ctrl.lp_core_etm_wakeup_flag_clr = 1;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if SOC_LP_CORE_SUPPORTED
|
||||
|
||||
#if SOC_LP_CORE_SUPPORT_ETM
|
||||
/**
|
||||
* @brief LP-Core event types enum
|
||||
*/
|
||||
typedef enum {
|
||||
LP_CORE_EVENT_ERR_INTR, /*!< Exception triggered on LP-Core */
|
||||
LP_CORE_EVENT_START_INTR, /*!< LP-Core clock has been turned on */
|
||||
LP_CORE_EVENT_MAX, /*!< Maximum number of LP-Core events */
|
||||
} lp_core_etm_event_type_t;
|
||||
|
||||
/**
|
||||
* @brief LP-Core task types enum
|
||||
*/
|
||||
typedef enum {
|
||||
LP_CORE_TASK_WAKEUP_CPU, /*!< LP-Core wake-up task */
|
||||
LP_CORE_TASK_MAX, /*!< Maximum number of LP-Core tasks */
|
||||
} lp_core_etm_task_type_t;
|
||||
|
||||
#endif //SOC_LP_CORE_SUPPORT_ETM
|
||||
|
||||
#endif //SOC_LP_CORE_SUPPORTED
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user