Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 2 IMU I2C drivers, SPI mode and bus speed option, fixed 1 I2C read bug, etc. #14168

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
72a03b7
add I2C drivers to 2 IMU sensors, add SPI mode and bus frequency opti…
Feb 16, 2020
55e0d4c
merge with upstream master
UAV-Pilot Feb 16, 2020
a95c88e
re-formatted imu code changes for text alignment
UAV-Pilot Feb 16, 2020
07fe515
reformatted code according to astyle requirement
UAV-Pilot Feb 17, 2020
14f8815
handle format identifier %u %lu %llu on different platforms
UAV-Pilot Feb 17, 2020
622b753
handle format identifier %u %lu %llu for 1 file
UAV-Pilot Feb 17, 2020
fdfaf8f
Update src/drivers/distance_sensor/vl53lxx/vl53lxx.cpp
UAV-Pilot Feb 17, 2020
768a519
Update src/drivers/imu/bmi088/BMI088_accel.hpp
UAV-Pilot Feb 17, 2020
63cd80a
get rid of the platform define __PX4_NUTTX; use px4_usleep on all pla…
UAV-Pilot Feb 17, 2020
921b5a3
fixed inconsistent parameter issue with MPU9250_I2C_interface
UAV-Pilot Feb 17, 2020
5961031
roll one %lu back to %llu
UAV-Pilot Feb 17, 2020
34f9281
Merge remote-tracking branch 'upstream/master'
UAV-Pilot Feb 18, 2020
c1a67de
fixed an implicit conversion issue
UAV-Pilot Feb 18, 2020
0c14cc9
Merge branch 'master' of https://github.com/PX4/Firmware
UAV-Pilot Feb 18, 2020
f55d8f9
Merge remote-tracking branch 'upstream/master'
UAV-Pilot Feb 20, 2020
0e73d4b
changed some size_t to int per review comments and changed %lu back t…
UAV-Pilot Feb 20, 2020
8340418
removed one cast
UAV-Pilot Feb 20, 2020
9527be3
Merge remote-tracking branch 'upstream/master'
UAV-Pilot Feb 26, 2020
a5afb96
moved SPI/I2C read/write register APIs to upper classes, plus other m…
UAV-Pilot Feb 26, 2020
4ddcc18
removed some PX4_INFO, etc
UAV-Pilot Feb 26, 2020
291601f
add return type to write_reg for more sensors
UAV-Pilot Feb 26, 2020
2bead77
handle return type of write_reg in more drivers
UAV-Pilot Feb 26, 2020
25d786d
sync to upstream
UAV-Pilot Feb 26, 2020
238f0dd
removed some override
UAV-Pilot Feb 26, 2020
849a853
removed more PX4_INFO and corrected some formats, etc
UAV-Pilot Feb 28, 2020
d7ebc0c
match ioctl API with the one in its super class
UAV-Pilot Feb 28, 2020
247e2a0
added using file_t
UAV-Pilot Feb 29, 2020
bf963ed
Merge branch 'master' into master
dagar Mar 10, 2020
501ae72
To fix fxas21002c SPI issue on NuttX, and to prevent accidentally ena…
UAV-Pilot Mar 28, 2020
6c78716
Merge branch 'master' of https://github.com/UAV-Pilot/Firmware
UAV-Pilot Mar 28, 2020
d8e2575
remove read_reg/write_reg from base classes
UAV-Pilot Mar 31, 2020
a68f6d6
Merge branch 'master' of https://github.com/UAV-Pilot/Firmware
UAV-Pilot Mar 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/drivers/barometer/bmp280/BMP280_I2C.cpp
Expand Up @@ -47,7 +47,7 @@
class BMP280_I2C: public device::I2C, public bmp280::IBMP280
{
public:
BMP280_I2C(uint8_t bus, uint32_t device);
BMP280_I2C(uint8_t bus, uint32_t device, uint32_t bus_freq_hz);
virtual ~BMP280_I2C() override = default;

int init() override { return I2C::init(); }
Expand All @@ -65,14 +65,16 @@ class BMP280_I2C: public device::I2C, public bmp280::IBMP280
bmp280::data_s _data{};
};

bmp280::IBMP280 *bmp280_i2c_interface(uint8_t busnum, uint32_t device)
bmp280::IBMP280 *bmp280_i2c_interface(uint8_t busnum, uint32_t device,
uint8_t bus_mode, uint32_t bus_freq_hz)
{
return new BMP280_I2C(busnum, device);
return new BMP280_I2C(busnum, device, bus_freq_hz);
}

BMP280_I2C::BMP280_I2C(uint8_t bus, uint32_t device) :
I2C("BMP280_I2C", nullptr, bus, device, 100 * 1000)
BMP280_I2C::BMP280_I2C(uint8_t bus, uint32_t device, uint32_t bus_freq_hz) :
I2C("BMP280_I2C", nullptr, bus, device, bus_freq_hz)
{
PX4_DEBUG("BMP280_I2C: bus frequency: %i KHz", bus_freq_hz / 1000);
}

uint8_t
Expand Down
12 changes: 7 additions & 5 deletions src/drivers/barometer/bmp280/BMP280_SPI.cpp
Expand Up @@ -63,7 +63,7 @@ struct spi_calibration_s {
class BMP280_SPI: public device::SPI, public bmp280::IBMP280
{
public:
BMP280_SPI(uint8_t bus, uint32_t device);
BMP280_SPI(uint8_t bus, uint32_t device, uint8_t bus_mode, uint32_t bus_freq_hz);
virtual ~BMP280_SPI() override = default;

int init() override { return SPI::init(); }
Expand All @@ -82,13 +82,15 @@ class BMP280_SPI: public device::SPI, public bmp280::IBMP280
};

bmp280::IBMP280 *
bmp280_spi_interface(uint8_t busnum, uint32_t device)
bmp280_spi_interface(uint8_t busnum, uint32_t device,
uint8_t bus_mode, uint32_t bus_freq_hz)
{
return new BMP280_SPI(busnum, device);
return new BMP280_SPI(busnum, device, bus_mode, bus_freq_hz);
}

BMP280_SPI::BMP280_SPI(uint8_t bus, uint32_t device) :
SPI("BMP280_SPI", nullptr, bus, device, SPIDEV_MODE3, 10 * 1000 * 1000)
BMP280_SPI::BMP280_SPI(uint8_t bus, uint32_t device,
uint8_t bus_mode, uint32_t bus_freq_hz) :
SPI("BMP280_SPI", nullptr, bus, device, (enum spi_mode_e)bus_mode, bus_freq_hz)
{
}

Expand Down
12 changes: 9 additions & 3 deletions src/drivers/barometer/bmp280/bmp280.h
Expand Up @@ -83,6 +83,9 @@
#define BMP280_MT_INIT 6400 /* max measure time of initial p + t in us */
#define BMP280_MT 2300 /* max measure time of p or t in us */

#define BMP280_I2C_SPEED 100 * 1000
#define BMP280_SPI_SPEED 10 * 1000 * 1000

namespace bmp280
{

Expand Down Expand Up @@ -157,6 +160,9 @@ class IBMP280


/* interface factories */
extern bmp280::IBMP280 *bmp280_spi_interface(uint8_t busnum, uint32_t device);
extern bmp280::IBMP280 *bmp280_i2c_interface(uint8_t busnum, uint32_t device);
typedef bmp280::IBMP280 *(*BMP280_constructor)(uint8_t, uint32_t);
extern bmp280::IBMP280 *bmp280_spi_interface(uint8_t busnum, uint32_t device,
uint8_t bus_mode, uint32_t bus_freq_hz);
extern bmp280::IBMP280 *bmp280_i2c_interface(uint8_t busnum, uint32_t device,
uint8_t bus_mode, uint32_t bus_freq_hz);
typedef bmp280::IBMP280 *(*BMP280_constructor)(uint8_t busnum, uint32_t device,
uint8_t bus_mode, uint32_t bus_freq_hz);
46 changes: 39 additions & 7 deletions src/drivers/barometer/bmp280/bmp280_main.cpp
Expand Up @@ -54,20 +54,22 @@ struct bmp280_bus_option {
uint8_t busnum;
uint32_t address;
BMP280 *dev;
uint8_t bus_mode;
uint32_t bus_freq_hz;
} bus_options[] = {
#if defined(PX4_SPI_BUS_EXT) && defined(PX4_SPIDEV_EXT_BARO)
{ BMP280_BUS::SPI_EXTERNAL, &bmp280_spi_interface, PX4_SPI_BUS_EXT, PX4_SPIDEV_EXT_BARO, nullptr },
{ BMP280_BUS::SPI_EXTERNAL, &bmp280_spi_interface, PX4_SPI_BUS_EXT, PX4_SPIDEV_EXT_BARO, nullptr, 3, BMP280_SPI_SPEED },
#endif
#if defined(PX4_SPIDEV_BARO_BUS) && defined(PX4_SPIDEV_BARO)
{ BMP280_BUS::SPI_INTERNAL, &bmp280_spi_interface, PX4_SPIDEV_BARO_BUS, PX4_SPIDEV_BARO, nullptr },
{ BMP280_BUS::SPI_INTERNAL, &bmp280_spi_interface, PX4_SPIDEV_BARO_BUS, PX4_SPIDEV_BARO, nullptr, 3, BMP280_SPI_SPEED },
#elif defined(PX4_SPI_BUS_SENSORS) && defined(PX4_SPIDEV_BARO)
{ BMP280_BUS::SPI_INTERNAL, &bmp280_spi_interface, PX4_SPI_BUS_SENSORS, PX4_SPIDEV_BARO, nullptr },
{ BMP280_BUS::SPI_INTERNAL, &bmp280_spi_interface, PX4_SPI_BUS_SENSORS, PX4_SPIDEV_BARO, nullptr, 3, BMP280_SPI_SPEED },
#endif
#if defined(PX4_I2C_BUS_ONBOARD) && defined(PX4_I2C_OBDEV_BMP280)
{ BMP280_BUS::I2C_INTERNAL, &bmp280_i2c_interface, PX4_I2C_BUS_ONBOARD, PX4_I2C_OBDEV_BMP280, nullptr },
{ BMP280_BUS::I2C_INTERNAL, &bmp280_i2c_interface, PX4_I2C_BUS_ONBOARD, PX4_I2C_OBDEV_BMP280, nullptr, 0, BMP280_I2C_SPEED },
#endif
#if defined(PX4_I2C_BUS_EXPANSION) && defined(PX4_I2C_OBDEV_BMP280)
{ BMP280_BUS::I2C_EXTERNAL, &bmp280_i2c_interface, PX4_I2C_BUS_EXPANSION, PX4_I2C_OBDEV_BMP280, nullptr },
{ BMP280_BUS::I2C_EXTERNAL, &bmp280_i2c_interface, PX4_I2C_BUS_EXPANSION, PX4_I2C_OBDEV_BMP280, nullptr, 0, BMP280_I2C_SPEED },
#endif
};

Expand All @@ -85,9 +87,25 @@ static struct bmp280_bus_option *find_bus(BMP280_BUS busid)
return nullptr;
}

static void updateBusMode(uint8_t dev_mode)
{
for (bmp280_bus_option &bus_option : bus_options) {
//only one option will be used, so simply update all options here
bus_option.bus_mode = dev_mode;
}
}

static void updateBusSpeed(uint32_t freq_hz)
{
for (bmp280_bus_option &bus_option : bus_options) {
//only one option will be used, so simply update all options here
bus_option.bus_freq_hz = freq_hz;
}
}

static bool start_bus(bmp280_bus_option &bus)
{
bmp280::IBMP280 *interface = bus.interface_constructor(bus.busnum, bus.address);
bmp280::IBMP280 *interface = bus.interface_constructor(bus.busnum, bus.address, bus.bus_mode, bus.bus_freq_hz);

if ((interface == nullptr) || (interface->init() != PX4_OK)) {
PX4_WARN("no device on bus %u", (unsigned)bus.busid);
Expand Down Expand Up @@ -173,6 +191,8 @@ static int usage()
PX4_INFO(" -I (i2c internal bus)");
PX4_INFO(" -s (spi internal bus)");
PX4_INFO(" -S (spi external bus)");
PX4_INFO(" -m spi_bus_mode (0-3)");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is setting the spi mode on the command line necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The host system currently cannot support default SPI Mode 3, so a way to use other mode is needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't the host system change the SPI mode?

In the case of the bmp280 it appears to support both SPI mode 0 and 3. We could also simply change the only supported bmp280 spi mode depending on where this requirement is coming from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPI mode 3 currently does not work on the host system. With mode 3, it cannot go pass probe (whoami) phase. But the host system is currently working with spi mode 0. Changing default spi mode of bmp280 to spi mode 0 might break other systems.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which host system is this? Can we set the SPI mode from the board configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct SPI communication between SPI master and slaves highly depends on maximum supported frequency and relative timing of CLK, CS, MISO and MOSI signal, so no matter what kind of host system is in use, it's better to have option to customize bus frequency and SPI mode. I guess the intent to set SPI mode in board configuration is to apply the same SPI mode to all SPI sensors attached to the board, but it cannot deal with the case that some sensors work with only one SPI mode while others only work with a different SPI mode. Setting SPI mode at individual sensor level is more flexible as it allows choosing the best matching mode between master and slave for an individual sensor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the intent to set SPI mode in board configuration is to apply the same SPI mode to all SPI sensors attached to the board, but it cannot deal with the case that some sensors work with only one SPI mode while others only work with a different SPI mode.

Not necessarily, we can also do it per-device. I'm working on some general improvements around that in #14156. I don't have a clear preference.

PX4_INFO(" -k bus_frequency_in_kHz");

return 0;
}
Expand All @@ -187,7 +207,7 @@ extern "C" int bmp280_main(int argc, char *argv[])

BMP280_BUS busid = BMP280_BUS::ALL;

while ((ch = px4_getopt(argc, argv, "XISs:", &myoptind, &myoptarg)) != EOF) {
while ((ch = px4_getopt(argc, argv, "XISsm:k:", &myoptind, &myoptarg)) != EOF) {
switch (ch) {
case 'X':
busid = BMP280_BUS::I2C_EXTERNAL;
Expand All @@ -205,6 +225,18 @@ extern "C" int bmp280_main(int argc, char *argv[])
busid = BMP280_BUS::SPI_INTERNAL;
break;

case 'm': {
uint8_t bus_mode = (uint8_t)atoi(myoptarg);
bmp280::updateBusMode(bus_mode);
break;
}

case 'k': {
uint32_t bus_freq_hz = (uint32_t)atoi(myoptarg) * 1000;
bmp280::updateBusSpeed(bus_freq_hz);
break;
}

default:
return bmp280::usage();
}
Expand Down
9 changes: 4 additions & 5 deletions src/drivers/distance_sensor/mappydot/MappyDot.cpp
Expand Up @@ -177,7 +177,7 @@ class MappyDot : public device::I2C, public ModuleParams, public px4::ScheduledW
/**
* Sends an i2c measure command to check for presence of a sensor.
*/
int probe();
int probe() override;

/**
* Collects the most recent sensor measurement data from the i2c bus.
Expand All @@ -197,7 +197,7 @@ class MappyDot : public device::I2C, public ModuleParams, public px4::ScheduledW
px4::Array<uint8_t, RANGE_FINDER_MAX_SENSORS> _sensor_addresses {};
px4::Array<uint8_t, RANGE_FINDER_MAX_SENSORS> _sensor_rotations {};

size_t _sensor_count{0};
int _sensor_count{0};

orb_advert_t _distance_sensor_topic{nullptr};

Expand Down Expand Up @@ -250,7 +250,7 @@ MappyDot::collect()
perf_begin(_sample_perf);

// Increment the sensor index, (limited to the number of sensors connected).
for (size_t index = 0; index < _sensor_count; index++) {
for (int index = 0; index < _sensor_count; index++) {

// Set address of the current sensor to collect data from.
set_device_address(_sensor_addresses[index]);
Expand Down Expand Up @@ -337,7 +337,7 @@ MappyDot::init()

// Check for connected rangefinders on each i2c port,
// starting from the base address 0x08 and incrementing
for (size_t i = 0; i <= RANGE_FINDER_MAX_SENSORS; i++) {
for (int i = 0; i <= RANGE_FINDER_MAX_SENSORS; i++) {
set_device_address(MAPPYDOT_BASE_ADDR + i);

// Check if a sensor is present.
Expand Down Expand Up @@ -384,7 +384,6 @@ MappyDot::init()
}

PX4_INFO("%i sensors connected", _sensor_count);

return PX4_OK;
}

Expand Down
9 changes: 4 additions & 5 deletions src/drivers/distance_sensor/mb12xx/mb12xx.cpp
Expand Up @@ -150,11 +150,10 @@ class MB12XX : public device::I2C, public ModuleParams, public px4::ScheduledWor
px4::Array<uint8_t, RANGE_FINDER_MAX_SENSORS> _sensor_rotations {};

int _measure_interval{MB12XX_MEASURE_INTERVAL}; // Initialize the measure interval for a single sensor.
int _orb_class_instance{-1};

size_t _sensor_index{0}; // Initialize counter for cycling i2c adresses to zero.
int _sensor_index{0}; // Initialize counter for cycling i2c adresses to zero.

size_t _sensor_count{0};
int _sensor_count{0};

orb_advert_t _distance_sensor_topic{nullptr};

Expand Down Expand Up @@ -350,8 +349,8 @@ MB12XX::print_info()
perf_print_counter(_comms_error);
PX4_INFO("poll interval: %ums", _measure_interval / 1000);

for (size_t i = 0; i < _sensor_count; i++) {
PX4_INFO("sensor: %u, address %u", i, _sensor_addresses[i]);
for (int i = 0; i < _sensor_count; i++) {
PX4_INFO("sensor: %i, address %u", i, _sensor_addresses[i]);
}
}

Expand Down
Expand Up @@ -113,9 +113,6 @@ class AerotennaULanding : public px4::ScheduledWorkItem

int _file_descriptor{-1};

unsigned int _head{0};
unsigned int _tail{0};

uint8_t _buffer[ULANDING_BUFFER_LENGTH] {};

perf_counter_t _comms_errors{perf_alloc(PC_COUNT, MODULE_NAME": com_err")};
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/distance_sensor/vl53lxx/vl53lxx.cpp
Expand Up @@ -101,7 +101,7 @@ class VL53LXX : public device::I2C, public px4::ScheduledWorkItem
*/
void print_info();

virtual ssize_t read(device::file_t *file_pointer, char *buffer, size_t buflen);
ssize_t read(device::file_t *file_pointer, char *buffer, size_t buflen) override;

/**
* Initialise the automatic measurement state machine and start it.
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/imu/adis16477/ADIS16477.cpp
Expand Up @@ -247,13 +247,13 @@ ADIS16477::read_reg16(uint8_t reg)
return cmd[0];
}

void
int
ADIS16477::write_reg(uint8_t reg, uint8_t val)
{
uint8_t cmd[2] {};
cmd[0] = reg | 0x8;
cmd[1] = val;
transfer(cmd, cmd, sizeof(cmd));
return transfer(cmd, cmd, sizeof(cmd));
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/imu/adis16477/ADIS16477.hpp
Expand Up @@ -114,7 +114,7 @@ class ADIS16477 : public device::SPI, public px4::ScheduledWorkItem

uint16_t read_reg16(uint8_t reg);

void write_reg(uint8_t reg, uint8_t value);
int write_reg(uint8_t reg, uint8_t value);
void write_reg16(uint8_t reg, uint16_t value);

// ADIS16477 onboard self test
Expand Down
5 changes: 3 additions & 2 deletions src/drivers/imu/bmi055/BMI055.hpp
Expand Up @@ -69,16 +69,17 @@ class BMI055 : public device::SPI
* @param The register to read.
* @return The value that was read.
*/
uint8_t read_reg(unsigned reg);
uint8_t read_reg(unsigned reg) override;
uint16_t read_reg16(unsigned reg);

/**
* Write a register in the BMI055
*
* @param reg The register to write.
* @param value The new value to write.
* @return OK on success, negative errno otherwise.
*/
void write_reg(unsigned reg, uint8_t value);
int write_reg(unsigned reg, uint8_t value) override;

/* do not allow to copy this class due to pointer data members */
BMI055(const BMI055 &);
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/imu/bmi055/bmi055_main.cpp
Expand Up @@ -322,15 +322,15 @@ BMI055::read_reg16(unsigned reg)
return (uint16_t)(cmd[1] << 8) | cmd[2];
}

void
int
BMI055::write_reg(unsigned reg, uint8_t value)
{
uint8_t cmd[2];

cmd[0] = reg | DIR_WRITE;
cmd[1] = value;

transfer(cmd, nullptr, sizeof(cmd));
return transfer(cmd, nullptr, sizeof(cmd));
}

int
Expand Down
5 changes: 3 additions & 2 deletions src/drivers/imu/bmi088/BMI088.hpp
Expand Up @@ -70,16 +70,17 @@ class BMI088 : public device::SPI
* @param The register to read.
* @return The value that was read.
*/
virtual uint8_t read_reg(unsigned reg); // This needs to be declared as virtual, because the
uint8_t read_reg(unsigned reg) override;
virtual uint16_t read_reg16(unsigned reg);

/**
* Write a register in the BMI088
*
* @param reg The register to write.
* @param value The new value to write.
* @return OK on success, negative errno otherwise.
*/
void write_reg(unsigned reg, uint8_t value);
int write_reg(unsigned reg, uint8_t value) override;

/* do not allow to copy this class due to pointer data members */
BMI088(const BMI088 &);
Expand Down
9 changes: 5 additions & 4 deletions src/drivers/imu/bmi088/BMI088_accel.cpp
Expand Up @@ -52,8 +52,9 @@ const uint8_t BMI088_accel::_checked_registers[BMI088_ACCEL_NUM_CHECKED_REGISTER
BMI088_ACC_PWR_CTRL,
};

BMI088_accel::BMI088_accel(int bus, const char *path_accel, uint32_t device, enum Rotation rotation) :
BMI088("BMI088_ACCEL", path_accel, bus, device, SPIDEV_MODE3, BMI088_BUS_SPEED, rotation),
BMI088_accel::BMI088_accel(int bus, const char *path_accel, uint32_t device, enum Rotation rotation,
enum spi_mode_e spi_mode, uint32_t bus_freq_hz) :
BMI088("BMI088_ACCEL", path_accel, bus, device, spi_mode, bus_freq_hz, rotation), // both Mode 0 & 3 worked for BMI088
ScheduledWorkItem(MODULE_NAME, px4::device_bus_to_wq(get_device_id())),
_px4_accel(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
_sample_perf(perf_alloc(PC_ELAPSED, "bmi088_accel_read")),
Expand Down Expand Up @@ -123,7 +124,7 @@ int BMI088_accel::reset()
* Setting it to 5ms.
*/

up_udelay(5000);
px4_usleep(5000);

// Perform a dummy read here to put the accelerometer part of the BMI088 back into SPI mode after the reset
// The dummy read basically pulls the chip select line low and then high
Expand All @@ -137,7 +138,7 @@ int BMI088_accel::reset()
* Any communication with the sensor during this time should be avoided
* (see section "Power Modes: Acceleromter" in the BMI datasheet) */

up_udelay(5000);
px4_usleep(5000);

// Set the PWR CONF to be active
write_checked_reg(BMI088_ACC_PWR_CONF, BMI088_ACC_PWR_CONF_ACTIVE); // Sets the accelerometer to active mode
Expand Down