mikroSDK Reference Manual
drv_dma.h File Reference

Go to the source code of this file.

Data Structures

struct  dma_config_t
 DMA Configuration Structure prototype. More...
 
struct  dma_t
 DMA Handle prototype. More...
 

Typedefs

typedef uint8_t dma_channel_t[DMA_NUM_OF_MODULES][DMA_NUM_OF_STREAMS_FAMILY][DMA_NUM_OF_CHANNELS_FAMILY]
 

Enumerations

enum  dma_err_t
 
enum  dma_state_t
 
enum  dma_source_memory_region_t
 
enum  dma_direction_t
 
enum  dma_data_align_t
 
enum  dma_mode_t
 
enum  dma_priority_t
 
enum  dma_burst_size_t
 

Functions

void dma_configure_default (dma_config_t *config)
 Configure DMA Driver configuration structure. More...
 
err_t dma_open (dma_t *obj, dma_config_t *config)
 Open the DMA Driver object. More...
 
void dma_get_channels (dma_channel_t *channels)
 Get DMA modules/streams/channels. More...
 
err_t dma_set_mode (dma_t *obj, dma_mode_t mode)
 Set the DMA mode. More...
 
err_t dma_set_direction (dma_t *obj, dma_direction_t direction)
 Set the DMA direction. More...
 
err_t dma_set_priority (dma_t *obj, dma_priority_t priority)
 Set the DMA priority. More...
 
err_t dma_set_transfer_config (dma_t *obj, uint32_t addr_src, uint32_t addr_dst, size_t transfer_size, dma_source_memory_region_t src_mem_type)
 Configure the DMA transfer. More...
 
err_t dma_transfer_start (dma_t *obj)
 Initializes the DMA transfer. More...
 
err_t dma_transfer_stop (dma_t *obj)
 Stops the DMA transfer. More...
 
err_t dma_transfer_abort (dma_t *obj)
 Aborts a DMA transfer. More...
 
err_t dma_close (dma_t *obj)
 Close DMA Driver object. More...
 

Typedef Documentation

◆ dma_channel_t

typedef uint8_t dma_channel_t[DMA_NUM_OF_MODULES][DMA_NUM_OF_STREAMS_FAMILY][DMA_NUM_OF_CHANNELS_FAMILY]

Module/Stream/Channel array prototype.

Note
Size varies based on selected MCU.
DMA_NUM_OF_MODULES, DMA_NUM_OF_STREAMS_FAMILY, DMA_NUM_OF_CHANNELS_FAMILY are declared separately for each MCU.

Enumeration Type Documentation

◆ dma_err_t

enum dma_err_t

Return values.

Enumerator
DMA_SUCCESS 

Success.

DMA_ERROR 

Error.

◆ dma_state_t

Module state values.

Enumerator
DMA_STATE_FREE 

DMA object is free for use.

DMA_STATE_ALLOCATED 

DMA object has been allocated - not free for use.

◆ dma_source_memory_region_t

Source address memory region.

Enumerator
DMA_SOURCE_MEMORY_REGION_RAM 

DMA source address is in RAM section.

DMA_SOURCE_MEMORY_REGION_PFM 

DMA source address is in Program Flash Memory section.

DMA_SOURCE_MEMORY_REGION_DEEPROM 

DMA source address is in Data EEPROM section.

◆ dma_direction_t

Module direction values.

Enumerator
DMA_DIRECTION_MEMORY_TO_MEMORY 

M2M

DMA_DIRECTION_MEMORY_TO_PERIPH 

M2P

DMA_DIRECTION_PERIPH_TO_MEMORY 

P2M

DMA_DIRECTION_PERIPH_TO_PERIPH 

P2P

DMA_DIRECTION_DEFAULT 

Default value is M2M.

◆ dma_data_align_t

Module data alignment values.

Enumerator
DMA_DATA_ALIGN_BYTES_1 

Align data to byte (uint8_t).

DMA_DATA_ALIGN_BYTES_2 

Align data to half word (uint16_t).

DMA_DATA_ALIGN_BYTES_3 

Align data to 3 bytes (uint24_t).

DMA_DATA_ALIGN_BYTES_4 

Align data to word (uint32_t).

DMA_DATA_ALIGN_DEFAULT 

Default data alignment of byte (uint8_t).

◆ dma_mode_t

enum dma_mode_t

Module mode values.

Enumerator
DMA_MODE_NORMAL 

Normal mode.

DMA_MODE_CIRCULAR 

Circular mode.

DMA_MODE_DEFAULT 

Default mode set to normal.

◆ dma_priority_t

Module priority levels.

Enumerator
DMA_PRIORITY_LOW 

Sets priority level to low.

DMA_PRIORITY_MEDIUM 

Sets priority level to medium.

DMA_PRIORITY_HIGH 

Sets priority level to high.

DMA_PRIORITY_VERY_HIGH 

Sets priority level to very high.

DMA_PRIORITY_DEFAULT 

Default priority level set to medium.

◆ dma_burst_size_t

Module burst increment size.

Enumerator
DMA_BURST_SIZE_INCREMENT_1 

Dma module burst increment size set to 1 byte.

DMA_BURST_SIZE_INCREMENT_2 

Dma module burst increment size set to 2 bytes.

DMA_BURST_SIZE_INCREMENT_4 

Dma module burst increment size set to 4 bytes.

DMA_BURST_SIZE_INCREMENT_8 

Dma module burst increment size set to 8 bytes.

DMA_BURST_SIZE_INCREMENT_16 

Dma module burst increment size set to 16 bytes.

DMA_BURST_SIZE_INCREMENT_32 

Dma module burst increment size set to 32 bytes.

DMA_BURST_SIZE_INCREMENT_DEFAULT 

Default burst increment size set to 1 byte.