/** ****************************************************************************** * @addtogroup UAVObjects OpenPilot UAVObjects * @{ * @addtogroup BatterySettings BatterySettings * @brief Battery configuration information. * * Autogenerated files and functions for BatterySettings Object * @{ * * @file batterysettings.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief Implementation of the BatterySettings object. This file has been * automatically generated by the UAVObjectGenerator. * * @note Object definition file: batterysettings.xml. * This is an automatically generated file. * DO NOT modify manually. * * @see The GNU Public License (GPL) Version 3 * *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef BATTERYSETTINGS_H #define BATTERYSETTINGS_H // Object constants #define BATTERYSETTINGS_OBJID 2784959898U #define BATTERYSETTINGS_NAME "BatterySettings" #define BATTERYSETTINGS_METANAME "BatterySettingsMeta" #define BATTERYSETTINGS_ISSINGLEINST 1 #define BATTERYSETTINGS_ISSETTINGS 1 #define BATTERYSETTINGS_NUMBYTES sizeof(BatterySettingsData) // Object access macros /** * @function BatterySettingsGet(dataOut) * @brief Populate a BatterySettingsData object * @param[out] dataOut */ #define BatterySettingsGet(dataOut) UAVObjGetData(BatterySettingsHandle(), dataOut) #define BatterySettingsSet(dataIn) UAVObjSetData(BatterySettingsHandle(), dataIn) #define BatterySettingsInstGet(instId, dataOut) UAVObjGetInstanceData(BatterySettingsHandle(), instId, dataOut) #define BatterySettingsInstSet(instId, dataIn) UAVObjSetInstanceData(BatterySettingsHandle(), instId, dataIn) #define BatterySettingsConnectQueue(queue) UAVObjConnectQueue(BatterySettingsHandle(), queue, EV_MASK_ALL_UPDATES) #define BatterySettingsConnectCallback(cb) UAVObjConnectCallback(BatterySettingsHandle(), cb, EV_MASK_ALL_UPDATES) #define BatterySettingsCreateInstance() UAVObjCreateInstance(BatterySettingsHandle()) #define BatterySettingsRequestUpdate() UAVObjRequestUpdate(BatterySettingsHandle()) #define BatterySettingsRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(BatterySettingsHandle(), instId) #define BatterySettingsUpdated() UAVObjUpdated(BatterySettingsHandle()) #define BatterySettingsInstUpdated(instId) UAVObjUpdated(BatterySettingsHandle(), instId) #define BatterySettingsGetMetadata(dataOut) UAVObjGetMetadata(BatterySettingsHandle(), dataOut) #define BatterySettingsSetMetadata(dataIn) UAVObjSetMetadata(BatterySettingsHandle(), dataIn) #define BatterySettingsReadOnly(dataIn) UAVObjReadOnly(BatterySettingsHandle()) // Object data typedef struct { float BatteryVoltage; uint32_t BatteryCapacity; uint8_t BatteryType; float Calibrations[2]; } __attribute__((packed)) BatterySettingsData; // Field information // Field BatteryVoltage information // Field BatteryCapacity information // Field BatteryType information /* Enumeration options for field BatteryType */ typedef enum { BATTERYSETTINGS_BATTERYTYPE_LIPO=0, BATTERYSETTINGS_BATTERYTYPE_A123=1, BATTERYSETTINGS_BATTERYTYPE_LICO=2, BATTERYSETTINGS_BATTERYTYPE_LIFESO4=3, BATTERYSETTINGS_BATTERYTYPE_NONE=4 } BatterySettingsBatteryTypeOptions; // Field Calibrations information /* Array element names for field Calibrations */ typedef enum { BATTERYSETTINGS_CALIBRATIONS_VOLTAGE=0, BATTERYSETTINGS_CALIBRATIONS_CURRENT=1 } BatterySettingsCalibrationsElem; /* Number of elements for field Calibrations */ #define BATTERYSETTINGS_CALIBRATIONS_NUMELEM 2 // Generic interface functions int32_t BatterySettingsInitialize(); UAVObjHandle BatterySettingsHandle(); #endif // BATTERYSETTINGS_H /** * @} * @} */