mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
refactor: remove gdma_trigger_peripheral_t
This commit is contained in:
@@ -29,7 +29,6 @@ extern "C" {
|
||||
|
||||
// for M2M mode, hardware will automatically assign peri_sel ID depends on the channel number (ch0: 10, ch1: 11, ch2: 12)
|
||||
#define AHB_DMA_LL_M2M_FREE_PERIPH_ID_MASK (0x1C00)
|
||||
#define AHB_DMA_LL_INVALID_PERIPH_ID (0x3F)
|
||||
|
||||
#define GDMA_LL_EVENT_TX_FIFO_UDF (1<<5)
|
||||
#define GDMA_LL_EVENT_TX_FIFO_OVF (1<<4)
|
||||
@@ -388,18 +387,27 @@ static inline void ahb_dma_ll_rx_set_priority(ahb_dma_dev_t *dev, uint32_t chann
|
||||
/**
|
||||
* @brief Connect DMA RX channel to a given peripheral
|
||||
*/
|
||||
static inline void ahb_dma_ll_rx_connect_to_periph(ahb_dma_dev_t *dev, uint32_t channel, gdma_trigger_peripheral_t periph, int periph_id)
|
||||
static inline void ahb_dma_ll_rx_connect_to_periph(ahb_dma_dev_t *dev, uint32_t channel, int periph_id)
|
||||
{
|
||||
dev->channel[channel].in.in_peri_sel.peri_in_sel_chn = periph_id;
|
||||
dev->channel[channel].in.in_conf0.mem_trans_en_chn = (periph == GDMA_TRIG_PERIPH_M2M);
|
||||
dev->channel[channel].in.in_conf0.mem_trans_en_chn = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect DMA RX channel from peripheral
|
||||
* @brief Connect DMA RX channel to memory (M2M mode)
|
||||
*/
|
||||
static inline void ahb_dma_ll_rx_disconnect_from_periph(ahb_dma_dev_t *dev, uint32_t channel)
|
||||
static inline void ahb_dma_ll_rx_connect_to_mem(ahb_dma_dev_t *dev, uint32_t channel, int dummy_id)
|
||||
{
|
||||
dev->channel[channel].in.in_peri_sel.peri_in_sel_chn = AHB_DMA_LL_INVALID_PERIPH_ID;
|
||||
dev->channel[channel].in.in_peri_sel.peri_in_sel_chn = dummy_id;
|
||||
dev->channel[channel].in.in_conf0.mem_trans_en_chn = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect DMA RX channel from all peripherals
|
||||
*/
|
||||
static inline void ahb_dma_ll_rx_disconnect_all(ahb_dma_dev_t *dev, uint32_t channel)
|
||||
{
|
||||
dev->channel[channel].in.in_peri_sel.peri_in_sel_chn = 0x3F;
|
||||
dev->channel[channel].in.in_conf0.mem_trans_en_chn = false;
|
||||
}
|
||||
|
||||
@@ -656,18 +664,25 @@ static inline void ahb_dma_ll_tx_set_priority(ahb_dma_dev_t *dev, uint32_t chann
|
||||
/**
|
||||
* @brief Connect DMA TX channel to a given peripheral
|
||||
*/
|
||||
static inline void ahb_dma_ll_tx_connect_to_periph(ahb_dma_dev_t *dev, uint32_t channel, gdma_trigger_peripheral_t periph, int periph_id)
|
||||
static inline void ahb_dma_ll_tx_connect_to_periph(ahb_dma_dev_t *dev, uint32_t channel, int periph_id)
|
||||
{
|
||||
(void)periph;
|
||||
dev->channel[channel].out.out_peri_sel.peri_out_sel_chn = periph_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect DMA TX channel from peripheral
|
||||
* @brief Connect DMA TX channel to memory (M2M mode)
|
||||
*/
|
||||
static inline void ahb_dma_ll_tx_disconnect_from_periph(ahb_dma_dev_t *dev, uint32_t channel)
|
||||
static inline void ahb_dma_ll_tx_connect_to_mem(ahb_dma_dev_t *dev, uint32_t channel, int dummy_id)
|
||||
{
|
||||
dev->channel[channel].out.out_peri_sel.peri_out_sel_chn = AHB_DMA_LL_INVALID_PERIPH_ID;
|
||||
dev->channel[channel].out.out_peri_sel.peri_out_sel_chn = dummy_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect DMA TX channel from all peripherals
|
||||
*/
|
||||
static inline void ahb_dma_ll_tx_disconnect_all(ahb_dma_dev_t *dev, uint32_t channel)
|
||||
{
|
||||
dev->channel[channel].out.out_peri_sel.peri_out_sel_chn = 0x3F;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user