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

BMI220 firmware support #357

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum class ImuID {
LSM6DSV,
LSM6DSO,
LSM6DSR,
BMI220,
Empty = 255
};

Expand All @@ -62,6 +63,7 @@ enum class ImuID {
#define IMU_LSM6DSO SoftFusionLSM6DSO
#define IMU_LSM6DSR SoftFusionLSM6DSR
#define IMU_MPU6050_SF SoftFusionMPU6050
#define IMU_BMI220 SoftFusionBMI220

#define IMU_DEV_RESERVED 250 // Reserved, should not be used in any release firmware

Expand Down
2 changes: 2 additions & 0 deletions src/sensors/SensorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "softfusion/drivers/lsm6dso.h"
#include "softfusion/drivers/lsm6dsr.h"
#include "softfusion/drivers/mpu6050.h"
#include "softfusion/drivers/bmi220.h"

#include "softfusion/i2cimpl.h"

Expand All @@ -56,6 +57,7 @@ namespace SlimeVR
using SoftFusionLSM6DSO = SoftFusionSensor<SoftFusion::Drivers::LSM6DSO, SoftFusion::I2CImpl>;
using SoftFusionLSM6DSR = SoftFusionSensor<SoftFusion::Drivers::LSM6DSR, SoftFusion::I2CImpl>;
using SoftFusionMPU6050 = SoftFusionSensor<SoftFusion::Drivers::MPU6050, SoftFusion::I2CImpl>;
using SoftFusionBMI220 = SoftFusionSensor<SoftFusion::Drivers::BMI220, SoftFusion::I2CImpl>;

// TODO Make it more generic in the future and move another place (abstract sensor interface)
void SensorManager::swapI2C(uint8_t sclPin, uint8_t sdaPin)
Expand Down
2 changes: 2 additions & 0 deletions src/sensors/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ const char * getIMUNameByType(ImuID imuType) {
return "LSM6DSO";
case ImuID::LSM6DSR:
return "LSM6DSR";
case ImuID::BMI220:
return "BMI220";
case ImuID::Unknown:
case ImuID::Empty:
return "UNKNOWN";
Expand Down
Loading