Lines Matching refs:Gyro
93 // mask of virtual sensors that require gyro + accel + compass data
100 // mask of virtual sensors that require gyro + accel data (but no compass data)
104 // mask of virtual sensors that require mag + accel data (but no gyro data)
296 LOGV_IF(EXTRA_VERBOSE, "HAL:gyro temperature path: %s", mpu.temperature);
305 /* read gyro FSR to calculate accel scale later */
313 LOGE("HAL:Error opening gyro FSR");
318 LOGE("HAL:Error reading gyro FSR");
322 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro FSR used %ld", mGyroScale);
327 /* read gyro self test scale used to calculate factory cal bias later */
333 LOGE("HAL:Error opening gyro self test scale");
338 LOGE("HAL:Error reading gyro self test scale");
342 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro self test scale used %ld", mGyroSelfTestScale);
347 /* open Factory Gyro Bias fd */
350 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro x offset path: %s", mpu.in_gyro_x_offset);
351 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro y offset path: %s", mpu.in_gyro_y_offset);
352 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro z offset path: %s", mpu.in_gyro_z_offset);
358 LOGE("HAL:could not open factory gyro calibrated bias");
364 /* open Gyro Bias fd */
369 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro x dmp bias path: %s", mpu.in_gyro_x_dmp_bias);
370 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro y dmp bias path: %s", mpu.in_gyro_y_dmp_bias);
371 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro z dmp bias path: %s", mpu.in_gyro_z_dmp_bias);
377 LOGE("HAL:could not open gyro DMP calibrated bias");
482 mPendingEvents[Gyro].version = sizeof(sensors_event_t);
483 mPendingEvents[Gyro].sensor = ID_GY;
484 mPendingEvents[Gyro].type = SENSOR_TYPE_GYROSCOPE;
485 mPendingEvents[Gyro].gyro.status = SENSOR_STATUS_ACCURACY_HIGH;
490 mPendingEvents[RawGyro].gyro.status = SENSOR_STATUS_ACCURACY_HIGH;
539 mHandlers[Gyro] = &MPLSensor::gyroHandler;
541 mHandlers[Gyro] = &MPLSensor::rawGyroHandler;
567 /* initialize Gyro Bias */
805 /* gyro setup */
808 LOGI_IF(EXTRA_VERBOSE, "HAL: Set MPL Gyro Scale %ld", mGyroScale << 15);
874 // get gyro orientation
886 "HAL:gyro mounting matrix: "
900 LOGE("HAL:Couldn't read gyro mounting matrix");
979 /* Turn off Gyro master enable */
1066 //2. Either Gyro or Accel must be enabled/configured before next step
1379 } else if ((mEnabled & ( 1 << Gyro)) ||
1391 // enable gyro engine
1405 // disable gyro FIFO
1407 !((mBatchEnabled & (1 << Gyro)) || (mBatchEnabled & (1 << RawGyro)))) {
1495 } else if ((mEnabled & ( 1 << Gyro)) ||
1508 // enable gyro engine
1523 (!(mBatchEnabled & (1 << Gyro)) ||
1524 (!(mEnabled & (1 << Gyro))))) {
1913 /* takes care of Gyro case */
1975 changed & ((1 << Gyro) | (1 << RawGyro) | (1 << Accelerometer) |
1990 if (changed & ((1 << Gyro) | (1 << RawGyro))) {
1991 LOGV_IF(PROCESS_VERBOSE, "HAL:enableSensors - gyro %s",
1998 if (!cal_stored && (!en && (changed & (1 << Gyro)))) {
2046 if (!(changed & ((1 << Gyro)
2068 /* apply accel/gyro bias to DMP bias */
2082 if (changed & ((1 << Gyro) | (1 << RawGyro) | (1 << Accelerometer) |
2086 LOGV_IF(ENG_VERBOSE, "HAL DEBUG: Gyro, Accel, Compass, Pressure changes");
2148 LOGV_IF(ENG_VERBOSE, "HAL DEBUG: Gyro, Accel, Compass no change");
2368 update = inv_get_sensor_type_gyroscope(s->gyro.v, &s->gyro.status,
2370 LOGV_IF(HANDLER_DATA, "HAL:gyro data : %+f %+f %+f -- %lld - %d",
2371 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2380 &s->gyro.status, &s->timestamp);
2383 LOGV_IF(HANDLER_DATA,"HAL:gyro bias data : %+f %+f %+f -- %lld - %d",
2387 s->gyro.status = SENSOR_STATUS_UNRELIABLE;
2388 LOGV_IF(HANDLER_DATA, "HAL:raw gyro data : %+f %+f %+f -- %lld - %d",
2493 s->gyro.v, &s->gyro.status, &s->timestamp);
2496 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2504 update = inv_get_sensor_type_gravity(s->gyro.v, &s->gyro.status,
2508 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2661 what = Gyro;
2662 sname = "Gyro";
2666 sname = "Gyro Uncalibrated";
2732 case Gyro:
2766 for (int i = Gyro; i <= RawMagneticField; i++) {
2783 for (int i = Gyro; i <= RawMagneticField; i++) {
2867 what = Gyro;
2868 sname = "Gyro";
2872 sname = "Gyro Uncalibrated";
2955 case Gyro:
2958 for (int i = Gyro;
2972 (((mEnabled & (1 << Gyro)) && ns > mDelays[Gyro]) ||
2977 "HAL:ignore delay set due to gyro/accel");
3049 gyroRate = mDelays[Gyro] < mDelays[RawGyro] ? mDelays[Gyro] : mDelays[RawGyro];
3074 gyro vs compass vs accel */
3091 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz", mplGyroRate, 1000000000.f / gyroRate);
3128 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz", rateInus, 1000000000.f / gyroRate);
3158 LOGE("HAL:GYRO update delay error");
3224 wanted = (mDelays[Gyro] <= mDelays[RawGyro]?
3225 (mEnabled & (1 << Gyro)? mDelays[Gyro]: mDelays[RawGyro]):
3226 (mEnabled & (1 << RawGyro)? mDelays[RawGyro]: mDelays[Gyro]));
3235 "HAL:MPL gyro sample rate: (mpl)=%d us", int(wanted/1000LL));
3240 LOGE_IF(res < 0, "HAL:GYRO update delay error");
3248 if (GY_ENABLED && mDelays[Gyro] < mDelays[Accelerometer]) {
3249 wanted = mDelays[Gyro];
3295 && (mDelays[Gyro] < compassWanted)) {
3296 wanted = mDelays[Gyro];
3424 * Should be called after reading at least one of gyro
3444 /* after the first no motion, the gyro should be
3536 // because accel/gyro are turned off anyway
3756 mPendingMask |= 1 << Gyro;
3801 set status bits to disable gyro bias cal */
3823 set status bits to disable gyro bias cal */
3844 set status bits to disable gyro bias cal */
4341 LOGE("HAL:error reading gyro temperature");
4403 LOGE("HAL:Error reading gyro bias");
4445 /* first add gyro, accel and compass to the list */
4447 /* fill in gyro/accel values */
4449 LOGE("HAL:Can not get gyro/accel id");
4551 void MPLSensor::fillGyro(const char* gyro, struct sensor_t *list)
4555 if ( gyro != NULL && strcmp(gyro, "MPU3050") == 0) {
4556 list[Gyro].maxRange = GYRO_MPU3050_RANGE;
4557 list[Gyro].resolution = GYRO_MPU3050_RESOLUTION;
4558 list[Gyro].power = GYRO_MPU3050_POWER;
4559 list[Gyro].minDelay = GYRO_MPU3050_MINDELAY;
4560 } else if( gyro != NULL && strcmp(gyro, "MPU6050") == 0) {
4561 list[Gyro].maxRange = GYRO_MPU6050_RANGE;
4562 list[Gyro].resolution = GYRO_MPU6050_RESOLUTION;
4563 list[Gyro].power = GYRO_MPU6050_POWER;
4564 list[Gyro].minDelay = GYRO_MPU6050_MINDELAY;
4565 } else if( gyro != NULL && strcmp(gyro, "MPU6500") == 0) {
4566 list[Gyro].maxRange = GYRO_MPU6500_RANGE;
4567 list[Gyro].resolution = GYRO_MPU6500_RESOLUTION;
4568 list[Gyro].power = GYRO_MPU6500_POWER;
4569 list[Gyro].minDelay = GYRO_MPU6500_MINDELAY;
4570 } else if( gyro != NULL && strcmp(gyro, "MPU6515") == 0) {
4571 list[Gyro].maxRange = GYRO_MPU6500_RANGE;
4572 list[Gyro].resolution = GYRO_MPU6500_RESOLUTION;
4573 list[Gyro].power = GYRO_MPU6500_POWER;
4574 list[Gyro].minDelay = GYRO_MPU6500_MINDELAY;
4575 } else if( gyro != NULL && strcmp(gyro, "MPU9150") == 0) {
4576 list[Gyro].maxRange = GYRO_MPU9150_RANGE;
4577 list[Gyro].resolution = GYRO_MPU9150_RESOLUTION;
4578 list[Gyro].power = GYRO_MPU9150_POWER;
4579 list[Gyro].minDelay = GYRO_MPU9150_MINDELAY;
4581 LOGE("HAL:unknown gyro id -- gyro params will be wrong.");
4583 list[Gyro].maxRange = GYRO_MPU3050_RANGE;
4584 list[Gyro].resolution = GYRO_MPU3050_RESOLUTION;
4585 list[Gyro].power = GYRO_MPU3050_POWER;
4586 list[Gyro].minDelay = GYRO_MPU3050_MINDELAY;
4589 list[RawGyro].maxRange = list[Gyro].maxRange;
4590 list[RawGyro].resolution = list[Gyro].resolution;
4591 list[RawGyro].power = list[Gyro].power;
4592 list[RawGyro].minDelay = list[Gyro].minDelay;
4597 /* fillRV depends on values of gyro, accel and compass in the list */
4603 list[RotationVector].power = list[Gyro].power +
4628 /* fillGRV depends on values of gyro and accel in the list */
4634 list[GameRotationVector].power = list[Gyro].power +
4647 list[Orientation].power = list[Gyro].power +
4661 list[Gravity].power = list[Gyro].power +
4675 list[LinearAccel].power = list[Gyro].power +
4911 LOGV_IF(ENG_VERBOSE, "Factory Gyro Bias %ld %ld %ld", mFactoryGyroBias[0], mFactoryGyroBias[1], mFactoryGyroBias[2]);
4920 /* offset = x/2^16 * (Gyro scale / self test scale used) * (-1) / offset scale
4922 /* gyro scale default to = 2000
4964 LOGV_IF(EXTRA_VERBOSE, "HAL:Factory Gyro Calibrated Bias Applied");
4985 LOGV_IF(ENG_VERBOSE, "Mpl Gyro Bias (HW unit) %ld %ld %ld", mGyroChipBias[0], mGyroChipBias[1], mGyroChipBias[2]);
4986 LOGV_IF(ENG_VERBOSE, "Mpl Gyro Bias (HW unit) (body) %ld %ld %ld", bias[0], bias[1], bias[2]);
5043 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro DMP Calibrated Bias Applied");
5204 /* Supported sensors: Accel, Gyro, Raw Gyro, Compass, Raw Compass, GRV, Step Detector */
5461 uint32_t hardwareSensorMask = (1<<Gyro) | (1<<RawGyro) | (1<<Accelerometer) | (1<<MagneticField) |
5784 /* take care of case where only one type of gyro sensors or compass sensors is turned on */
5785 gyroRate = mBatchDelays[Gyro] < mBatchDelays[RawGyro] ? mBatchDelays[Gyro] : mBatchDelays[RawGyro];
5801 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz", mplGyroRate, 1000000000.f / gyroRate);
5828 LOGE("HAL:GYRO update delay error");
5874 gyroRate = mDelays[Gyro] < mDelays[RawGyro] ? mDelays[Gyro] : mDelays[RawGyro];
5899 "HAL:MPL gyro sample rate: (mpl)=%lld us (mpu)=%.2f Hz", gyroRate/1000LL, 1000000000.f / gyroRate);
5921 LOGE("HAL:GYRO update delay error");