Skip to content

Commit

Permalink
[target] TMOTORF7 update; add ICM42688P and BMI270
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdCopter committed Nov 1, 2023
1 parent 218da79 commit 291c5d0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 21 deletions.
21 changes: 11 additions & 10 deletions src/main/target/TMTR_TMOTORF7/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@
#include "drivers/timer_def.h"

const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
DEF_TIM(TIM3, CH1, PC6, TIM_USE_MOTOR, 0, 0), // motor 1
DEF_TIM(TIM3, CH2, PC7, TIM_USE_MOTOR, 0, 0), // motor 2
DEF_TIM(TIM8, CH2N, PB0, TIM_USE_MOTOR, 0, 0), // motor 3
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // motor 4
DEF_TIM(TIM4, CH1, PB6, TIM_USE_MOTOR, 0, 0), // motor 5
DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0), // motor 6
// DEF_TIM(TIM4, CH2, PB7, TIM_USE_MOTOR, 0, 0), // motor 7
// DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // motor 8

DEF_TIM(TIM8, CH1, PC6, TIM_USE_MOTOR, 0, 0),
DEF_TIM(TIM8, CH2, PC7, TIM_USE_MOTOR, 0, 0),
DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR, 0, 0),
DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0),
DEF_TIM(TIM4, CH1, PB6, TIM_USE_MOTOR, 0, 0),
DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0),

DEF_TIM(TIM2, CH1, PA15, TIM_USE_PPM, 0, 0),
DEF_TIM(TIM11, CH1, PB9, TIM_USE_ANY, 0, 0),
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 0)
DEF_TIM(TIM2, CH1, PA15, TIM_USE_PPM, 0, 0), // ppm
DEF_TIM(TIM11, CH1, PB9, TIM_USE_ANY, 0, 0), // cam ctrl
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 0), // led
};
47 changes: 37 additions & 10 deletions src/main/target/TMTR_TMOTORF7/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

#pragma once

#define TARGET_BOARD_IDENTIFIER "TMR7"
#define USBD_PRODUCT_STRING "TMOTORF7"
#define TARGET_MANUFACTURER_IDENTIFIER "TMTR"
#define USBD_PRODUCT_STRING "TMOTORF7"

#define FC_TARGET_MCU STM32F7X2 // not used in EmuF
#define TARGET_BOARD_IDENTIFIER "S7X2" // generic ID

#define LED0_PIN PB2

Expand All @@ -35,7 +37,7 @@
#define USE_PINIO
#define PINIO1_PIN PC14
#define USE_PINIOBOX

#define PINIO1_BOX 40

#define ENABLE_DSHOT_DMAR true

Expand All @@ -44,21 +46,44 @@
#define USE_MPU_DATA_READY_SIGNAL

#define USE_GYRO
#define USE_ACC

#define USE_GYRO_SPI_MPU6000
#define USE_ACC_SPI_MPU6000
#define USE_ACCGYRO_BMI270
#define USE_GYRO_SPI_ICM42688P
#define USE_ACC_SPI_ICM42688P
#define USE_GYRO_SPI_MPU6500
#define USE_ACC_SPI_MPU6500

#define MPU6000_CS_PIN PA4
#define MPU6000_SPI_INSTANCE SPI1
#define ACC_MPU6000_ALIGN CW0_DEG
#define GYRO_MPU6000_ALIGN CW0_DEG
#define ACC_MPU6000_ALIGN CW0_DEG
#define GYRO_MPU6000_ALIGN CW0_DEG

#define USE_ACC
#define USE_ACC_SPI_MPU6000
#define USE_ACC_SPI_MPU6500
#define MPU6500_CS_PIN PA4
#define MPU6500_SPI_INSTANCE SPI1
#define ACC_MPU6500_ALIGN CW0_DEG
#define GYRO_MPU6500_ALIGN CW0_DEG

#define USE_SPI_GYRO
#define BMI270_CS_PIN PA4
#define BMI270_SPI_INSTANCE SPI1
#define ACC_BMI270_ALIGN CW0_DEG
#define GYRO_BMI270_ALIGN CW0_DEG

#define ICM42688P_CS_PIN PA4
#define ICM42688P_SPI_INSTANCE SPI1
#define ACC_ICM42688P_ALIGN CW0_DEG
#define GYRO_ICM42688P_ALIGN CW0_DEG

#define USE_BARO
#define USE_BARO_SPI_BMP280
#define DEFAULT_BARO_SPI_BMP280
#define BMP280_SPI_INSTANCE SPI3
#define BMP280_CS_PIN PC15
#define BARO_SPI_INSTANCE SPI3
#define BARO_CS_PIN PC15

#define USE_MAG
#define USE_MAG_HMC5883
Expand Down Expand Up @@ -103,6 +128,7 @@

#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_PIN PA15
//#define RX_PPM_PIN PA15 //??

#define USE_SPI
#define USE_SPI_DEVICE_1
Expand Down Expand Up @@ -133,15 +159,16 @@
#define VBAT_ADC_PIN PC1
#define CURRENT_METER_ADC_PIN PC2
#define RSSI_ADC_PIN PC3
#define ADC1_DMA_STREAM DMA2_Stream4 //# ADC 1: DMA2 Stream 4 Channel 0
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC

#define SERIALRX_PROVIDER SERIALRX_SBUS
//#define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_UART5
//#define SBUS_TELEMETRY_UART SERIAL_PORT_USART1

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

#define TARGET_IO_PORTA ( 0xffff )
#define TARGET_IO_PORTB ( 0xffff )
Expand Down
7 changes: 6 additions & 1 deletion src/main/target/TMTR_TMOTORF7/target.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
F7X2RE_TARGETS += $(TARGET)
FEATURES = VCP ONBOARDFLASH
TARGET_SRC = \
drivers/accgyro/accgyro_spi_bmi270.c \
drivers/accgyro/accgyro_spi_icm426xx.c \
drivers/accgyro/accgyro_mpu6500.c \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_spi_mpu6500.c \
drivers/barometer/barometer_bmp280.c \
drivers/compass/compass_hmc5883l.c \
drivers/compass/compass_qmc5883l.c \
drivers/max7456.c
drivers/light_led.h \
drivers/light_ws2811strip.c \
drivers/pinio.c \
drivers/max7456.c \

0 comments on commit 291c5d0

Please sign in to comment.