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

initial BMI270 support - NORMAL config file 8192 bytes #890

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
03989bc
BMI270 - WIP - failing - incl IFRC_IFLIGHT_F745_AIO_V2 for testing
nerdCopter Aug 5, 2022
8b58bfe
bmi270 - add IFLIGHT_F745_AIO_V2
nerdCopter Aug 11, 2022
94b8b2a
bmi270 - fix my obvious mistakes
nerdCopter Aug 11, 2022
05b5df8
bmi270 - align ifrcf745aiov2 target
nerdCopter Aug 11, 2022
f71bc6c
BMI270 should compile on IFLIGHT_F745_AIO_V2 target
Peck07 May 15, 2023
89d5f14
add BMI270 support to BETAFPVF411 target
Peck07 May 15, 2023
37fe3e6
Delete accgyro_spi_bmi270.c.newww
Peck07 May 15, 2023
2f6f115
change to OSD4 by default
Peck07 May 15, 2023
a961980
put back a working getBmiOsrMode function (discussed with nerdCopter)
Peck07 May 15, 2023
ae3d9ae
LPF_EXPERIMENTAL should give back OSR2
Peck07 May 15, 2023
639c8e3
unneeded files cleanup and file move; target path change
nerdCopter May 15, 2023
0d2fc3f
reorganize gyroRateKHz with switch/case; add bmi270 3.2 KHz
nerdCopter May 15, 2023
578c743
bmi270 - more file cleanup
nerdCopter May 15, 2023
e4cd16c
bmi270 - switch/case - samplingTime
nerdCopter May 15, 2023
7190104
bmi270 targets - really not sure about this CS_PIN stuff
nerdCopter May 15, 2023
7db61cf
BMI270 - FOXEERF745_AIO (V2)
nerdCopter May 17, 2023
353be17
BMI270 - NBD_INFINITYAIOV2PRO
nerdCopter May 18, 2023
891bfed
added SkystarsF7 target updates
BeauBrewski May 25, 2023
bebd92b
Merge branch 'master' into 20230601_PR890_bmi270-testing-merge-master
nerdCopter Jun 1, 2023
1a0ffaf
BMI270: switched back to normal mode instead of max_fifo, added back …
Peck07 Jun 4, 2023
067bc19
BMI270 - normal mode drivers per target
nerdCopter Jun 6, 2023
b0ae8d0
Merge branch 'master' into 20230515_rebase_master_Peck07_20220726_BMI…
nerdCopter Jun 6, 2023
e89b314
fix FLYWOOF411_5IN1_AIO align
nerdCopter Jun 6, 2023
b234771
BMI270 - gyro/pid denom default 1
nerdCopter Jun 6, 2023
8016bcc
BMI270 - GYRO_HARDWARE_LPF_EXPERIMENTAL 3
nerdCopter Jun 13, 2023
b24869d
BMI270 - deduplicate spiCalculateDivider in bus_spi.h
nerdCopter Jun 21, 2023
841ecde
BMI270 - remove OWNER_GYRO_EXTI from resource.h to fix breakage
nerdCopter Jun 21, 2023
f2938f6
BMI270 - gyro_hardware_lpf options (USE_GYRO_DLPF_EXPERIMENTAL)
nerdCopter Jun 22, 2023
748035a
BMI270 - replace OWNER_GYRO_EXTI with OWNER_MPU_EXTI
nerdCopter Jun 27, 2023
ad6e0af
BMI270 - extra driver files not needed
nerdCopter Jul 10, 2023
4234039
BMI270 - sync targets with prior commit (remove extra driver files)
nerdCopter Jul 10, 2023
249bf12
Merge remote-tracking branch 'upstream/master' into 20230515_rebase_m…
nerdCopter Jul 11, 2023
de38c49
BMI270 - fix NBD_INFINITYAIOV2PRO dual-gyro defines
nerdCopter Jul 11, 2023
55e9c98
BMI270 - add bmi gyros to accgyro_mpu.h ifdef
nerdCopter Aug 23, 2023
136f035
BMI270 - fix detect
nerdCopter Aug 28, 2023
33b4418
BMI270 - NBD_INFINITYAIOV2PRO - USE_EXTI for USE_GYRO_EXTI
nerdCopter Sep 27, 2023
1d4f0e4
BMI270 - clean a line
nerdCopter Sep 27, 2023
6b436d3
Merge remote-tracking branch 'emuflight/master' into 20230515_rebase_…
nerdCopter Sep 27, 2023
72d0d9f
BMI270 - remove extraneous fifo.c file
nerdCopter Sep 28, 2023
e4fa920
BMI270 - sync targets
nerdCopter Sep 28, 2023
03fdfbe
Merge remote-tracking branch 'emuflight/master' into 20230515_rebase_…
nerdCopter Oct 11, 2023
f870088
Merge remote-tracking branch 'emuflight/master' into 20230515_rebase_…
nerdCopter Oct 27, 2023
4103c04
Merge remote-tracking branch 'emuflight/master' into 20230515_rebase_…
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
914 changes: 914 additions & 0 deletions src/main/drivers/accgyro/accgyro_spi_bmi270.c

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions src/main/drivers/accgyro/accgyro_spi_bmi270.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "drivers/bus.h"

uint8_t bmi270Detect(const busDevice_t *bus);
bool bmi270SpiAccDetect(accDev_t *acc);
bool bmi270SpiGyroDetect(gyroDev_t *gyro);
uint8_t bmi270InterruptStatus(gyroDev_t *gyro);
28 changes: 19 additions & 9 deletions src/main/drivers/accgyro/gyro_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,26 @@ uint32_t gyroSetSampleRate(gyroDev_t *gyro, uint8_t lpf, uint8_t gyroSyncDenomin
}
gyro->mpuDividerDrops = gyroSyncDenominator - 1;
gyro->gyroRateKHz = lpfNoneOr256 ? GYRO_RATE_8_kHz : GYRO_RATE_1_kHz;
//20649 is a weird gyro
if (gyro->mpuDetectionResult.sensor == ICM_20649_SPI) {
gyro->gyroRateKHz = lpfNoneOr256 ? GYRO_RATE_9_kHz : GYRO_RATE_1100_Hz;
} else if (gyro->mpuDetectionResult.sensor == BMI_160_SPI && lpfNoneOr256) {
//brainFPV is also a weird gyro
gyro->gyroRateKHz = GYRO_RATE_3200_Hz;
} else if (gyro_use_32khz) {
//use full 32k
gyro->gyroRateKHz = GYRO_RATE_32_kHz;



switch (gyro->mpuDetectionResult.sensor) {
case ICM_20649_SPI: //20649 is a weird gyro
gyro->gyroRateKHz = lpfNoneOr256 ? GYRO_RATE_9_kHz : GYRO_RATE_1100_Hz;
break;
case BMI_160_SPI: //brainFPV is also a weird gyro
if (lpfNoneOr256) { gyro->gyroRateKHz = GYRO_RATE_3200_Hz; }
break;
case BMI_270_SPI: //bmi270
gyro->gyroRateKHz = GYRO_RATE_3200_Hz;
break;
default:
if (gyro_use_32khz) {
//use full 32k
gyro->gyroRateKHz = GYRO_RATE_32_kHz;
}
}

// return the targetLooptime (expected cycleTime)
return (uint32_t)(gyroSyncDenominator * gyro->gyroRateKHz);
}
1 change: 1 addition & 0 deletions src/main/drivers/bus_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ void spiBusSetInstance(busDevice_t *bus, SPI_TypeDef *instance) {
bus->busdev_u.spi.instance = instance;
}

// icm42688p and bmi270 porting
uint16_t spiCalculateDivider(uint32_t freq)
{
#if defined(STM32F4) || defined(STM32G4) || defined(STM32F7)
Expand Down
1 change: 1 addition & 0 deletions src/main/fc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ void validateAndFixGyroConfig(void) {
samplingTime = 1.0f / 9000.0f;
break;
case BMI_160_SPI:
case BMI_270_SPI:
samplingTime = 0.0003125f;
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/main/flight/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ PG_REGISTER_WITH_RESET_TEMPLATE(pidConfig_t, pidConfig, PG_PID_CONFIG, 2);

#ifdef STM32F10X
#define PID_PROCESS_DENOM_DEFAULT 1
#elif defined(USE_GYRO_SPI_MPU6000) || defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_ICM20689) || defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P)
#elif defined(USE_GYRO_SPI_MPU6000) || defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_ICM20689) || defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P) || defined(USE_ACCGYRO_BMI160) || defined(USE_ACCGYRO_BMI270)
#define PID_PROCESS_DENOM_DEFAULT 1
#else
#define PID_PROCESS_DENOM_DEFAULT 2
Expand Down
8 changes: 4 additions & 4 deletions src/main/interface/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@
const char * const lookupTableAccHardware[] = {
"AUTO", "NONE", "ADXL345", "MPU6050", "MMA8452", "BMA280", "LSM303DLHC",
"MPU6000", "MPU6500", "MPU9250", "ICM20601", "ICM20602", "ICM20608G", "ICM20649", "ICM20689",
"ICM42605", "ICM42688P", "BMI160", "ACC_IMUF9001", "FAKE"
"ICM42605", "ICM42688P", "BMI160", "BMI270", "ACC_IMUF9001", "FAKE"
};
// sync with gyroSensor_e
const char * const lookupTableGyroHardware[] = {
"AUTO", "NONE", "MPU6050", "L3G4200D", "MPU3050", "L3GD20",
"MPU6000", "MPU6500", "MPU9250", "ICM20601", "ICM20602", "ICM20608G", "ICM20649", "ICM20689",
"ICM42605", "ICM42688P", "BMI160", "GYRO_IMUF9001", "FAKE"
"ICM42605", "ICM42688P", "BMI160", "BMI270", "GYRO_IMUF9001", "FAKE"
};

#if defined(USE_SENSOR_NAMES) || defined(USE_BARO)
Expand Down Expand Up @@ -252,10 +252,10 @@ static const char * const lookupTableRxSpi[] = {

static const char * const lookupTableGyroHardwareLpf[] = {
"NORMAL",
#if defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P)
#if defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P) || defined(USE_ACCGYRO_BMI270)
"OPTION1",
"OPTION2",
#if defined(USE_GYRO_SPI_ICM42688P) && defined(USE_GYRO_DLPF_EXPERIMENTAL) // will need bmi270 logic as well
#if ( defined(USE_GYRO_SPI_ICM42688P) || defined(USE_ACCGYRO_BMI270) ) && defined(USE_GYRO_DLPF_EXPERIMENTAL) // icm42688p & bmi270 experimental
"EXPERIMENTAL",
#endif
#else
Expand Down
3 changes: 3 additions & 0 deletions src/main/pg/bus_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ ioTag_t preinitIPUList[SPI_PREINIT_IPU_COUNT] = {
#ifdef BMI160_CS_PIN
IO_TAG(BMI160_CS_PIN),
#endif
#ifdef BMI270_CS_PIN
IO_TAG(BMI270_CS_PIN),
#endif
#ifdef L3GD20_CS_PIN
IO_TAG(L3GD20_CS_PIN),
#endif
Expand Down
13 changes: 13 additions & 0 deletions src/main/sensors/acceleration.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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 @@ -299,6 +300,18 @@ bool accDetect(accDev_t *dev, accelerationSensor_e accHardwareToUse) {
}
FALLTHROUGH;
#endif

#ifdef USE_ACCGYRO_BMI270
case ACC_BMI270:
if (bmi270SpiAccDetect(dev)) {
accHardware = ACC_BMI270;
#ifdef ACC_BMI270_ALIGN
dev->accAlign = ACC_BMI270_ALIGN;
#endif
break;
}
FALLTHROUGH;
#endif
#if defined(USE_ACC_SPI_ICM42605) || defined(USE_ACC_SPI_ICM42688P)
case ACC_ICM42605:
case ACC_ICM42688P:
Expand Down
1 change: 1 addition & 0 deletions src/main/sensors/acceleration.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef enum {
ACC_ICM42605,
ACC_ICM42688P,
ACC_BMI160,
ACC_BMI270,
ACC_IMUF9001,
ACC_FAKE
} accelerationSensor_e;
Expand Down
17 changes: 15 additions & 2 deletions src/main/sensors/gyro.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,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 @@ -211,7 +212,7 @@ static void gyroInitLowpassFilterLpf(gyroSensor_t *gyroSensor, int slot, int typ
#ifdef STM32F10X
#define GYRO_SYNC_DENOM_DEFAULT 8
#elif defined(USE_GYRO_SPI_MPU6000) || defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_ICM20601) || 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_SYNC_DENOM_DEFAULT 1
#else
#define GYRO_SYNC_DENOM_DEFAULT 3
Expand Down Expand Up @@ -537,6 +538,17 @@ STATIC_UNIT_TESTED gyroSensor_e gyroDetect(gyroDev_t *dev) {
}
FALLTHROUGH;
#endif
#ifdef USE_ACCGYRO_BMI270
case GYRO_BMI270:
if (bmi270SpiGyroDetect(dev)) {
gyroHardware = GYRO_BMI270;
#ifdef GYRO_BMI270_ALIGN
dev->gyroAlign = GYRO_BMI270_ALIGN;
#endif
break;
}
FALLTHROUGH;
#endif
#ifdef USE_GYRO_IMUF9001
case GYRO_IMUF9001:
if (imufSpiGyroDetect(dev)) {
Expand Down Expand Up @@ -566,7 +578,7 @@ STATIC_UNIT_TESTED gyroSensor_e gyroDetect(gyroDev_t *dev) {
static bool gyroInitSensor(gyroSensor_t *gyroSensor) {
gyroSensor->gyroDev.gyro_high_fsr = gyroConfig()->gyro_high_fsr;
#if defined(USE_GYRO_MPU6050) || defined(USE_GYRO_MPU3050) || defined(USE_GYRO_MPU6500) || defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_MPU6000) \
|| defined(USE_ACC_MPU6050) || defined(USE_GYRO_SPI_MPU9250) || defined(USE_GYRO_SPI_ICM20601) || defined(USE_GYRO_SPI_ICM20649) || defined(USE_GYRO_SPI_ICM20689) || defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P) || defined(USE_GYRO_IMUF9001) || defined(USE_ACCGYRO_BMI160)
|| defined(USE_ACC_MPU6050) || defined(USE_GYRO_SPI_MPU9250) || defined(USE_GYRO_SPI_ICM20601) || defined(USE_GYRO_SPI_ICM20649) || defined(USE_GYRO_SPI_ICM20689) || defined(USE_GYRO_SPI_ICM42605) || defined(USE_GYRO_SPI_ICM42688P) || defined(USE_GYRO_IMUF9001) || defined(USE_ACCGYRO_BMI160) || defined(USE_ACCGYRO_BMI270)
mpuDetect(&gyroSensor->gyroDev);
mpuResetFn = gyroSensor->gyroDev.mpuConfiguration.resetFn; // must be set after mpuDetect
#endif
Expand Down Expand Up @@ -611,6 +623,7 @@ static bool gyroInitSensor(gyroSensor_t *gyroSensor) {
case GYRO_MPU3050:
case GYRO_L3GD20:
case GYRO_BMI160:
case GYRO_BMI270:
case GYRO_MPU6000:
case GYRO_MPU6500:
case GYRO_MPU9250:
Expand Down
1 change: 1 addition & 0 deletions src/main/sensors/gyro.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ typedef enum {
GYRO_ICM42605,
GYRO_ICM42688P,
GYRO_BMI160,
GYRO_BMI270,
GYRO_IMUF9001,
GYRO_FAKE
} gyroSensor_e;
Expand Down
7 changes: 7 additions & 0 deletions src/main/target/BETAFPVF411/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
#define USE_SPI
#define USE_SPI_DEVICE_1

#define USE_SPI_GYRO
#define USE_ACCGYRO_BMI270
#define BMI270_CS_PIN PA4
#define BMI270_SPI_INSTANCE SPI1
#define ACC_BMI270_ALIGN CW90_DEG
#define GYRO_BMI270_ALIGN CW90_DEG

#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
Expand Down
1 change: 1 addition & 0 deletions src/main/target/BETAFPVF411/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FEATURES = VCP ONBOARDFLASH
TARGET_SRC = \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_spi_bmi270.c \
drivers/barometer/barometer_bmp085.c \
drivers/barometer/barometer_bmp280.c \
drivers/barometer/barometer_ms5611.c \
Expand Down
25 changes: 13 additions & 12 deletions src/main/target/FLYWOOF411_5IN1_AIO/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ F411_TARGETS += $(TARGET)
FEATURES += VCP

TARGET_SRC = \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_spi_icm20689.c \
drivers/accgyro/accgyro_spi_icm426xx.c \
drivers/barometer/barometer_bmp085.c \
drivers/barometer/barometer_bmp280.c \
drivers/barometer/barometer_ms5611.c \
drivers/compass/compass_hmc5883l.c \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_spi_bmi270.c \
drivers/accgyro/accgyro_spi_icm20689.c \
drivers/accgyro/accgyro_spi_icm426xx.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/barometer/barometer_bmp085.c \
drivers/barometer/barometer_bmp280.c \
drivers/barometer/barometer_ms5611.c \
drivers/compass/compass_hmc5883l.c \
drivers/compass/compass_qmc5883l.c \
drivers/max7456.c \
drivers/rx/rx_cc2500.c \
rx/cc2500_common.c \
rx/cc2500_common.c \
rx/cc2500_frsky_shared.c \
rx/cc2500_frsky_d.c \
rx/cc2500_frsky_x.c \
rx/cc2500_redpine.c \
rx/cc2500_frsky_x.c \
rx/cc2500_redpine.c \
rx/cc2500_sfhss.c\
drivers/rx/rx_a7105.c \
drivers/light_ws2811strip.c
drivers/light_ws2811strip.c
Empty file.
15 changes: 15 additions & 0 deletions src/main/target/FOXEERF745_AIO/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
#pragma once

#define TARGET_BOARD_IDENTIFIER "FOXE"

#if defined(FOXEERF745_AIO_V2)
#define USBD_PRODUCT_STRING "FOXEERF745_AIO_V2"
#else
#define USBD_PRODUCT_STRING "FOXEERF745_AIO"
#endif

#define LED0_PIN PC13

Expand Down Expand Up @@ -55,6 +60,16 @@
//#define MAG_HMC5883_ALIGN CW270_DEG_FLIP
//#define MAG_ALIGN CW180_DEG //not sure if this command will work or if should be more specific to mag

#if defined(FOXEERF745_AIO_V2)
//BMI270
#define USE_SPI_GYRO
#define USE_ACCGYRO_BMI270
#define BMI270_CS_PIN PA15
#define BMI270_SPI_INSTANCE SPI3
#define ACC_BMI270_ALIGN CW180_DEG
#define GYRO_BMI270_ALIGN CW180_DEG
#endif

#define USE_BARO
#define USE_BARO_BMP280
#define BARO_I2C_INSTANCE (I2CDEV_1)
Expand Down
5 changes: 3 additions & 2 deletions src/main/target/FOXEERF745_AIO/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ F7X5XG_TARGETS += $(TARGET)
FEATURES += VCP ONBOARDFLASH

TARGET_SRC = \
drivers/accgyro/accgyro_spi_bmi270.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_mpu.c \
drivers/barometer/barometer_bmp280.c \
drivers/compass/compass_hmc5883l.c \
drivers/compass/compass_qmc5883l.c \
drivers/compass/compass_lis3mdl.c \
drivers/compass/compass_lis3mdl.c \
drivers/light_ws2811strip.c \
drivers/max7456.c
Loading
Loading