# cpu/uc3/include/cpu/dma.h File Reference

DMA mapping for AVR32 UC3. More...

`#include <types.h>`

Include dependency graph for dma.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
union | buffer_addr_t
| A physical/virtual address pair used in struct buffer. More...
## Defines
#define | CPU_DMA_ALIGN 2
| log2 of the minimum alignment of DMA-able objects
## Functions
static void | dma_sync_for_device (void *vaddr, size_t size, enum dma_direction direction)
| Synchronize a DMA buffer before transfer.
static void | dma_sync_for_cpu (void *vaddr, size_t size, enum dma_direction direction)
| Synchronize a DMA buffer after transfer.
static phys_addr_t | dma_map_single (void *vaddr, size_t size, enum dma_direction direction)
| Map a single contiguous buffer for DMA transfer.
static void | dma_unmap_single (void *vaddr, size_t size, enum dma_direction direction)
| Unmap a single contiguous buffer after a DMA transfer.

## Detailed Description

DMA mapping for AVR32 UC3.

- Compiler: IAR EWAVR32 and GNU GCC for AVR32
- Supported devices: All AVR32 UC3 devices
- AppNote:

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file dma.h.

## Define Documentation

#define CPU_DMA_ALIGN 2

log2 of the minimum alignment of DMA-able objects

Definition at line 47 of file dma.h.

## Function Documentation

static phys_addr_t dma_map_single | ( | void * | vaddr,
|  | size_t | size,
|  | enum dma_direction | direction |
| ) |  |  | `[inline, static]`

Map a single contiguous buffer for DMA transfer.

After this function has been called, the device can access the buffer, but the CPU must not.

Parameters:

  | vaddr | The virtual address of the buffer
  | size | The length of the buffer in bytes
  | direction | The direction of the transfer

Returns:
  The physical address of the buffer

Definition at line 104 of file dma.h.

Referenced by buffer_init_rx(), and buffer_init_tx().

static void dma_sync_for_cpu | ( | void * | vaddr,
|  | size_t | size,
|  | enum dma_direction | direction |
| ) |  |  | `[inline, static]`

Synchronize a DMA buffer after transfer.

After this function has been called, the CPU can access the buffer, but the device must not.

Parameters:

  | vaddr | The virtual address of the buffer
  | size | The length of the buffer in bytes
  | direction | The direction of the transfer

Definition at line 86 of file dma.h.

static void dma_sync_for_device | ( | void * | vaddr,
|  | size_t | size,
|  | enum dma_direction | direction |
| ) |  |  | `[inline, static]`

Synchronize a DMA buffer before transfer.

After this function has been called, the device can access the buffer, but the CPU must not.

Parameters:

  | vaddr | The virtual address of the buffer
  | size | The length of the buffer in bytes
  | direction | The direction of the transfer

Definition at line 70 of file dma.h.

static void dma_unmap_single | ( | void * | vaddr,
|  | size_t | size,
|  | enum dma_direction | direction |
| ) |  |  | `[inline, static]`

Unmap a single contiguous buffer after a DMA transfer.

After this function has been called, the CPU can access the buffer, but the device must not.

Parameters:

  | vaddr | The virtual address of the buffer
  | size | The length of the buffer in bytes
  | direction | The direction of the transfer

Returns:
  The physical address of the buffer

Definition at line 122 of file dma.h.