2011-11-12 23:14:55 -04:00
|
|
|
|
|
|
|
#ifndef __AP_ANALOG_SOURCE_ADC_H__
|
|
|
|
#define __AP_ANALOG_SOURCE_ADC_H__
|
|
|
|
|
|
|
|
#include "AnalogSource.h"
|
|
|
|
#include "../AP_ADC/AP_ADC.h"
|
|
|
|
|
|
|
|
class AP_AnalogSource_ADC : public AP_AnalogSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AP_AnalogSource_ADC( AP_ADC * adc, int ch, float prescale = 1.0 ) :
|
2011-12-10 03:23:06 -04:00
|
|
|
_adc(adc), _ch(ch), _prescale(prescale) {}
|
2011-11-12 23:14:55 -04:00
|
|
|
int read(void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
AP_ADC * _adc;
|
|
|
|
int _ch;
|
|
|
|
float _prescale;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_ANALOG_SOURCE_ADC_H__
|