-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptoDMA.h
More file actions
57 lines (48 loc) · 1.86 KB
/
OptoDMA.h
File metadata and controls
57 lines (48 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* OptoDMA.h
*
*
* Author: Caroline
*/
#ifndef OPTODMA_H_
#define OPTODMA_H_
#include <stdint.h>
#include "avr32\uc3l064.h"
#include "avr32\pdca_122.h"
/************************************************************************/
/* Initialize DMA for ADC
/*
/* Parameters:
/* volatile avr32_pdca_channel_t *dma - base address of DMA
/* unsigned int channel - DMA channel number
/* volatile uint16_t *adc_buffer - address to store ADC samples
/************************************************************************/
void init_adc_dma(unsigned int channel, volatile avr32_pdca_channel_t *dma, volatile uint16_t *adc_buffer);
/************************************************************************/
/* Enable DMA for a given channel
/*
/* Parameters:
/* volatile avr32_pdca_channel_t *dma - base address of DMA
/* unsigned int channel - DMA channel number
/************************************************************************/
void enable_dma(unsigned int channel, volatile avr32_pdca_channel_t *dma);
/************************************************************************/
/* Disable DMA for a given channel
/*
/* Parameters:
/* volatile avr32_pdca_channel_t *dma - base address of DMA
/* unsigned int channel - DMA channel number
/************************************************************************/
void disable_dma(unsigned int channel, volatile avr32_pdca_channel_t *dma);
/************************************************************************/
/* Get the DMA channel transfer status
/*
/* Parameters:
/* volatile avr32_pdca_channel_t *dma - base address of DMA
/* unsigned int channel - DMA channel number
/*
/* Returns:
/* 0 if transfer incomplete; 1 if transfer complete
/************************************************************************/
unsigned int dma_transfer_status(unsigned int channel, volatile avr32_pdca_channel_t *dma);
#endif /* OPTODMA_H_ */