From db070a7e9e1d8350f484c379dfea79570225ca76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E7=BB=AE?= Date: Sat, 7 Dec 2024 11:50:30 +0800 Subject: [PATCH 01/10] Create config.h ADD DAKEFPVF435 --- configs/DAKEFPVF435/config.h | 125 +++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 configs/DAKEFPVF435/config.h diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h new file mode 100644 index 000000000..42e5d3465 --- /dev/null +++ b/configs/DAKEFPVF435/config.h @@ -0,0 +1,125 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is 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. + * + * Betaflight is distributed in the hope that it 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 . + */ + +#pragma once + +#define FC_TARGET_MCU AT32F435G + +#define BOARD_NAME DAKEFPVF435 +#define MANUFACTURER_ID DAKE + +#define USE_ACC +#define USE_ACC_SPI_MPU6000 +#define USE_ACC_SPI_ICM42688P +#define USE_GYRO +#define USE_GYRO_SPI_MPU6000 +#define USE_GYRO_SPI_ICM42688P + +#define USE_BARO +#define USE_BARO_BMP280 +#define USE_BARO_DPS310 +#define USE_FLASH +#define USE_FLASH_M25P16 +#define USE_MAX7456 +#define USE_LED_STRIP +#ifndef USE_CAMERA_CONTROL +#define USE_CAMERA_CONTROL +#endif + +#define BEEPER_PIN PC3 +#define MOTOR1_PIN PA0 +#define MOTOR2_PIN PA1 +#define MOTOR3_PIN PA2 +#define MOTOR4_PIN PA3 +#define MOTOR5_PIN PA8 +#define MOTOR6_PIN PA9 +#define MOTOR7_PIN PA10 +#define MOTOR8_PIN PC9 +#define UART1_TX_PIN PB6 +#define UART1_RX_PIN PB7 +#define UART3_RX_PIN PB11 +#define UART4_TX_PIN PC10 +#define UART4_RX_PIN PC11 +#define UART5_TX_PIN PC12 +#define UART5_RX_PIN PD2 +#define UART6_TX_PIN PC6 +#define UART6_RX_PIN PC7 +#define I2C1_SCL_PIN PB8 +#define I2C1_SDA_PIN PB9 +#define LED0_PIN PA15 +#define SPI1_SCK_PIN PA5 +#define SPI1_SDI_PIN PA6 +#define SPI1_SDO_PIN PA7 +#define SPI2_SCK_PIN PB13 +#define SPI2_SDI_PIN PB14 +#define SPI2_SDO_PIN PB15 +#define SPI3_SCK_PIN PB3 +#define SPI3_SDI_PIN PB4 +#define SPI3_SDO_PIN PB5 +#define CAMERA_CONTROL_PIN PC5 +#define ADC_CURR_PIN PC0 +#define ADC_VBAT_PIN PC1 +#define ADC_RSSI_PIN PC2 +#define PINIO1_PIN PB0 +#define PINIO2_PIN PB10 +#define FLASH_CS_PIN PB1 +#define MAX7456_SPI_CS_PIN PB12 +#define GYRO_1_EXTI_PIN PC4 +#define GYRO_1_CS_PIN PA4 + +#define TIMER_PIN_MAPPING \ + TIMER_PIN_MAP( 0, PA0 , 1, 0) \ + TIMER_PIN_MAP( 1, PA1 , 1, 1) \ + TIMER_PIN_MAP( 2, PA2 , 1, 2) \ + TIMER_PIN_MAP( 3, PA3 , 1, 3) \ + TIMER_PIN_MAP( 4, PA8 , 1, 4) \ + TIMER_PIN_MAP( 5, PA9 , 1, 5) \ + TIMER_PIN_MAP( 6, PA10, 1, 6) \ + TIMER_PIN_MAP( 7, PC9 , 2, 7) \ + TIMER_PIN_MAP( 8, PH2 , 1, 8) \ + TIMER_PIN_MAP( 9, PC5 , 1, -1) + +#define ADC2_DMA_OPT 9 + +#define ADC_INSTANCE ADC2 +#define FLASH_SPI_INSTANCE SPI3 +#define MAX7456_SPI_INSTANCE SPI2 + +#define BARO_I2C_INSTANCE I2CDEV_1 + +#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH +#define DEFAULT_DSHOT_BITBANG DSHOT_BITBANG_ON +#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC +#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC + +#define BEEPER_INVERTED +#define PINIO1_CONFIG 129 +#define PINIO1_BOX 40 +#define PINIO2_CONFIG 129 +#define PINIO2_BOX 41 + +#define GYRO_1_SPI_INSTANCE SPI1 +#define GYRO_1_ALIGN CW90_DEG +#define GYRO_1_ALIGN_YAW 900 +#define DEFAULT_CURRENT_METER_SCALE 120 + +#define SERIALRX_UART SERIAL_PORT_UART5 +#define ESC_SENSOR_UART SERIAL_PORT_USART3 \ No newline at end of file From 8ef115fb9e1a987888d791ec2d77a36b116b4934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E7=BB=AE?= Date: Sat, 7 Dec 2024 16:25:02 +0800 Subject: [PATCH 02/10] Add two SERVO --- configs/DAKEFPVF435/config.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index 42e5d3465..52f9f46aa 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -53,6 +53,8 @@ #define MOTOR6_PIN PA9 #define MOTOR7_PIN PA10 #define MOTOR8_PIN PC9 +#define SERVO1_PIN PH3 // S9 +#define SERVO2_PIN PC8 // S10 #define UART1_TX_PIN PB6 #define UART1_RX_PIN PB7 #define UART3_RX_PIN PB11 @@ -95,7 +97,9 @@ TIMER_PIN_MAP( 6, PA10, 1, 6) \ TIMER_PIN_MAP( 7, PC9 , 2, 7) \ TIMER_PIN_MAP( 8, PH2 , 1, 8) \ - TIMER_PIN_MAP( 9, PC5 , 1, -1) + TIMER_PIN_MAP( 9, PC8 , 1, 9) \ + TIMER_PIN_MAP( 10,PH3 , 1, 10) \ + TIMER_PIN_MAP( 11,PC5 , 1, -1) #define ADC2_DMA_OPT 9 From 4d5c39f0bcf61964fa47b3d312dc0db07da2ce53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E7=BB=AE?= Date: Sat, 7 Dec 2024 17:23:17 +0800 Subject: [PATCH 03/10] Remove DMA assignment from servos. --- configs/DAKEFPVF435/config.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index 52f9f46aa..e67a0f6d8 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -87,7 +87,7 @@ #define GYRO_1_EXTI_PIN PC4 #define GYRO_1_CS_PIN PA4 -#define TIMER_PIN_MAPPING \ +#define TIMER_PIN_MAPPING \ TIMER_PIN_MAP( 0, PA0 , 1, 0) \ TIMER_PIN_MAP( 1, PA1 , 1, 1) \ TIMER_PIN_MAP( 2, PA2 , 1, 2) \ @@ -97,8 +97,8 @@ TIMER_PIN_MAP( 6, PA10, 1, 6) \ TIMER_PIN_MAP( 7, PC9 , 2, 7) \ TIMER_PIN_MAP( 8, PH2 , 1, 8) \ - TIMER_PIN_MAP( 9, PC8 , 1, 9) \ - TIMER_PIN_MAP( 10,PH3 , 1, 10) \ + TIMER_PIN_MAP( 9, PH3 , 1, -1) \ + TIMER_PIN_MAP( 10,PC8 , 1, -1) \ TIMER_PIN_MAP( 11,PC5 , 1, -1) #define ADC2_DMA_OPT 9 From 2b6943410e2e0867b1409f95becb064fe2614ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E7=BB=AE?= Date: Tue, 10 Dec 2024 14:11:21 +0800 Subject: [PATCH 04/10] Swap the pins of the LED_STRIP and the servo and add a magnetometer using IIC1. --- configs/DAKEFPVF435/config.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index e67a0f6d8..d925defa0 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -39,7 +39,6 @@ #define USE_FLASH #define USE_FLASH_M25P16 #define USE_MAX7456 -#define USE_LED_STRIP #ifndef USE_CAMERA_CONTROL #define USE_CAMERA_CONTROL #endif @@ -53,8 +52,9 @@ #define MOTOR6_PIN PA9 #define MOTOR7_PIN PA10 #define MOTOR8_PIN PC9 +#define LED_STRIP_PIN PC8 #define SERVO1_PIN PH3 // S9 -#define SERVO2_PIN PC8 // S10 +#define SERVO2_PIN PH2 // S10 #define UART1_TX_PIN PB6 #define UART1_RX_PIN PB7 #define UART3_RX_PIN PB11 @@ -96,9 +96,9 @@ TIMER_PIN_MAP( 5, PA9 , 1, 5) \ TIMER_PIN_MAP( 6, PA10, 1, 6) \ TIMER_PIN_MAP( 7, PC9 , 2, 7) \ - TIMER_PIN_MAP( 8, PH2 , 1, 8) \ + TIMER_PIN_MAP( 8, PC8 , 2, 8) \ TIMER_PIN_MAP( 9, PH3 , 1, -1) \ - TIMER_PIN_MAP( 10,PC8 , 1, -1) \ + TIMER_PIN_MAP( 10,PH2 , 1, -1) \ TIMER_PIN_MAP( 11,PC5 , 1, -1) #define ADC2_DMA_OPT 9 @@ -108,6 +108,7 @@ #define MAX7456_SPI_INSTANCE SPI2 #define BARO_I2C_INSTANCE I2CDEV_1 +#define MAG_I2C_INSTANCE I2CDEV_1 #define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH #define DEFAULT_DSHOT_BITBANG DSHOT_BITBANG_ON From b5c7b7e15d612d4c4203ae99f49447848e9b03cc Mon Sep 17 00:00:00 2001 From: ThanYangFPV <74483959+ThanYangFPV@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:15:51 +0800 Subject: [PATCH 05/10] Add new line at EOF Co-authored-by: Mark Haslinghuis --- configs/DAKEFPVF435/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index d925defa0..8b3a7953e 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -127,4 +127,4 @@ #define DEFAULT_CURRENT_METER_SCALE 120 #define SERIALRX_UART SERIAL_PORT_UART5 -#define ESC_SENSOR_UART SERIAL_PORT_USART3 \ No newline at end of file +#define ESC_SENSOR_UART SERIAL_PORT_USART3 From 845bc3e90db37fc22c963c63ebd262f1da807d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E7=BB=AE?= Date: Fri, 13 Dec 2024 16:36:22 +0800 Subject: [PATCH 06/10] Replace USE_CAMERA_CONTROL with USE_VTX. --- configs/DAKEFPVF435/config.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index 8b3a7953e..b2f8bf535 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -39,9 +39,7 @@ #define USE_FLASH #define USE_FLASH_M25P16 #define USE_MAX7456 -#ifndef USE_CAMERA_CONTROL -#define USE_CAMERA_CONTROL -#endif +#define USE_VTX #define BEEPER_PIN PC3 #define MOTOR1_PIN PA0 From 352988241137e7194d2de5133ae3cb748249316e Mon Sep 17 00:00:00 2001 From: ThanYangFPV <74483959+ThanYangFPV@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:09:33 +0800 Subject: [PATCH 07/10] remove USE_VTX Co-authored-by: Mark Haslinghuis --- configs/DAKEFPVF435/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index b2f8bf535..0e7981f4c 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -39,7 +39,6 @@ #define USE_FLASH #define USE_FLASH_M25P16 #define USE_MAX7456 -#define USE_VTX #define BEEPER_PIN PC3 #define MOTOR1_PIN PA0 From 2d6c813861dbd5565d27401ff304dcc4b189891d Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Fri, 13 Dec 2024 17:33:31 +0100 Subject: [PATCH 08/10] Update configs/DAKEFPVF435/config.h Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/DAKEFPVF435/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index 0e7981f4c..1578c4384 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -93,7 +93,7 @@ TIMER_PIN_MAP( 5, PA9 , 1, 5) \ TIMER_PIN_MAP( 6, PA10, 1, 6) \ TIMER_PIN_MAP( 7, PC9 , 2, 7) \ - TIMER_PIN_MAP( 8, PC8 , 2, 8) \ + TIMER_PIN_MAP( 8, PC8 , 1, 8) \ TIMER_PIN_MAP( 9, PH3 , 1, -1) \ TIMER_PIN_MAP( 10,PH2 , 1, -1) \ TIMER_PIN_MAP( 11,PC5 , 1, -1) From 20d997cf54fec1667a640aaf977745c5055cf55b Mon Sep 17 00:00:00 2001 From: ThanYangFPV <74483959+ThanYangFPV@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:43:19 +0800 Subject: [PATCH 09/10] Remove DEFAULT_CURRENT_METER_SCALE Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/DAKEFPVF435/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index 1578c4384..d3877b411 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -121,7 +121,6 @@ #define GYRO_1_SPI_INSTANCE SPI1 #define GYRO_1_ALIGN CW90_DEG #define GYRO_1_ALIGN_YAW 900 -#define DEFAULT_CURRENT_METER_SCALE 120 #define SERIALRX_UART SERIAL_PORT_UART5 #define ESC_SENSOR_UART SERIAL_PORT_USART3 From ea54671f6d3fd9e1d30ce8fd8333beaa62eb827d Mon Sep 17 00:00:00 2001 From: ThanYangFPV <74483959+ThanYangFPV@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:44:05 +0800 Subject: [PATCH 10/10] Update configs/DAKEFPVF435/config.h Use GYRO_1_ALIGN CW180_DEG. Co-authored-by: ot0tot <36753790+ot0tot@users.noreply.github.com> --- configs/DAKEFPVF435/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/DAKEFPVF435/config.h b/configs/DAKEFPVF435/config.h index d3877b411..42b844551 100644 --- a/configs/DAKEFPVF435/config.h +++ b/configs/DAKEFPVF435/config.h @@ -119,8 +119,8 @@ #define PINIO2_BOX 41 #define GYRO_1_SPI_INSTANCE SPI1 -#define GYRO_1_ALIGN CW90_DEG -#define GYRO_1_ALIGN_YAW 900 +#define GYRO_1_ALIGN CW180_DEG + #define SERIALRX_UART SERIAL_PORT_UART5 #define ESC_SENSOR_UART SERIAL_PORT_USART3