ISSDK  1.7
IoT Sensing Software Development Kit
standard_build.h
Go to the documentation of this file.
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
4  * Copyright 2016-2017 NXP
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,
8  * are permitted (subject to the limitations in the disclaimer below) provided
9  * that the following conditions are met:
10  *
11  * o Redistributions of source code must retain the above copyright notice, this list
12  * of conditions and the following disclaimer.
13  *
14  * o Redistributions in binary form must reproduce the above copyright notice, this
15  * list of conditions and the following disclaimer in the documentation and/or
16  * other materials provided with the distribution.
17  *
18  * o Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 /*! \file standard_build.h
36  \brief A "standard" build configuration file
37 
38  This file contains only those parameters that directly relate to fusion
39  implementation choices. Board dependencies are in hal_<shield_board>.h. Consult the
40  Sensor Fusion User Guide for guidance and details.
41 */
42 
43 #ifndef BUILD_H
44 #define BUILD_H
45 
46 
47 #define THISBUILD 700 ///< define build number sent in debug packet for display purposes only
48 
49 /// @name CoordinateSystemBitFields
50 /// These defines determine the frame of reference (x, y, z axes and Euler angles) standard
51 /// to be used for a particular build. Change THISCOORDSYSTEM to whichever of NED, ANDROID
52 /// or WIN8 you prefer.
53 ///@{
54 #define NED 0 ///< identifier for NED (Aerospace) axes and angles
55 #define ANDROID 1 ///< identifier for Android axes and angles
56 #define WIN8 2 ///< identifier for Windows 8 axes and angles
57 #define THISCOORDSYSTEM NED ///< the coordinate system to be used
58 ///@}
59 
60 ///@{
61 /// @name SensorBitFields
62 /// These bit-field values are used to declare which sensor types are used in the application.
63 /// Change bit-field values to 0x0000 for any features NOT USED
64 #define F_USING_ACCEL 0x0001 ///< nominally 0x0001 if an accelerometer is to be used, 0x0000 otherwise
65 #define F_USING_MAG 0x0002 ///< nominally 0x0002 if an magnetometer is to be used, 0x0000 otherwise
66 #define F_USING_GYRO 0x0004 ///< nominally 0x0004 if a gyro is to be used, 0x0000 otherwise
67 #define F_USING_PRESSURE 0x0008 ///< nominally 0x0008 if altimeter is to be used, 0x0000 otherwise
68 #define F_USING_TEMPERATURE 0x0010 ///< nominally 0x0010 if temp sensor is to be used, 0x0000 otherwise
69 #define F_ALL_SENSORS 0x001F ///< refers to all applicable sensor types for the given physical unit
70 ///@}
71 /// @name FusionSelectionBitFields
72 /// These bit-field values are used to declare which sensor fusion algorithms are used
73 /// in the application. You can use more than one, altough they all run from the same data.
74 /// Change individual bit-field values to 0x0000 for any features NOT USED.
75 ///@{
76 #define F_1DOF_P_BASIC 0x0100 ///< 1DOF pressure (altitude) and temperature algorithm selector - 0x0100 to include, 0x0000 otherwise
77 #define F_3DOF_G_BASIC 0x0200 ///< 3DOF accel tilt (accel) algorithm selector - 0x0200 to include, 0x0000 otherwise
78 #define F_3DOF_B_BASIC 0x0400 ///< 3DOF mag eCompass (vehicle/mag) algorithm selector - 0x0400 to include, 0x0000 otherwise
79 #define F_3DOF_Y_BASIC 0x0800 ///< 3DOF gyro integration algorithm selector - 0x0800 to include, 0x0000 otherwise
80 #define F_6DOF_GB_BASIC 0x1000 ///< 6DOF accel and mag eCompass algorithm selector - 0x1000 to include, 0x0000 otherwise
81 #define F_6DOF_GY_KALMAN 0x2000 ///< 6DOF accel and gyro (Kalman) algorithm selector - 0x2000 to include, 0x0000 otherwise
82 #define F_9DOF_GBY_KALMAN 0x4000 ///< 9DOF accel, mag and gyro algorithm selector - 0x4000 to include, 0x0000 otherwise
83 ///@}
84 
85 /// @name SensorParameters
86 /// FIFO sizes effect the size of the sensor data structures. ODR refers to "Output Data Rate"
87 ///@{
88 #define ACCEL_FIFO_SIZE 32 ///< FXOS8700 (accel), MMA8652, FXLS8952 all have 32 element FIFO
89 #define MAG_FIFO_SIZE 16 ///< FXOS8700 (mag), MAG3110 have no FIFO so equivalent to 1 element FIFO
90 #define GYRO_FIFO_SIZE 32 ///< FXAX21000, FXAS21002 have 32 element FIFO
91 #define ACCEL_ODR_HZ 200 ///< (int) requested accelerometer ODR Hz (over-rides MAG_ODR_HZ for FXOS8700)
92 #define MAG_ODR_HZ 200 ///< (int) requested magnetometer ODR Hz (over-ridden by ACCEL_ODR_HZ for FXOS8700)
93 #define GYRO_ODR_HZ 400 ///< (int) requested gyroscope ODR Hz
94 #define FUSION_HZ 40 ///< (int) actual rate of fusion algorithm execution and sensor FIFO reads
95 #define FAST_LOOP_HZ 80 ///< Over Sample Ratio * FUSION_HZ when using no FIFO
96 #define OVERSAMPLE_RATE FAST_LOOP_HZ/FUSION_HZ
97 ///@}
98 
99 #endif // BUILD_H