Path: blob/master/libraries/AP_DAC/AP_DAC_Backend.h
4182 views
/*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*/14/*15digitial to analog support, for control of an analog output voltage16*/17#pragma once1819#include "AP_DAC_config.h"2021#if AP_DAC_ENABLED2223class AP_DAC_Backend24{25public:26AP_DAC_Backend(const AP_DAC_Params &_params) :27params(_params) {}2829// initialise backend30virtual void init(void) = 0;3132// update backend33virtual void update(void) {};3435// set voltage for a channel36virtual bool set_voltage(uint8_t chan, float v) = 0;3738protected:39const AP_DAC_Params ¶ms;40};4142#endif // AP_DAC_ENABLED434445