24 if (!this->
read_byte(MPU6050_REGISTER_WHO_AM_I, &who_am_i) ||
25 (who_am_i != 0x68 && who_am_i != 0x70 && who_am_i != 0x98)) {
30 ESP_LOGV(TAG,
" Setting up Power Management");
32 uint8_t power_management;
33 if (!this->
read_byte(MPU6050_REGISTER_POWER_MANAGEMENT_1, &power_management)) {
37 ESP_LOGV(TAG,
" Input power_management: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(power_management));
39 power_management &= 0b11111000;
45 ESP_LOGV(TAG,
" Output power_management: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(power_management));
46 if (!this->
write_byte(MPU6050_REGISTER_POWER_MANAGEMENT_1, power_management)) {
51 ESP_LOGV(TAG,
" Setting up Gyro Config");
54 if (!this->
read_byte(MPU6050_REGISTER_GYRO_CONFIG, &gyro_config)) {
58 ESP_LOGV(TAG,
" Input gyro_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(gyro_config));
59 gyro_config &= 0b11100111;
61 ESP_LOGV(TAG,
" Output gyro_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(gyro_config));
62 if (!this->
write_byte(MPU6050_REGISTER_GYRO_CONFIG, gyro_config)) {
67 ESP_LOGV(TAG,
" Setting up Accel Config");
70 if (!this->
read_byte(MPU6050_REGISTER_ACCEL_CONFIG, &accel_config)) {
74 ESP_LOGV(TAG,
" Input accel_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(accel_config));
75 accel_config &= 0b11100111;
77 ESP_LOGV(TAG,
" Output accel_config: 0b" BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(accel_config));
78 if (!this->
write_byte(MPU6050_REGISTER_ACCEL_CONFIG, accel_config)) {