Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/libraries/AP_Airspeed/AP_Airspeed_Backend.cpp
Views: 1798
/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/1415/*16backend driver class for airspeed17*/1819#include "AP_Airspeed_config.h"2021#if AP_AIRSPEED_ENABLED2223#include <AP_Common/AP_Common.h>24#include <AP_HAL/AP_HAL.h>25#include "AP_Airspeed.h"26#include "AP_Airspeed_Backend.h"2728extern const AP_HAL::HAL &hal;2930AP_Airspeed_Backend::AP_Airspeed_Backend(AP_Airspeed &_frontend, uint8_t _instance) :31frontend(_frontend),32instance(_instance)33{34}3536AP_Airspeed_Backend::~AP_Airspeed_Backend(void)37{38}394041int8_t AP_Airspeed_Backend::get_pin(void) const42{43#ifndef HAL_BUILD_AP_PERIPH44return frontend.param[instance].pin;45#else46return 0;47#endif48}4950float AP_Airspeed_Backend::get_psi_range(void) const51{52return frontend.param[instance].psi_range;53}5455uint8_t AP_Airspeed_Backend::get_bus(void) const56{57return frontend.param[instance].bus;58}5960bool AP_Airspeed_Backend::bus_is_configured(void) const61{62return frontend.param[instance].bus.configured();63}6465void AP_Airspeed_Backend::set_bus_id(uint32_t id)66{67frontend.param[instance].bus_id.set_and_save(int32_t(id));68}6970#endif // AP_AIRSPEED_ENABLED717273