/*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/*15digital to analog support, for control of an analog output voltage16*/17#pragma once1819#include "AP_DAC_config.h"2021#if AP_DAC_ENABLED2223#include "AP_DAC_Params.h"24#include "AP_DAC_Backend.h"2526class AP_DAC27{28public:29// Constructor30AP_DAC();3132CLASS_NO_COPY(AP_DAC);3334// detect and initialise any available DACs35void init();3637// update all of the backends38void update();3940// set voltage for a channel41bool set_voltage(uint8_t instance, uint8_t chan, float v);4243static const struct AP_Param::GroupInfo var_info[];4445private:46AP_DAC_Params params[AP_DAC_MAX_INSTANCES];47AP_DAC_Backend *backends[AP_DAC_MAX_INSTANCES];48};4950#endif // AP_DAC_ENABLED515253