Skip to content

Commit

Permalink
[target] BETAFPVF405 dual gyro, add BMI270, ICM42688P, motor_poles 12 (
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdCopter authored Apr 16, 2024
1 parent 2d53acc commit 89c5629
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 6 deletions.
34 changes: 34 additions & 0 deletions src/main/target/BETAFPVF405/config.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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/>.
*/

#include <stdbool.h>
#include <stdint.h>
#include <string.h>

#include "platform.h"

#ifdef USE_TARGET_CONFIG

#include "flight/mixer.h"

void targetConfiguration(void) {
motorConfigMutable()->motorPoleCount = 12;
}
#endif
24 changes: 18 additions & 6 deletions src/main/target/BETAFPVF405/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@

#pragma once

#define TARGET_BOARD_IDENTIFIER "BEFH"
#define USBD_PRODUCT_STRING "BetaFPV f405"
#define BOARD_NAME BETAFPVF405
#define MANUFACTURER_ID BEFH
#define TARGET_BOARD_IDENTIFIER "S405" // generic ID
#define FC_TARGET_MCU STM32F405 // not used in EmuF

#define USE_BEEPER
#define BEEPER_PIN PB4
Expand Down Expand Up @@ -98,18 +100,28 @@
#define USE_GYRO
#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define GYRO_MPU6000_ALIGN CW270_DEG
#define USE_GYRO_SPI_MPU6000
#define ACC_MPU6000_ALIGN CW270_DEG
#define USE_GYRO_SPI_ICM42688P
#define USE_ACC_SPI_ICM42688P
#define USE_ACCGYRO_BMI270

// MPU6000 interrupts
#define USE_EXTI
#define MPU_INT_EXTI PC4
#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW

#define MPU6000_CS_PIN PA4
#define MPU6000_SPI_INSTANCE SPI1
#define ACC_1_ALIGN CW270_DEG
#define GYRO_1_ALIGN CW270_DEG
#define GYRO_1_CS_PIN PA4
#define GYRO_1_EXTI_PIN PC4
#define GYRO_1_SPI_INSTANCE SPI1

#define USE_DUAL_GYRO

#define ACC_2_ALIGN CW0_DEG
#define GYRO_2_ALIGN CW0_DEG
#define GYRO_2_SPI_INSTANCE SPI1

#define USE_BARO
#define USE_BARO_BMP280
Expand Down
2 changes: 2 additions & 0 deletions src/main/target/BETAFPVF405/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FEATURES += VCP SDCARD ONBOARDFLASH
TARGET_SRC = \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_spi_icm426xx.c \
drivers/accgyro/accgyro_spi_bmi270.c \
drivers/barometer/barometer_bmp280.c \
drivers/barometer/barometer_ms5611.c \
drivers/compass/compass_hmc5883l.c \
Expand Down

0 comments on commit 89c5629

Please sign in to comment.