Path: blob/master/libraries/AP_DAC/AP_DAC_Params.cpp
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*/1415#include "AP_DAC_Params.h"16#include "AP_DAC.h"1718#if AP_DAC_ENABLED1920#ifndef AP_DAC_DEFAULT_BUS21#define AP_DAC_DEFAULT_BUS 022#endif2324#ifndef AP_DAC_DEFAULT_ADDR25#define AP_DAC_DEFAULT_ADDR 026#endif2728#ifndef AP_DAC_DEFAULT_VREF29#define AP_DAC_DEFAULT_VREF 3.330#endif3132#ifndef AP_DAC_DEFAULT_VOLT33#define AP_DAC_DEFAULT_VOLT 3.334#endif3536#ifndef AP_DAC_DEFAULT_TYPE37#define AP_DAC_DEFAULT_TYPE int8_t(Type::NONE)38#endif3940const AP_Param::GroupInfo AP_DAC_Params::var_info[] = {41// @Param: TYPE42// @DisplayName: DAC Type43// @Description: DAC Type44// @Values: 0:Disabled, 1:TIx3204, 2:MCP401x45// @User: Standard46// @RebootRequired: True47AP_GROUPINFO_FLAGS("TYPE", 1, AP_DAC_Params, type, AP_DAC_DEFAULT_TYPE, AP_PARAM_FLAG_ENABLE),4849// @Param: BUS50// @DisplayName: I2C bus51// @Description: I2C bus number52// @Range: 0 353// @User: Standard54// @RebootRequired: True55AP_GROUPINFO("BUS", 2, AP_DAC_Params, bus, AP_DAC_DEFAULT_BUS),5657// @Param: ADDR58// @DisplayName: I2C address59// @Description: I2C address60// @Range: 0 12761// @User: Standard62// @RebootRequired: True63AP_GROUPINFO("ADDR", 3, AP_DAC_Params, bus_address, AP_DAC_DEFAULT_ADDR),6465// @Param: VREF66// @DisplayName: Voltage reference67// @Description: Voltage reference68// @Range: 0 100069// @User: Standard70AP_GROUPINFO("VREF", 4, AP_DAC_Params, voltage_reference, AP_DAC_DEFAULT_VREF),7172// @Param: VOLTS73// @DisplayName: Voltage74// @Description: Voltage75// @Range: 0 100076// @User: Standard77AP_GROUPINFO("VOLTS", 5, AP_DAC_Params, voltage, AP_DAC_DEFAULT_VOLT),7879AP_GROUPEND80};8182AP_DAC_Params::AP_DAC_Params(void)83{84AP_Param::setup_object_defaults(this, var_info);85}8687#endif // AP_DAC_ENABLED888990