25 if (!this->
read_byte(MPU6050_REGISTER_WHO_AM_I, &who_am_i) ||
26 (who_am_i != 0x68 && who_am_i != 0x70 && who_am_i != 0x98)) {
31 ESP_LOGV(TAG,
" Setting up Power Management");
33 uint8_t power_management;
34 if (!this->
read_byte(MPU6050_REGISTER_POWER_MANAGEMENT_1, &power_management)) {
38 ESP_LOGV(TAG,
" Input power_management: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(power_management));
40 power_management &= 0b11111000;
46 ESP_LOGV(TAG,
" Output power_management: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(power_management));
47 if (!this->
write_byte(MPU6050_REGISTER_POWER_MANAGEMENT_1, power_management)) {
52 ESP_LOGV(TAG,
" Setting up Gyro Config");
55 if (!this->
read_byte(MPU6050_REGISTER_GYRO_CONFIG, &gyro_config)) {
59 ESP_LOGV(TAG,
" Input gyro_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(gyro_config));
60 gyro_config &= 0b11100111;
62 ESP_LOGV(TAG,
" Output gyro_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(gyro_config));
63 if (!this->
write_byte(MPU6050_REGISTER_GYRO_CONFIG, gyro_config)) {
68 ESP_LOGV(TAG,
" Setting up Accel Config");
71 if (!this->
read_byte(MPU6050_REGISTER_ACCEL_CONFIG, &accel_config)) {
75 ESP_LOGV(TAG,
" Input accel_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(accel_config));
76 accel_config &= 0b11100111;
78 ESP_LOGV(TAG,
" Output accel_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(accel_config));
79 if (!this->
write_byte(MPU6050_REGISTER_ACCEL_CONFIG, accel_config)) {