AnalogIn.h 620 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include "AP_HAL_Empty.h"
  3. class Empty::AnalogSource : public AP_HAL::AnalogSource {
  4. public:
  5. AnalogSource(float v);
  6. float read_average() override;
  7. float read_latest() override;
  8. void set_pin(uint8_t p) override;
  9. float voltage_average() override;
  10. float voltage_latest() override;
  11. float voltage_average_ratiometric() override { return voltage_average(); }
  12. private:
  13. float _v;
  14. };
  15. class Empty::AnalogIn : public AP_HAL::AnalogIn {
  16. public:
  17. AnalogIn();
  18. void init() override;
  19. AP_HAL::AnalogSource* channel(int16_t n) override;
  20. float board_voltage(void) override;
  21. };