Skip to content

Commit

Permalink
[target] FLYWOOF405 update dual-gyro, add ICM42688P; fix timers, add …
Browse files Browse the repository at this point in the history
…pinio (#1012)
  • Loading branch information
nerdCopter authored Apr 17, 2024
1 parent 1d7430e commit d0396f7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
5 changes: 2 additions & 3 deletions src/main/target/FLYWOOF405/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@
#include "drivers/timer_def.h"

const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {

DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0), // MOTOR 1
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // MOTOR 2
DEF_TIM(TIM2, CH4, PA3, TIM_USE_MOTOR, 0, 1), // MOTOR 1
DEF_TIM(TIM2, CH3, PA2, TIM_USE_MOTOR, 0, 0), // MOTOR 3


DEF_TIM(TIM3, CH2, PB5, TIM_USE_MOTOR, 0, 0), // MOTOR 5
DEF_TIM(TIM4, CH2, PB7, TIM_USE_MOTOR, 0, 0), // MOTOR 6
DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // MOTOR 7
DEF_TIM(TIM3, CH1, PB4, TIM_USE_MOTOR, 0, 0), // MOTOR 8

DEF_TIM(TIM8, CH3, PC8, TIM_USE_ANY, 0, 0),

DEF_TIM(TIM1, CH2, PA9, TIM_USE_ANY, 0, 0), // CAMERA CONTROL

};
38 changes: 28 additions & 10 deletions src/main/target/FLYWOOF405/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@

#pragma once

#define TARGET_BOARD_IDENTIFIER "S405"
#define USBD_PRODUCT_STRING "FLYWOOF405 - MPU6000"
#define BOARD_NAME FLYWOOF405
#define MANUFACTURER_ID FLWO
#define TARGET_BOARD_IDENTIFIER "S405" // generic ID
#define FC_TARGET_MCU STM32F405 // not used in EmuF

//----------------------------------------
#define USE_TARGET_CONFIG
Expand All @@ -36,8 +38,11 @@
#define CAMERA_CONTROL_PIN PA9

#define USE_PINIO
#define PINIO1_PIN PB12
#define USE_PINIOBOX
#define PINIO1_PIN PB12
#define PINIO2_PIN PB13
#define PINIO1_BOX 40
#define PINIO2_BOX 41

//SPI DEVICE-------------------------------
#define USE_SPI
Expand All @@ -54,20 +59,32 @@
#define SPI3_MOSI_PIN PC12
//Gyro & ACC-------------------------------

#define USE_SPI_GYRO
#define USE_EXTI
#define MPU_INT_EXTI PC5
#define USE_GYRO_EXTI
#define USE_MPU_DATA_READY_SIGNAL

//MPU-6000
#define USE_GYRO
#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define USE_GYRO_SPI_MPU6000
#define USE_GYRO_SPI_ICM20689
#define USE_ACC_SPI_ICM20689
#define USE_GYRO_SPI_ICM42688P
#define USE_ACC_SPI_ICM42688P

#define MPU6000_CS_PIN PC4
#define MPU6000_SPI_INSTANCE SPI1
#define GYRO_MPU6000_ALIGN CW270_DEG
#define ACC_MPU6000_ALIGN CW270_DEG
#define ACC_1_ALIGN CW270_DEG
#define GYRO_1_ALIGN CW270_DEG
#define GYRO_1_CS_PIN PC4
#define GYRO_1_EXTI_PIN PC5
#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

//Baro & MAG-------------------------------
#define USE_I2C
Expand Down Expand Up @@ -155,6 +172,7 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))

#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_AIRMODE | FEATURE_RX_SERIAL)

#define USABLE_TIMER_CHANNEL_COUNT 9
#define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(8)|TIM_N(12))
#define USABLE_TIMER_CHANNEL_COUNT 10
#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) )
6 changes: 4 additions & 2 deletions src/main/target/FLYWOOF405/target.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
F405_TARGETS += $(TARGET)
FEATURES += VCP ONBOARDFLASH
TARGET_SRC = \
drivers/accgyro/accgyro_spi_icm20689.c \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_mpu.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/pinio.c \
drivers/max7456.c

0 comments on commit d0396f7

Please sign in to comment.