![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
Command interpreter which interfaces to the Sensor Fusion Toolbox. More...
#include "sensor_fusion.h"
#include "control.h"
#include "fusion.h"
#include "calibration_storage.h"
Go to the source code of this file.
Macros | |
#define | cmd_VGplus (((((('V' << 8) | 'G') << 8) | '+') << 8) | ' ') |
#define | cmd_VGminus (((((('V' << 8) | 'G') << 8) | '-') << 8) | ' ') |
#define | cmd_DBplus (((((('D' << 8) | 'B') << 8) | '+') << 8) | ' ') |
#define | cmd_DBminus (((((('D' << 8) | 'B') << 8) | '-') << 8) | ' ') |
#define | cmd_Q3 (((((('Q' << 8) | '3') << 8) | ' ') << 8) | ' ') |
#define | cmd_Q3M (((((('Q' << 8) | '3') << 8) | 'M') << 8) | ' ') |
#define | cmd_Q3G (((((('Q' << 8) | '3') << 8) | 'G') << 8) | ' ') |
#define | cmd_Q6MA (((((('Q' << 8) | '6') << 8) | 'M') << 8) | 'A') |
#define | cmd_Q6AG (((((('Q' << 8) | '6') << 8) | 'A') << 8) | 'G') |
#define | cmd_Q9 (((((('Q' << 8) | '9') << 8) | ' ') << 8) | ' ') |
#define | cmd_RPCplus (((((('R' << 8) | 'P') << 8) | 'C') << 8) | '+') |
#define | cmd_RPCminus (((((('R' << 8) | 'P') << 8) | 'C') << 8) | '-') |
#define | cmd_ALTplus (((((('A' << 8) | 'L') << 8) | 'T') << 8) | '+') |
#define | cmd_ALTminus (((((('A' << 8) | 'L') << 8) | 'T') << 8) | '-') |
#define | cmd_RST (((((('R' << 8) | 'S') << 8) | 'T') << 8) | ' ') |
#define | cmd_RINS (((((('R' << 8) | 'I') << 8) | 'N') << 8) | 'S') |
#define | cmd_SVAC (((((('S' << 8) | 'V') << 8) | 'A') << 8) | 'C') |
#define | cmd_SVMC (((((('S' << 8) | 'V') << 8) | 'M') << 8) | 'C') |
#define | cmd_SVYC (((((('S' << 8) | 'V') << 8) | 'Y') << 8) | 'C') |
#define | cmd_SVGC (((((('S' << 8) | 'V') << 8) | 'G') << 8) | 'C') |
#define | cmd_ERAC (((((('E' << 8) | 'R') << 8) | 'A') << 8) | 'C') |
#define | cmd_ERMC (((((('E' << 8) | 'R') << 8) | 'M') << 8) | 'C') |
#define | cmd_ERYC (((((('E' << 8) | 'R') << 8) | 'Y') << 8) | 'C') |
#define | cmd_ERGC (((((('E' << 8) | 'R') << 8) | 'G') << 8) | 'C') |
#define | cmd_180X (((((('1' << 8) | '8') << 8) | '0') << 8) | 'X') |
#define | cmd_180Y (((((('1' << 8) | '8') << 8) | '0') << 8) | 'Y') |
#define | cmd_180Z (((((('1' << 8) | '8') << 8) | '0') << 8) | 'Z') |
#define | cmd_M90X (((((('M' << 8) | '9') << 8) | '0') << 8) | 'X') |
#define | cmd_P90X (((((('P' << 8) | '9') << 8) | '0') << 8) | 'X') |
#define | cmd_M90Y (((((('M' << 8) | '9') << 8) | '0') << 8) | 'Y') |
#define | cmd_P90Y (((((('P' << 8) | '9') << 8) | '0') << 8) | 'Y') |
#define | cmd_M90Z (((((('M' << 8) | '9') << 8) | '0') << 8) | 'Z') |
#define | cmd_P90Z (((((('P' << 8) | '9') << 8) | '0') << 8) | 'Z') |
#define | cmd_PA00 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '0') |
#define | cmd_PA01 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '1') |
#define | cmd_PA02 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '2') |
#define | cmd_PA03 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '3') |
#define | cmd_PA04 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '4') |
#define | cmd_PA05 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '5') |
#define | cmd_PA06 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '6') |
#define | cmd_PA07 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '7') |
#define | cmd_PA08 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '8') |
#define | cmd_PA09 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '9') |
#define | cmd_PA10 (((((('P' << 8) | 'A') << 8) | '1') << 8) | '0') |
#define | cmd_PA11 (((((('P' << 8) | 'A') << 8) | '1') << 8) | '1') |
Functions | |
void | DecodeCommandBytes (SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[], uint16 nbytes) |
Command interpreter which interfaces to the Sensor Fusion Toolbox.
Definition in file DecodeCommandBytes.c.
#define cmd_180X (((((('1' << 8) | '8') << 8) | '0') << 8) | 'X') |
Definition at line 46 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_180Y (((((('1' << 8) | '8') << 8) | '0') << 8) | 'Y') |
Definition at line 47 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_180Z (((((('1' << 8) | '8') << 8) | '0') << 8) | 'Z') |
Definition at line 48 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_ALTminus (((((('A' << 8) | 'L') << 8) | 'T') << 8) | '-') |
Definition at line 35 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_ALTplus (((((('A' << 8) | 'L') << 8) | 'T') << 8) | '+') |
Definition at line 34 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_DBminus (((((('D' << 8) | 'B') << 8) | '-') << 8) | ' ') |
Definition at line 25 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_DBplus (((((('D' << 8) | 'B') << 8) | '+') << 8) | ' ') |
Definition at line 24 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_ERAC (((((('E' << 8) | 'R') << 8) | 'A') << 8) | 'C') |
Definition at line 42 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
Definition at line 45 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_ERMC (((((('E' << 8) | 'R') << 8) | 'M') << 8) | 'C') |
Definition at line 43 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_ERYC (((((('E' << 8) | 'R') << 8) | 'Y') << 8) | 'C') |
Definition at line 44 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_M90X (((((('M' << 8) | '9') << 8) | '0') << 8) | 'X') |
Definition at line 49 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_M90Y (((((('M' << 8) | '9') << 8) | '0') << 8) | 'Y') |
Definition at line 51 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_M90Z (((((('M' << 8) | '9') << 8) | '0') << 8) | 'Z') |
Definition at line 53 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_P90X (((((('P' << 8) | '9') << 8) | '0') << 8) | 'X') |
Definition at line 50 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_P90Y (((((('P' << 8) | '9') << 8) | '0') << 8) | 'Y') |
Definition at line 52 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_P90Z (((((('P' << 8) | '9') << 8) | '0') << 8) | 'Z') |
Definition at line 54 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA00 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '0') |
Definition at line 55 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA01 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '1') |
Definition at line 56 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA02 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '2') |
Definition at line 57 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA03 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '3') |
Definition at line 58 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA04 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '4') |
Definition at line 59 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA05 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '5') |
Definition at line 60 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA06 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '6') |
Definition at line 61 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA07 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '7') |
Definition at line 62 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA08 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '8') |
Definition at line 63 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA09 (((((('P' << 8) | 'A') << 8) | '0') << 8) | '9') |
Definition at line 64 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA10 (((((('P' << 8) | 'A') << 8) | '1') << 8) | '0') |
Definition at line 65 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_PA11 (((((('P' << 8) | 'A') << 8) | '1') << 8) | '1') |
Definition at line 66 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_Q3 (((((('Q' << 8) | '3') << 8) | ' ') << 8) | ' ') |
Definition at line 26 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_Q3G (((((('Q' << 8) | '3') << 8) | 'G') << 8) | ' ') |
Definition at line 28 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_Q3M (((((('Q' << 8) | '3') << 8) | 'M') << 8) | ' ') |
Definition at line 27 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_Q6AG (((((('Q' << 8) | '6') << 8) | 'A') << 8) | 'G') |
Definition at line 30 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_Q6MA (((((('Q' << 8) | '6') << 8) | 'M') << 8) | 'A') |
Definition at line 29 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_Q9 (((((('Q' << 8) | '9') << 8) | ' ') << 8) | ' ') |
Definition at line 31 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
Definition at line 37 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_RPCminus (((((('R' << 8) | 'P') << 8) | 'C') << 8) | '-') |
Definition at line 33 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_RPCplus (((((('R' << 8) | 'P') << 8) | 'C') << 8) | '+') |
Definition at line 32 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_RST (((((('R' << 8) | 'S') << 8) | 'T') << 8) | ' ') |
Definition at line 36 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_SVAC (((((('S' << 8) | 'V') << 8) | 'A') << 8) | 'C') |
Definition at line 38 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_SVGC (((((('S' << 8) | 'V') << 8) | 'G') << 8) | 'C') |
Definition at line 41 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_SVMC (((((('S' << 8) | 'V') << 8) | 'M') << 8) | 'C') |
Definition at line 39 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_SVYC (((((('S' << 8) | 'V') << 8) | 'Y') << 8) | 'C') |
Definition at line 40 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_VGminus (((((('V' << 8) | 'G') << 8) | '-') << 8) | ' ') |
Definition at line 23 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
#define cmd_VGplus (((((('V' << 8) | 'G') << 8) | '+') << 8) | ' ') |
Definition at line 22 of file DecodeCommandBytes.c.
Referenced by DecodeCommandBytes().
void DecodeCommandBytes | ( | SensorFusionGlobals * | sfg, |
char | iCommandBuffer[], | ||
uint8 | sUART_InputBuffer[], | ||
uint16 | nbytes | ||
) |
This function is responsible for decoding commands sent by the NXP Sensor Fusion Toolbox and setting the appropriate flags in the ControlSubsystem data structure. Packet protocols are defined in the NXP Sensor Fusion for Kinetis Product Development Kit User Guide.
Definition at line 68 of file DecodeCommandBytes.c.
References ACCEL_CAL_AVERAGING_SECS, ControlSubsystem::AccelCalPacketOn, ControlSubsystem::AltPacketOn, ControlSubsystem::AngularVelocityPacketOn, CHX, CHZ, cmd_180X, cmd_180Y, cmd_180Z, cmd_ALTminus, cmd_ALTplus, cmd_DBminus, cmd_DBplus, cmd_ERAC, cmd_ERGC, cmd_ERMC, cmd_ERYC, cmd_M90X, cmd_M90Y, cmd_M90Z, cmd_P90X, cmd_P90Y, cmd_P90Z, cmd_PA00, cmd_PA01, cmd_PA02, cmd_PA03, cmd_PA04, cmd_PA05, cmd_PA06, cmd_PA07, cmd_PA08, cmd_PA09, cmd_PA10, cmd_PA11, cmd_Q3, cmd_Q3G, cmd_Q3M, cmd_Q6AG, cmd_Q6MA, cmd_Q9, cmd_RINS, cmd_RPCminus, cmd_RPCplus, cmd_RST, cmd_SVAC, cmd_SVGC, cmd_SVMC, cmd_SVYC, cmd_VGminus, cmd_VGplus, ControlSubsystem::DebugPacketOn, EraseAccelCalibrationFromNVM(), EraseGyroCalibrationFromNVM(), EraseMagCalibrationFromNVM(), fInitializeAccelCalibration(), fInitializeFusion(), fInitializeMagCalibration(), FUSION_HZ, SensorFusionGlobals::iPerturbation, SensorFusionGlobals::MagBuffer, SensorFusionGlobals::MagCal, SensorFusionGlobals::pControlSubsystem, Q3, Q3G, Q3M, Q6AG, Q6MA, Q9, ControlSubsystem::QuaternionPacketType, ControlSubsystem::RPCPacketOn, SaveAccelCalibrationToNVM(), SaveGyroCalibrationToNVM(), and SaveMagCalibrationToNVM().
Referenced by CONTROL_UART_IRQHandler(), WIRED_UART_IRQHandler(), WIRED_USART_IRQHandler(), and WIRELESS_UART_IRQHandler().