AP_RangeFinder_analog.h 680 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "RangeFinder.h"
  3. #include "RangeFinder_Backend.h"
  4. #include "AP_RangeFinder_Params.h"
  5. class AP_RangeFinder_analog : public AP_RangeFinder_Backend
  6. {
  7. public:
  8. // constructor
  9. AP_RangeFinder_analog(RangeFinder::RangeFinder_State &_state, AP_RangeFinder_Params &_params);
  10. // static detection function
  11. static bool detect(AP_RangeFinder_Params &_params);
  12. // update state
  13. void update(void) override;
  14. protected:
  15. MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
  16. return MAV_DISTANCE_SENSOR_UNKNOWN;
  17. }
  18. private:
  19. // update raw voltage
  20. void update_voltage(void);
  21. AP_HAL::AnalogSource *source;
  22. };