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

BMI270 Support - FIFO config file 328 bytes #930

Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d9d8b1c
BMI270 - WIP - failing - incl IFRC_IFLIGHT_F745_AIO_V2 for testing
nerdCopter Jun 20, 2023
c9167b8
bmi270 - add IFLIGHT_F745_AIO_V2
nerdCopter Aug 11, 2022
19489bc
bmi270 - fix my obvious mistakes
nerdCopter Aug 11, 2022
c750038
bmi270 - align ifrcf745aiov2 target
nerdCopter Aug 11, 2022
4c3276c
BMI270 should compile on IFLIGHT_F745_AIO_V2 target
Peck07 May 15, 2023
f3e3165
add BMI270 support to BETAFPVF411 target
Peck07 May 15, 2023
973509c
Delete accgyro_spi_bmi270.c.newww
Peck07 May 15, 2023
16a057f
change to OSD4 by default
Peck07 May 15, 2023
3ebab76
put back a working getBmiOsrMode function (discussed with nerdCopter)
Peck07 May 15, 2023
7b238f1
LPF_EXPERIMENTAL should give back OSR2
Peck07 May 15, 2023
41bd0d2
unneeded files cleanup and file move; target path change
nerdCopter May 15, 2023
3cdc841
reorganize gyroRateKHz with switch/case; add bmi270 3.2 KHz
nerdCopter May 15, 2023
26b4b03
bmi270 - more file cleanup
nerdCopter May 15, 2023
b389500
bmi270 - switch/case - samplingTime
nerdCopter May 15, 2023
4a34f0d
bmi270 targets - really not sure about this CS_PIN stuff
nerdCopter May 15, 2023
ffbef9c
BMI270 - FOXEERF745_AIO (V2)
nerdCopter May 17, 2023
44e6c32
BMI270 - NBD_INFINITYAIOV2PRO
nerdCopter May 18, 2023
1600ac9
added SkystarsF7 target updates
BeauBrewski May 25, 2023
2740f8c
fix FLYWOOF411_5IN1_AIO align
nerdCopter Jun 20, 2023
0fd54a0
BMI270 - gyro/pid denom default 1
nerdCopter Jun 6, 2023
97f660e
BMI270 - GYRO_HARDWARE_LPF_EXPERIMENTAL 3
nerdCopter Jun 13, 2023
6ea948f
BMI270 - deduplicate spiCalculateDivider in bus_spi.h
nerdCopter Jun 21, 2023
f28be02
BMI270 - remove OWNER_GYRO_EXTI from resource.h to fix breakage
nerdCopter Jun 21, 2023
11b769b
BMI270 - gyro_hardware_lpf options (USE_GYRO_DLPF_EXPERIMENTAL)
nerdCopter Jun 22, 2023
4db3460
BMI270 - replace OWNER_GYRO_EXTI with OWNER_MPU_EXTI
nerdCopter Jun 27, 2023
f4ccac9
BMI270 - fix NBD_INFINITYAIOV2PRO dual-gyro defines
nerdCopter Jul 11, 2023
c29b87f
Merge remote-tracking branch 'origin/master' into 20230620_rebase_PR8…
nerdCopter Jul 13, 2023
98e549f
fix IFLIGHT_F745_AIO_V2 .mk
nerdCopter Jul 19, 2023
945016f
BMI270 - add bmi gyros to accgyro_mpu.h ifdef
nerdCopter Aug 23, 2023
206f7cd
BMI270 - fix detect
nerdCopter Aug 28, 2023
95d5bcb
BMI270 - ensure over
nerdCopter Sep 27, 2023
21b0b52
BMI270 - move bmi270_maximum_fifo_config_file constant
nerdCopter Sep 27, 2023
0d9ca6c
Merge remote-tracking branch 'emuflight/master' into 20230620_rebase_…
nerdCopter Sep 27, 2023
aaf935d
BMI270 - remove extraneous fifo.c file inclusions
nerdCopter Sep 27, 2023
aa3daa8
BMI270 - comment spiCalculateDivider
nerdCopter Sep 28, 2023
dc51cc9
BMI270 - sync targets
nerdCopter Sep 28, 2023
726e2a5
Merge remote-tracking branch 'emuflight/master' into 20230620_rebase_…
nerdCopter Oct 11, 2023
7c83158
Merge remote-tracking branch 'emuflight/master' into 20230620_rebase_…
nerdCopter Oct 25, 2023
f6f4fa4
Merge remote-tracking branch 'emuflight/master' into 20230620_rebase_…
nerdCopter Oct 27, 2023
78d1ce6
Merge remote-tracking branch 'emuflight/master' into 20230620_rebase_…
nerdCopter Oct 31, 2023
b5ac87a
BMI270 - remove targets and targets modification from this PR
nerdCopter Oct 31, 2023
dd6f3c3
BMI270 - emptyline cleanup
nerdCopter Oct 31, 2023
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
1 change: 1 addition & 0 deletions make/source.mk
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ SPEED_OPTIMISED_SRC := $(SPEED_OPTIMISED_SRC) \
drivers/accgyro/accgyro_mpu6050.c \
drivers/accgyro/accgyro_mpu6500.c \
drivers/accgyro/accgyro_spi_bmi160.c \
drivers/accgyro/accgyro_spi_bmi270.c \
drivers/accgyro/accgyro_spi_icm20689.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_spi_mpu6500.c \
Expand Down
5 changes: 4 additions & 1 deletion src/main/drivers/accgyro/accgyro.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@
#include <pthread.h>
#endif

#define GYRO_SCALE_2000DPS (2000.0f / (1 << 15)) // 16.384 dps/lsb scalefactor for 2000dps sensors
#define GYRO_SCALE_4000DPS (4000.0f / (1 << 15)) // 8.192 dps/lsb scalefactor for 4000dps sensor

#ifndef MPU_I2C_INSTANCE
#define MPU_I2C_INSTANCE I2C_DEVICE
#endif

#define GYRO_HARDWARE_LPF_NORMAL 0
#define GYRO_HARDWARE_LPF_1KHZ_SAMPLE 2

#if defined(USE_GYRO_SPI_ICM42688P)
#if defined(USE_GYRO_SPI_ICM42688P) || defined(USE_ACCGYRO_BMI270)
#define GYRO_HARDWARE_LPF_EXPERIMENTAL 3
#else
#define GYRO_HARDWARE_LPF_EXPERIMENTAL 1
Expand Down
14 changes: 14 additions & 0 deletions src/main/drivers/accgyro/accgyro_mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "drivers/accgyro/accgyro_mpu6050.h"
#include "drivers/accgyro/accgyro_mpu6500.h"
#include "drivers/accgyro/accgyro_spi_bmi160.h"
#include "drivers/accgyro/accgyro_spi_bmi270.h"
#include "drivers/accgyro/accgyro_spi_icm20649.h"
#include "drivers/accgyro/accgyro_spi_icm20689.h"
#include "drivers/accgyro/accgyro_spi_icm426xx.h"
Expand Down Expand Up @@ -404,6 +405,19 @@ static bool detectSPISensorsAndUpdateDetectionResult(gyroDev_t *gyro) {
gyro->mpuDetectionResult.sensor = sensor;
return true;
}
#endif
#ifdef USE_ACCGYRO_BMI270
#ifndef USE_DUAL_GYRO
spiBusSetInstance(&gyro->bus, BMI270_SPI_INSTANCE);
#endif
#ifdef BMI270_CS_PIN
gyro->bus.busdev_u.spi.csnPin = gyro->bus.busdev_u.spi.csnPin == IO_NONE ? IOGetByTag(IO_TAG(BMI270_CS_PIN)) : gyro->bus.busdev_u.spi.csnPin;
#endif
sensor = bmi270Detect(&gyro->bus);
if (sensor != MPU_NONE) {
gyro->mpuDetectionResult.sensor = sensor;
return true;
}
#endif
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/drivers/accgyro/accgyro_mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//#define DEBUG_MPU_DATA_READY_INTERRUPT

#if defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_MPU6000) || defined(USE_GYRO_SPI_MPU9250) || defined(USE_GYRO_SPI_ICM20649) \
|| defined(USE_GYRO_SPI_ICM20689) || defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P)
|| defined(USE_GYRO_SPI_ICM20689) || defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P) || defined(USE_ACCGYRO_BMI160) || defined(USE_ACCGYRO_BMI270)
#define GYRO_USES_SPI
#endif

Expand Down Expand Up @@ -219,6 +219,7 @@ typedef enum {
ICM_42605_SPI,
ICM_42688P_SPI,
BMI_160_SPI,
BMI_270_SPI,
IMUF_9001_SPI,
} mpuSensor_e;

Expand Down
Loading
Loading