mikroSDK Reference Manual
dma_config_t Struct Reference

DMA Configuration Structure prototype. More...

Data Fields

uint8_t module
 
uint8_t stream
 
uint8_t channel
 
dma_direction_t direction
 
dma_mode_t mode
 
bool src_inc
 
dma_data_align_t data_align_source
 
dma_burst_size_t burst_size_source
 
bool dst_inc
 
dma_data_align_t data_align_destination
 
dma_burst_size_t burst_size_destination
 
dma_priority_t priority
 
uint32_t addr_src
 
uint32_t addr_dst
 
size_t transfer_length
 

Detailed Description

Example

// DMA driver configuration structure.
static dma_config_t dma_cfg;
// Fill structure with default values.
// Specify desired DMA module.
dma_cfg.module = 0; // First module (DMA0 or DMA1 based on MCU).
// Specify desired DMA stream number.
dma_cfg.stream = 5;
// Specify desired DMA channel number.
dma_cfg.channel = 3;

Field Documentation

◆ module

uint8_t dma_config_t::module

Specifies the module.

◆ stream

uint8_t dma_config_t::stream

Specifies the stream.

◆ channel

uint8_t dma_config_t::channel

Specifies the channel used for the specified stream.

◆ direction

dma_direction_t dma_config_t::direction

Specifies if the data will be transferred from memory to peripheral, from memory to memory, from peripheral to memory, or from peripheral to peripheral. This parameter can be a value of dma_direction_t

◆ mode

dma_mode_t dma_config_t::mode

Specifies the operation mode of the DMA Stream. This parameter can be a value of dma_mode_t

◆ src_inc

bool dma_config_t::src_inc

Specifies whether the Source address register should be incremented or not.

◆ data_align_source

dma_data_align_t dma_config_t::data_align_source

Specifies the Source data width. This parameter can be a value of dma_data_align_t

◆ burst_size_source

dma_burst_size_t dma_config_t::burst_size_source

Specifies the Burst transfer configuration for the source transfers. It specifies the amount of data to be transferred in a single non interruptable transaction. This parameter can be a value of dma_burst_size_t

Note
The burst mode is possible only if the address increment mode is enabled.

◆ dst_inc

bool dma_config_t::dst_inc

Specifies whether the Destination address register should be incremented or not.

◆ data_align_destination

dma_data_align_t dma_config_t::data_align_destination

Specifies the Destination data width. This parameter can be a value of dma_data_align_t

◆ burst_size_destination

dma_burst_size_t dma_config_t::burst_size_destination

Specifies the Burst transfer configuration for the destination transfers. It specifies the amount of data to be transferred in a single non interruptable transaction. This parameter can be a value of dma_burst_size_t

Note
The burst mode is possible only if the address increment mode is enabled.

◆ priority

dma_priority_t dma_config_t::priority

Specifies the software priority for the DMA Stream. This parameter can be a value of dma_priority_t

◆ addr_src

uint32_t dma_config_t::addr_src

Address to transfer from.

◆ addr_dst

uint32_t dma_config_t::addr_dst

Address to transfer to.

◆ transfer_length

size_t dma_config_t::transfer_length

Number of bytes to transfer.

dma_config_t::module
uint8_t module
Definition: drv_dma.h:177
dma_config_t::stream
uint8_t stream
Definition: drv_dma.h:178
dma_config_t
DMA Configuration Structure prototype.
Definition: drv_dma.h:175
dma_configure_default
void dma_configure_default(dma_config_t *config)
Configure DMA Driver configuration structure.
dma_config_t::channel
uint8_t channel
Definition: drv_dma.h:179