From 4af2e0ec7ec6f128ac25d03fa8ab26c9d73ea35c Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Fri, 3 May 2024 09:25:17 -0500 Subject: [PATCH] [targets] BEEBRAIN_PRO_DSM_US/INTL add BMI160 --- src/main/target/BEEBRAIN_PRO/target.h | 23 ++++++++++++++++++- src/main/target/BEEBRAIN_PRO/target.mk | 31 +++++++++++++------------- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/main/target/BEEBRAIN_PRO/target.h b/src/main/target/BEEBRAIN_PRO/target.h index 042f4ba008..6fbbb6c8b1 100644 --- a/src/main/target/BEEBRAIN_PRO/target.h +++ b/src/main/target/BEEBRAIN_PRO/target.h @@ -20,8 +20,20 @@ #pragma once -#define TARGET_BOARD_IDENTIFIER "BBPRO" // BeeBrain Pro +#define MANUFACTURER_ID NEBD #define USBD_PRODUCT_STRING "BeeBrain PRO" +#define TARGET_BOARD_IDENTIFIER "S411" // generic ID +#define FC_TARGET_MCU STM32F411 // not used in EmuF + +#if defined(BEEBRAIN_PRO_DSM_US) +#define BOARD_NAME BEEBRAIN_PRO_DSM_US +#elif defined(BEEBRAIN_PRO_DSM_INTL) +#define BOARD_NAME BEEBRAIN_PRO_DSM_INTL +#elif defined(BEEBRAIN_PRO_FRSKY_US) +#define BOARD_NAME BEEBRAIN_PRO_FRSKY_US +#else +#define BOARD_NAME BEEBRAINPRO +#endif #define USE_TARGET_CONFIG #define TARGET_PREINIT @@ -73,6 +85,15 @@ #define GYRO_MPU6000_ALIGN CW90_DEG #define ACC_MPU6000_ALIGN CW90_DEG +#if (defined(BEEBRAIN_PRO_DSM_US) || defined(BEEBRAIN_PRO_DSM_INTL)) +#define USE_ACCGYRO_BMI160 +#define BMI160_SPI_DIVISOR 16 +#define BMI160_INT_EXTI PB0 +#define BMI160_CS_PIN PA4 +#define BMI160_SPI_INSTANCE SPI3 +#define GYRO_BMI160_ALIGN CW0_DEG +#endif + // *************** RX ****************************** #if (defined(BEEBRAIN_PRO_DSM_US) || defined(BEEBRAIN_PRO_DSM_INTL)) #define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048 diff --git a/src/main/target/BEEBRAIN_PRO/target.mk b/src/main/target/BEEBRAIN_PRO/target.mk index 976d6c30ee..394583f69f 100644 --- a/src/main/target/BEEBRAIN_PRO/target.mk +++ b/src/main/target/BEEBRAIN_PRO/target.mk @@ -2,40 +2,41 @@ F411_TARGETS += $(TARGET) FEATURES = VCP ONBOARDFLASH TARGET_SRC = \ - drivers/accgyro/accgyro_spi_mpu6500.c \ - drivers/accgyro/accgyro_mpu6500.c \ + drivers/accgyro/accgyro_spi_mpu6500.c \ + drivers/accgyro/accgyro_mpu6500.c \ drivers/accgyro/accgyro_spi_mpu6000.c \ + drivers/accgyro/accgyro_spi_bmi160.c \ drivers/barometer/barometer_bmp280.c \ drivers/nbd7456.c \ - drivers/vtx_rtc6705_soft_spi.c \ + drivers/vtx_rtc6705_soft_spi.c \ drivers/flash_m25p16.c ifeq ($(TARGET), BEEBRAIN_PRO_FRSKY_INTL) TARGET_SRC += drivers/rx/rx_cc2500.c \ rx/cc2500_frsky_shared.c \ - rx/cc2500_common.c \ + rx/cc2500_common.c \ rx/cc2500_frsky_d.c \ - rx/cc2500_frsky_x.c \ - rx/cc2500_redpine.c \ - rx/cc2500_sfhss.c + rx/cc2500_frsky_x.c \ + rx/cc2500_redpine.c \ + rx/cc2500_sfhss.c endif ifeq ($(TARGET), BEEBRAIN_PRO_FRSKY_US) TARGET_SRC += drivers/rx/rx_cc2500.c \ rx/cc2500_frsky_shared.c \ - rx/cc2500_common.c \ + rx/cc2500_common.c \ rx/cc2500_frsky_d.c \ - rx/cc2500_frsky_x.c \ - rx/cc2500_redpine.c \ - rx/cc2500_sfhss.c + rx/cc2500_frsky_x.c \ + rx/cc2500_redpine.c \ + rx/cc2500_sfhss.c endif ifeq ($(TARGET), BEEBRAIN_PRO) TARGET_SRC += drivers/rx/rx_cc2500.c \ rx/cc2500_frsky_shared.c \ - rx/cc2500_common.c \ + rx/cc2500_common.c \ rx/cc2500_frsky_d.c \ - rx/cc2500_frsky_x.c \ - rx/cc2500_redpine.c \ - rx/cc2500_sfhss.c + rx/cc2500_frsky_x.c \ + rx/cc2500_redpine.c \ + rx/cc2500_sfhss.c endif