Skip to content

Commit feaf1b3

Browse files
Merge pull request #10956 from ThanYangFPV/DAKEFPVF435
Add New Target DAKEFPVF435
2 parents a97fb70 + 9294672 commit feaf1b3

File tree

4 files changed

+272
-0
lines changed

4 files changed

+272
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_at32f43x_xGT7(DAKEFPVF435)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdbool.h>
19+
#include <stdint.h>
20+
21+
#include <platform.h>
22+
23+
#include "io/serial.h"
24+
#include "rx/rx.h"
25+
26+
#include "io/piniobox.h"
27+
28+
void targetConfiguration(void)
29+
{
30+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
31+
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
32+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* This file is part of INAV Project.
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
6+
* You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*
8+
* Alternatively, the contents of this file may be used under the terms
9+
* of the GNU General Public License Version 3, as described below:
10+
*
11+
* This file is free software: you may copy, redistribute and/or modify
12+
* it under the terms of the GNU General Public License as published by the
13+
* Free Software Foundation, either version 3 of the License, or (at your
14+
* option) any later version.
15+
*
16+
* This file is distributed in the hope that it will be useful, but
17+
* WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19+
* Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with this program. If not, see http://www.gnu.org/licenses/.
23+
*/
24+
25+
#include <stdint.h>
26+
27+
#include "platform.h"
28+
29+
#include "drivers/bus.h"
30+
#include "drivers/io.h"
31+
#include "drivers/pwm_mapping.h"
32+
#include "drivers/timer.h"
33+
34+
// # pin A00: TIM2 CH1 (AF1)
35+
// # pin A01: TIM2 CH2 (AF1)
36+
// # pin A02: TIM2 CH3 (AF1)
37+
// # pin A03: TIM2 CH4 (AF1)
38+
// # pin A08: TIM1 CH1 (AF1)
39+
// # pin A09: TIM1 CH2 (AF1)
40+
// # pin A10: TIM1 CH3 (AF1)
41+
// # pin C09: TIM8 CH4 (AF3)
42+
// # pin H03: TIM5 CH2 (AF2)
43+
// # pin H02: TIM5 CH1 (AF2)
44+
// # pin C08: TIM3 CH3 (AF2)
45+
// # pin C05: TIM9 CH2 (AF3)
46+
47+
timerHardware_t timerHardware[] = {
48+
49+
DEF_TIM(TMR2, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0,0), // M1
50+
DEF_TIM(TMR2, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0,1), // M2
51+
DEF_TIM(TMR2, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0,2), // M3
52+
DEF_TIM(TMR2, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0,3), // M4
53+
DEF_TIM(TMR1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0,4), // M5
54+
DEF_TIM(TMR1, CH2, PA9, TIM_USE_OUTPUT_AUTO, 0,5), // M6
55+
DEF_TIM(TMR1, CH3, PA10, TIM_USE_OUTPUT_AUTO, 0,6), // M7
56+
DEF_TIM(TMR8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0,8), // M8
57+
DEF_TIM(TMR5, CH2, PH3, TIM_USE_OUTPUT_AUTO, 0,9), // S1
58+
DEF_TIM(TMR5, CH1, PH2, TIM_USE_OUTPUT_AUTO, 0,10),// S2
59+
60+
DEF_TIM(TMR3, CH3, PC8, TIM_USE_ANY, 0, 11), //
61+
// DEF_TIM(TMR9, CH2, PC5, TIM_USE_LED, 0, 0), // LED STRIP
62+
};
63+
64+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
65+
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
/*
2+
* This file is part of INAV Project.
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
6+
* You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*
8+
* Alternatively, the contents of this file may be used under the terms
9+
* of the GNU General Public License Version 3, as described below:
10+
*
11+
* This file is free software: you may copy, redistribute and/or modify
12+
* it under the terms of the GNU General Public License as published by the
13+
* Free Software Foundation, either version 3 of the License, or (at your
14+
* option) any later version.
15+
*
16+
* This file is distributed in the hope that it will be useful, but
17+
* WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19+
* Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with this program. If not, see http://www.gnu.org/licenses/.
23+
*/
24+
25+
#pragma once
26+
27+
#define TARGET_BOARD_IDENTIFIER "DAK4"
28+
#define USBD_PRODUCT_STRING "DAKEFPV F435"
29+
30+
#define LED0 PA15
31+
32+
#define BEEPER PC3
33+
#define BEEPER_INVERTED
34+
35+
36+
// Buses
37+
38+
#define USE_SPI
39+
40+
#define USE_SPI_DEVICE_1
41+
#define SPI1_SCK_PIN PA5
42+
#define SPI1_MISO_PIN PA6
43+
#define SPI1_MOSI_PIN PA7
44+
45+
#define USE_SPI_DEVICE_2
46+
#define SPI2_SCK_PIN PB13
47+
#define SPI2_MISO_PIN PB14
48+
#define SPI2_MOSI_PIN PB15
49+
50+
#define USE_SPI_DEVICE_3
51+
#define SPI3_SCK_PIN PB3
52+
#define SPI3_MISO_PIN PB4
53+
#define SPI3_MOSI_PIN PB5
54+
55+
#define USE_I2C
56+
#define USE_I2C_DEVICE_1
57+
#define I2C1_SCL PB8
58+
#define I2C1_SDA PB9
59+
// #define USE_I2C_PULLUP
60+
61+
#define DEFAULT_I2C_BUS BUS_I2C1
62+
63+
// Gyro
64+
#define USE_IMU_MPU6500
65+
#define IMU_MPU6500_ALIGN CW90_DEG
66+
#define MPU6500_CS_PIN PA4
67+
#define MPU6500_SPI_BUS BUS_SPI1
68+
69+
// ICM42605/ICM42688P
70+
#define USE_IMU_ICM42605
71+
#define IMU_ICM42605_ALIGN CW90_DEG
72+
#define ICM42605_SPI_BUS BUS_SPI1
73+
#define ICM42605_CS_PIN PA4
74+
75+
//Baro
76+
#define USE_BARO
77+
#define USE_BARO_BMP280
78+
#define BMP280_I2C_BUS DEFAULT_I2C_BUS
79+
80+
// Other sensors
81+
82+
#define USE_BARO
83+
#define BARO_I2C_BUS DEFAULT_I2C_BUS
84+
#define USE_BARO_ALL
85+
86+
#define USE_MAG
87+
#define MAG_I2C_BUS DEFAULT_I2C_BUS
88+
#define USE_MAG_ALL
89+
90+
// OSD
91+
#define USE_MAX7456
92+
#define MAX7456_SPI_BUS BUS_SPI2
93+
#define MAX7456_CS_PIN PB12
94+
95+
// Flash
96+
97+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
98+
#define USE_FLASHFS
99+
#define USE_FLASH_M25P16
100+
#define M25P16_SPI_BUS BUS_SPI3
101+
#define M25P16_CS_PIN PB1
102+
103+
#define USE_FLASH_W25N01G
104+
#define W25N01G_SPI_BUS BUS_SPI3
105+
#define W25N01G_CS_PIN PB1
106+
107+
// UARTs
108+
#define USE_VCP
109+
110+
#define USE_UART1
111+
#define UART1_TX_PIN PB6
112+
#define UART1_RX_PIN PB7
113+
114+
// USART3 RX only
115+
#define USE_UART3
116+
#define UART3_RX_PIN PB11
117+
#define UART3_TX_PIN PC13 // PC13 is just for compilation pass
118+
119+
#define USE_UART4
120+
#define UART4_TX_PIN PC10
121+
#define UART4_RX_PIN PC11
122+
123+
#define USE_UART5
124+
#define UART5_TX_PIN PC12
125+
#define UART5_RX_PIN PD2
126+
127+
#define USE_UART6
128+
#define UART6_TX_PIN PC6
129+
#define UART6_RX_PIN PC7
130+
131+
#define SERIAL_PORT_COUNT 6
132+
133+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
134+
#define SERIALRX_PROVIDER SERIALRX_CRSF
135+
#define SERIALRX_UART SERIAL_PORT_USART5
136+
#define GPS_UART SERIAL_PORT_USART1
137+
138+
// *************** ADC *****************************
139+
#define USE_ADC
140+
#define ADC_INSTANCE ADC1
141+
142+
#define ADC_CHANNEL_1_PIN PC1
143+
#define ADC_CHANNEL_2_PIN PC2
144+
#define ADC_CHANNEL_3_PIN PC0
145+
#define VBAT_ADC_CHANNEL ADC_CHN_1
146+
#define RSSI_ADC_CHANNEL ADC_CHN_2
147+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
148+
149+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY )
150+
151+
#define USE_LED_STRIP
152+
#define WS2811_PIN PC8
153+
154+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
155+
156+
#define TARGET_IO_PORTA 0xffff
157+
#define TARGET_IO_PORTB 0xffff
158+
#define TARGET_IO_PORTC 0xffff
159+
#define TARGET_IO_PORTD 0xffff
160+
#define TARGET_IO_PORTE 0xffff
161+
#define TARGET_IO_PORTH 0xffff
162+
163+
#define USE_DSHOT
164+
#define USE_ESC_SENSOR
165+
#define MAX_PWM_OUTPUT_PORTS 10
166+
167+
// PINIO
168+
#define USE_PINIO
169+
#define USE_PINIOBOX
170+
#define PINIO1_PIN PB0
171+
#define PINIO2_PIN PB10
172+
173+
// VBAT 10K/160K
174+
#define VBAT_SCALE_DEFAULT 1600

0 commit comments

Comments
 (0)