AP_Airspeed_Backend.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. /*
  14. backend driver class for airspeed
  15. */
  16. #include <AP_Common/AP_Common.h>
  17. #include <AP_HAL/AP_HAL.h>
  18. #include "AP_Airspeed.h"
  19. #include "AP_Airspeed_Backend.h"
  20. extern const AP_HAL::HAL &hal;
  21. AP_Airspeed_Backend::AP_Airspeed_Backend(AP_Airspeed &_frontend, uint8_t _instance) :
  22. frontend(_frontend),
  23. instance(_instance)
  24. {
  25. }
  26. AP_Airspeed_Backend::~AP_Airspeed_Backend(void)
  27. {
  28. }
  29. int8_t AP_Airspeed_Backend::get_pin(void) const
  30. {
  31. return frontend.param[instance].pin;
  32. }
  33. float AP_Airspeed_Backend::get_psi_range(void) const
  34. {
  35. return frontend.param[instance].psi_range;
  36. }
  37. uint8_t AP_Airspeed_Backend::get_bus(void) const
  38. {
  39. return frontend.param[instance].bus;
  40. }