Index: Accel.h =================================================================== diff -u -rcc6261f66d7ad49efe9483d354166f03a5254a3d -r2d34a8a22eb654693c6ad85bb471a83f0ded7171 --- Accel.h (.../Accel.h) (revision cc6261f66d7ad49efe9483d354166f03a5254a3d) +++ Accel.h (.../Accel.h) (revision 2d34a8a22eb654693c6ad85bb471a83f0ded7171) @@ -14,72 +14,72 @@ * @date (original) 29-Jul-2020 * ***************************************************************************/ - -#ifndef __ACCEL_H__ -#define __ACCEL_H__ - -#include "Common.h" - -/** - * @defgroup Accel Accel - * @brief Accelerometer monitor module. Monitors the accelerometer sensor (Analog Devices ADXL345). - * - * @addtogroup Accel - * @{ - */ - -// ********** public definitions ********** - -/// Enumeration of accelerometer axes. -typedef enum Accelerometer_Axes -{ - ACCEL_AXIS_X = 0, ///< X axis of accelerometer - ACCEL_AXIS_Y, ///< Y axis of accelerometer - ACCEL_AXIS_Z, ///< Z axis of accelerometer - NUM_OF_ACCEL_AXES ///< Number of accelerometer axes -} ACCEL_AXIS_T; - -/// Record structure for broadcast accelerometer data. -typedef struct -{ - F32 x; ///< X axis reading (in g) - F32 y; ///< Y axis reading (in g) - F32 z; ///< Z axis reading (in g) - F32 xMax; ///< X axis max reading (in g) - F32 yMax; ///< Y axis max reading (in g) - F32 zMax; ///< Z axis max reading - 1.0 (in g) - F32 xTilt; ///< X axis tilt (in degrees) - F32 yTilt; ///< Y axis tilt (in degrees) - F32 zTilt; ///< Z axis tilt (in degrees) -} ACCEL_DATA_PAYLOAD_T; - + +#ifndef __ACCEL_H__ +#define __ACCEL_H__ + +#include "Common.h" + +/** + * @defgroup Accel Accel + * @brief Accelerometer monitor module. Monitors the accelerometer sensor (Analog Devices ADXL345). + * + * @addtogroup Accel + * @{ + */ + +// ********** public definitions ********** + +/// Enumeration of accelerometer axes. +typedef enum Accelerometer_Axes +{ + ACCEL_AXIS_X = 0, ///< X axis of accelerometer + ACCEL_AXIS_Y, ///< Y axis of accelerometer + ACCEL_AXIS_Z, ///< Z axis of accelerometer + NUM_OF_ACCEL_AXES ///< Number of accelerometer axes +} ACCEL_AXIS_T; + +/// Record structure for broadcast accelerometer data. +typedef struct +{ + F32 x; ///< X axis reading (in g) + F32 y; ///< Y axis reading (in g) + F32 z; ///< Z axis reading (in g) + F32 xMax; ///< X axis max reading (in g) + F32 yMax; ///< Y axis max reading (in g) + F32 zMax; ///< Z axis max reading - 1.0 (in g) + F32 xTilt; ///< X axis tilt (in degrees) + F32 yTilt; ///< Y axis tilt (in degrees) + F32 zTilt; ///< Z axis tilt (in degrees) +} ACCEL_DATA_PAYLOAD_T; + /// Payload record structure for an accelerometer calibration message. typedef struct { - F32 xOffset; - F32 yOffset; - F32 zOffset; + F32 xOffset; ///< X offset. + F32 yOffset; ///< Y offset. + F32 zOffset; ///< Z offset. } ACCEL_CAL_PAYLOAD_T; -// ********** public function prototypes ********** - -void initAccel( void ); -void execAccel( void ); - -F32 getMeasuredAccelAxis( U32 axis ); -F32 getMaxAccelAxis( U32 axis ); - +// ********** public function prototypes ********** + +void initAccel( void ); +void execAccel( void ); + +F32 getMeasuredAccelAxis( U32 axis ); +F32 getMaxAccelAxis( U32 axis ); + SELF_TEST_STATUS_T execAccelTest( void ); -void resetAccelPOSTState( void ); - -BOOL testSetAccelDataPublishIntervalOverride( U32 value ); -BOOL testResetAccelDataPublishIntervalOverride( void ); -BOOL testSetAccelAxisOverride( U32 axis, F32 value ); -BOOL testResetAccelAxisOverride( U32 axis ); -BOOL testSetAccelMaxOverride( U32 axis, F32 value ); -BOOL testResetAccelMaxOverride( U32 axis ); - -/**@}*/ - -#endif +void resetAccelPOSTState( void ); + +BOOL testSetAccelDataPublishIntervalOverride( U32 value ); +BOOL testResetAccelDataPublishIntervalOverride( void ); +BOOL testSetAccelAxisOverride( U32 axis, F32 value ); +BOOL testResetAccelAxisOverride( U32 axis ); +BOOL testSetAccelMaxOverride( U32 axis, F32 value ); +BOOL testResetAccelMaxOverride( U32 axis ); + +/**@}*/ + +#endif