-
Notifications
You must be signed in to change notification settings - Fork 0
/
OptoADC.h
60 lines (51 loc) · 1.97 KB
/
OptoADC.h
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
58
59
60
/*
* OptoADC.h
*
*
* Author: Caroline
*/
#ifndef OptoADC_H_
#define OptoADC_H_
#include "avr32\adcifb_101.h"
/************************************************************************/
/* Initialize the ADC interface
/* NOTE: Please ensure AVREF is connected correctly!
/*
/* Parameters:
/* volatile avr32_adcifb_t *adc - base address of ADC
/************************************************************************/
void adc_init(volatile avr32_adcifb_t *adc);
/************************************************************************/
/* Start conversion
/*
/* Parameters:
/* volatile avr32_adcifb_1 *adc - base address of ADC
/************************************************************************/
void adc_start(volatile avr32_adcifb_t *adc);
/************************************************************************/
/* Enable an ADC channel
/*
/* Parameters:
/* volatile avr32_adcifb_t *adc - base address of ADC
/* unsigned short channel - ADC channel number
/************************************************************************/
void adc_enable(volatile avr32_adcifb_t *adc, unsigned short channel);
/************************************************************************/
/* Disable an ADC channel
/*
/* Parameters:
/* volatile avr32_adcifb_t *adc - base address of ADC
/* unsigned short channel - ADC channel number
/************************************************************************/
void adc_disable(volatile avr32_adcifb_t *adc, unsigned short channel);
/************************************************************************/
/* Check conversion status of ADC channel
/*
/* Parameters:
/* volatile avr32_adcifb_t *adc - base address of ADC
/*
/* Returns:
/* 0 for conversion in progress; 1 for ADC ready
/************************************************************************/
unsigned char conversion_status(volatile avr32_adcifb_t *adc);
#endif /* INCFILE1_H_ */