-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAD.h
32 lines (27 loc) · 749 Bytes
/
AD.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
/*
* AD.h
*
* Created on: Feb 9, 2017
* Author: nem1
*/
#ifndef AD_H_
#define AD_H_
#include <basictypes.h>
#define ADC_CR1_STOP 0x4000
#define ADC_CR1_START 0x2000
#define ADC_CR1_LOOP 0x0002
#define ADC_CR2_INIT_OFF 0x0000
#define ADC_ZCCR_OFF 0x0000
#define ADC_SDIS_ENABLE_ALL 0x0000
#define ADC_SDIS_DISABLE_ALL 0x0000
class AD {
public:
AD();
virtual ~AD();
void Init(void); // Setup the A/D converter to be ready to run
void StartAD(void); // Start A/D conversion set.
void StopAD(void); // Stop A/D conversion set.
bool ADDone(void); // Check the status of the conversion
WORD GetADResult(int ch); // Return the AD Result
};
#endif /* AD_H_ */