Lines Matching defs:inv_obj

93 struct inv_obj_t inv_obj;
229 inv_obj.accel_sens = (long)(accelScale * 65536L);
233 inv_obj.accel_sens /= 32768 / mldl_cfg->accel_sens_trim;
235 inv_obj.accel_sens /= 2;
239 inv_obj.compass_sens = (long)(magScale * 32768);
306 memset(&inv_obj, 0, sizeof(struct inv_obj_t));
309 inv_obj.compass_correction[0] = 1073741824L;
310 inv_obj.compass_correction_relative[0] = 1073741824L;
311 inv_obj.compass_disturb_correction[0] = 1073741824L;
312 inv_obj.compass_correction_offset[0] = 1073741824L;
313 inv_obj.relative_quat[0] = 1073741824L;
316 inv_obj.no_motion_threshold = 20; // noMotionThreshold
318 inv_obj.motion_duration = 1536; // motionDuration
320 inv_obj.motion_state = INV_MOTION; // Motion state
322 inv_obj.bias_update_time = 8000;
323 inv_obj.bias_calc_time = 2000;
325 inv_obj.internal_motion_state = ML_MOT_STATE_MOVING;
327 inv_obj.start_time = inv_get_tick_count();
329 inv_obj.compass_cal[0] = 322122560L;
330 inv_obj.compass_cal[4] = 322122560L;
331 inv_obj.compass_cal[8] = 322122560L;
332 inv_obj.compass_sens = 322122560L; // Should only change when the sensor full-scale range (FSR) is changed.
335 inv_obj.compass_scale[ii] = 65536L;
336 inv_obj.compass_test_scale[ii] = 65536L;
337 inv_obj.compass_bias_error[ii] = P_INIT;
338 inv_obj.init_compass_bias[ii] = 0;
339 inv_obj.compass_asa[ii] = (1L << 30);
343 inv_obj.compass_asa[ii] = tmp[ii];
345 inv_obj.got_no_motion_bias = 0;
346 inv_obj.got_compass_bias = 0;
347 inv_obj.compass_state = SF_UNCALIBRATED;
348 inv_obj.acc_state = SF_STARTUP_SETTLE;
350 inv_obj.got_init_compass_bias = 0;
351 inv_obj.resetting_compass = 0;
353 inv_obj.external_slave_callback = NULL;
354 inv_obj.compass_accuracy = 0;
356 inv_obj.factory_temp_comp = 0;
357 inv_obj.got_coarse_heading = 0;
359 inv_obj.compass_bias_ptr[0] = P_INIT;
360 inv_obj.compass_bias_ptr[4] = P_INIT;
361 inv_obj.compass_bias_ptr[8] = P_INIT;
363 inv_obj.gyro_bias_err = 1310720;
365 inv_obj.accel_lpf_gain = 1073744L;
366 inv_obj.no_motion_accel_threshold = 7000000L;
436 mlxCallbackInterrupt.processInterruptCb[kk] (&inv_obj);
448 inv_obj.motion_state = INV_MOTION;
449 inv_obj.flags[INV_MOTION_STATE_CHANGE] = INV_MOTION;
450 inv_obj.no_motion_accel_time = inv_get_tick_count();
462 regs[0] = (unsigned char)((inv_obj.motion_duration >> 8) & 0xff);
463 regs[1] = (unsigned char)(inv_obj.motion_duration & 0xff);
495 inv_obj.suspend = 1;
506 inv_obj.suspend = 0;
601 int flagReturn = inv_obj.flags[flag];
603 inv_obj.flags[flag] = 0;
629 inv_obj.interrupt_sources |= INV_INT_MOTION;
631 inv_obj.interrupt_sources &= ~INV_INT_MOTION;
632 if (!inv_obj.interrupt_sources) {
676 inv_obj.interrupt_sources |= INV_INT_FIFO;
678 inv_obj.interrupt_sources &= ~INV_INT_FIFO;
679 if (!inv_obj.interrupt_sources) {
726 return inv_obj.interrupt_sources;
791 inv_obj.accel_sens = 0;
807 inv_obj.accel_cal[kk] = (long)(cal[kk] * (float)(1L << 30));
859 if (inv_obj.accel_sens != 0) {
860 sf = (1073741824L / inv_obj.accel_sens);
932 inv_obj.gyro_sens = (long)(range * 32768L);
935 inv_obj.gyro_cal[kk] = (long)(scale * orientation[kk] * (1L << 30));
936 inv_obj.gyro_orient[kk] = (long)((double)orientation[kk] * (1L << 30));
957 if (inv_obj.gyro_orient[0 + 3 * i] < 0)
959 if (ABS(inv_obj.gyro_orient[1 + 3 * i]) >
960 ABS(inv_obj.gyro_orient[0 + 3 * i])) {
962 if (inv_obj.gyro_orient[1 + 3 * i] < 0)
965 if (ABS(inv_obj.gyro_orient[2 + 3 * i]) >
966 ABS(inv_obj.gyro_orient[1 + 3 * i])) {
969 if (inv_obj.gyro_orient[2 + 3 * i] < 0)
998 inv_obj.gyro_sf =
999 (long)(((long long)inv_obj.gyro_sens * 767603923LL) / 1073741824LL);
1002 inv_int32_to_big8(inv_obj.gyro_sf, regs));
1008 if (inv_obj.gyro_sens != 0) {
1009 sf = (long)((long long)23832619764371LL / inv_obj.gyro_sens);
1071 inv_obj.compass_cal[kk] = (long)(cal[kk] * (float)(1L << 30));
1074 inv_obj.compass_sens = (long)(scale * 1073741824L);
1242 inv_obj.factory_temp_comp = 0; // FIXME, workaround
1245 inv_obj.factory_temp_comp = 1;
1248 if (inv_obj.factory_temp_comp == 0) {
1250 result = inv_set_gyro_temp_slope(inv_obj.temp_slope);
1301 return inv_obj.motion_state;
1332 inv_obj.no_motion_threshold = tmp;
1368 inv_obj.no_motion_accel_threshold = thresh;
1402 inv_obj.motion_duration = (unsigned short)tmp;
1404 regs[0] = (unsigned char)((inv_obj.motion_duration >> 8) & 0xff);
1405 regs[1] = (unsigned char)(inv_obj.motion_duration & 0xff);
1747 if (inv_obj.mode_change_func) {
1748 result = inv_obj.mode_change_func(mldl_cfg->requested_sensors, sensors);
1804 inv_obj.mode_change_func = mode_change_func;