refactor(gdma): add reset and clock control in LL driver

This commit is contained in:
morris
2023-08-24 16:09:24 +08:00
parent 200eb866dc
commit b962fdee89
8 changed files with 183 additions and 22 deletions

View File

@@ -12,6 +12,7 @@
#include "soc/gdma_struct.h"
#include "soc/gdma_reg.h"
#include "soc/soc_etm_source.h"
#include "soc/pcr_struct.h"
#ifdef __cplusplus
extern "C" {
@@ -91,6 +92,26 @@ extern "C" {
}}}[group][chan][task]
///////////////////////////////////// Common /////////////////////////////////////////
/**
* @brief Enable the bus clock for the DMA module
*/
static inline void gdma_ll_enable_bus_clock(int group_id, bool enable)
{
(void)group_id;
PCR.gdma_conf.gdma_clk_en = enable;
}
/**
* @brief Reset the DMA module
*/
static inline void gdma_ll_reset_register(int group_id)
{
(void)group_id;
PCR.gdma_conf.gdma_rst_en = 1;
PCR.gdma_conf.gdma_rst_en = 0;
}
/**
* @brief Force enable register clock
*/