From b20640beafdbafffc124264fa82c54c4f98ec6b7 Mon Sep 17 00:00:00 2001 From: jflyper Date: Mon, 7 May 2018 01:21:31 +0900 Subject: [PATCH] Config for NERO --- src/main/target/STM32F7X2/config/NERO.config | 79 ++++++++++++++++++++ src/main/target/STM32F7X2/target.h | 34 +++++---- 2 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 src/main/target/STM32F7X2/config/NERO.config diff --git a/src/main/target/STM32F7X2/config/NERO.config b/src/main/target/STM32F7X2/config/NERO.config new file mode 100644 index 000000000..2e4653b3a --- /dev/null +++ b/src/main/target/STM32F7X2/config/NERO.config @@ -0,0 +1,79 @@ +// Usual lawyer stuff here + +# Basic I/O +resource LED 1 B06 +resource LED 2 B05 +resource LED 3 B04 +resource beeper C1 +set beeper_od = OFF +set beeper_inversion = ON + +# Buses +resource I2C_SCL 1 B08 +resource I2C_SDA 1 B09 + +resource SPI_SCK 1 A05 +resource SPI_MISO 1 A06 +resource SPI_MOSI 1 A07 + +resource SPI_SCK 2 B13 +resource SPI_MISO 2 B14 +resource SPI_MOSI 2 B15 + +resource SPI_SCK 3 C10 +resource SPI_MISO 3 C11 +resource SPI_MOSI 3 C12 + +# Timers +# First four timers +# timer is zero origin +timer A0 1 +timer A1 1 +timer A2 1 +timer A3 1 +resource MOTOR 1 A0 +resource MOTOR 2 A1 +resource MOTOR 3 A2 +resource MOTOR 4 A3 + +# Remaining timers +timer B0 1 +timer B1 1 +timer C7 1 +timer C8 1 +timer C9 1 + +# DMA stream conflict if burst mode is not used +# Need to specify dmaopt +set dshot_burst = ON + +resource LED_STRIP B0 + +resource PPM C7 + +# Serial ports + +resource SERIAL_TX 1 A9 +resource SERIAL_RX 1 A10 + +resource SERIAL_TX 3 B10 +resource SERIAL_RX 3 B11 + +resource SERIAL_TX 6 C6 +resource SERIAL_RX 6 C7 + +# ADC + +resource ADC_BATT 1 C03 + +# Remaining + +resource ESCSERIAL 1 C07 +resource SDCARD_CS 1 A15 +resource SDCARD_DETECT 1 D02 + +# Some configs + +FEATURE RX_SERIAL +set serialrx_provider = SBUS +serial 5 64 115200 57600 0 115200 diff --git a/src/main/target/STM32F7X2/target.h b/src/main/target/STM32F7X2/target.h index 9a9b190f1..80f789d50 100644 --- a/src/main/target/STM32F7X2/target.h +++ b/src/main/target/STM32F7X2/target.h @@ -23,27 +23,32 @@ #define USBD_PRODUCT_STRING "S7X2" +#define USE_BEEPER + #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC -// MPU6500 interrupt +// MPU interrupt #define USE_EXTI #define USE_MPU_DATA_READY_SIGNAL //#define DEBUG_MPU_DATA_READY_INTERRUPT +#define MPU_INT_EXTI PB15 // XXX Should be gone #define USE_ACC -#define USE_FAKE_ACC -#define USE_ACC_MPU6050 -#define ACC_MPU6050_ALIGN CW270_DEG - #define USE_GYRO -#define USE_FAKE_GYRO -#define USE_GYRO_MPU6050 -#define GYRO_MPU6050_ALIGN CW270_DEG -// MPU6050 interrupts -#define USE_MPU_DATA_READY_SIGNAL -#define MPU_INT_EXTI PB15 -#define USE_EXTI +#define USE_FAKE_ACC +#define USE_FAKE_GYRO + +#define USE_ACC_SPI_MPU6500 +#define USE_GYRO_SPI_MPU6500 +// Other USE_ACCs and USE_GYROs should follow + +// Should be gone +#define MPU6500_CS_PIN PC4 // XXX Should be gone +#define MPU6500_SPI_INSTANCE SPI1 // XXX Should be gone +#define ACC_MPU6500_ALIGN CW0_DEG +#define GYRO_MPU6500_ALIGN CW0_DEG + #define USE_MAG #define USE_FAKE_MAG @@ -66,12 +71,15 @@ #define USE_VCP #define USE_UART1 +#define USE_UART2 #define USE_UART3 +#define USE_UART4 +#define USE_UART5 #define USE_UART6 #define USE_SOFTSERIAL1 #define USE_SOFTSERIAL2 -#define SERIAL_PORT_COUNT 6 +#define SERIAL_PORT_COUNT 9 #define USE_ESCSERIAL