Microchip® Advanced Software Framework

dma.c File Reference

AVR XMEGA Direct Memory Access Controller driver.

Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include <status_codes.h>
#include <sleepmgr.h>
#include <sysclk.h>
#include <dma.h>

Functions

void dma_channel_read_config (dma_channel_num_t num, struct dma_channel_config *config)
 Read DMA channel configuration from hardware. More...
 
void dma_channel_write_config (dma_channel_num_t num, struct dma_channel_config *config)
 Write DMA channel configuration to hardware. More...
 
void dma_disable (void)
 Disable DMA controller. More...
 
void dma_enable (void)
 Enable DMA controller. More...
 
static void dma_interrupt (const dma_channel_num_t num)
 Common DMA channel interrupt handler. More...
 
void dma_set_callback (dma_channel_num_t num, dma_callback_t callback)
 Set callback for given DMA channel. More...
 
 ISR (DMA_CH0_vect)
 DMA channel 0 interrupt handler. More...
 
 ISR (DMA_CH1_vect)
 DMA channel 1 interrupt handler. More...
 
 ISR (DMA_CH2_vect)
 DMA channel 2 interrupt handler. More...
 
 ISR (DMA_CH3_vect)
 DMA channel 3 interrupt handler. More...
 

Variables

struct dma_data_struct dma_data [DMA_NUMBER_OF_CHANNELS]
 DMA private data for each channel. More...
 

static void dma_interrupt ( const dma_channel_num_t  num)
static

Common DMA channel interrupt handler.

Calls the channel callback with the channel status code. The following status codes are possible:

  • DMA_CH_TRANSFER_COMPLETED: Transfer completed successfully
  • DMA_CH_TRANSFER_ERROR: Fault in transfer

The optional callback used by the interrupt handler is set by the dma_set_callback() function.

Parameters
numDMA channel number to handle interrupt for

References dma_data, dma_get_channel_address_from_num, and dma_get_channel_status().

Referenced by ISR().

ISR ( DMA_CH0_vect  )

DMA channel 0 interrupt handler.

References dma_interrupt().

ISR ( DMA_CH1_vect  )

DMA channel 1 interrupt handler.

References dma_interrupt().

ISR ( DMA_CH2_vect  )

DMA channel 2 interrupt handler.

References dma_interrupt().

ISR ( DMA_CH3_vect  )

DMA channel 3 interrupt handler.

References dma_interrupt().

struct dma_data_struct dma_data[DMA_NUMBER_OF_CHANNELS]

DMA private data for each channel.

Referenced by dma_interrupt(), and dma_set_callback().