Answers checklist.
What is the expected behavior?
Calling set_gyroscope_dlpf_enabled(true, ec) from icm20948 component enables low pass filter
What is the actual behavior?
Doesn't enable low pass filter and sometimes returns an error.
Steps to reproduce.
Call set_gyroscope_dlpf_enabled(true, ec)
Build or installation Logs.
More Information.
From line 531 of icm20948.cpp:
template <espp::icm20948::Interface I>
bool Icm20948<I>::set_gyroscope_dlpf_enabled(bool enable, std::error_code &ec) {
std::lock_guard<std::recursive_mutex> lock(base_mutex_);
// select bank 2
if (!select_bank(Bank::_2, ec)) {
return false;
}
uint8_t bitmask = 0x01; // enable DLPF is bit 0 in GYRO_CONFIG_1
set_bits_in_register_by_mask(static_cast<uint8_t>(RegisterBank2::GYRO_CONFIG_2), bitmask,
enable ? bitmask : 0, ec);
return !ec;
}
Both comment and page 59 of datasheet indicate enable bit is is in GYRO_CONFIG_1 register not config_2
Answers checklist.
What is the expected behavior?
Calling set_gyroscope_dlpf_enabled(true, ec) from icm20948 component enables low pass filter
What is the actual behavior?
Doesn't enable low pass filter and sometimes returns an error.
Steps to reproduce.
Call set_gyroscope_dlpf_enabled(true, ec)
Build or installation Logs.
More Information.
From line 531 of icm20948.cpp:
Both comment and page 59 of datasheet indicate enable bit is is in GYRO_CONFIG_1 register not config_2