Skip to content

Commit

Permalink
allow disable the data ready interrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
corruptbear committed Jun 8, 2024
1 parent 0a70507 commit 8a542e3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion software/firmware/src/peripherals/src/imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,21 @@ static void enable_data_ready_interrupts(void)
i2c_write8(BNO055_PAGE_ID_ADDR, 1);
uint8_t int_msk = i2c_read8(INT_MSK)|(ACC_BSX_DRDY | MAG_DRDY | GYR_DRDY);
uint8_t int_en = i2c_read8(INT_EN)|(ACC_BSX_DRDY | MAG_DRDY | GYR_DRDY);
i2c_write8(INT_MSK, int_msk);
i2c_write8(INT_MSK, int_msk);
i2c_write8(INT_EN, int_en);
i2c_write8(BNO055_PAGE_ID_ADDR, 0);
}

static void disable_data_ready_interrupts(void)
{
i2c_write8(BNO055_PAGE_ID_ADDR, 1);
uint8_t int_msk = i2c_read8(INT_MSK) && ~(ACC_BSX_DRDY | MAG_DRDY | GYR_DRDY);
uint8_t int_en = i2c_read8(INT_EN) && ~(ACC_BSX_DRDY | MAG_DRDY | GYR_DRDY);
i2c_write8(INT_MSK, int_msk);
i2c_write8(INT_EN, int_en);
i2c_write8(BNO055_PAGE_ID_ADDR, 0);
}

// Math helper functions -----------------------------------------------------------------------------------------------
void quaternion_to_euler(bno055_quaternion_t quaternion, bno055_euler_t *euler)
{
Expand Down

0 comments on commit 8a542e3

Please sign in to comment.