2010-06-13 19:21:31 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
2010-08-27 02:15:42 +02:00
|
|
|
* @addtogroup UAVObjects OpenPilot UAVObjects
|
|
|
|
* @{
|
|
|
|
* @addtogroup FlightBatteryState FlightBatteryState
|
2010-12-28 05:28:39 +01:00
|
|
|
* @brief Battery status information.
|
2010-08-27 02:15:42 +02:00
|
|
|
*
|
|
|
|
* Autogenerated files and functions for FlightBatteryState Object
|
|
|
|
|
|
|
|
* @{
|
2010-06-13 19:21:31 +02:00
|
|
|
*
|
|
|
|
* @file flightbatterystate.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @brief Implementation of the FlightBatteryState object. This file has been
|
|
|
|
* automatically generated by the UAVObjectGenerator.
|
|
|
|
*
|
|
|
|
* @note Object definition file: flightbatterystate.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 FLIGHTBATTERYSTATE_H
|
|
|
|
#define FLIGHTBATTERYSTATE_H
|
|
|
|
|
|
|
|
// Object constants
|
2010-12-28 05:28:39 +01:00
|
|
|
#define FLIGHTBATTERYSTATE_OBJID 126985486U
|
2010-06-13 19:21:31 +02:00
|
|
|
#define FLIGHTBATTERYSTATE_NAME "FlightBatteryState"
|
|
|
|
#define FLIGHTBATTERYSTATE_METANAME "FlightBatteryStateMeta"
|
|
|
|
#define FLIGHTBATTERYSTATE_ISSINGLEINST 1
|
|
|
|
#define FLIGHTBATTERYSTATE_ISSETTINGS 0
|
|
|
|
#define FLIGHTBATTERYSTATE_NUMBYTES sizeof(FlightBatteryStateData)
|
|
|
|
|
|
|
|
// Object access macros
|
2010-08-27 02:15:42 +02:00
|
|
|
/**
|
|
|
|
* @function FlightBatteryStateGet(dataOut)
|
|
|
|
* @brief Populate a FlightBatteryStateData object
|
|
|
|
* @param[out] dataOut
|
|
|
|
*/
|
2010-06-13 19:21:31 +02:00
|
|
|
#define FlightBatteryStateGet(dataOut) UAVObjGetData(FlightBatteryStateHandle(), dataOut)
|
|
|
|
#define FlightBatteryStateSet(dataIn) UAVObjSetData(FlightBatteryStateHandle(), dataIn)
|
|
|
|
#define FlightBatteryStateInstGet(instId, dataOut) UAVObjGetInstanceData(FlightBatteryStateHandle(), instId, dataOut)
|
|
|
|
#define FlightBatteryStateInstSet(instId, dataIn) UAVObjSetInstanceData(FlightBatteryStateHandle(), instId, dataIn)
|
|
|
|
#define FlightBatteryStateConnectQueue(queue) UAVObjConnectQueue(FlightBatteryStateHandle(), queue, EV_MASK_ALL_UPDATES)
|
|
|
|
#define FlightBatteryStateConnectCallback(cb) UAVObjConnectCallback(FlightBatteryStateHandle(), cb, EV_MASK_ALL_UPDATES)
|
|
|
|
#define FlightBatteryStateCreateInstance() UAVObjCreateInstance(FlightBatteryStateHandle())
|
|
|
|
#define FlightBatteryStateRequestUpdate() UAVObjRequestUpdate(FlightBatteryStateHandle())
|
|
|
|
#define FlightBatteryStateRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(FlightBatteryStateHandle(), instId)
|
|
|
|
#define FlightBatteryStateUpdated() UAVObjUpdated(FlightBatteryStateHandle())
|
|
|
|
#define FlightBatteryStateInstUpdated(instId) UAVObjUpdated(FlightBatteryStateHandle(), instId)
|
|
|
|
#define FlightBatteryStateGetMetadata(dataOut) UAVObjGetMetadata(FlightBatteryStateHandle(), dataOut)
|
|
|
|
#define FlightBatteryStateSetMetadata(dataIn) UAVObjSetMetadata(FlightBatteryStateHandle(), dataIn)
|
2010-08-27 02:15:48 +02:00
|
|
|
#define FlightBatteryStateReadOnly(dataIn) UAVObjReadOnly(FlightBatteryStateHandle())
|
2010-06-13 19:21:31 +02:00
|
|
|
|
|
|
|
// Object data
|
|
|
|
typedef struct {
|
2010-06-26 12:59:11 +02:00
|
|
|
float Voltage;
|
|
|
|
float Current;
|
2010-12-28 05:28:39 +01:00
|
|
|
float PeakCurrent;
|
|
|
|
float AvgCurrent;
|
|
|
|
float ConsumedEnergy;
|
|
|
|
float EstimatedFlightTime;
|
2010-06-13 19:21:31 +02:00
|
|
|
|
|
|
|
} __attribute__((packed)) FlightBatteryStateData;
|
|
|
|
|
|
|
|
// Field information
|
2010-06-16 15:41:10 +02:00
|
|
|
// Field Voltage information
|
2010-06-13 19:21:31 +02:00
|
|
|
// Field Current information
|
2010-12-28 05:28:39 +01:00
|
|
|
// Field PeakCurrent information
|
|
|
|
// Field AvgCurrent information
|
2010-06-13 19:21:31 +02:00
|
|
|
// Field ConsumedEnergy information
|
2010-12-28 05:28:39 +01:00
|
|
|
// Field EstimatedFlightTime information
|
2010-06-13 19:21:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Generic interface functions
|
|
|
|
int32_t FlightBatteryStateInitialize();
|
|
|
|
UAVObjHandle FlightBatteryStateHandle();
|
|
|
|
|
|
|
|
#endif // FLIGHTBATTERYSTATE_H
|
2010-08-27 02:15:42 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
* @}
|
2010-09-03 01:55:24 +02:00
|
|
|
*/
|