Home | History | Annotate | Download | only in mllite

Lines Matching refs:inv_obj

93 struct inv_obj_t inv_obj;
234 inv_obj.accel_sens = (long)(accelScale * 65536L);
238 inv_obj.accel_sens /= 32768 / mldl_cfg->accel_sens_trim;
240 inv_obj.accel_sens /= 2;
245 inv_obj.compass_sens = (long)(magScale * 32768);
317 memset(&inv_obj, 0, sizeof(struct inv_obj_t));
320 inv_obj.compass_correction[0] = 1073741824L;
321 inv_obj.compass_correction_relative[0] = 1073741824L;
322 inv_obj.compass_disturb_correction[0] = 1073741824L;
323 inv_obj.compass_correction_offset[0] = 1073741824L;
324 inv_obj.relative_quat[0] = 1073741824L;
327 inv_obj.no_motion_threshold = 20; // noMotionThreshold
329 inv_obj.motion_duration = 1536; // motionDuration
331 inv_obj.motion_state = INV_MOTION; // Motion state
333 inv_obj.bias_update_time = 8000;
334 inv_obj.bias_calc_time = 2000;
336 inv_obj.internal_motion_state = ML_MOT_STATE_MOVING;
338 inv_obj.start_time = inv_get_tick_count();
340 inv_obj.compass_cal[0] = 322122560L;
341 inv_obj.compass_cal[4] = 322122560L;
342 inv_obj.compass_cal[8] = 322122560L;
343 inv_obj.compass_sens = 322122560L; // Should only change when the sensor full-scale range (FSR) is changed.
346 inv_obj.compass_scale[ii] = 65536L;
347 inv_obj.compass_test_scale[ii] = 65536L;
348 inv_obj.compass_bias_error[ii] = P_INIT;
349 inv_obj.init_compass_bias[ii] = 0;
350 inv_obj.compass_asa[ii] = (1L << 30);
354 inv_obj.compass_asa[ii] = tmp[ii];
356 inv_obj.got_no_motion_bias = 0;
357 inv_obj.got_compass_bias = 0;
358 inv_obj.compass_state = SF_UNCALIBRATED;
359 inv_obj.acc_state = SF_STARTUP_SETTLE;
361 inv_obj.got_init_compass_bias = 0;
362 inv_obj.resetting_compass = 0;
364 inv_obj.external_slave_callback = NULL;
365 inv_obj.compass_accuracy = 0;
367 inv_obj.factory_temp_comp = 0;
368 inv_obj.got_coarse_heading = 0;
370 inv_obj.compass_bias_ptr[0] = P_INIT;
371 inv_obj.compass_bias_ptr[4] = P_INIT;
372 inv_obj.compass_bias_ptr[8] = P_INIT;
374 inv_obj.gyro_bias_err = 1310720;
376 inv_obj.accel_lpf_gain = 1073744L;
377 inv_obj.no_motion_accel_threshold = 7000000L;
447 mlxCallbackInterrupt.processInterruptCb[kk] (&inv_obj);
459 inv_obj.motion_state = INV_MOTION;
460 inv_obj.flags[INV_MOTION_STATE_CHANGE] = INV_MOTION;
461 inv_obj.no_motion_accel_time = inv_get_tick_count();
473 regs[0] = (unsigned char)((inv_obj.motion_duration >> 8) & 0xff);
474 regs[1] = (unsigned char)(inv_obj.motion_duration & 0xff);
506 inv_obj.suspend = 1;
517 inv_obj.suspend = 0;
612 int flagReturn = inv_obj.flags[flag];
614 inv_obj.flags[flag] = 0;
640 inv_obj.interrupt_sources |= INV_INT_MOTION;
642 inv_obj.interrupt_sources &= ~INV_INT_MOTION;
643 if (!inv_obj.interrupt_sources) {
687 inv_obj.interrupt_sources |= INV_INT_FIFO;
689 inv_obj.interrupt_sources &= ~INV_INT_FIFO;
690 if (!inv_obj.interrupt_sources) {
737 return inv_obj.interrupt_sources;
802 inv_obj.accel_sens = 0;
818 inv_obj.accel_cal[kk] = (long)(cal[kk] * (float)(1L << 30));
870 if (inv_obj.accel_sens != 0) {
871 sf = (1073741824L / inv_obj.accel_sens);
943 inv_obj.gyro_sens = (long)(range * 32768L);
946 inv_obj.gyro_cal[kk] = (long)(scale * orientation[kk] * (1L << 30));
947 inv_obj.gyro_orient[kk] = (long)((double)orientation[kk] * (1L << 30));
968 if (inv_obj.gyro_orient[0 + 3 * i] < 0)
970 if (ABS(inv_obj.gyro_orient[1 + 3 * i]) >
971 ABS(inv_obj.gyro_orient[0 + 3 * i])) {
973 if (inv_obj.gyro_orient[1 + 3 * i] < 0)
976 if (ABS(inv_obj.gyro_orient[2 + 3 * i]) >
977 ABS(inv_obj.gyro_orient[1 + 3 * i])) {
980 if (inv_obj.gyro_orient[2 + 3 * i] < 0)
1009 inv_obj.gyro_sf =
1010 (long)(((long long)inv_obj.gyro_sens * 767603923LL) / 1073741824LL);
1013 inv_int32_to_big8(inv_obj.gyro_sf, regs));
1019 if (inv_obj.gyro_sens != 0) {
1020 sf = (long)((long long)23832619764371LL / inv_obj.gyro_sens);
1082 inv_obj.compass_cal[kk] = (long)(cal[kk] * (float)(1L << 30));
1085 inv_obj.compass_sens = (long)(scale * 1073741824L);
1253 inv_obj.factory_temp_comp = 0; // FIXME, workaround
1256 inv_obj.factory_temp_comp = 1;
1259 if (inv_obj.factory_temp_comp == 0) {
1261 result = inv_set_gyro_temp_slope(inv_obj.temp_slope);
1312 return inv_obj.motion_state;
1343 inv_obj.no_motion_threshold = tmp;
1379 inv_obj.no_motion_accel_threshold = thresh;
1413 inv_obj.motion_duration = (unsigned short)tmp;
1415 regs[0] = (unsigned char)((inv_obj.motion_duration >> 8) & 0xff);
1416 regs[1] = (unsigned char)(inv_obj.motion_duration & 0xff);
1758 if (inv_obj.mode_change_func) {
1759 result = inv_obj.mode_change_func(mldl_cfg->requested_sensors, sensors);
1815 inv_obj.mode_change_func = mode_change_func;