Lines Matching full:this
52 this->i2c_bus = (struct rt_i2c_bus_device *)rt_device_find(iic_bus); in MPU6050()
53 if (this->i2c_bus == NULL) in MPU6050()
59 this->i2c_addr = addr; in MPU6050()
62 SensorManager::registerSensor(this); in MPU6050()
69 msgs[0].addr = this->i2c_addr; in read_reg()
74 msgs[1].addr = this->i2c_addr; in read_reg()
79 if (rt_i2c_transfer(this->i2c_bus, msgs, 2) == 2) in read_reg()
89 msgs[0].addr = this->i2c_addr; in read_buffer()
94 msgs[1].addr = this->i2c_addr; in read_buffer()
99 if (rt_i2c_transfer(this->i2c_bus, msgs, 2) == 2) in read_buffer()
109 msgs[0].addr = this->i2c_addr; in write_reg()
114 msgs[1].addr = this->i2c_addr; in write_reg()
119 if (rt_i2c_transfer(this->i2c_bus, msgs, 2) == 2) in write_reg()
167 this->enable = RT_FALSE; in MPU6050_Accelerometer()
168 this->sensitivity = SENSOR_ACCEL_SENSITIVITY_2G; in MPU6050_Accelerometer()
169 this->config = config; in MPU6050_Accelerometer()
187 this->sensitivity = SENSOR_ACCEL_SENSITIVITY_2G; in configure()
191 this->sensitivity = SENSOR_ACCEL_SENSITIVITY_4G; in configure()
195 this->sensitivity = SENSOR_ACCEL_SENSITIVITY_8G; in configure()
199 this->sensitivity = SENSOR_ACCEL_SENSITIVITY_16G; in configure()
220 if (enable && this->enable == RT_FALSE) in activate()
228 if (!enable && this->enable == RT_TRUE) in activate()
236 if (enable) this->enable = RT_TRUE; in activate()
237 else this->enable = RT_FALSE; in activate()
253 event->sensor = (int32_t) this; in poll()
274 event->acceleration.x = x * this->sensitivity * SENSORS_GRAVITY_STANDARD; in poll()
275 event->acceleration.y = y * this->sensitivity * SENSORS_GRAVITY_STANDARD; in poll()
276 event->acceleration.z = z * this->sensitivity * SENSORS_GRAVITY_STANDARD; in poll()
331 this->enable = RT_FALSE; in MPU6050_Gyroscope()
332 this->sensitivity = SENSOR_GYRO_SENSITIVITY_250DPS; in MPU6050_Gyroscope()
350 this->sensitivity = SENSOR_GYRO_SENSITIVITY_250DPS; in configure()
354 this->sensitivity = SENSOR_GYRO_SENSITIVITY_500DPS; in configure()
358 this->sensitivity = SENSOR_GYRO_SENSITIVITY_1000DPS; in configure()
362 this->sensitivity = SENSOR_GYRO_SENSITIVITY_2000DPS; in configure()
383 if (enable && this->enable == RT_FALSE) in activate()
395 if (!enable && this->enable == RT_TRUE) in activate()
403 if (enable) this->enable = RT_TRUE; in activate()
404 else this->enable = RT_FALSE; in activate()
420 event->sensor = (int32_t) this; in poll()
441 event->gyro.x = x * this->sensitivity * SENSORS_DPS_TO_RADS; in poll()
442 event->gyro.y = y * this->sensitivity * SENSORS_DPS_TO_RADS; in poll()
443 event->gyro.z = z * this->sensitivity * SENSORS_DPS_TO_RADS; in poll()