mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
d02a3325d9
This module reads from the BMP085 pressure sensor. It periodically updates the pressure (kPa) and temperature (C) as well as the calculated altitude (m). git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@640 ebee16cc-31ac-478f-84a7-5cbb03baadba
77 lines
3.3 KiB
C
77 lines
3.3 KiB
C
/**
|
|
******************************************************************************
|
|
*
|
|
* @file altitudeactual.h
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
* @brief Implementation of the AltitudeActual object. This file has been
|
|
* automatically generated by the UAVObjectGenerator.
|
|
*
|
|
* @note Object definition file: altitudeactual.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 ALTITUDEACTUAL_H
|
|
#define ALTITUDEACTUAL_H
|
|
|
|
// Object constants
|
|
#define ALTITUDEACTUAL_OBJID 2251817750U
|
|
#define ALTITUDEACTUAL_NAME "AltitudeActual"
|
|
#define ALTITUDEACTUAL_METANAME "AltitudeActualMeta"
|
|
#define ALTITUDEACTUAL_ISSINGLEINST 1
|
|
#define ALTITUDEACTUAL_ISSETTINGS 0
|
|
#define ALTITUDEACTUAL_NUMBYTES sizeof(AltitudeActualData)
|
|
|
|
// Object access macros
|
|
#define AltitudeActualGet(dataOut) UAVObjGetData(AltitudeActualHandle(), dataOut)
|
|
#define AltitudeActualSet(dataIn) UAVObjSetData(AltitudeActualHandle(), dataIn)
|
|
#define AltitudeActualInstGet(instId, dataOut) UAVObjGetInstanceData(AltitudeActualHandle(), instId, dataOut)
|
|
#define AltitudeActualInstSet(instId, dataIn) UAVObjSetInstanceData(AltitudeActualHandle(), instId, dataIn)
|
|
#define AltitudeActualConnectQueue(queue) UAVObjConnectQueue(AltitudeActualHandle(), queue, EV_MASK_ALL_UPDATES)
|
|
#define AltitudeActualConnectCallback(cb) UAVObjConnectCallback(AltitudeActualHandle(), cb, EV_MASK_ALL_UPDATES)
|
|
#define AltitudeActualCreateInstance() UAVObjCreateInstance(AltitudeActualHandle())
|
|
#define AltitudeActualRequestUpdate() UAVObjRequestUpdate(AltitudeActualHandle())
|
|
#define AltitudeActualRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(AltitudeActualHandle(), instId)
|
|
#define AltitudeActualUpdated() UAVObjUpdated(AltitudeActualHandle())
|
|
#define AltitudeActualInstUpdated(instId) UAVObjUpdated(AltitudeActualHandle(), instId)
|
|
#define AltitudeActualGetMetadata(dataOut) UAVObjGetMetadata(AltitudeActualHandle(), dataOut)
|
|
#define AltitudeActualSetMetadata(dataIn) UAVObjSetMetadata(AltitudeActualHandle(), dataIn)
|
|
|
|
// Object data
|
|
typedef struct {
|
|
float Altitude;
|
|
float Temperature;
|
|
float Pressure;
|
|
|
|
} __attribute__((packed)) AltitudeActualData;
|
|
|
|
// Field information
|
|
// Field Altitude information
|
|
// Field Temperature information
|
|
// Field Pressure information
|
|
|
|
|
|
// Generic interface functions
|
|
int32_t AltitudeActualInitialize();
|
|
UAVObjHandle AltitudeActualHandle();
|
|
|
|
#endif // ALTITUDEACTUAL_H
|