Synopsis
CTL_STATUS_t imu3000_combo_initialize_i2c(IMU3000_COMBO_t *self,
                                          CTL_I2C_BUS_t *bus,
                                          int addr);
Description

imu3000_combo_initialize_i2c initializes the ADXL345 accelerometer and IMU-3000 gyroscope, the I2C bus bus using appropriate I2C addresses. The address addr is the address of the IMU-3000; the ADXL345's address is fixed by hardware. When complete, the the IMU member core is initialized pointing to the appropriate members within self.

imu3000_combo_initialize_i2c takes care of correcting the alignment of the accelerometer axes with respect to the gyroscope.

Note

Once initialized, you can set the accelerometer's range and bandwidth, but you must do this before taking any accelerometer measurements. Once an accelerometer measurement is taken, you cannot change the bandwidth or range of the accelerometer because the accelerometer is under control of the IMU-3000. We have not found a clean way to shut down autonomous reading by the IMU-3000 such that the auxiliary I2C bus can be placed in bypass mode and the accelerometer reconfigured.

Return Value

imu3000_combo_initialize_i2c returns a standard status code.

Thread Safety

imu3000_combo_initialize_i2c is thread-safe if a mutex is associated with the I2C bus bus.