mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-23 17:24:44 +00:00
feat(esp_hw_support): enable auto clock gating for multi peripherals
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "soc/hp_system_struct.h"
|
||||
#include "soc/hp_sys_clkrst_struct.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -26,6 +27,18 @@ static inline void l2mem_ll_enable_ahb_burst_buffer(bool en_read, bool en_write)
|
||||
HP_SYSTEM.l2_mem_ahb_buffer_ctrl.l2_mem_ahb_wrbuffer_en = en_write;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Force enable the clock of L2 memory.
|
||||
* @param enable True to force enable L2 memory clock.
|
||||
*/
|
||||
static inline void _l2mem_ll_clock_force_en(bool enable)
|
||||
{
|
||||
HP_SYS_CLKRST.clk_force_on_ctrl0.reg_l2mem_mem_clk_force_on = enable;
|
||||
}
|
||||
|
||||
// HP_SYS_CLKRST.soc_clk_ctrl2 are shared registers, so this function must be used in an atomic way
|
||||
#define l2mem_ll_clock_force_en(...) (void)__DECLARE_RCC_ATOMIC_ENV; _l2mem_ll_clock_force_en(__VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user