ISSDK  1.7
IoT Sensing Software Development Kit
DecodeCommandBytes.c
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 DecodeCommandBytes.c
36  \brief Command interpreter which interfaces to the Sensor Fusion Toolbox
37 */
38 
39 #include "sensor_fusion.h"
40 #include "control.h"
41 #include "fusion.h"
42 #include "calibration_storage.h"
43 // All commands for the command interpreter are exactly 4 characters long.
44 // The command interpeter converts the incoming packet to a 32-bit integer, which is then
45 // the index into a large switch statement for processing commands.
46 // The following block of #define statements are responsible for the conversion from 4-characters
47 // into an easier to use integer format.
48 #define cmd_VGplus (((((('V' << 8) | 'G') << 8) | '+') << 8) | ' ') // "VG+ " = enable angular velocity packet transmission
49 #define cmd_VGminus (((((('V' << 8) | 'G') << 8) | '-') << 8) | ' ') // "VG- " = disable angular velocity packet transmission
50 #define cmd_DBplus (((((('D' << 8) | 'B') << 8) | '+') << 8) | ' ') // "DB+ " = enable debug packet transmission
51 #define cmd_DBminus (((((('D' << 8) | 'B') << 8) | '-') << 8) | ' ') // "DB- " = disable debug packet transmission
52 #define cmd_Q3 (((((('Q' << 8) | '3') << 8) | ' ') << 8) | ' ') // "Q3 " = transmit 3-axis accelerometer quaternion in standard packet
53 #define cmd_Q3M (((((('Q' << 8) | '3') << 8) | 'M') << 8) | ' ') // "Q3M " = transmit 3-axis magnetic quaternion in standard packet
54 #define cmd_Q3G (((((('Q' << 8) | '3') << 8) | 'G') << 8) | ' ') // "Q3G " = transmit 3-axis gyro quaternion in standard packet
55 #define cmd_Q6MA (((((('Q' << 8) | '6') << 8) | 'M') << 8) | 'A') // "Q6MA" = transmit 6-axis mag/accel quaternion in standard packet
56 #define cmd_Q6AG (((((('Q' << 8) | '6') << 8) | 'A') << 8) | 'G') // "Q6AG" = transmit 6-axis accel/gyro quaternion in standard packet
57 #define cmd_Q9 (((((('Q' << 8) | '9') << 8) | ' ') << 8) | ' ') // "Q9 " = transmit 9-axis quaternion in standard packet (default)
58 #define cmd_RPCplus (((((('R' << 8) | 'P') << 8) | 'C') << 8) | '+') // "RPC+" = Roll/Pitch/Compass on
59 #define cmd_RPCminus (((((('R' << 8) | 'P') << 8) | 'C') << 8) | '-') // "RPC-" = Roll/Pitch/Compass off
60 #define cmd_ALTplus (((((('A' << 8) | 'L') << 8) | 'T') << 8) | '+') // "ALT+" = Altitude packet on
61 #define cmd_ALTminus (((((('A' << 8) | 'L') << 8) | 'T') << 8) | '-') // "ALT-" = Altitude packet off
62 #define cmd_RST (((((('R' << 8) | 'S') << 8) | 'T') << 8) | ' ') // "RST " = Soft reset
63 #define cmd_RINS (((((('R' << 8) | 'I') << 8) | 'N') << 8) | 'S') // "RINS" = Reset INS inertial navigation velocity and position
64 #define cmd_SVAC (((((('S' << 8) | 'V') << 8) | 'A') << 8) | 'C') // "SVAC" = save all calibrations to Kinetis flash
65 #define cmd_SVMC (((((('S' << 8) | 'V') << 8) | 'M') << 8) | 'C') // "SVMC" = save magnetic calibration to Kinetis flash
66 #define cmd_SVYC (((((('S' << 8) | 'V') << 8) | 'Y') << 8) | 'C') // "SVYC" = save gyroscope calibration to Kinetis flash
67 #define cmd_SVGC (((((('S' << 8) | 'V') << 8) | 'G') << 8) | 'C') // "SVGC" = save precision accelerometer calibration to Kinetis flash
68 #define cmd_ERAC (((((('E' << 8) | 'R') << 8) | 'A') << 8) | 'C') // "ERAC" = erase all calibrations from Kinetis flash
69 #define cmd_ERMC (((((('E' << 8) | 'R') << 8) | 'M') << 8) | 'C') // "ERMC" = erase magnetic calibration from Kinetis flash
70 #define cmd_ERYC (((((('E' << 8) | 'R') << 8) | 'Y') << 8) | 'C') // "ERYC" = erase gyro offset calibration from Kinetis flash
71 #define cmd_ERGC (((((('E' << 8) | 'R') << 8) | 'G') << 8) | 'C') // "ERGC" = erase precision accelerometer calibration from Kinetis flash
72 #define cmd_180X (((((('1' << 8) | '8') << 8) | '0') << 8) | 'X') // "180X" perturbation
73 #define cmd_180Y (((((('1' << 8) | '8') << 8) | '0') << 8) | 'Y') // "180Y" perturbation
74 #define cmd_180Z (((((('1' << 8) | '8') << 8) | '0') << 8) | 'Z') // "180Z" perturbation
75 #define cmd_M90X (((((('M' << 8) | '9') << 8) | '0') << 8) | 'X') // "M90X" perturbation
76 #define cmd_P90X (((((('P' << 8) | '9') << 8) | '0') << 8) | 'X') // "P90X" perturbation
77 #define cmd_M90Y (((((('M' << 8) | '9') << 8) | '0') << 8) | 'Y') // "M90Y" perturbation
78 #define cmd_P90Y (((((('P' << 8) | '9') << 8) | '0') << 8) | 'Y') // "P90Y" perturbation
79 #define cmd_M90Z (((((('M' << 8) | '9') << 8) | '0') << 8) | 'Z') // "M90Z" perturbation
80 #define cmd_P90Z (((((('P' << 8) | '9') << 8) | '0') << 8) | 'Z') // "P90Z" perturbation
81 #define cmd_PA00 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '0') // "PA00" average precision accelerometer location 0
82 #define cmd_PA01 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '1') // "PA01" average precision accelerometer location 1
83 #define cmd_PA02 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '2') // "PA02" average precision accelerometer location 2
84 #define cmd_PA03 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '3') // "PA03" average precision accelerometer location 3
85 #define cmd_PA04 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '4') // "PA04" average precision accelerometer location 4
86 #define cmd_PA05 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '5') // "PA05" average precision accelerometer location 5
87 #define cmd_PA06 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '6') // "PA06" average precision accelerometer location 6
88 #define cmd_PA07 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '7') // "PA07" average precision accelerometer location 7
89 #define cmd_PA08 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '8') // "PA08" average precision accelerometer location 8
90 #define cmd_PA09 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '9') // "PA09" average precision accelerometer location 9
91 #define cmd_PA10 (((((('P' << 8) | 'A') << 8) | '1') << 8) | '0') // "PA10" average precision accelerometer location 10
92 #define cmd_PA11 (((((('P' << 8) | 'A') << 8) | '1') << 8) | '1') // "PA11" average precision accelerometer location 11
93 
94 void DecodeCommandBytes(SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[], uint16 nbytes)
95 {
96  int32 isum; // 32 bit command identifier
97  int16 i, j; // loop counters
98 
99  // parse all received bytes in sUARTInputBuf into the iCommandBuffer delay line
100  for (i = 0; i < nbytes; i++) {
101  // shuffle the iCommandBuffer delay line and add the new command byte
102  for (j = 0; j < 3; j++)
103  iCommandBuffer[j] = iCommandBuffer[j + 1];
104  iCommandBuffer[3] = sUART_InputBuffer[i];
105 
106  // check if we have a valid command yet
107  isum = ((((((int32)iCommandBuffer[0] << 8) | iCommandBuffer[1]) << 8) | iCommandBuffer[2]) << 8) | iCommandBuffer[3];
108  switch (isum) {
109  case cmd_VGplus: // "VG+ " = enable angular velocity packet transmission
111  iCommandBuffer[3] = '~';
112  break;
113 
114  case cmd_VGminus: // "VG- " = disable angular velocity packet transmission
116  iCommandBuffer[3] = '~';
117  break;
118 
119  case cmd_DBplus: // "DB+ " = enable debug packet transmission
120  sfg->pControlSubsystem->DebugPacketOn = true;
121  iCommandBuffer[3] = '~';
122  break;
123 
124  case cmd_DBminus: // "DB- " = disable debug packet transmission
125  sfg->pControlSubsystem->DebugPacketOn = false;
126  iCommandBuffer[3] = '~';
127  break;
128 
129  case cmd_Q3: // "Q3 " = transmit 3-axis accelerometer quaternion in standard packet
130 #if F_3DOF_G_BASIC
132 #endif
133  iCommandBuffer[3] = '~';
134  break;
135 
136  case cmd_Q3M: // "Q3M " = transmit 3-axis magnetometer quaternion in standard packet
137 #if F_3DOF_B_BASIC
139 #endif
140  iCommandBuffer[3] = '~';
141  break;
142 
143  case cmd_Q3G: // "Q3G " = transmit 3-axis gyro quaternion in standard packet
144 #if F_3DOF_Y_BASIC
146 #endif
147  iCommandBuffer[3] = '~';
148  break;
149 
150  case cmd_Q6MA: // "Q6MA" = transmit 6-axis mag/accel quaternion in standard packet
151 #if F_6DOF_GB_BASIC
153 #endif
154  iCommandBuffer[3] = '~';
155  break;
156 
157  case cmd_Q6AG: // "Q6AG" = transmit 6-axis accel/gyro quaternion in standard packet
158 #if F_6DOF_GY_KALMAN
160 #endif
161  iCommandBuffer[3] = '~';
162  break;
163 
164  case cmd_Q9: // "Q9 " = transmit 9-axis quaternion in standard packet (default)
165 #if F_9DOF_GBY_KALMAN
167 #endif
168  iCommandBuffer[3] = '~';
169  break;
170 
171  case cmd_RPCplus: // "RPC+" = Roll/Pitch/Compass on
172  sfg->pControlSubsystem->RPCPacketOn = true;
173  iCommandBuffer[3] = '~';
174  break;
175 
176  case cmd_RPCminus: // "RPC-" = Roll/Pitch/Compass off
177  sfg->pControlSubsystem->RPCPacketOn = false;
178  iCommandBuffer[3] = '~';
179  break;
180 
181  case cmd_ALTplus: // "ALT+" = Altitude packet on
182  sfg->pControlSubsystem->AltPacketOn = true;
183  iCommandBuffer[3] = '~';
184  break;
185 
186  case cmd_ALTminus: // "ALT-" = Altitude packet off
187  sfg->pControlSubsystem->AltPacketOn = false;
188  iCommandBuffer[3] = '~';
189  break;
190 
191  case cmd_RST: // "RST " = Soft reset
192  // reset sensor fusion
193  fInitializeFusion(sfg);
194 
195  // reset magnetic calibration and magnetometer data buffer
196 #if F_USING_MAG
198 #endif
199  // reset precision accelerometer calibration and accelerometer measurements
200 #if F_USING_ACCEL
201  fInitializeAccelCalibration(&sfg->AccelCal, &sfg->AccelBuffer, &(sfg->pControlSubsystem->AccelCalPacketOn)) ;
202 #endif
203  iCommandBuffer[3] = '~';
204  break;
205 
206  case cmd_RINS: // "RINS" = Reset INS inertial navigation velocity and position
207 #if F_9DOF_GBY_KALMAN
208  for (i = CHX; i <= CHZ; i++) {
209  sfg->SV_9DOF_GBY_KALMAN.fVelGl[i] = 0.0F;
210  sfg->SV_9DOF_GBY_KALMAN.fDisGl[i] = 0.0F;
211  }
212 #endif
213  iCommandBuffer[3] = '~';
214  break;
215 
216  case cmd_SVAC: // "SVAC" = save all calibrations to Kinetis flash
220  iCommandBuffer[3] = '~';
221  break;
222 
223  case cmd_SVMC: // "SVMC" = save magnetic calibration to Kinetis flash
225  iCommandBuffer[3] = '~';
226  break;
227 
228  case cmd_SVYC: // "SVYC" = save gyroscope calibration to Kinetis flash
230  iCommandBuffer[3] = '~';
231  break;
232 
233  case cmd_SVGC: // "SVGC" = save precision accelerometer calibration to Kinetis flash
235  iCommandBuffer[3] = '~';
236  break;
237 
238  case cmd_ERAC: // "ERAC" = erase all calibrations from Kinetis flash
242  iCommandBuffer[3] = '~';
243  break;
244 
245  case cmd_ERMC: // "ERMC" = erase magnetic calibration offset 0 bytes from Kinetis flash
247  iCommandBuffer[3] = '~';
248  break;
249 
250  case cmd_ERYC: // "ERYC" = erase gyro offset calibrationoffset 128 bytes from Kinetis flash
252  iCommandBuffer[3] = '~';
253  break;
254 
255  case cmd_ERGC: // "ERGC" = erase precision accelerometer calibration offset 192 bytesfrom Kinetis flash
257  iCommandBuffer[3] = '~';
258  break;
259 
260  case cmd_180X: // "180X" perturbation
261  sfg->iPerturbation = 1;
262  iCommandBuffer[3] = '~';
263  break;
264 
265  case cmd_180Y: // "180Y" perturbation
266  sfg->iPerturbation = 2;
267  iCommandBuffer[3] = '~';
268  break;
269 
270  case cmd_180Z: // "180Z" perturbation
271  sfg->iPerturbation = 3;
272  iCommandBuffer[3] = '~';
273  break;
274 
275  case cmd_M90X: // "M90X" perturbation
276  sfg->iPerturbation = 4;
277  iCommandBuffer[3] = '~';
278  break;
279 
280  case cmd_P90X: // "P90X" perturbation
281  sfg->iPerturbation = 5;
282  iCommandBuffer[3] = '~';
283  break;
284 
285  case cmd_M90Y: // "M90Y" perturbation
286  sfg->iPerturbation = 6;
287  iCommandBuffer[3] = '~';
288  break;
289 
290  case cmd_P90Y: // "P90Y" perturbation
291  sfg->iPerturbation = 7;
292  iCommandBuffer[3] = '~';
293  break;
294 
295  case cmd_M90Z: // "M90Z" perturbation
296  sfg->iPerturbation = 8;
297  iCommandBuffer[3] = '~';
298  break;
299 
300  case cmd_P90Z: // "P90Z" perturbation
301  sfg->iPerturbation = 9;
302  iCommandBuffer[3] = '~';
303  break;
304 
305 #if F_USING_ACCEL
306  case cmd_PA00: // "PA00" average precision accelerometer location 0
307  sfg->AccelBuffer.iStoreLocation = 0;
308  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
309  iCommandBuffer[3] = '~';
310  break;
311 
312  case cmd_PA01: // "PA01" average precision accelerometer location 1
313  sfg->AccelBuffer.iStoreLocation = 1;
314  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
315  iCommandBuffer[3] = '~';
316  break;
317 
318  case cmd_PA02: // "PA02" average precision accelerometer location 2
319  sfg->AccelBuffer.iStoreLocation = 2;
320  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
321  iCommandBuffer[3] = '~';
322  break;
323 
324  case cmd_PA03: // "PA03" average precision accelerometer location 3
325  sfg->AccelBuffer.iStoreLocation = 3;
326  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
327  iCommandBuffer[3] = '~';
328  break;
329 
330  case cmd_PA04: // "PA04" average precision accelerometer location 4
331  sfg->AccelBuffer.iStoreLocation = 4;
332  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
333  iCommandBuffer[3] = '~';
334  break;
335 
336  case cmd_PA05: // "PA05" average precision accelerometer location 5
337  sfg->AccelBuffer.iStoreLocation = 5;
338  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
339  iCommandBuffer[3] = '~';
340  break;
341 
342  case cmd_PA06: // "PA06" average precision accelerometer location 6
343  sfg->AccelBuffer.iStoreLocation = 6;
344  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
345  iCommandBuffer[3] = '~';
346  break;
347 
348  case cmd_PA07: // "PA07" average precision accelerometer location 7
349  sfg->AccelBuffer.iStoreLocation = 7;
350  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
351  iCommandBuffer[3] = '~';
352  break;
353 
354  case cmd_PA08: // "PA08" average precision accelerometer location 8
355  sfg->AccelBuffer.iStoreLocation = 8;
356  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
357  iCommandBuffer[3] = '~';
358  break;
359 
360  case cmd_PA09: // "PA09" average precision accelerometer location 9
361  sfg->AccelBuffer.iStoreLocation = 9;
362  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
363  iCommandBuffer[3] = '~';
364  break;
365 
366  case cmd_PA10: // "PA10" average precision accelerometer location 10
367  sfg->AccelBuffer.iStoreLocation = 10;
368  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
369  iCommandBuffer[3] = '~';
370  break;
371 
372  case cmd_PA11: // "PA11" average precision accelerometer location 11
373  sfg->AccelBuffer.iStoreLocation = 11;
374  sfg->AccelBuffer.iStoreCounter = (ACCEL_CAL_AVERAGING_SECS * FUSION_HZ);
375  iCommandBuffer[3] = '~';
376  break;
377 #endif // precision accelerometer calibration
378 
379  default:
380  // no action
381  break;
382  }
383  } // end of loop over received characters
384 
385  return;
386 }
#define cmd_PA07
Quaternion derived from full 9-axis sensor fusion.
Definition: sensor_fusion.h:80
void EraseGyroCalibrationFromNVM(void)
volatile quaternion_type QuaternionPacketType
quaternion type transmitted over UART
Definition: control.h:70
#define cmd_P90X
void fInitializeFusion(SensorFusionGlobals *sfg)
Definition: fusion.c:59
void SaveMagCalibrationToNVM(SensorFusionGlobals *sfg)
#define cmd_ALTminus
#define cmd_PA04
#define cmd_RINS
#define cmd_P90Z
SensorFusionGlobals sfg
void fInitializeAccelCalibration(struct AccelCalibration *pthisAccelCal, struct AccelBuffer *pthisAccelBuffer, volatile int8 *AccelCalPacketOn)
Initialize the accelerometer calibration functions.
volatile uint8_t iPerturbation
test perturbation to be applied
Lower level sensor fusion interface.
struct MagBuffer MagBuffer
mag cal constellation points
#define cmd_PA11
void SaveAccelCalibrationToNVM(SensorFusionGlobals *sfg)
void EraseMagCalibrationFromNVM(void)
Quaternion derived from 3-axis mag only (auto compass algorithm)
Definition: sensor_fusion.h:76
#define cmd_SVMC
#define cmd_Q3G
#define cmd_RPCplus
#define cmd_VGplus
#define cmd_ERYC
#define ACCEL_CAL_AVERAGING_SECS
calibration constants
volatile uint8_t AltPacketOn
flag to enable altitude packet
Definition: control.h:74
#define cmd_M90X
#define cmd_P90Y
#define cmd_SVGC
#define cmd_ERMC
Quaternion derived from 3-axis gyro only (rotation)
Definition: sensor_fusion.h:77
#define cmd_Q3M
Quaternion derived from 3-axis accel + 3 axis mag (eCompass)
Definition: sensor_fusion.h:78
#define cmd_ERAC
#define cmd_M90Z
#define cmd_ALTplus
uint8_t uint8
Definition: sensor_fusion.h:68
int32_t int32
Definition: sensor_fusion.h:67
Quaternion derived from 3-axis accel + 3-axis gyro (gaming)
Definition: sensor_fusion.h:79
volatile uint8_t AngularVelocityPacketOn
flag to enable angular velocity packet
Definition: control.h:71
The top level fusion structure.
#define cmd_PA05
void SaveGyroCalibrationToNVM(SensorFusionGlobals *sfg)
#define cmd_Q6AG
void fInitializeMagCalibration(struct MagCalibration *pthisMagCal, struct MagBuffer *pthisMagBuffer)
Definition: magnetic.c:50
#define cmd_M90Y
#define cmd_180Z
#define cmd_PA09
#define cmd_ERGC
The sensor_fusion.h file implements the top level programming interface.
volatile uint8_t RPCPacketOn
flag to enable roll, pitch, compass packet
Definition: control.h:73
#define CHZ
Used to access Z-channel entries in various data data structures.
Definition: sensor_fusion.h:88
#define cmd_PA00
#define cmd_Q9
#define CHX
Used to access X-channel entries in various data data structures.
Definition: sensor_fusion.h:86
Provides functions to store calibration to NVM.
#define cmd_180X
#define cmd_DBminus
#define cmd_RPCminus
uint16_t uint16
Definition: sensor_fusion.h:69
#define cmd_PA10
struct MagCalibration MagCal
mag cal storage
#define cmd_PA02
Quaternion derived from 3-axis accel (tilt)
Definition: sensor_fusion.h:75
void EraseAccelCalibrationFromNVM(void)
#define cmd_PA03
#define FUSION_HZ
(int) actual rate of fusion algorithm execution and sensor FIFO reads
#define cmd_PA08
Defines control sub-system.
#define cmd_180Y
struct ControlSubsystem * pControlSubsystem
#define cmd_DBplus
int16_t int16
Definition: sensor_fusion.h:66
#define cmd_RST
#define cmd_SVAC
#define cmd_VGminus
#define cmd_PA01
#define cmd_PA06
#define cmd_Q3
#define cmd_SVYC
volatile int8_t AccelCalPacketOn
variable used to coordinate accelerometer calibration
Definition: control.h:75
void DecodeCommandBytes(SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[], uint16 nbytes)
#define cmd_Q6MA
volatile uint8_t DebugPacketOn
flag to enable debug packet
Definition: control.h:72