From 224c69e0540b91cec25e669eee39a1285bb3dd50 Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Fri, 10 Nov 2017 15:56:23 +1300 Subject: [PATCH] Updates to the MATEKF722 target. --- src/main/target/MATEKF722/target.c | 2 ++ src/main/target/MATEKF722/target.h | 34 ++++++++++++++++++++++++----- src/main/target/MATEKF722/target.mk | 5 +++++ 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/main/target/MATEKF722/target.c b/src/main/target/MATEKF722/target.c index 8f92a4f198..f46b937827 100644 --- a/src/main/target/MATEKF722/target.c +++ b/src/main/target/MATEKF722/target.c @@ -35,5 +35,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // S5 DMA1_ST2 DEF_TIM(TIM1, CH1, PA8, TIM_USE_MOTOR, 0, 0), // S6 DMA2_ST6 + DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0), // PWM + DEF_TIM(TIM2, CH1, PA15, TIM_USE_LED, 0, 0), // LED STRIP DMA1_ST5 }; diff --git a/src/main/target/MATEKF722/target.h b/src/main/target/MATEKF722/target.h index 2955f39038..1992a38a79 100644 --- a/src/main/target/MATEKF722/target.h +++ b/src/main/target/MATEKF722/target.h @@ -35,6 +35,9 @@ #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 +#define MPU6500_CS_PIN PC2 +#define MPU6500_SPI_INSTANCE SPI1 + #define ICM20689_CS_PIN PC2 #define ICM20689_SPI_INSTANCE SPI1 @@ -43,13 +46,33 @@ #define USE_MPU_DATA_READY_SIGNAL #define USE_GYRO +#define USE_GYRO_SPI_MPU6500 +#define GYRO_MPU6500_ALIGN CW180_DEG + #define USE_GYRO_SPI_ICM20689 #define GYRO_ICM20689_ALIGN CW90_DEG #define USE_ACC +#define USE_ACC_SPI_MPU6500 +#define ACC_MPU6500_ALIGN CW180_DEG + #define USE_ACC_SPI_ICM20689 #define ACC_ICM20689_ALIGN CW90_DEG +// *************** Baro ************************** +#define USE_I2C + +#define USE_I2C_DEVICE_1 +#define I2C_DEVICE (I2CDEV_1) +#define I2C1_SCL PB6 // SCL pad +#define I2C1_SDA PB7 // SDA pad +#define BARO_I2C_INSTANCE (I2CDEV_1) + +#define USE_BARO +#define USE_BARO_BMP280 +#define USE_BARO_MS5611 +#define USE_BARO_BMP085 + // *************** SD Card ************************** #define USE_SDCARD #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT @@ -125,13 +148,12 @@ #define CURRENT_METER_ADC_PIN PC4 #define RSSI_ADC_PIN PB0 -#define DEFAULT_FEATURES (FEATURE_OSD ) +#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY ) +#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC +#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC #define USE_LED_STRIP -#define USE_SPEKTRUM_BIND -#define BIND_PIN PA1 // USART4 RX - #define USE_ESCSERIAL #define USE_SERIAL_4WAY_BLHELI_INTERFACE @@ -140,5 +162,5 @@ #define TARGET_IO_PORTC 0xffff #define TARGET_IO_PORTD (BIT(2)) -#define USABLE_TIMER_CHANNEL_COUNT 8 -#define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(5)|TIM_N(8)) +#define USABLE_TIMER_CHANNEL_COUNT 9 +#define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(4)|TIM_N(5)|TIM_N(8)) diff --git a/src/main/target/MATEKF722/target.mk b/src/main/target/MATEKF722/target.mk index 0f18108db9..ed567aec1a 100644 --- a/src/main/target/MATEKF722/target.mk +++ b/src/main/target/MATEKF722/target.mk @@ -2,5 +2,10 @@ F7X2RE_TARGETS += $(TARGET) FEATURES += SDCARD VCP TARGET_SRC = \ + drivers/accgyro/accgyro_spi_mpu6500.c \ + drivers/accgyro/accgyro_mpu6500.c \ drivers/accgyro/accgyro_spi_icm20689.c \ + drivers/barometer/barometer_bmp085.c \ + drivers/barometer/barometer_bmp280.c \ + drivers/barometer/barometer_ms5611.c \ drivers/max7456.c