feat(ppa): add sleep retention support for DMA2D and PPA

This commit is contained in:
Song Ruo Jing
2026-07-03 20:36:32 +08:00
parent 69d6deb7e6
commit 9516083cb1
20 changed files with 569 additions and 118 deletions
@@ -79,7 +79,7 @@ extern "C" {
* @param group_id Group ID
* @param enable True to enable; false to disable
*/
static inline void dma2d_ll_enable_bus_clock(int group_id, bool enable)
static inline void _dma2d_ll_enable_bus_clock(int group_id, bool enable)
{
(void)group_id;
HP_SYS_CLKRST.soc_clk_ctrl1.reg_dma2d_sys_clk_en = enable;
@@ -87,14 +87,14 @@ static inline void dma2d_ll_enable_bus_clock(int group_id, bool enable)
/// use a macro to wrap the function, force the caller to use it in a critical section
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
#define dma2d_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; dma2d_ll_enable_bus_clock(__VA_ARGS__)
#define dma2d_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; _dma2d_ll_enable_bus_clock(__VA_ARGS__)
/**
* @brief Reset the 2D-DMA module
*
* @param group_id Group ID
*/
static inline void dma2d_ll_reset_register(int group_id)
static inline void _dma2d_ll_reset_register(int group_id)
{
(void)group_id;
HP_SYS_CLKRST.hp_rst_en0.reg_rst_en_dma2d = 1;
@@ -103,7 +103,7 @@ static inline void dma2d_ll_reset_register(int group_id)
/// use a macro to wrap the function, force the caller to use it in a critical section
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
#define dma2d_ll_reset_register(...) (void)__DECLARE_RCC_ATOMIC_ENV; dma2d_ll_reset_register(__VA_ARGS__)
#define dma2d_ll_reset_register(...) (void)__DECLARE_RCC_ATOMIC_ENV; _dma2d_ll_reset_register(__VA_ARGS__)
/**
* @brief Check if the bus clock is enabled for the DMA module
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -53,19 +53,19 @@ typedef enum {
*
* @param enable Set true to enable, false to disable
*/
static inline void ppa_ll_enable_bus_clock(bool enable)
static inline void _ppa_ll_enable_bus_clock(bool enable)
{
HP_SYS_CLKRST.soc_clk_ctrl1.reg_ppa_sys_clk_en = enable;
}
/// use a macro to wrap the function, force the caller to use it in a critical section
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
#define ppa_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; ppa_ll_enable_bus_clock(__VA_ARGS__)
#define ppa_ll_enable_bus_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; _ppa_ll_enable_bus_clock(__VA_ARGS__)
/**
* @brief Reset the PPA module
*/
static inline void ppa_ll_reset_register(void)
static inline void _ppa_ll_reset_register(void)
{
HP_SYS_CLKRST.hp_rst_en1.reg_rst_en_ppa = 1;
HP_SYS_CLKRST.hp_rst_en1.reg_rst_en_ppa = 0;
@@ -73,7 +73,7 @@ static inline void ppa_ll_reset_register(void)
/// use a macro to wrap the function, force the caller to use it in a critical section
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
#define ppa_ll_reset_register(...) (void)__DECLARE_RCC_ATOMIC_ENV; ppa_ll_reset_register(__VA_ARGS__)
#define ppa_ll_reset_register(...) (void)__DECLARE_RCC_ATOMIC_ENV; _ppa_ll_reset_register(__VA_ARGS__)
///////////////////////// Scaling, Rotating, Mirroring (SRM) //////////////////////////////
/**