2013-01-03 13:56:23 -04:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_SMACCM_ANALOGIN_H__
|
|
|
|
#define __AP_HAL_SMACCM_ANALOGIN_H__
|
|
|
|
|
|
|
|
#include <AP_HAL_SMACCM.h>
|
|
|
|
|
|
|
|
class SMACCM::SMACCMAnalogSource : public AP_HAL::AnalogSource {
|
|
|
|
public:
|
|
|
|
SMACCMAnalogSource(float v);
|
|
|
|
float read_average();
|
|
|
|
float read_latest();
|
|
|
|
void set_pin(uint8_t p);
|
2013-03-03 01:13:04 -04:00
|
|
|
float voltage_average();
|
2013-05-02 21:09:14 -03:00
|
|
|
void set_stop_pin(uint8_t p) {}
|
|
|
|
void set_settle_time(uint16_t settle_time_ms) {}
|
|
|
|
|
2013-01-03 13:56:23 -04:00
|
|
|
private:
|
|
|
|
float _v;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SMACCM::SMACCMAnalogIn : public AP_HAL::AnalogIn {
|
|
|
|
public:
|
|
|
|
SMACCMAnalogIn();
|
|
|
|
void init(void* implspecific);
|
|
|
|
AP_HAL::AnalogSource* channel(int16_t n);
|
|
|
|
AP_HAL::AnalogSource* channel(int16_t n, float scale);
|
|
|
|
};
|
|
|
|
#endif // __AP_HAL_SMACCM_ANALOGIN_H__
|