![]() |
Kinetis SDK v.1.2 Demo Applications User's Guide
Rev. 0
Freescale Semiconductor, Inc.
|
#include "stdio.h"
#include "math.h"
#include "stdlib.h"
#include "string.h"
Go to the source code of this file.
Data Structures | |
struct | fquaternion |
struct | SimulationModel |
struct | AccelSensor |
struct | MagSensor |
struct | MagCalibration |
struct | SV6DOF |
struct | MagneticBuffer |
Macros | |
#define | FCOUNTSPERUT |
#define | FCOUNTSPERG |
#define | FUTPERCOUNT |
#define | ANGLE_LPF_FPU |
#define | DELTAT |
#define | NED |
#define | ANDROID |
#define | WIN8 |
#define | PI |
#define | FDEGTORAD |
#define | FRADTODEG |
#define | FRECIP180 |
#define | FMATRIXSCALING |
#define | FINVMATRIXSCALING |
#define | MAGBUFFSIZE |
#define | INITIALCALINTERVAL |
#define | FINALCALINTERVAL |
#define | MINEQUATIONS |
#define | MEDEQUATIONS |
#define | MAXEQUATIONS |
#define | MINBFIT |
#define | MAXBFIT |
#define | FITERRORAGING |
#define | MAXMATINV |
#define | BUFFSIZE |
Typedefs | |
typedef char | int8 |
typedef unsigned char | uint8 |
typedef short int | int16 |
typedef unsigned short int | uint16 |
typedef long int | int32 |
typedef unsigned long int | uint32 |
Functions | |
uint8 | fSixDOFSensorDrivers (struct AccelSensor *pthisAccel, struct MagSensor *pthisMag) |
uint8 | SensorDrivers_Init (void) |
void | feCompassDirectNED (struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel) |
void | feCompassDirectAndroid (struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel) |
void | feCompassDirectWin8 (struct SV6DOF *pthisSV6DOF, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel) |
void | fInitLPFOrientationMatrix (float *pfb0, float *pfa1, float *pfa2) |
void | fLPFOrientationMatrix (struct SV6DOF *pthisSV6DOF, int32 iCoordSystem, int32 loopcounter, float fb0, float fa1, float fa2) |
void | fUpdateMagnetometerBuffer (struct MagneticBuffer *pthisMagneticBuffer, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel, int32 loopcounter) |
void | fUpdateCalibration10EIG (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer, float **ftmpA10x10, float **ftmpB10x10, float **ftmpA10x1, float **ftmpA3x3, float **ftmpA3x1) |
void | fUpdateCalibration7EIG (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer, float **ftmpA7x7, float **ftmpB7x7, float **ftmpA7x1) |
void | fUpdateCalibration4INV (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer, float **ftmpA4x4, float **ftmpB4x4, float **ftmpA4x1, float **ftmpB4x1, int32 **icolind, int32 **irowind, int32 **ipivot) |
void | ResetMagCalibration (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagneticBuffer) |
void | fInvertMagCal (struct MagSensor *pthisMag, struct MagCalibration *pthisMagCal) |
void | fmatrixAeqBxC (float **A, float **B, float **C, int32 rB, int32 cBrC, int32 cC) |
void | fmatrixAeqTrBxC (float **A, float **B, float **C, int32 rBrC, int32 cB, int32 cC) |
void | fmatrixAeqBxTrB (float **A, float **B, int32 rB, int32 cB) |
void | fmatrixAeqI (float **A, int32 rc) |
void | fmatrixPrintA (float **A, int32 r1, int32 r2, int32 c1, int32 c2) |
void | f3x3matrixAeqInvSymB (float **A, float **B) |
void | fmatrixAeqRootSymB (float **A, float **B, float **ftmpmat, float **ftmpvec, int32 rc) |
void | fmatrixAeqB (float **A, float **B, int32 r, int32 c) |
void | fmatrixAeqAxScalar (float **A, float Scalar, int32 r, int32 c) |
void | fmatrixAeqMinusA (float **A, int32 r, int32 c) |
void | fmatrixAeqInvA (float **A, int32 isize, int32 **icolind, int32 **irowind, int32 **ipivot) |
float | f3x3matrixDetA (float **inp) |
void | eigencompute (float **mat, int32 n, float **eigval, float **eigvec) |
void | fmatrixAeqRenormRotA (float **A) |
void | fQuaternionFromRotationMatrix (float **R, struct fquaternion *pq) |
void | fNEDAnglesDegFromRotationMatrix (float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg) |
void | fAndroidAnglesDegFromRotationMatrix (float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg) |
void | fWin8AnglesDegFromRotationMatrix (float **R, float *pfPhiDeg, float *pfTheDeg, float *pfPsiDeg, float *pfRhoDeg) |
struct SimulationModel |
struct MagSensor |
struct MagCalibration |
Data Fields | ||
---|---|---|
float * | fA[3] | |
float | fB | |
float | fFitErrorpc | |
float * | finvA[3] | |
float * | finvW[3] | |
float | ftrB | |
float | ftrFitErrorpc | |
float * | ftrinvW[3] | |
float | ftrVx | |
float | ftrVy | |
float | ftrVz | |
float | fVx | |
float | fVy | |
float | fVz | |
int32 | iValidMagCal | |
float | xfA[3][3] | |
float | xfinvW[3][3] | |
float | xftrinvW[3][3] | |
float | xinvA[3][3] |
struct SV6DOF |
Data Fields | ||
---|---|---|
float | fDelta6DOFn | |
float | fDelta6DOFnm1 | |
float | fDelta6DOFnm2 | |
float | fLPDelta6DOFn | |
float | fLPDelta6DOFnm1 | |
float | fLPDelta6DOFnm2 | |
float | fLPPhi6DOF | |
float | fLPPsi6DOF | |
struct fquaternion | fLPq6DOFn | |
float * | fLPR6DOFn[3] | |
float * | fLPR6DOFnm1[3] | |
float * | fLPR6DOFnm2[3] | |
float | fLPRho6DOF | |
float | fLPThe6DOF | |
float | fPhi6DOF | |
float | fPsi6DOF | |
struct fquaternion | fq6DOFn | |
float * | fR6DOFn[3] | |
float * | fR6DOFnm1[3] | |
float * | fR6DOFnm2[3] | |
float | fRho6DOF | |
float | fThe6DOF | |
float | xfLPR6DOFn[3][3] | |
float | xfLPR6DOFnm1[3][3] | |
float | xfLPR6DOFnm2[3][3] | |
float | xfR6DOFn[3][3] | |
float | xfR6DOFnm1[3][3] | |
float | xfR6DOFnm2[3][3] |
struct MagneticBuffer |
Data Fields | ||
---|---|---|
int16 | iBx[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE] | |
int16 | iBy[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE] | |
int16 | iBz[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE] | |
int32 | iMagBufferCount | |
int32 | index[MAGBUFFSIZE][MAGBUFFSIZE][MAGBUFFSIZE] |
#define ANDROID |
#define ANGLE_LPF_FPU |
#define BUFFSIZE |
#define DELTAT |
#define FCOUNTSPERG |
#define FCOUNTSPERUT |
#define FDEGTORAD |
#define FINALCALINTERVAL |
#define FINVMATRIXSCALING |
#define FITERRORAGING |
#define FMATRIXSCALING |
#define FRADTODEG |
#define FRECIP180 |
#define FUTPERCOUNT |
#define INITIALCALINTERVAL |
#define MAGBUFFSIZE |
#define MAXBFIT |
#define MAXEQUATIONS |
#define MAXMATINV |
#define MEDEQUATIONS |
#define MINBFIT |
#define MINEQUATIONS |
#define NED |
#define PI |
#define WIN8 |
typedef short int int16 |
typedef long int int32 |
typedef char int8 |
typedef unsigned short int uint16 |
typedef unsigned long int uint32 |
typedef unsigned char uint8 |
void eigencompute | ( | float ** | mat, |
int32 | n, | ||
float ** | eigval, | ||
float ** | eigvec | ||
) |
void f3x3matrixAeqInvSymB | ( | float ** | A, |
float ** | B | ||
) |
float f3x3matrixDetA | ( | float ** | inp | ) |
void fAndroidAnglesDegFromRotationMatrix | ( | float ** | R, |
float * | pfPhiDeg, | ||
float * | pfTheDeg, | ||
float * | pfPsiDeg, | ||
float * | pfRhoDeg | ||
) |
void feCompassDirectAndroid | ( | struct SV6DOF * | pthisSV6DOF, |
struct MagSensor * | pthisMag, | ||
struct AccelSensor * | pthisAccel | ||
) |
void feCompassDirectNED | ( | struct SV6DOF * | pthisSV6DOF, |
struct MagSensor * | pthisMag, | ||
struct AccelSensor * | pthisAccel | ||
) |
void feCompassDirectWin8 | ( | struct SV6DOF * | pthisSV6DOF, |
struct MagSensor * | pthisMag, | ||
struct AccelSensor * | pthisAccel | ||
) |
void fInitLPFOrientationMatrix | ( | float * | pfb0, |
float * | pfa1, | ||
float * | pfa2 | ||
) |
void fInvertMagCal | ( | struct MagSensor * | pthisMag, |
struct MagCalibration * | pthisMagCal | ||
) |
void fLPFOrientationMatrix | ( | struct SV6DOF * | pthisSV6DOF, |
int32 | iCoordSystem, | ||
int32 | loopcounter, | ||
float | fb0, | ||
float | fa1, | ||
float | fa2 | ||
) |
void fmatrixAeqI | ( | float ** | A, |
int32 | rc | ||
) |
void fmatrixAeqInvA | ( | float ** | A, |
int32 | isize, | ||
int32 ** | icolind, | ||
int32 ** | irowind, | ||
int32 ** | ipivot | ||
) |
void fmatrixAeqRenormRotA | ( | float ** | A | ) |
void fmatrixAeqRootSymB | ( | float ** | A, |
float ** | B, | ||
float ** | ftmpmat, | ||
float ** | ftmpvec, | ||
int32 | rc | ||
) |
void fNEDAnglesDegFromRotationMatrix | ( | float ** | R, |
float * | pfPhiDeg, | ||
float * | pfTheDeg, | ||
float * | pfPsiDeg, | ||
float * | pfRhoDeg | ||
) |
void fQuaternionFromRotationMatrix | ( | float ** | R, |
struct fquaternion * | pq | ||
) |
uint8 fSixDOFSensorDrivers | ( | struct AccelSensor * | pthisAccel, |
struct MagSensor * | pthisMag | ||
) |
void fUpdateCalibration10EIG | ( | struct MagCalibration * | pthisMagCal, |
struct MagneticBuffer * | pthisMagneticBuffer, | ||
float ** | ftmpA10x10, | ||
float ** | ftmpB10x10, | ||
float ** | ftmpA10x1, | ||
float ** | ftmpA3x3, | ||
float ** | ftmpA3x1 | ||
) |
void fUpdateCalibration4INV | ( | struct MagCalibration * | pthisMagCal, |
struct MagneticBuffer * | pthisMagneticBuffer, | ||
float ** | ftmpA4x4, | ||
float ** | ftmpB4x4, | ||
float ** | ftmpA4x1, | ||
float ** | ftmpB4x1, | ||
int32 ** | icolind, | ||
int32 ** | irowind, | ||
int32 ** | ipivot | ||
) |
void fUpdateCalibration7EIG | ( | struct MagCalibration * | pthisMagCal, |
struct MagneticBuffer * | pthisMagneticBuffer, | ||
float ** | ftmpA7x7, | ||
float ** | ftmpB7x7, | ||
float ** | ftmpA7x1 | ||
) |
void fUpdateMagnetometerBuffer | ( | struct MagneticBuffer * | pthisMagneticBuffer, |
struct MagSensor * | pthisMag, | ||
struct AccelSensor * | pthisAccel, | ||
int32 | loopcounter | ||
) |
void fWin8AnglesDegFromRotationMatrix | ( | float ** | R, |
float * | pfPhiDeg, | ||
float * | pfTheDeg, | ||
float * | pfPsiDeg, | ||
float * | pfRhoDeg | ||
) |
void ResetMagCalibration | ( | struct MagCalibration * | pthisMagCal, |
struct MagneticBuffer * | pthisMagneticBuffer | ||
) |
uint8 SensorDrivers_Init | ( | void | ) |