feat(dma2d): add support for esp32s31

This commit is contained in:
Song Ruo Jing
2026-04-09 20:30:26 +08:00
parent 17f8e9c6d5
commit db8b921a13
14 changed files with 1136 additions and 197 deletions
@@ -35,10 +35,6 @@
#define DMA2D_LL_RX_CHANS_PER_INST 2
#endif
#ifdef __cplusplus
extern "C" {
#endif
// 2D-DMA interrupts
#define DMA2D_LL_RX_EVENT_MASK (0x3FFF)
#define DMA2D_LL_TX_EVENT_MASK (0x1FFF)
@@ -92,6 +88,14 @@ extern "C" {
#define DMA2D_LL_DESC_ALIGNMENT 8 // Descriptor must be aligned to 8 bytes
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
DMA2D_LL_MEM_LP_MODE_SHUT_DOWN, // power down memory during low power stage
} dma2d_ll_mem_lp_mode_t;
///////////////////////////////////// Common /////////////////////////////////////////
/**
* @brief Enable the bus clock for 2D-DMA module
@@ -141,6 +145,48 @@ static inline bool dma2d_ll_is_bus_clock_enabled(int group_id)
return HP_SYS_CLKRST.soc_clk_ctrl1.reg_dma2d_sys_clk_en;
}
/**
* @brief Force power on the DMA2D memory block, regardless of the outside PMU logic
*
* @param dev Peripheral instance address
*/
static inline void dma2d_ll_mem_force_power_on(dma2d_dev_t *dev)
{
(void)dev;
}
/**
* @brief Force the DMA2D memory block into low power mode, regardless of the outside PMU logic
*
* @param dev Peripheral instance address
*/
static inline void dma2d_ll_mem_force_low_power(dma2d_dev_t *dev)
{
(void)dev;
}
/**
* @brief Power control the DMA2D memory block by the outside PMU logic
*
* @param dev Peripheral instance address
*/
static inline void dma2d_ll_mem_power_by_pmu(dma2d_dev_t *dev)
{
(void)dev;
}
/**
* @brief Set low power mode for DMA2D memory block
*
* @param dev Peripheral instance address
* @param mode DMA2D memory low power mode in low power stage
*/
static inline void dma2d_ll_mem_set_low_power_mode(dma2d_dev_t *dev, dma2d_ll_mem_lp_mode_t mode)
{
(void)dev;
HAL_ASSERT(mode == DMA2D_LL_MEM_LP_MODE_SHUT_DOWN);
}
/**
* @brief Enable 2D-DMA module
*/