| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros | Functions
magnetic.c File Reference
`#include "math.h"`
`#include "stdlib.h"`
`#include "matrix.h"`
`#include "math_constants.h"`
`#include "magnetic.h"`
Include dependency graph for magnetic.c:

Go to the source code of this file.

## Macros
#define | ONETHIRD 0.33333333F
#define | ONESIXTH 0.166666667F

## Functions
void | fInitMagCalibration (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagBuffer)
void | iUpdateMagnetometerBuffer (struct MagneticBuffer *pthisMagBuffer, struct AccelSensor *pthisAccel, struct MagSensor *pthisMag, int32 loopcounter)
void | fInvertMagCal (struct MagSensor *pthisMag, struct MagCalibration *pthisMagCal)
void | fRunMagCalibration (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagBuffer, struct MagSensor *pthisMag)
void | fUpdateCalibration4INV (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagBuffer, struct MagSensor *pthisMag)
void | fUpdateCalibration7EIG (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagBuffer, struct MagSensor *pthisMag)
void | fUpdateCalibration10EIG (struct MagCalibration *pthisMagCal, struct MagneticBuffer *pthisMagBuffer, struct MagSensor *pthisMag)

## Macro Definition Documentation

#define ONESIXTH 0.166666667F

Definition at line 39 of file magnetic.c.

Referenced by fUpdateCalibration10EIG(), and fUpdateCalibration7EIG().

#define ONETHIRD 0.33333333F

Definition at line 38 of file magnetic.c.

Referenced by fUpdateCalibration10EIG(), and fUpdateCalibration7EIG().

## Function Documentation

void fInitMagCalibration | ( | struct MagCalibration * | pthisMagCal,
|  | struct MagneticBuffer * | pthisMagBuffer
| ) |  |

Definition at line 42 of file magnetic.c.

References DEFAULTB, f3x3matrixAeqI(), MagCalibration::fB, MagCalibration::fFitErrorpc, MagCalibration::fFourBsq, MagCalibration::finvW, MagCalibration::fV, MagCalibration::iCalInProgress, MagneticBuffer::iMagBufferCount, MagCalibration::iMagCalHasRun, MagneticBuffer::index, MagCalibration::iValidMagCal, MAGBUFFSIZEX, MAGBUFFSIZEY, PI, MagneticBuffer::tanarray, X, Y, and Z.

Referenced by Fusion_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

void fInvertMagCal | ( | struct MagSensor * | pthisMag,
|  | struct MagCalibration * | pthisMagCal
| ) |  |

Definition at line 247 of file magnetic.c.

References MagSensor::fBc, MagSensor::fBp, MagCalibration::finvW, MagCalibration::fV, X, Y, and Z.

Referenced by Fusion_Run().

Here is the caller graph for this function:

void fRunMagCalibration | ( | struct MagCalibration * | pthisMagCal,
|  | struct MagneticBuffer * | pthisMagBuffer,
|  | struct MagSensor * | pthisMag
| ) |  |

Definition at line 270 of file magnetic.c.

References MagCalibration::fB, MagCalibration::fFitErrorpc, MagCalibration::fFourBsq, MagCalibration::finvW, FITERRORAGINGSECS, MagCalibration::ftrB, MagCalibration::ftrFitErrorpc, MagCalibration::ftrinvW, MagCalibration::ftrV, fUpdateCalibration10EIG(), fUpdateCalibration4INV(), fUpdateCalibration7EIG(), MagCalibration::fV, MagCalibration::iCalInProgress, MagneticBuffer::iMagBufferCount, INTERVAL10CAL, INTERVAL4CAL, INTERVAL7CAL, MagCalibration::iValidMagCal, MAG_OVERSAMPLE_RATIO, MAXBFITUT, MINBFITUT, MINMEASUREMENTS10CAL, MINMEASUREMENTS7CAL, SENSORFS, X, and Z.

Referenced by MagCal_Run().

Here is the call graph for this function:

Here is the caller graph for this function:

void fUpdateCalibration10EIG | ( | struct MagCalibration * | pthisMagCal,
|  | struct MagneticBuffer * | pthisMagBuffer,
|  | struct MagSensor * | pthisMag
| ) |  |

Definition at line 669 of file magnetic.c.

References DEFAULTB, eigencompute(), f3x3matrixAeqAxScalar(), f3x3matrixAeqInvSymB(), f3x3matrixAeqMinusA(), f3x3matrixDetA(), MagCalibration::fA, MagCalibration::finvA, MagCalibration::fmatA, MagCalibration::fmatB, MagCalibration::ftrB, MagCalibration::ftrFitErrorpc, MagCalibration::ftrinvW, MagCalibration::ftrV, FUTPERCOUNT, MagCalibration::fvecA, MagneticBuffer::iBp, MagneticBuffer::iMagBufferCount, MagneticBuffer::index, INV_DEFAULTB, MAGBUFFSIZEX, MAGBUFFSIZEY, ONESIXTH, ONETHIRD, X, Y, and Z.

Referenced by fRunMagCalibration().

Here is the call graph for this function:

Here is the caller graph for this function:

void fUpdateCalibration4INV | ( | struct MagCalibration * | pthisMagCal,
|  | struct MagneticBuffer * | pthisMagBuffer,
|  | struct MagSensor * | pthisMag
| ) |  |

Definition at line 344 of file magnetic.c.

References DEFAULTB, f3x3matrixAeqI(), MagCalibration::fmatA, MagCalibration::fmatB, fmatrixAeqInvA(), MagCalibration::ftrB, MagCalibration::ftrFitErrorpc, MagCalibration::ftrinvW, MagCalibration::ftrV, FUTPERCOUNT, MagCalibration::fvecA, MagCalibration::fvecB, MagneticBuffer::iBp, MagneticBuffer::iMagBufferCount, MagneticBuffer::index, INV_DEFAULTB, MAGBUFFSIZEX, MAGBUFFSIZEY, X, Y, and Z.

Referenced by fRunMagCalibration().

Here is the call graph for this function:

Here is the caller graph for this function:

void fUpdateCalibration7EIG | ( | struct MagCalibration * | pthisMagCal,
|  | struct MagneticBuffer * | pthisMagBuffer,
|  | struct MagSensor * | pthisMag
| ) |  |

Definition at line 522 of file magnetic.c.

References DEFAULTB, eigencompute(), f3x3matrixAeqAxScalar(), f3x3matrixAeqI(), f3x3matrixAeqMinusA(), f3x3matrixAeqScalar(), MagCalibration::fA, MagCalibration::fmatA, MagCalibration::fmatB, MagCalibration::ftrB, MagCalibration::ftrFitErrorpc, MagCalibration::ftrinvW, MagCalibration::ftrV, FUTPERCOUNT, MagCalibration::fvecA, MagneticBuffer::iBp, MagneticBuffer::iMagBufferCount, MagneticBuffer::index, INV_DEFAULTB, MAGBUFFSIZEX, MAGBUFFSIZEY, ONESIXTH, ONETHIRD, X, Y, and Z.

Referenced by fRunMagCalibration().

Here is the call graph for this function:

Here is the caller graph for this function:

void iUpdateMagnetometerBuffer | ( | struct MagneticBuffer * | pthisMagBuffer,
|  | struct AccelSensor * | pthisAccel,
|  | struct MagSensor * | pthisMag,
|  | int32 | loopcounter
| ) |  |

Definition at line 79 of file magnetic.c.

References MagneticBuffer::iBp, MagSensor::iBp, AccelSensor::iGp, MagneticBuffer::iMagBufferCount, MagneticBuffer::index, MAGBUFFSIZEX, MAGBUFFSIZEY, MAXMEASUREMENTS, MESHDELTACOUNTS, MagneticBuffer::tanarray, X, Y, and Z.

Referenced by Fusion_Run().

Here is the caller graph for this function:
- © Freescale Semiconductor, Inc. 2015. All Rights Reserved.