ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
fusion_config.h
Go to the documentation of this file.
1 /**
2  * @file fusion_config.h
3  * @brief The \b fusion_config.h file contains additional static configuration for the Sensor Fusion based Virtual Orientation sensor adapter
4 
5  * @copyright Copyright (c) 2014, Freescale Semiconductor, Inc.
6  * @version 01.00
7 */
8 #ifndef FUSION_CONFIG_H_
9 #define FUSION_CONFIG_H_
10 
11 #include "fusion_types.h"
12 
13 // set this value to set parallel (1) or sequential (0) operation of fusion algorithms
14 // a) if defined to be 1 (true) (default for demos) then all algorithms execute in parallel
15 // b) if defined to be 0 (false) then only the one algorithm required to support
16 // pState->algorithmToUse is executed
17 #define PARALLELNOTSEQUENTIAL 1 // default is 1
18 
19 // sampling rate and kalman filter timing
20 #define ORIENTATION_OUTPUT_PERIOD_USECS 40000 // time in usecs between orientation output samples
21 #define SENSORFS (uint32)(1000000.0F/((float)ORIENTATION_OUTPUT_PERIOD_USECS)) // int32: 200Hz: frequency (Hz) of sensor sampling process
22 #define ACCEL_OVERSAMPLE_RATIO 4 // number of accel samples to take per orientation output
23 #define MAG_OVERSAMPLE_RATIO 4 // number of mag samples to take per orientation output
24 #define GYRO_OVERSAMPLE_RATIO 16 // number of gyro samples to take per orientation output
25 #define PRESSURE_OVERSAMPLE_RATIO 1 // number of pressure samples to take per orientation output
26 #define ALGO_CHOICE Q9 // Enum for the fusion algorithm to use in computing the orientation output
27 
28 // normally all enabled: degrees of freedom algorithms to be executed
29 #define COMPUTE_3DOF_G_BASIC // 3DOF accel tilt: (1x accel)
30 #define COMPUTE_3DOF_B_BASIC // 3DOF mag eCompass (vehicle): (1x mag)
31 #define COMPUTE_3DOF_Y_BASIC // 3DOF gyro integration: (1x gyro)
32 #define COMPUTE_6DOF_GB_BASIC // 6DOF accel and mag eCompass: (1x accel + 1x mag)
33 #define COMPUTE_6DOF_GY_KALMAN // 6DOF accel and gyro (Kalman): (1x accel + 1x gyro)
34 #define COMPUTE_9DOF_GBY_KALMAN // 9DOF accel, mag and gyro (Kalman): (1x accel + 1x mag + 1x gyro)
35 
36 // TODO - Check the names in the component vs. the #defines in the code.
37 #define THISCOORDSYSTEM NED // the coordinate system to be used
38 
39 #define USE_ACCELEROMETER
40 #define USE_MAGNETOMETER
41 #define USE_GYROMETER
42 
43 // Coordinate HAL Configuration set based on the Coordinate System selected
44 // Default Values for NED Coordinate System
45 # define ACCEL_GET_HAL_X_VALUE(v) (v)
46 # define ACCEL_HAL_X_INDEX Y
47 # define ACCEL_GET_HAL_Y_VALUE(v) (v)
48 # define ACCEL_HAL_Y_INDEX X
49 # define ACCEL_GET_HAL_Z_VALUE(v) (v)
50 # define ACCEL_HAL_Z_INDEX Z
51 # define MAG_GET_HAL_X_VALUE(v) (-(v))
52 # define MAG_HAL_X_INDEX Y
53 # define MAG_GET_HAL_Y_VALUE(v) (-(v))
54 # define MAG_HAL_Y_INDEX X
55 # define MAG_GET_HAL_Z_VALUE(v) (v) // USING MAG3110
56 # define MAG_HAL_Z_INDEX Z
57 # define GYRO_GET_HAL_X_VALUE(v) (-(v))
58 # define GYRO_HAL_X_INDEX Y
59 # define GYRO_GET_HAL_Y_VALUE(v) (-(v))
60 # define GYRO_HAL_Y_INDEX X
61 # define GYRO_GET_HAL_Z_VALUE(v) (-(v))
62 # define GYRO_HAL_Z_INDEX Z
63 
64 #endif /* FUSION_CONFIG_H_ */
65