Elmar van Rijnswou
7 years ago
5 changed files with 108 additions and 35 deletions
@ -0,0 +1,36 @@ |
|||||
|
/*
|
||||
|
* dummy_adc.cpp |
||||
|
* |
||||
|
* Created on: Aug 15, 2017 |
||||
|
* Author: Elmar |
||||
|
*/ |
||||
|
|
||||
|
#include "dummy_adc.h" |
||||
|
|
||||
|
namespace rijnfel { |
||||
|
|
||||
|
cDymmyAdc::cDymmyAdc() { |
||||
|
m_sampleCounter = 0; |
||||
|
} |
||||
|
|
||||
|
void cDymmyAdc::WaitSample(void) { |
||||
|
} |
||||
|
|
||||
|
bool cDymmyAdc::IsReady(void) { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
uint32_t cDymmyAdc::RawSample(void) { |
||||
|
m_sampleCounter++; |
||||
|
return m_sampleCounter; |
||||
|
} |
||||
|
|
||||
|
uint32_t cDymmyAdc::ConvertSample(uint32_t& sample) { |
||||
|
return sample - 1; |
||||
|
} |
||||
|
|
||||
|
cDymmyAdc::~cDymmyAdc() { |
||||
|
// TODO Auto-generated destructor stub
|
||||
|
} |
||||
|
|
||||
|
} /* namespace rijnfel */ |
@ -0,0 +1,30 @@ |
|||||
|
/*
|
||||
|
* dummy_adc.h |
||||
|
* |
||||
|
* Created on: Aug 15, 2017 |
||||
|
* Author: Elmar |
||||
|
*/ |
||||
|
|
||||
|
#ifndef APP_DUMMY_ADC_H_ |
||||
|
#define APP_DUMMY_ADC_H_ |
||||
|
|
||||
|
#include "adc.h" |
||||
|
#include <stdint.h> |
||||
|
|
||||
|
namespace rijnfel { |
||||
|
|
||||
|
class cDymmyAdc: public cADC<uint32_t, uint32_t> { |
||||
|
public: |
||||
|
cDymmyAdc(); |
||||
|
virtual void WaitSample(void); |
||||
|
virtual bool IsReady(void); |
||||
|
virtual uint32_t RawSample(void); |
||||
|
virtual uint32_t ConvertSample(uint32_t & sample); |
||||
|
virtual ~cDymmyAdc(); |
||||
|
private: |
||||
|
uint32_t m_sampleCounter; |
||||
|
}; |
||||
|
|
||||
|
} /* namespace rijnfel */ |
||||
|
|
||||
|
#endif /* APP_DUMMY_ADC_H_ */ |
Loading…
Reference in new issue