Atmel Software Framework

dma_example.c File Reference

AVR XMEGA DMA example 2.

Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.

#include <conf_example.h>
#include <string.h>
#include <asf.h>

Functions

static void example_dma_transfer_done (enum dma_channel_status status)
 Callback for DMA transfer complete. More...
 
static void fill_pattern (uint8_t *buffer, size_t len)
 Fill buffer with a specific pattern. More...
 
int main (void)
 main function More...
 
static bool verify_pattern (uint8_t *buffer, size_t len)
 Verify if buffer if filled by the specific pattern generated by the fill_pattern() function. More...
 

Variables

static uint8_t destination [DMA_BUFFER_SIZE]
 Destination buffer to use for DMA transfer. More...
 
static uint8_t source [DMA_BUFFER_SIZE]
 Source buffer to use for DMA transfer. More...
 

static void example_dma_transfer_done ( enum dma_channel_status  status)
static

Callback for DMA transfer complete.

Parameters
statusStatus of a completed (or failed) DMA transfer

References destination, DMA_BUFFER_SIZE, DMA_CH_TRANSFER_COMPLETED, source, and verify_pattern().

Referenced by main().

static void fill_pattern ( uint8_t *  buffer,
size_t  len 
)
static

Fill buffer with a specific pattern.

Parameters
bufferBuffer to fill with a specific pattern
lenLength of the buffer

Referenced by main().

static bool verify_pattern ( uint8_t *  buffer,
size_t  len 
)
static

Verify if buffer if filled by the specific pattern generated by the fill_pattern() function.

Parameters
bufferBuffer to verify
lenLength of the buffer
Return values
trueBuffer is equal to specific pattern
falseBuffer is not equal to specific pattern

Referenced by example_dma_transfer_done().

uint8_t destination[DMA_BUFFER_SIZE]
static

Destination buffer to use for DMA transfer.

Referenced by example_dma_transfer_done(), and main().

uint8_t source[DMA_BUFFER_SIZE]
static

Source buffer to use for DMA transfer.

Referenced by example_dma_transfer_done(), and main().