2016-02-17 21:25:23 -04:00
|
|
|
#pragma once
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include "AP_HAL_Empty.h"
|
2012-12-14 21:55:38 -04:00
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
class Empty::AnalogSource : public AP_HAL::AnalogSource {
|
2012-12-17 15:07:26 -04:00
|
|
|
public:
|
2015-12-07 14:53:55 -04:00
|
|
|
AnalogSource(float v);
|
2018-11-07 06:59:10 -04:00
|
|
|
float read_average() override;
|
|
|
|
float read_latest() override;
|
2021-09-22 16:48:11 -03:00
|
|
|
bool set_pin(uint8_t p) override;
|
2018-11-07 06:59:10 -04:00
|
|
|
float voltage_average() override;
|
|
|
|
float voltage_latest() override;
|
|
|
|
float voltage_average_ratiometric() override { return voltage_average(); }
|
2012-12-17 15:07:26 -04:00
|
|
|
private:
|
|
|
|
float _v;
|
2012-12-14 21:55:38 -04:00
|
|
|
};
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
class Empty::AnalogIn : public AP_HAL::AnalogIn {
|
2012-12-17 15:07:26 -04:00
|
|
|
public:
|
2015-12-07 14:53:55 -04:00
|
|
|
AnalogIn();
|
2018-11-07 06:59:10 -04:00
|
|
|
void init() override;
|
|
|
|
AP_HAL::AnalogSource* channel(int16_t n) override;
|
|
|
|
float board_voltage(void) override;
|
2012-12-17 15:07:26 -04:00
|
|
|
};
|