mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-13 20:48:42 +01:00
108 lines
4.0 KiB
C
108 lines
4.0 KiB
C
|
/**
|
||
|
******************************************************************************
|
||
|
* @addtogroup UAVObjects OpenPilot UAVObjects
|
||
|
* @{
|
||
|
* @addtogroup I2CStats I2CStats
|
||
|
* @brief Tracks statistics on the I2C bus.
|
||
|
*
|
||
|
* Autogenerated files and functions for I2CStats Object
|
||
|
|
||
|
* @{
|
||
|
*
|
||
|
* @file i2cstats.h
|
||
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
||
|
* @brief Implementation of the I2CStats object. This file has been
|
||
|
* automatically generated by the UAVObjectGenerator.
|
||
|
*
|
||
|
* @note Object definition file: i2cstats.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 I2CSTATS_H
|
||
|
#define I2CSTATS_H
|
||
|
|
||
|
// Object constants
|
||
|
#define I2CSTATS_OBJID 1063893720U
|
||
|
#define I2CSTATS_NAME "I2CStats"
|
||
|
#define I2CSTATS_METANAME "I2CStatsMeta"
|
||
|
#define I2CSTATS_ISSINGLEINST 1
|
||
|
#define I2CSTATS_ISSETTINGS 0
|
||
|
#define I2CSTATS_NUMBYTES sizeof(I2CStatsData)
|
||
|
|
||
|
// Object access macros
|
||
|
/**
|
||
|
* @function I2CStatsGet(dataOut)
|
||
|
* @brief Populate a I2CStatsData object
|
||
|
* @param[out] dataOut
|
||
|
*/
|
||
|
#define I2CStatsGet(dataOut) UAVObjGetData(I2CStatsHandle(), dataOut)
|
||
|
#define I2CStatsSet(dataIn) UAVObjSetData(I2CStatsHandle(), dataIn)
|
||
|
#define I2CStatsInstGet(instId, dataOut) UAVObjGetInstanceData(I2CStatsHandle(), instId, dataOut)
|
||
|
#define I2CStatsInstSet(instId, dataIn) UAVObjSetInstanceData(I2CStatsHandle(), instId, dataIn)
|
||
|
#define I2CStatsConnectQueue(queue) UAVObjConnectQueue(I2CStatsHandle(), queue, EV_MASK_ALL_UPDATES)
|
||
|
#define I2CStatsConnectCallback(cb) UAVObjConnectCallback(I2CStatsHandle(), cb, EV_MASK_ALL_UPDATES)
|
||
|
#define I2CStatsCreateInstance() UAVObjCreateInstance(I2CStatsHandle())
|
||
|
#define I2CStatsRequestUpdate() UAVObjRequestUpdate(I2CStatsHandle())
|
||
|
#define I2CStatsRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(I2CStatsHandle(), instId)
|
||
|
#define I2CStatsUpdated() UAVObjUpdated(I2CStatsHandle())
|
||
|
#define I2CStatsInstUpdated(instId) UAVObjUpdated(I2CStatsHandle(), instId)
|
||
|
#define I2CStatsGetMetadata(dataOut) UAVObjGetMetadata(I2CStatsHandle(), dataOut)
|
||
|
#define I2CStatsSetMetadata(dataIn) UAVObjSetMetadata(I2CStatsHandle(), dataIn)
|
||
|
#define I2CStatsReadOnly(dataIn) UAVObjReadOnly(I2CStatsHandle())
|
||
|
|
||
|
// Object data
|
||
|
typedef struct {
|
||
|
uint16_t event_errors;
|
||
|
uint16_t fsm_errors;
|
||
|
uint16_t irq_errors;
|
||
|
uint8_t last_error_type;
|
||
|
uint32_t event_log[5];
|
||
|
uint32_t state_log[5];
|
||
|
|
||
|
} __attribute__((packed)) I2CStatsData;
|
||
|
|
||
|
// Field information
|
||
|
// Field event_errors information
|
||
|
// Field fsm_errors information
|
||
|
// Field irq_errors information
|
||
|
// Field last_error_type information
|
||
|
/* Enumeration options for field last_error_type */
|
||
|
typedef enum { I2CSTATS_LAST_ERROR_TYPE_EVENT=0, I2CSTATS_LAST_ERROR_TYPE_FSM=1, I2CSTATS_LAST_ERROR_TYPE_INTERRUPT=2 } I2CStatslast_error_typeOptions;
|
||
|
// Field event_log information
|
||
|
/* Number of elements for field event_log */
|
||
|
#define I2CSTATS_EVENT_LOG_NUMELEM 5
|
||
|
// Field state_log information
|
||
|
/* Number of elements for field state_log */
|
||
|
#define I2CSTATS_STATE_LOG_NUMELEM 5
|
||
|
|
||
|
|
||
|
// Generic interface functions
|
||
|
int32_t I2CStatsInitialize();
|
||
|
UAVObjHandle I2CStatsHandle();
|
||
|
|
||
|
#endif // I2CSTATS_H
|
||
|
|
||
|
/**
|
||
|
* @}
|
||
|
* @}
|
||
|
*/
|