Home | History | Annotate | Download | only in libsensors_iio

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)
300 LOGV_IF(EXTRA_VERBOSE, "HAL:gyro temperature path: %s", mpu.temperature);
309 /* read gyro FSR to calculate accel scale later */
317 LOGE("HAL:Error opening gyro FSR");
322 LOGE("HAL:Error reading gyro FSR");
326 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro FSR used %ld", mGyroScale);
331 /* read gyro self test scale used to calculate factory cal bias later */
337 LOGE("HAL:Error opening gyro self test scale");
342 LOGE("HAL:Error reading gyro self test scale");
346 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro self test scale used %ld", mGyroSelfTestScale);
351 /* open Factory Gyro Bias fd */
354 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro x offset path: %s", mpu.in_gyro_x_offset);
355 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro y offset path: %s", mpu.in_gyro_y_offset);
356 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro z offset path: %s", mpu.in_gyro_z_offset);
362 LOGE("HAL:could not open factory gyro calibrated bias");
368 /* open Gyro Bias fd */
373 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro x dmp bias path: %s", mpu.in_gyro_x_dmp_bias);
374 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro y dmp bias path: %s", mpu.in_gyro_y_dmp_bias);
375 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro z dmp bias path: %s", mpu.in_gyro_z_dmp_bias);
381 LOGE("HAL:could not open gyro DMP calibrated bias");
416 LOGE("HAL:Error opening gyro self test scale");
525 mPendingEvents[Gyro].version = sizeof(sensors_event_t);
526 mPendingEvents[Gyro].sensor = ID_GY;
527 mPendingEvents[Gyro].type = SENSOR_TYPE_GYROSCOPE;
528 mPendingEvents[Gyro].gyro.status = SENSOR_STATUS_ACCURACY_HIGH;
533 mPendingEvents[RawGyro].gyro.status = SENSOR_STATUS_ACCURACY_HIGH;
582 mHandlers[Gyro] = &MPLSensor::gyroHandler;
584 mHandlers[Gyro] = &MPLSensor::rawGyroHandler;
610 /* initialize Gyro Bias */
865 /* gyro setup */
868 LOGI_IF(EXTRA_VERBOSE, "HAL: Set MPL Gyro Scale %ld", mGyroScale << 15);
937 // get gyro orientation
946 LOGE("HAL:Could not read gyro mounting matrix");
949 "HAL:gyro mounting matrix: "
1040 /* Turn off Gyro master enable */
1129 //2. Either Gyro or Accel must be enabled/configured before next step
1443 } else if ((mEnabled & ( 1 << Gyro)) ||
1455 // enable gyro engine
1469 // disable gyro FIFO
1471 !((mBatchEnabled & (1 << Gyro)) || (mBatchEnabled & (1 << RawGyro)))) {
1566 } else if ((mEnabled & ( 1 << Gyro)) ||
1579 // enable gyro engine
1594 (!(mBatchEnabled & (1 << Gyro)) ||
1595 (!(mEnabled & (1 << Gyro))))) {
1998 /* takes care of Gyro case */
2059 changed & ((1 << Gyro) | (1 << RawGyro) | (1 << Accelerometer) |
2074 if (changed & ((1 << Gyro) | (1 << RawGyro))) {
2075 LOGV_IF(ENG_VERBOSE, "HAL:enableSensors - gyro %s",
2082 if (!cal_stored && (!en && (changed & (1 << Gyro)))) {
2130 if (!(changed & ((1 << Gyro)
2152 /* apply accel/gyro bias to DMP bias */
2170 if (changed & ((1 << Gyro) | (1 << RawGyro) | (1 << Accelerometer) |
2175 "HAL DEBUG: Gyro, Accel, Compass, Pressure changes");
2239 LOGV_IF(ENG_VERBOSE, "HAL DEBUG: Gyro, Accel, Compass no change");
2488 update = inv_get_sensor_type_gyroscope(s->gyro.v, &s->gyro.status,
2490 LOGV_IF(HANDLER_DATA, "HAL:gyro data : %+f %+f %+f -- %lld - %d",
2491 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2500 &s->gyro.status, &s->timestamp);
2503 LOGV_IF(HANDLER_DATA,"HAL:gyro bias data : %+f %+f %+f -- %lld - %d",
2507 s->gyro.status = SENSOR_STATUS_UNRELIABLE;
2508 LOGV_IF(HANDLER_DATA, "HAL:raw gyro data : %+f %+f %+f -- %lld - %d",
2613 s->gyro.v, &s->gyro.status, &s->timestamp);
2616 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2624 update = inv_get_sensor_type_gravity(s->gyro.v, &s->gyro.status,
2628 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2819 what = Gyro;
2820 sname = "Gyro";
2824 sname = "Gyro Uncalibrated";
2889 case Gyro:
2923 for (int i = Gyro; i <= RawMagneticField; i++) {
2940 for (int i = Gyro; i <= RawMagneticField; i++) {
3026 what = Gyro;
3027 sname = "Gyro";
3031 sname = "Gyro Uncalibrated";
3116 case Gyro:
3128 for (int i = Gyro;
3149 (((mEnabled & (1 << Gyro)) && ns > mDelays[Gyro]) ||
3156 "HAL:ignore delay set due to gyro/accel");
3223 gyroRate = mDelays[Gyro] < mDelays[RawGyro] ? mDelays[Gyro] : mDelays[RawGyro];
3276 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz",
3303 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz", rateInus, 1000000000.f / gyroRate);
3332 LOGE("HAL:GYRO update delay error");
3398 wanted = (mDelays[Gyro] <= mDelays[RawGyro]?
3399 (mEnabled & (1 << Gyro)? mDelays[Gyro]: mDelays[RawGyro]):
3400 (mEnabled & (1 << RawGyro)? mDelays[RawGyro]: mDelays[Gyro]));
3409 "HAL:MPL gyro sample rate: (mpl)=%d us", int(wanted/1000LL));
3414 LOGE_IF(res < 0, "HAL:GYRO update delay error");
3421 if (GY_ENABLED && mDelays[Gyro] < mDelays[Accelerometer]) {
3422 wanted = mDelays[Gyro];
3468 && (mDelays[Gyro] < compassWanted)) {
3469 wanted = mDelays[Gyro];
3579 * Should be called after reading at least one of gyro
3599 /* after the first no motion, the gyro should be
3612 LOGV_IF(EXTRA_VERBOSE, "HAL:***** New Gyro Bias *****\n");
3617 LOGV_IF(EXTRA_VERBOSE, "HAL:***** New Factory Gyro Bias *****\n");
3725 // because accel/gyro fifo are always turned off
3992 mPendingMask |= 1 << Gyro;
4049 set status bits to disable gyro bias cal */
4070 set status bits to disable gyro bias cal */
4090 set status bits to disable gyro bias cal */
4606 LOGE("HAL:error reading gyro temperature");
4668 LOGE("HAL:Error reading gyro bias");
4710 /* first add gyro, accel and compass to the list */
4712 /* fill in gyro/accel values */
4715 // LOGE("HAL:Can not get gyro/accel id");
4833 void MPLSensor::fillGyro(const char* gyro, struct sensor_t *list)
4837 if ( gyro != NULL && strcmp(gyro, "MPU3050") == 0) {
4838 list[Gyro].maxRange = GYRO_MPU3050_RANGE;
4839 list[Gyro].resolution = GYRO_MPU3050_RESOLUTION;
4840 list[Gyro].power = GYRO_MPU3050_POWER;
4841 list[Gyro].minDelay = GYRO_MPU3050_MINDELAY;
4842 } else if( gyro != NULL && strcmp(gyro, "MPU6050") == 0) {
4843 list[Gyro].maxRange = GYRO_MPU6050_RANGE;
4844 list[Gyro].resolution = GYRO_MPU6050_RESOLUTION;
4845 list[Gyro].power = GYRO_MPU6050_POWER;
4846 list[Gyro].minDelay = GYRO_MPU6050_MINDELAY;
4847 } else if( gyro != NULL && strcmp(gyro, "MPU6500") == 0) {
4848 list[Gyro].maxRange = GYRO_MPU6500_RANGE;
4849 list[Gyro].resolution = GYRO_MPU6500_RESOLUTION;
4850 list[Gyro].power = GYRO_MPU6500_POWER;
4851 list[Gyro].minDelay = GYRO_MPU6500_MINDELAY;
4852 } else if( gyro != NULL && strcmp(gyro, "MPU6515") == 0) {
4853 list[Gyro].maxRange = GYRO_MPU6500_RANGE;
4854 list[Gyro].resolution = GYRO_MPU6500_RESOLUTION;
4855 list[Gyro].power = GYRO_MPU6500_POWER;
4856 list[Gyro].minDelay = GYRO_MPU6500_MINDELAY;
4857 } else if( gyro != NULL && strcmp(gyro, "MPU9150") == 0) {
4858 list[Gyro].maxRange = GYRO_MPU9150_RANGE;
4859 list[Gyro].resolution = GYRO_MPU9150_RESOLUTION;
4860 list[Gyro].power = GYRO_MPU9150_POWER;
4861 list[Gyro].minDelay = GYRO_MPU9150_MINDELAY;
4862 } else if( gyro != NULL && strcmp(gyro, "MPU9250") == 0) {
4863 list[Gyro].maxRange = GYRO_MPU9250_RANGE;
4864 list[Gyro].resolution = GYRO_MPU9250_RESOLUTION;
4865 list[Gyro].power = GYRO_MPU9250_POWER;
4866 list[Gyro].minDelay = GYRO_MPU9250_MINDELAY;
4867 } else if( gyro != NULL && strcmp(gyro, "MPU9350") == 0) {
4868 list[Gyro].maxRange = GYRO_MPU9350_RANGE;
4869 list[Gyro].resolution = GYRO_MPU9350_RESOLUTION;
4870 list[Gyro].power = GYRO_MPU9350_POWER;
4871 list[Gyro].minDelay = GYRO_MPU9350_MINDELAY;
4873 LOGE("HAL:unknown gyro id -- gyro params will be wrong.");
4875 list[Gyro].maxRange = GYRO_MPU3050_RANGE;
4876 list[Gyro].resolution = GYRO_MPU3050_RESOLUTION;
4877 list[Gyro].power = GYRO_MPU3050_POWER;
4878 list[Gyro].minDelay = GYRO_MPU3050_MINDELAY;
4881 list[RawGyro].maxRange = list[Gyro].maxRange;
4882 list[RawGyro].resolution = list[Gyro].resolution;
4883 list[RawGyro].power = list[Gyro].power;
4884 list[RawGyro].minDelay = list[Gyro].minDelay;
4889 /* fillRV depends on values of gyro, accel and compass in the list */
4895 list[RotationVector].power = list[Gyro].power +
4920 /* fillGRV depends on values of gyro and accel in the list */
4926 list[GameRotationVector].power = list[Gyro].power +
4939 list[Orientation].power = list[Gyro].power +
4953 list[Gravity].power = list[Gyro].power +
4967 list[LinearAccel].power = list[Gyro].power +
5210 LOGV_IF(ENG_VERBOSE, "Factory Gyro Bias %ld %ld %ld", mFactoryGyroBias[0], mFactoryGyroBias[1], mFactoryGyroBias[2]);
5219 offset = x/2^16 * (Gyro scale / self test scale used) * (-1) / offset scale
5221 gyro scale default to = 2000
5263 LOGV_IF(EXTRA_VERBOSE, "HAL:Factory Gyro Calibrated Bias Applied");
5283 LOGV_IF(ENG_VERBOSE, "Mpl Gyro Bias (HW unit) %ld %ld %ld", mGyroChipBias[0], mGyroChipBias[1], mGyroChipBias[2]);
5284 LOGV_IF(ENG_VERBOSE, "Mpl Gyro Bias (HW unit) (body) %ld %ld %ld", bias[0], bias[1], bias[2]);
5338 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro DMP Calibrated Bias Applied");
5519 case Gyro:
5842 uint32_t hardwareSensorMask = (1 << Gyro)
6209 /* take care of case where only one type of gyro sensors or compass sensors is turned on */
6210 gyroRate = mBatchDelays[Gyro] < mBatchDelays[RawGyro] ? mBatchDelays[Gyro] : mBatchDelays[RawGyro];
6237 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz", mplGyroRate, 1000000000.f / gyroRate);
6264 LOGE("HAL:GYRO update delay error");
6332 "HAL:MPL gyro sample rate: (mpl)=%lld us (mpu)=%.2f Hz",
6357 LOGE("HAL:GYRO update delay error");