27#define CHANNEL_SUPPORT_LOOP(ch) (((ch) == DMA_CH0) || ((ch) == DMA_CH1))
71 if (desc_base & 0xFF) {
305 DMA_IEN &= ~DMA_IEN_CHxDONE(ch);
405 cfg &= ~DMA_DESC_CH_CFG_DEST_SIZE_MASK;
421 cfg &= ~DMA_DESC_CH_CFG_DEST_INC_MASK;
437 cfg &= ~DMA_DESC_CH_CFG_SRC_SIZE_MASK;
453 cfg &= ~DMA_DESC_CH_CFG_SRC_INC_MASK;
469 cfg &= ~DMA_DESC_CH_CFG_R_POWER_MASK;
506 cfg &= ~DMA_DESC_CH_CFG_N_MINUS_1_MASK;
553 return start + n_minus_1;
555 return start + (n_minus_1 << 1);
557 return start + (n_minus_1 << 2);
622 cfg &= ~DMA_DESC_CH_CFG_CYCLE_CTRL_MASK;
#define DMA_CHENS_CHxSENS(i)
#define DMA_DESC_CHx_CFG(base, x)
#define DMA_DESC_CH_CFG_DEST_INC(v)
#define DMA_CHUSEBURSTC_CHxSUSEBURSTC(i)
#define DMA_DESC_CH_CFG_SRC_INC_SHIFT
#define DMA_CHPRIS_CHxSPRIC(i)
#define DMA_ERRORC_ERRORC
#define DMA_IFS_CHxDONE(x)
#define DMA_CHENC_CHxSENC(i)
#define DMA_DESC_CH_CFG_N_MINUS_1(v)
#define DMA_CHREQMASKC_CHxSREQMASKC(i)
#define DMA_DESC_CH_CFG_SRC_INC_MASK
#define DMA_CHPRIC_CHxSPRIC(i)
#define DMA_CHREQSTATUS_CHxSREQSTATUS(i)
#define DMA_IEN_CHxDONE(x)
#define DMA_DESC_CH_CFG_NEXT_USEBURST
#define DMA_CHUSEBURSTS_CHxSUSEBURSTS(i)
#define DMA_DESC_CH_CFG_SRC_INC(v)
#define DMA_IF_CHxDONE(x)
#define DMA_DESC_CH_CFG_N_MINUS_1_SHIFT
#define DMA_DESC_CH_CFG_SRC_SIZE(v)
#define DMA_DESC_CHx_USER_DATA(base, x)
#define DMA_CHSWREQ_CHxSWREQ(i)
#define DMA_CONFIG_CHPROT
#define DMA_DESC_CHx_DEST_DATA_END_PTR(base, x)
#define DMA_CHWAITSTATUS_CHxWAITSTATUS(i)
#define DMA_LOOP_WIDTH(v)
#define DMA_CHREQMASKS_CHxSREQMASKS(i)
#define DMA_IFC_CHxDONE(x)
#define DMA_DESC_CH_CFG_DEST_SIZE(v)
#define DMA_DESC_CHx_SRC_DATA_END_PTR(base, x)
#define DMA_DESC_CH_CFG_N_MINUS_1_MASK
#define DMA_DESC_CH_CFG_DEST_INC_SHIFT
#define DMA_CHALTC_CHxSALTC(i)
#define DMA_DESC_CH_CFG_CYCLE_CTRL(v)
#define DMA_DESC_CH_CFG_R_POWER(v)
#define DMA_CHALTS_CHxSALTS(i)
#define DMA_DESC_CH_CFG_DEST_INC_MASK
void dma_enable_alternate_structure(enum dma_ch ch)
Enable channel alternate structure.
void dma_set_signal(enum dma_ch ch, uint32_t signal)
Set channel source signal.
void dma_desc_set_dest_inc(uint32_t desc_base, enum dma_ch ch, enum dma_mem inc)
Set destination increment.
bool dma_get_request_flag(enum dma_ch ch)
Get channel request flag.
void dma_desc_set_r_power(uint32_t desc_base, enum dma_ch ch, enum dma_r_power r_power)
Set R Power.
void dma_enable_priority(enum dma_ch ch)
Enable channel high priority.
void dma_set_bus_error_interrupt_flag(void)
Set bus error interrupt flag.
void dma_enable_channel(enum dma_ch ch)
Enable channel.
void dma_set_loop_count(enum dma_ch ch, uint16_t count)
Set channel loop width to ( count + 1)
void dma_disable(void)
Disable DMA.
void dma_disable_loop(enum dma_ch ch)
Disable channel loop.
void dma_enable_with_privileged_access(void)
Enable DMA with privileged access.
void dma_disable_priority(enum dma_ch ch)
Disable channel high priority.
uint32_t dma_desc_get_user_data(uint32_t desc_base, enum dma_ch ch)
Extract user data field from channel descriptor.
void dma_desc_set_src_inc(uint32_t desc_base, enum dma_ch ch, enum dma_mem inc)
Set source increment.
#define CHANNEL_SUPPORT_LOOP(ch)
void dma_desc_set_mode(uint32_t desc_base, enum dma_ch ch, enum dma_mode mode)
Set the channel mode ("Cycle control")
void dma_enable_single_and_burst(enum dma_ch ch)
Enable channel single and burst.
void dma_desc_set_dest_address(uint32_t desc_base, enum dma_ch ch, uint32_t dest_start)
Assign Destination address to DMA Channel.
void dma_desc_set_src_size(uint32_t desc_base, enum dma_ch ch, enum dma_mem size)
Set source size.
void dma_desc_set_dest_size(uint32_t desc_base, enum dma_ch ch, enum dma_mem size)
Set desination size.
bool dma_get_done_interrupt_flag(enum dma_ch ch)
Get channel done interrupt flag.
static uint32_t dma_calc_end_from_start(uint32_t start, uint8_t inc, uint16_t n_minus_1)
Calculate end from start address.
bool dma_get_bus_error_flag(void)
Get bus error flag.
void dma_enable_burst_only(enum dma_ch ch)
Enable channel burst only.
void dma_enable_with_unprivileged_access(void)
Enable DMA with un-privileged access.
void dma_disable_bus_error_interrupt(void)
Disable bus error interrupt.
void dma_desc_set_src_address(uint32_t desc_base, enum dma_ch ch, uint32_t src_start)
Assign Source address to DMA Channel.
void dma_disable_done_interrupt(enum dma_ch ch)
Disable channel done interrupt.
void dma_enable_bus_error_interrupt(void)
Enable bus error interrupt.
void dma_disable_channel(enum dma_ch ch)
Disable channel.
void dma_set_source(enum dma_ch ch, uint32_t source)
Set channel source.
void dma_clear_done_interrupt_flag(enum dma_ch ch)
Clear channel done interrupt flag.
void dma_enable_done_interrupt(enum dma_ch ch)
Enable channel done interrupt.
void dma_disable_periph_request(enum dma_ch ch)
Disable channel peripherial request.
void dma_channel_reset(enum dma_ch ch)
Reset channel.
void dma_disable_alternate_structure(enum dma_ch ch)
Disable channel alternate structure.
void dma_enable_loop(enum dma_ch ch)
Enable channel loop.
void dma_desc_set_count(uint32_t desc_base, enum dma_ch ch, uint16_t count)
Set number (count) of transfer to be performed.
void dma_desc_set_user_data(uint32_t desc_base, enum dma_ch ch, uint32_t user_data)
Store user data field in channel descriptor.
void dma_set_desc_address(uint32_t desc_base)
Set channel's descriptor address.
void dma_set_done_interrupt_flag(enum dma_ch ch)
Set channel done interrupt flag.
bool dma_get_wait_on_request_flag(enum dma_ch ch)
Get channel wait on request status flag.
void dma_clear_bus_error_interrupt_flag(void)
Clear bus error interrupt flag.
void dma_enable(void)
same as dma_enable_with_unprivileged_access()
void dma_clear_bus_error_flag(void)
Clear bus error flag.
void dma_desc_disable_next_useburst(uint32_t desc_base, enum dma_ch ch)
Disable next useburst.
void dma_desc_enable_next_useburst(uint32_t desc_base, enum dma_ch ch)
Enable next useburst.
bool dma_get_bus_error_interrupt_flag(void)
Get bus error interrupt flag.
void dma_enable_periph_request(enum dma_ch ch)
Enable channel peripherial request.
void dma_generate_software_request(enum dma_ch ch)
Generate a software request on channel.