mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
refactor: remove gdma_trigger_peripheral_t
This commit is contained in:
@@ -24,7 +24,6 @@ extern "C" {
|
||||
|
||||
// any "dummy" peripheral ID can be used for M2M mode
|
||||
#define AHB_DMA_LL_M2M_FREE_PERIPH_ID_MASK (0xFAC2)
|
||||
#define AHB_DMA_LL_INVALID_PERIPH_ID (0x3F)
|
||||
|
||||
///////////////////////////////////// Common /////////////////////////////////////////
|
||||
/**
|
||||
@@ -325,16 +324,25 @@ 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 = 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;
|
||||
@@ -606,16 +614,23 @@ 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 = 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;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ extern "C" {
|
||||
|
||||
// any "dummy" peripheral ID can be used for M2M mode
|
||||
#define AXI_DMA_LL_M2M_FREE_PERIPH_ID_MASK (0xFFC0)
|
||||
#define AXI_DMA_LL_INVALID_PERIPH_ID (0x3F)
|
||||
|
||||
///////////////////////////////////// Common /////////////////////////////////////////
|
||||
/**
|
||||
@@ -267,16 +266,25 @@ static inline void axi_dma_ll_rx_set_priority(axi_dma_dev_t *dev, uint32_t chann
|
||||
/**
|
||||
* @brief Connect DMA RX channel to a given peripheral
|
||||
*/
|
||||
static inline void axi_dma_ll_rx_connect_to_periph(axi_dma_dev_t *dev, uint32_t channel, gdma_trigger_peripheral_t periph, int periph_id)
|
||||
static inline void axi_dma_ll_rx_connect_to_periph(axi_dma_dev_t *dev, uint32_t channel, int periph_id)
|
||||
{
|
||||
dev->in[channel].conf.in_peri_sel.peri_in_sel_chn = periph_id;
|
||||
dev->in[channel].conf.in_conf0.mem_trans_en_chn = (periph == GDMA_TRIG_PERIPH_M2M);
|
||||
dev->in[channel].conf.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 axi_dma_ll_rx_disconnect_from_periph(axi_dma_dev_t *dev, uint32_t channel)
|
||||
static inline void axi_dma_ll_rx_connect_to_mem(axi_dma_dev_t *dev, uint32_t channel, int dummy_id)
|
||||
{
|
||||
dev->in[channel].conf.in_peri_sel.peri_in_sel_chn = dummy_id;
|
||||
dev->in[channel].conf.in_conf0.mem_trans_en_chn = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect DMA RX channel from all peripherals
|
||||
*/
|
||||
static inline void axi_dma_ll_rx_disconnect_all(axi_dma_dev_t *dev, uint32_t channel)
|
||||
{
|
||||
dev->in[channel].conf.in_peri_sel.peri_in_sel_chn = 0x3F;
|
||||
dev->in[channel].conf.in_conf0.mem_trans_en_chn = false;
|
||||
@@ -502,16 +510,23 @@ static inline void axi_dma_ll_tx_set_priority(axi_dma_dev_t *dev, uint32_t chann
|
||||
/**
|
||||
* @brief Connect DMA TX channel to a given peripheral
|
||||
*/
|
||||
static inline void axi_dma_ll_tx_connect_to_periph(axi_dma_dev_t *dev, uint32_t channel, gdma_trigger_peripheral_t periph, int periph_id)
|
||||
static inline void axi_dma_ll_tx_connect_to_periph(axi_dma_dev_t *dev, uint32_t channel, int periph_id)
|
||||
{
|
||||
(void)periph;
|
||||
dev->out[channel].conf.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 axi_dma_ll_tx_disconnect_from_periph(axi_dma_dev_t *dev, uint32_t channel)
|
||||
static inline void axi_dma_ll_tx_connect_to_mem(axi_dma_dev_t *dev, uint32_t channel, int dummy_id)
|
||||
{
|
||||
dev->out[channel].conf.out_peri_sel.peri_out_sel_chn = dummy_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disconnect DMA TX channel from all peripherals
|
||||
*/
|
||||
static inline void axi_dma_ll_tx_disconnect_all(axi_dma_dev_t *dev, uint32_t channel)
|
||||
{
|
||||
dev->out[channel].conf.out_peri_sel.peri_out_sel_chn = 0x3F;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user