Home | History | Annotate | Download | only in libsensors_iio

Lines Matching refs:gyro

208     LOGV_IF(EXTRA_VERBOSE, "HAL:gyro temperature path: %s", mpu.temperature);
217 /* read gyro FSR to calculate accel scale later */
225 LOGE("HAL:Error opening gyro FSR");
230 LOGE("HAL:Error reading gyro FSR");
234 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro FSR used %ld", mGyroScale);
239 /* read gyro self test scale used to calculate factory cal bias later */
245 LOGE("HAL:Error opening gyro self test scale");
250 LOGE("HAL:Error reading gyro self test scale");
254 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro self test scale used %ld", mGyroSelfTestScale);
259 /* open Factory Gyro Bias fd */
262 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro x offset path: %s", mpu.in_gyro_x_offset);
263 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro y offset path: %s", mpu.in_gyro_y_offset);
264 LOGV_IF(EXTRA_VERBOSE, "HAL:factory gyro z offset path: %s", mpu.in_gyro_z_offset);
270 LOGE("HAL:could not open factory gyro calibrated bias");
276 /* open Gyro Bias fd */
281 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro x dmp bias path: %s", mpu.in_gyro_x_dmp_bias);
282 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro y dmp bias path: %s", mpu.in_gyro_y_dmp_bias);
283 LOGV_IF(EXTRA_VERBOSE, "HAL: gyro z dmp bias path: %s", mpu.in_gyro_z_dmp_bias);
289 LOGE("HAL:could not open gyro DMP calibrated bias");
324 LOGE("HAL:Error opening gyro self test scale");
447 mPendingEvents[Gyro].version = sizeof(sensors_event_t);
448 mPendingEvents[Gyro].sensor = ID_GY;
449 mPendingEvents[Gyro].type = SENSOR_TYPE_GYROSCOPE;
450 mPendingEvents[Gyro].gyro.status = SENSOR_STATUS_ACCURACY_HIGH;
455 mPendingEvents[RawGyro].gyro.status = SENSOR_STATUS_ACCURACY_HIGH;
517 mHandlers[Gyro] = &MPLSensor::gyroHandler;
541 /* initialize Gyro Bias */
807 /* gyro setup */
810 LOGI_IF(EXTRA_VERBOSE, "HAL: Set MPL Gyro Scale %ld", mGyroScale << 15);
881 // get gyro orientation
890 LOGE("HAL:Could not read gyro mounting matrix");
893 "HAL:gyro mounting matrix: "
908 LOGE("HAL:Could not close gyro mounting matrix");
990 /* Turn off Gyro master enable */
1053 //2. Either Gyro or Accel must be enabled/configured before next step
1181 LOGV_IF(PROCESS_VERBOSE, "HAL:computeAndSetDmpState() accel and gyro = 1");
1518 } else if ((mEnabled & ( 1 << Gyro)) ||
1530 // enable gyro engine
1544 // disable gyro FIFO
1546 !((mBatchEnabled & (1 << Gyro)) || (mBatchEnabled & (1 << RawGyro)))) {
1656 } else if ((mEnabled & ( 1 << Gyro)) ||
1669 // enable gyro engine
1684 (!(mBatchEnabled & (1 << Gyro)) ||
1685 (!(mEnabled & (1 << Gyro))))) {
2074 /* takes care of Gyro case */
2141 changed & ((1 << Gyro) | (1 << RawGyro) | (1 << Accelerometer) |
2158 if (changed & ((1 << Gyro) | (1 << RawGyro))) {
2159 LOGV_IF(ENG_VERBOSE, "HAL:enableSensors - gyro %s",
2166 if (!cal_stored && (!en && (changed & (1 << Gyro)))) {
2216 if (!(changed & ((1 << Gyro)
2238 /* apply accel/gyro bias to DMP bias */
2257 if (changed & ((1 << Gyro) | (1 << RawGyro) | (1 << Accelerometer) |
2264 "HAL DEBUG: Gyro, Accel, Compass, Pressure changes");
2325 LOGV_IF(ENG_VERBOSE, "HAL DEBUG: Gyro, Accel, Compass no change");
2624 update = inv_get_sensor_type_gyroscope(s->gyro.v, &s->gyro.status,
2627 update = inv_get_sensor_type_gyroscope(s->gyro.v, &s->gyro.status,
2630 if (!mEnabledTime[Gyro] || !(s->timestamp > mEnabledTime[Gyro])) {
2631 LOGV_IF(ENG_VERBOSE, "HAL:gyro incorrect timestamp Enabled=%lld, Timestamp=%lld, Now=%lld",
2632 mEnabledTime[Gyro], s->timestamp, android::elapsedRealtimeNano());
2636 LOGV_IF(HANDLER_DATA, "HAL:gyro data : %+f %+f %+f -- %lld - %d",
2637 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2647 &s->gyro.status, (inv_time_t *)(&s->timestamp));
2650 &s->gyro.status, &s->timestamp);
2653 LOGV_IF(ENG_VERBOSE, "HAL:raw gyro incorrect timestamp Enabled=%lld, Timestamp=%lld, Now=%lld",
2660 LOGV_IF(HANDLER_DATA,"HAL:gyro bias data : %+f %+f %+f -- %lld - %d",
2664 s->gyro.status = SENSOR_STATUS_UNRELIABLE;
2665 LOGV_IF(HANDLER_DATA, "HAL:raw gyro data : %+f %+f %+f -- %lld - %d",
2831 s->gyro.v, &s->gyro.status, (inv_time_t *)(&s->timestamp));
2834 s->gyro.v, &s->gyro.status, &s->timestamp);
2845 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
2854 update = inv_get_sensor_type_gravity(s->gyro.v, &s->gyro.status,
2857 update = inv_get_sensor_type_gravity(s->gyro.v, &s->gyro.status,
2869 s->gyro.v[0], s->gyro.v[1], s->gyro.v[2], s->timestamp, update);
3152 what = Gyro;
3153 sname = "Gyro";
3157 sname = "Gyro Uncalibrated";
3226 case Gyro:
3262 for (int i = Gyro; i <= RawMagneticField; i++) {
3279 for (int i = Gyro; i <= RawMagneticField; i++) {
3376 what = Gyro;
3377 sname = "Gyro";
3381 sname = "Gyro Uncalibrated";
3470 case Gyro:
3482 for (int i = Gyro;
3503 (((mEnabled & (1 << Gyro)) && ns > mDelays[Gyro]) ||
3510 "HAL:ignore delay set due to gyro/accel");
3635 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz",
3678 LOGE("HAL:GYRO update delay error");
3729 wanted = (mDelays[Gyro] <= mDelays[RawGyro]?
3730 (mEnabled & (1 << Gyro)? mDelays[Gyro]: mDelays[RawGyro]):
3731 (mEnabled & (1 << RawGyro)? mDelays[RawGyro]: mDelays[Gyro]));
3735 "HAL:MPL gyro sample rate: (mpl)=%d us", int(wanted/1000LL));
3740 LOGE_IF(res < 0, "HAL:GYRO update delay error");
3744 if (GY_ENABLED && mDelays[Gyro] < mDelays[Accelerometer]) {
3745 wanted = mDelays[Gyro];
3780 && (mDelays[Gyro] < compassWanted)) {
3781 wanted = mDelays[Gyro];
3838 * Should be called after reading at least one of gyro
3862 /* after the first no motion, the gyro should be
3875 LOGV_IF(EXTRA_VERBOSE, "HAL:***** New Gyro Bias *****\n");
3880 LOGV_IF(EXTRA_VERBOSE, "HAL:***** New Factory Gyro Bias *****\n");
4252 LOGV_IF(ENG_VERBOSE && INPUT_DATA, "GYRO DETECTED:0x%x", data_format);
4420 mPendingMask |= 1 << Gyro;
4486 set status bits to disable gyro bias cal */
4507 set status bits to disable gyro bias cal */
4527 set status bits to disable gyro bias cal */
4971 LOGE("HAL:error reading gyro temperature");
5033 LOGE("HAL:Error reading gyro bias");
5075 /* first add gyro, accel and compass to the list */
5077 /* fill in gyro/accel values */
5079 LOGE("HAL:Can not get gyro/accel id");
5192 void MPLSensor::fillGyro(const char* gyro, struct sensor_t *list)
5196 if ( gyro != NULL && strcmp(gyro, "MPU3050") == 0) {
5197 list[Gyro].maxRange = GYRO_MPU3050_RANGE;
5198 list[Gyro].resolution = GYRO_MPU3050_RESOLUTION;
5199 list[Gyro].power = GYRO_MPU3050_POWER;
5200 list[Gyro].minDelay = GYRO_MPU3050_MINDELAY;
5201 } else if( gyro != NULL && strcmp(gyro, "MPU6050") == 0) {
5202 list[Gyro].maxRange = GYRO_MPU6050_RANGE;
5203 list[Gyro].resolution = GYRO_MPU6050_RESOLUTION;
5204 list[Gyro].power = GYRO_MPU6050_POWER;
5205 list[Gyro].minDelay = GYRO_MPU6050_MINDELAY;
5206 } else if( gyro != NULL && strcmp(gyro, "MPU6500") == 0) {
5207 list[Gyro].maxRange = GYRO_MPU6500_RANGE;
5208 list[Gyro].resolution = GYRO_MPU6500_RESOLUTION;
5209 list[Gyro].power = GYRO_MPU6500_POWER;
5210 list[Gyro].minDelay = GYRO_MPU6500_MINDELAY;
5211 } else if( gyro != NULL && strcmp(gyro, "MPU6515") == 0) {
5212 list[Gyro].maxRange = GYRO_MPU6500_RANGE;
5213 list[Gyro].resolution = GYRO_MPU6500_RESOLUTION;
5214 list[Gyro].power = GYRO_MPU6500_POWER;
5215 list[Gyro].minDelay = GYRO_MPU6500_MINDELAY;
5216 } else if( gyro != NULL && strcmp(gyro, "MPU9150") == 0) {
5217 list[Gyro].maxRange = GYRO_MPU9150_RANGE;
5218 list[Gyro].resolution = GYRO_MPU9150_RESOLUTION;
5219 list[Gyro].power = GYRO_MPU9150_POWER;
5220 list[Gyro].minDelay = GYRO_MPU9150_MINDELAY;
5221 } else if( gyro != NULL && strcmp(gyro, "MPU9250") == 0) {
5222 list[Gyro].maxRange = GYRO_MPU9250_RANGE;
5223 list[Gyro].resolution = GYRO_MPU9250_RESOLUTION;
5224 list[Gyro].power = GYRO_MPU9250_POWER;
5225 list[Gyro].minDelay = GYRO_MPU9250_MINDELAY;
5226 } else if( gyro != NULL && strcmp(gyro, "MPU9255") == 0) {
5227 list[Gyro].maxRange = GYRO_MPU9255_RANGE;
5228 list[Gyro].resolution = GYRO_MPU9255_RESOLUTION;
5229 list[Gyro].power = GYRO_MPU9255_POWER;
5230 list[Gyro].minDelay = GYRO_MPU9255_MINDELAY;
5231 } else if( gyro != NULL && strcmp(gyro, "MPU9350") == 0) {
5232 list[Gyro].maxRange = GYRO_MPU9350_RANGE;
5233 list[Gyro].resolution = GYRO_MPU9350_RESOLUTION;
5234 list[Gyro].power = GYRO_MPU9350_POWER;
5235 list[Gyro].minDelay = GYRO_MPU9350_MINDELAY;
5237 LOGE("HAL:unknown gyro id -- gyro params will be wrong.");
5239 list[Gyro].maxRange = GYRO_MPU6500_RANGE;
5240 list[Gyro].resolution = GYRO_MPU6500_RESOLUTION;
5241 list[Gyro].power = GYRO_MPU6500_POWER;
5242 list[Gyro].minDelay = GYRO_MPU6500_MINDELAY;
5245 list[RawGyro].maxRange = list[Gyro].maxRange;
5246 list[RawGyro].resolution = list[Gyro].resolution;
5247 list[RawGyro].power = list[Gyro].power;
5248 list[RawGyro].minDelay = list[Gyro].minDelay;
5253 /* fillRV depends on values of gyro, accel and compass in the list */
5259 list[RotationVector].power = list[Gyro].power +
5284 /* fillGRV depends on values of gyro and accel in the list */
5290 list[GameRotationVector].power = list[Gyro].power +
5303 list[Orientation].power = list[Gyro].power +
5317 list[Gravity].power = list[Gyro].power +
5331 list[LinearAccel].power = list[Gyro].power +
5574 LOGV_IF(ENG_VERBOSE, "Factory Gyro Bias %ld %ld %ld", mFactoryGyroBias[0], mFactoryGyroBias[1], mFactoryGyroBias[2]);
5582 offset = x/2^16 * (Gyro scale / self test scale used) * (-1) / offset scale
5584 gyro scale default to = 2000
5625 LOGV_IF(EXTRA_VERBOSE, "HAL:Factory Gyro Calibrated Bias Applied");
5645 LOGV_IF(ENG_VERBOSE && INPUT_DATA, "Mpl Gyro Bias (HW unit) %ld %ld %ld", mGyroChipBias[0], mGyroChipBias[1], mGyroChipBias[2]);
5646 LOGV_IF(ENG_VERBOSE && INPUT_DATA, "Mpl Gyro Bias (HW unit) (body) %ld %ld %ld", bias[0], bias[1], bias[2]);
5686 LOGV_IF(EXTRA_VERBOSE, "HAL:Zero Gyro DMP Calibrated Bias Applied");
5728 LOGV_IF(EXTRA_VERBOSE, "HAL:Gyro DMP Calibrated Bias Applied");
5929 case Gyro:
6358 uint32_t hardwareSensorMask = (1 << Gyro)
6734 gyroRate = mBatchDelays[Gyro];
6735 /* take care of case where only one type of gyro sensors or
6737 if (mBatchEnabled & (1 << Gyro) || mBatchEnabled & (1 << RawGyro)) {
6738 gyroRate = (mBatchDelays[Gyro] <= mBatchDelays[RawGyro]) ?
6739 (mBatchEnabled & (1 << Gyro) ? mBatchDelays[Gyro] : mBatchDelays[RawGyro]):
6740 (mBatchEnabled & (1 << RawGyro) ? mBatchDelays[RawGyro] : mBatchDelays[Gyro]);
6781 "HAL:MPL gyro sample rate: (mpl)=%d us (mpu)=%.2f Hz", mplGyroRate, 1000000000.f / gyroRate);
6827 /* takes care of gyro rate */
6834 LOGE("HAL:GYRO update delay error");
6945 "HAL:MPL gyro sample rate: (mpl)=%lld us (mpu)=%.2f Hz",
6964 /* takes care of gyro rate */
6971 LOGE("HAL:GYRO update delay error");