2010-02-22 03:18:23 +01:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
2010-08-27 02:15:42 +02:00
|
|
|
* @addtogroup UAVObjects OpenPilot UAVObjects
|
|
|
|
* @{
|
|
|
|
* @addtogroup $(NAME) $(NAME)
|
|
|
|
* @brief $(DESCRIPTION)
|
|
|
|
*
|
|
|
|
* Autogenerated files and functions for $(NAME) Object
|
|
|
|
|
|
|
|
* @{
|
2010-02-22 03:18:23 +01:00
|
|
|
*
|
2010-03-27 04:19:56 +01:00
|
|
|
* @file $(NAMELC).h
|
2010-02-22 03:18:23 +01:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
2010-03-27 04:19:56 +01:00
|
|
|
* @brief Implementation of the $(NAME) object. This file has been
|
|
|
|
* automatically generated by the UAVObjectGenerator.
|
|
|
|
*
|
|
|
|
* @note Object definition file: $(XMLFILE).
|
|
|
|
* This is an automatically generated file.
|
|
|
|
* DO NOT modify manually.
|
2010-02-22 03:18:23 +01:00
|
|
|
*
|
|
|
|
* @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 $(NAMEUC)_H
|
|
|
|
#define $(NAMEUC)_H
|
|
|
|
|
2010-02-27 20:57:45 +01:00
|
|
|
// Object constants
|
2011-01-15 18:00:17 +01:00
|
|
|
#define $(NAMEUC)_OBJID $(OBJIDHEX)
|
2010-03-29 00:23:57 +02:00
|
|
|
#define $(NAMEUC)_ISSINGLEINST $(ISSINGLEINST)
|
|
|
|
#define $(NAMEUC)_ISSETTINGS $(ISSETTINGS)
|
2010-02-27 20:57:45 +01:00
|
|
|
#define $(NAMEUC)_NUMBYTES sizeof($(NAME)Data)
|
|
|
|
|
2012-11-10 11:17:10 +01:00
|
|
|
// Generic interface functions
|
|
|
|
int32_t $(NAME)Initialize();
|
|
|
|
UAVObjHandle $(NAME)Handle();
|
|
|
|
void $(NAME)SetDefaults(UAVObjHandle obj, uint16_t instId);
|
|
|
|
|
|
|
|
// Object data
|
|
|
|
typedef struct {
|
|
|
|
$(DATAFIELDS)
|
|
|
|
} __attribute__((packed)) $(NAME)Data;
|
|
|
|
|
|
|
|
// Typesafe Object access functions
|
2010-08-27 02:15:42 +02:00
|
|
|
/**
|
|
|
|
* @function $(NAME)Get(dataOut)
|
|
|
|
* @brief Populate a $(NAME)Data object
|
|
|
|
* @param[out] dataOut
|
|
|
|
*/
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)Get($(NAME)Data *dataOut) { return UAVObjGetData($(NAME)Handle(), dataOut); }
|
2010-02-22 03:18:23 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)Set(const $(NAME)Data *dataIn) { return UAVObjSetData($(NAME)Handle(), dataIn); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)InstGet(uint16_t instId, $(NAME)Data *dataOut) { return UAVObjGetInstanceData($(NAME)Handle(), instId, dataOut); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)InstSet(uint16_t instId, const $(NAME)Data *dataIn) { return UAVObjSetInstanceData($(NAME)Handle(), instId, dataIn); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)ConnectQueue(xQueueHandle queue) { return UAVObjConnectQueue($(NAME)Handle(), queue, EV_MASK_ALL_UPDATES); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)ConnectCallback(UAVObjEventCallback cb) { return UAVObjConnectCallback($(NAME)Handle(), cb, EV_MASK_ALL_UPDATES); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline uint16_t $(NAME)CreateInstance() { return UAVObjCreateInstance($(NAME)Handle(), &$(NAME)SetDefaults); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline void $(NAME)RequestUpdate() { UAVObjRequestUpdate($(NAME)Handle()); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline void $(NAME)RequestInstUpdate(uint16_t instId) { UAVObjRequestInstanceUpdate($(NAME)Handle(), instId); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline void $(NAME)Updated() { UAVObjUpdated($(NAME)Handle()); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline void $(NAME)InstUpdated(uint16_t instId) { UAVObjInstanceUpdated($(NAME)Handle(), instId); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)GetMetadata(UAVObjMetadata *dataOut) { return UAVObjGetMetadata($(NAME)Handle(), dataOut); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int32_t $(NAME)SetMetadata(const UAVObjMetadata *dataIn) { return UAVObjSetMetadata($(NAME)Handle(), dataIn); }
|
2012-11-10 11:17:10 +01:00
|
|
|
|
2012-11-22 21:45:28 +01:00
|
|
|
static inline int8_t $(NAME)ReadOnly() { return UAVObjReadOnly($(NAME)Handle()); }
|
2010-02-22 03:18:23 +01:00
|
|
|
|
2010-04-27 03:55:28 +02:00
|
|
|
// Field information
|
|
|
|
$(DATAFIELDINFO)
|
2010-04-01 04:03:40 +02:00
|
|
|
|
2011-06-03 06:18:34 +02:00
|
|
|
// set/Get functions
|
|
|
|
$(SETGETFIELDSEXTERN)
|
|
|
|
|
2010-03-27 04:19:56 +01:00
|
|
|
#endif // $(NAMEUC)_H
|
2010-08-27 02:15:42 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
* @}
|
2010-09-03 01:55:24 +02:00
|
|
|
*/
|