-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdeltaADC.h
45 lines (38 loc) · 1003 Bytes
/
deltaADC.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
/**
DeltaADC is using both ADC simultaneously to capture the voltage across a dipole
DeltaADCTime is the same thing but using a timer as a source of ADC conversion
*/
#pragma once
#include "testPins.h"
/**
*/
class DeltaADC
{
public:
DeltaADC(TestPin &A, TestPin &B): _pA(A),_pB(B)
{
}
virtual ~DeltaADC() {};
bool setup(const adc_smp_rate rate, const DSOADC::Prescaler scale,const int nbSamples);
virtual bool get(int &nbSamples, uint16_t **ptr, float &period);
protected:
TestPin &_pA,&_pB;
adc_smp_rate _rate;
DSOADC::Prescaler _scale;
int _nb;
};
/**
*
* @param A
* @param B
*/
class DeltaADCTime : public DeltaADC
{
public:
DeltaADCTime(TestPin &A, TestPin &B);
virtual ~DeltaADCTime();
bool setup(int frequency,const int nbSamples);
virtual bool get(int &nbSamples, uint16_t **ptr, float &period);
protected:
int _fq;
};