/hal_nxp-3.5.0/mcux/mcux-sdk/middleware/issdk/algorithms/sensorfusion/sources/ |
D | sensor_fusion.c | 26 void setStatus(SensorFusionGlobals *sfg, fusion_status_t status) in setStatus() argument 28 sfg->pStatusSubsystem->set(sfg->pStatusSubsystem, status); in setStatus() 33 void queueStatus(SensorFusionGlobals *sfg, fusion_status_t status) in queueStatus() argument 35 sfg->pStatusSubsystem->queue(sfg->pStatusSubsystem, status); in queueStatus() 40 void updateStatus(SensorFusionGlobals *sfg) in updateStatus() argument 42 sfg->pStatusSubsystem->update(sfg->pStatusSubsystem); in updateStatus() 45 void testStatus(SensorFusionGlobals *sfg) in testStatus() argument 47 sfg->pStatusSubsystem->test(sfg->pStatusSubsystem); in testStatus() 51 void initSensorFusionGlobals(SensorFusionGlobals *sfg, in initSensorFusionGlobals() argument 55 …sfg->iFlags = // all of the following defines are either 0x0000 or a 1-bit value (2, 4, 8 ...) and… in initSensorFusionGlobals() [all …]
|
D | DecodeCommandBytes.c | 68 void DecodeCommandBytes(SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[],… in DecodeCommandBytes() argument 84 sfg->pControlSubsystem->AngularVelocityPacketOn = true; in DecodeCommandBytes() 89 sfg->pControlSubsystem->AngularVelocityPacketOn = false; in DecodeCommandBytes() 94 sfg->pControlSubsystem->DebugPacketOn = true; in DecodeCommandBytes() 99 sfg->pControlSubsystem->DebugPacketOn = false; in DecodeCommandBytes() 105 sfg->pControlSubsystem->QuaternionPacketType = Q3; in DecodeCommandBytes() 112 sfg->pControlSubsystem->QuaternionPacketType = Q3M; in DecodeCommandBytes() 119 sfg->pControlSubsystem->QuaternionPacketType = Q3G; in DecodeCommandBytes() 126 sfg->pControlSubsystem->QuaternionPacketType = Q6MA; in DecodeCommandBytes() 133 sfg->pControlSubsystem->QuaternionPacketType = Q6AG; in DecodeCommandBytes() [all …]
|
D | drivers.h | 48 int8_t MPL3115_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 49 int8_t FXOS8700_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 50 int8_t FXAS21002_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 51 int8_t MMA8652_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 52 int8_t FXLS8952_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 53 int8_t MAG3110_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 54 int8_t MMA8451_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 55 int8_t FXLS8471Q_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 56 int8_t FXLS8962_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); 57 int8_t FXLS8972_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg); [all …]
|
D | output_stream.c | 122 void CreateAndSendPackets(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer) in CreateAndSendPackets() argument 155 quaternionPacketType = sfg->pControlSubsystem->QuaternionPacketType; in CreateAndSendPackets() 156 AngularVelocityPacketOn = sfg->pControlSubsystem->AngularVelocityPacketOn; in CreateAndSendPackets() 157 DebugPacketOn = sfg->pControlSubsystem->DebugPacketOn; in CreateAndSendPackets() 158 RPCPacketOn = sfg->pControlSubsystem->RPCPacketOn; in CreateAndSendPackets() 159 AccelCalPacketOn = sfg->pControlSubsystem->AccelCalPacketOn; in CreateAndSendPackets() 201 if (sfg->iFlags & F_USING_ACCEL) { in CreateAndSendPackets() 210 scratch32 = (sfg->Accel.iGc[CHX] * 8192) / sfg->Accel.iCountsPerg; in CreateAndSendPackets() 216 scratch32 = (sfg->Accel.iGc[CHY] * 8192) / sfg->Accel.iCountsPerg; in CreateAndSendPackets() 222 scratch32 = (sfg->Accel.iGc[CHZ] * 8192) / sfg->Accel.iCountsPerg; in CreateAndSendPackets() [all …]
|
D | driver_MPL3115.c | 68 int8_t MPL3115_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MPL3115_Init() argument 74 sfg->Pressure.iWhoAmI = reg; in MPL3115_Init() 89 sfg->Pressure.fmPerCount = MPL3115_MPERCOUNT; // Convert 32-bit Altitude value to meters in MPL3115_Init() 90 sfg->Pressure.fCPerCount = MPL3115_CPERCOUNT; // Convert 16-bit Temperature value to Celcius in MPL3115_Init() 93 sfg->Pressure.isEnabled = true; in MPL3115_Init() 98 int8_t MPL3115_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MPL3115_Read() argument 112 sfg->Pressure.iH = (I2C_Buffer[0] << 24) | (I2C_Buffer[1] << 16) | (I2C_Buffer[2] << 8); in MPL3115_Read() 113 sfg->Pressure.iT = (I2C_Buffer[3] << 8) | I2C_Buffer[4]; in MPL3115_Read() 116 sfg->Pressure.fH = (float) sfg->Pressure.iH * sfg->Pressure.fmPerCount; in MPL3115_Read() 117 sfg->Pressure.fT = (float) sfg->Pressure.iT * sfg->Pressure.fCPerCount; in MPL3115_Read() [all …]
|
D | driver_FXOS8700.c | 130 int8_t FXOS8700_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in FXOS8700_Init() argument 139 sfg->Accel.iWhoAmI = reg; in FXOS8700_Init() 140 sfg->Accel.iCountsPerg = FXOS8700_COUNTSPERG; in FXOS8700_Init() 141 sfg->Accel.fgPerCount = 1.0F / FXOS8700_COUNTSPERG; in FXOS8700_Init() 144 sfg->Mag.iWhoAmI = reg; in FXOS8700_Init() 145 sfg->Mag.iCountsPeruT = FXOS8700_COUNTSPERUT; in FXOS8700_Init() 146 sfg->Mag.fCountsPeruT = (float) FXOS8700_COUNTSPERUT; in FXOS8700_Init() 147 sfg->Mag.fuTPerCount = 1.0F / FXOS8700_COUNTSPERUT; in FXOS8700_Init() 163 sfg->Accel.isEnabled = true; in FXOS8700_Init() 166 sfg->Mag.isEnabled = true; in FXOS8700_Init() [all …]
|
D | debug.c | 36 void ApplyPerturbation(SensorFusionGlobals *sfg) in ApplyPerturbation() argument 61 quaternionPacketType = sfg->pControlSubsystem->QuaternionPacketType; in ApplyPerturbation() 66 switch (sfg->iPerturbation) in ApplyPerturbation() 151 CurrentQ = sfg->SV_3DOF_G_BASIC.fLPq; in ApplyPerturbation() 152 qAeqAxB(&(sfg->SV_3DOF_G_BASIC.fLPq), &ftmpq); in ApplyPerturbation() 157 CurrentQ = sfg->SV_3DOF_B_BASIC.fLPq; in ApplyPerturbation() 158 qAeqAxB(&(sfg->SV_3DOF_B_BASIC.fLPq), &ftmpq); in ApplyPerturbation() 163 CurrentQ = sfg->SV_3DOF_Y_BASIC.fq; in ApplyPerturbation() 164 qAeqAxB(&(sfg->SV_3DOF_Y_BASIC.fq), &ftmpq); in ApplyPerturbation() 169 CurrentQ = sfg->SV_6DOF_GB_BASIC.fLPq; in ApplyPerturbation() [all …]
|
D | driver_FXAS21002.c | 181 int8_t FXAS21002_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in FXAS21002_Init() argument 189 sfg->Gyro.iWhoAmI = reg; in FXAS21002_Init() 203 switch (sfg->Gyro.iWhoAmI) { in FXAS21002_Init() 208 sfg->Gyro.iCountsPerDegPerSec = FXAS21000_COUNTSPERDEGPERSEC; in FXAS21002_Init() 209 sfg->Gyro.fDegPerSecPerCount = 1.0F / FXAS21000_COUNTSPERDEGPERSEC; in FXAS21002_Init() 214 sfg->Gyro.iCountsPerDegPerSec = FXAS21002_COUNTSPERDEGPERSEC; in FXAS21002_Init() 215 sfg->Gyro.fDegPerSecPerCount = 1.0F / FXAS21002_COUNTSPERDEGPERSEC; in FXAS21002_Init() 218 sfg->Gyro.iFIFOCount=0; in FXAS21002_Init() 220 sfg->Gyro.isEnabled = true; in FXAS21002_Init() 225 int8_t FXAS21002_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in FXAS21002_Read() argument [all …]
|
D | driver_MAG3110.c | 82 int8_t MAG3110_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MAG3110_Init() argument 88 sfg->Mag.iWhoAmI = reg; in MAG3110_Init() 103 sfg->Mag.iCountsPeruT = MAG3110_COUNTSPERUT; in MAG3110_Init() 104 …sfg->Mag.fCountsPeruT = (float)MAG3110_COUNTSPERUT; // IAR optimized this out without the #pragma … in MAG3110_Init() 105 …sfg->Mag.fuTPerCount = 1.0F / MAG3110_COUNTSPERUT; // IAR optimized this out without the #pragma … in MAG3110_Init() 108 …sfg->Mag.isEnabled = true; // IAR optimized this out without the #pragma before t… in MAG3110_Init() 113 int8_t MAG3110_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MAG3110_Read() argument 131 addToFifo((union FifoSensor*) &(sfg->Mag), MAG_FIFO_SIZE, sample); in MAG3110_Read() 147 int8_t MAG3110_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MAG3110_Idle() argument 153 sfg->Mag.isEnabled = false; in MAG3110_Idle()
|
D | driver_FXLS8962.c | 118 int8_t FXLS8962_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in FXLS8962_Init() argument 125 sfg->Accel.iWhoAmI = reg; in FXLS8962_Init() 138 sfg->Accel.iCountsPerg = FXLS8962_COUNTSPERG; in FXLS8962_Init() 139 sfg->Accel.fgPerCount = 1.0F / FXLS8962_COUNTSPERG; in FXLS8962_Init() 140 sfg->Accel.fgPerCount = 1.0F / FXLS8962_COUNTSPERG; in FXLS8962_Init() 143 sfg->Accel.isEnabled = true; in FXLS8962_Init() 148 int8_t FXLS8962_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in FXLS8962_Read() argument 179 addToFifo((union FifoSensor*) &(sfg->Accel), ACCEL_FIFO_SIZE, sample); in FXLS8962_Read() 195 int8_t FXLS8962_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in FXLS8962_Idle() argument 201 sfg->Accel.isEnabled = false; in FXLS8962_Idle()
|
D | driver_MMA8652.c | 110 int8_t MMA8652_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MMA8652_Init() argument 116 sfg->Accel.iWhoAmI = reg; in MMA8652_Init() 124 sfg->Accel.iCountsPerg = MMA8652_COUNTSPERG; in MMA8652_Init() 125 sfg->Accel.fgPerCount = 1.0F / MMA8652_COUNTSPERG; in MMA8652_Init() 126 sfg->Accel.fgPerCount = 1.0F / MMA8652_COUNTSPERG; in MMA8652_Init() 129 sfg->Accel.isEnabled = true; in MMA8652_Init() 134 int8_t MMA8652_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MMA8652_Read() argument 169 addToFifo((union FifoSensor*) &(sfg->Accel), ACCEL_FIFO_SIZE, sample); in MMA8652_Read() 186 int8_t MMA8652_Idle(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg) in MMA8652_Idle() argument 192 sfg->Accel.isEnabled = false; in MMA8652_Idle()
|
D | sensor_fusion.h | 118 struct SensorFusionGlobals *sfg 122 struct SensorFusionGlobals *sfg 125 struct SensorFusionGlobals *sfg, 129 struct SensorFusionGlobals *sfg, ///< Global data structure pointer 141 typedef void (initializeFusionEngine_t) (struct SensorFusionGlobals *sfg); 142 typedef void (runFusion_t) (struct SensorFusionGlobals *sfg); 143 typedef void (clearFIFOs_t) (struct SensorFusionGlobals *sfg); 144 typedef void (conditionSensorReadings_t) (struct SensorFusionGlobals *sfg); 145 typedef void (applyPerturbation_t) (struct SensorFusionGlobals *sfg) ; 146 typedef void (setStatus_t) (struct SensorFusionGlobals *sfg, fusion_status_t status); [all …]
|
D | control.c | 43 extern SensorFusionGlobals sfg; 95 sfg.setStatus(&sfg, RECEIVING_WIRELESS); in WIRELESS_UART_IRQHandler() 104 DecodeCommandBytes(&sfg, iCommandBuffer_B, &data, 1); in WIRELESS_UART_IRQHandler() 144 sfg.setStatus(&sfg, RECEIVING_WIRED); in WIRED_UART_IRQHandler() 153 DecodeCommandBytes(&sfg, iCommandBuffer_A, &data, 1); in WIRED_UART_IRQHandler()
|
D | calibration_storage.c | 21 void SaveMagCalibrationToNVM(SensorFusionGlobals *sfg) in SaveMagCalibrationToNVM() argument 45 pSrc = (uint8 *) &(sfg->MagCal); in SaveMagCalibrationToNVM() 55 void SaveGyroCalibrationToNVM(SensorFusionGlobals *sfg) in SaveGyroCalibrationToNVM() argument 81 pSrc = (uint8 *) sfg->SV_9DOF_GBY_KALMAN.fbPl; in SaveGyroCalibrationToNVM() 83 pSrc = (uint8 *) sfg->SV_6DOF_GY_KALMAN.fbPl; in SaveGyroCalibrationToNVM() 94 void SaveAccelCalibrationToNVM(SensorFusionGlobals *sfg) in SaveAccelCalibrationToNVM() argument 118 pSrc = (uint8 *) &(sfg->AccelCal); in SaveAccelCalibrationToNVM()
|
D | calibration_storage.h | 21 void SaveMagCalibrationToNVM(SensorFusionGlobals *sfg); 22 void SaveGyroCalibrationToNVM(SensorFusionGlobals *sfg); 23 void SaveAccelCalibrationToNVM(SensorFusionGlobals *sfg);
|
D | control.h | 34 typedef void (streamData_t)(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer); 59 void CreateAndSendPackets(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer); 65 void DecodeCommandBytes(SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[],…
|
D | control_lpc.c | 30 extern SensorFusionGlobals sfg; 64 DecodeCommandBytes(&sfg, iCommandBuffer_B, &data, 1); in WIRED_USART_IRQHandler()
|
D | debug.h | 23 void ApplyPerturbation(SensorFusionGlobals *sfg);
|
D | fusion.c | 33 void fInitializeFusion(SensorFusionGlobals *sfg) in fInitializeFusion() argument 42 sfg->SV_1DOF_P_BASIC.resetflag = true; in fInitializeFusion() 45 sfg->SV_3DOF_B_BASIC.resetflag = true; in fInitializeFusion() 48 sfg->SV_3DOF_G_BASIC.resetflag = true; in fInitializeFusion() 51 sfg->SV_3DOF_Y_BASIC.resetflag = true; in fInitializeFusion() 54 sfg->SV_6DOF_GB_BASIC.resetflag = true; in fInitializeFusion() 57 sfg->SV_6DOF_GY_KALMAN.resetflag = true; in fInitializeFusion() 60 sfg->SV_9DOF_GBY_KALMAN.resetflag = true; in fInitializeFusion() 64 sfg->loopcounter = 0; in fInitializeFusion()
|
D | fusion.h | 70 void fInitializeFusion(SensorFusionGlobals *sfg);
|
/hal_nxp-3.5.0/mcux/mcux-sdk/middleware/issdk/driverexamples/demos/ |
D | orientaion_application_baremetal_agmp03.c | 74 SensorFusionGlobals sfg; /* Sensor Fusion Global Structure … variable 103 static void encodeOrientPacketStream (SensorFusionGlobals * sfg, uint8_t *sUARTOutputBuffer); 267 void encodeOrientPacketStream(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer) in encodeOrientPacketStream() argument 293 if (sfg->iFlags & F_USING_ACCEL) in encodeOrientPacketStream() 296 scratch32 = (sfg->Accel.iGc[CHX] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 302 scratch32 = (sfg->Accel.iGc[CHY] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 308 scratch32 = (sfg->Accel.iGc[CHZ] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 322 if (sfg->iFlags & F_USING_MAG) in encodeOrientPacketStream() 325 scratch16 = (int16_t) (sfg->Mag.iBc[CHX] * 10) / (sfg->Mag.iCountsPeruT); in encodeOrientPacketStream() 327 scratch16 = (int16_t) ((sfg->Mag.iBc[CHY] * 10) / sfg->Mag.iCountsPeruT); in encodeOrientPacketStream() [all …]
|
D | orientaion_application_baremetal_agm01.c | 75 SensorFusionGlobals sfg; /* Sensor Fusion Global Structure … variable 105 static void encodeOrientPacketStream (SensorFusionGlobals * sfg, uint8_t *sUARTOutputBuffer); 269 void encodeOrientPacketStream(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer) in encodeOrientPacketStream() argument 295 if (sfg->iFlags & F_USING_ACCEL) in encodeOrientPacketStream() 298 scratch32 = (sfg->Accel.iGc[CHX] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 304 scratch32 = (sfg->Accel.iGc[CHY] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 310 scratch32 = (sfg->Accel.iGc[CHZ] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 324 if (sfg->iFlags & F_USING_MAG) in encodeOrientPacketStream() 327 scratch16 = (int16_t) (sfg->Mag.iBc[CHX] * 10) / (sfg->Mag.iCountsPeruT); in encodeOrientPacketStream() 329 scratch16 = (int16_t) ((sfg->Mag.iBc[CHY] * 10) / sfg->Mag.iCountsPeruT); in encodeOrientPacketStream() [all …]
|
D | orientaion_application_baremetal_agm04.c | 74 SensorFusionGlobals sfg; /* Sensor Fusion Global Structure … variable 104 static void encodeOrientPacketStream (SensorFusionGlobals * sfg, uint8_t *sUARTOutputBuffer); 268 void encodeOrientPacketStream(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer) in encodeOrientPacketStream() argument 294 if (sfg->iFlags & F_USING_ACCEL) in encodeOrientPacketStream() 297 scratch32 = (sfg->Accel.iGc[CHX] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 303 scratch32 = (sfg->Accel.iGc[CHY] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 309 scratch32 = (sfg->Accel.iGc[CHZ] * 8192) / sfg->Accel.iCountsPerg; in encodeOrientPacketStream() 323 if (sfg->iFlags & F_USING_MAG) in encodeOrientPacketStream() 326 scratch16 = (int16_t) (sfg->Mag.iBc[CHX] * 10) / (sfg->Mag.iCountsPeruT); in encodeOrientPacketStream() 328 scratch16 = (int16_t) ((sfg->Mag.iBc[CHY] * 10) / sfg->Mag.iCountsPeruT); in encodeOrientPacketStream() [all …]
|