2012-12-14 21:55:38 -04:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_EMPTY_ANALOGIN_H__
|
|
|
|
#define __AP_HAL_EMPTY_ANALOGIN_H__
|
|
|
|
|
|
|
|
#include <AP_HAL_Empty.h>
|
|
|
|
|
2012-12-17 15:07:26 -04:00
|
|
|
class Empty::EmptyAnalogSource : public AP_HAL::AnalogSource {
|
|
|
|
public:
|
|
|
|
EmptyAnalogSource(float v);
|
|
|
|
float read_average();
|
|
|
|
float read_latest();
|
|
|
|
void set_pin(uint8_t p);
|
2013-04-26 01:52:47 -03:00
|
|
|
void set_stop_pin(uint8_t p);
|
|
|
|
void set_settle_time(uint16_t settle_time_ms);
|
2013-03-03 01:13:04 -04:00
|
|
|
float voltage_average();
|
2013-09-12 00:23:04 -03:00
|
|
|
float voltage_latest();
|
2013-05-13 02:12:43 -03:00
|
|
|
float voltage_average_ratiometric() { return voltage_average(); }
|
2012-12-17 15:07:26 -04:00
|
|
|
private:
|
|
|
|
float _v;
|
2012-12-14 21:55:38 -04:00
|
|
|
};
|
|
|
|
|
2012-12-17 15:07:26 -04:00
|
|
|
class Empty::EmptyAnalogIn : public AP_HAL::AnalogIn {
|
|
|
|
public:
|
|
|
|
EmptyAnalogIn();
|
|
|
|
void init(void* implspecific);
|
|
|
|
AP_HAL::AnalogSource* channel(int16_t n);
|
2014-02-13 02:07:32 -04:00
|
|
|
float board_voltage(void);
|
2012-12-17 15:07:26 -04:00
|
|
|
};
|
2012-12-14 21:55:38 -04:00
|
|
|
#endif // __AP_HAL_EMPTY_ANALOGIN_H__
|