Skip to content

Commit a533c69

Browse files
committed
Add new target: AET-AT32-WING
1 parent 1fa4ac2 commit a533c69

File tree

3 files changed

+284
-0
lines changed

3 files changed

+284
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_at32f43x_xMT7(AETAT32)

src/main/target/AETAT32/target.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* This file is part of Cleanflight.
3+
*
4+
* Cleanflight 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+
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
20+
#include "platform.h"
21+
22+
#include "drivers/bus.h"
23+
#include "drivers/io.h"
24+
#include "drivers/pwm_mapping.h"
25+
#include "drivers/timer.h"
26+
27+
timerHardware_t timerHardware[] = {
28+
29+
DEF_TIM(TMR1, CH4, PE14, TIM_USE_MOTOR, 0,1), // 1
30+
DEF_TIM(TMR1, CH3, PE13, TIM_USE_MOTOR, 0,2), // 2
31+
32+
DEF_TIM(TMR3, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0,3), // PWM4 - OUT8 DMA2 CH5
33+
DEF_TIM(TMR3, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0,4), // PWM3 - OUT7 DMA2 CH4
34+
DEF_TIM(TMR3, CH2, PC7, TIM_USE_OUTPUT_AUTO, 0,5), // PWM2 - OUT6 DMA2 CH3
35+
DEF_TIM(TMR3, CH1, PC6, TIM_USE_OUTPUT_AUTO, 0,6), // PWM1 - OUT5 DMA2 CH2 DMA2_CHANNEL1->ADC
36+
37+
DEF_TIM(TMR4, CH4, PB9, TIM_USE_OUTPUT_AUTO, 0,7), // motor4 DMA1 CH4
38+
DEF_TIM(TMR4, CH3, PB8, TIM_USE_OUTPUT_AUTO, 0,8), // motor3 DMA1 CH3
39+
DEF_TIM(TMR4, CH2, PB7, TIM_USE_OUTPUT_AUTO, 0,9), // motor2 DMA1 CH2
40+
DEF_TIM(TMR4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0,10), // motor1 DMA1 CH1
41+
42+
DEF_TIM(TMR2, CH3, PB10, TIM_USE_ANY | TIM_USE_LED, 0,11), // PWM1 - LED MCO1 DMA1 CH6
43+
44+
45+
};
46+
47+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
48+

src/main/target/AETAT32/target.h

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
/*
2+
* This file is part of Cleanflight.
3+
*
4+
* Cleanflight 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+
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#pragma once
19+
20+
#define TARGET_BOARD_IDENTIFIER "AEAT"
21+
22+
#define USBD_PRODUCT_STRING "AETAT32"
23+
24+
/**********swd debuger reserved *****************
25+
*
26+
* pa13 swdio
27+
* pa14 swclk
28+
* PA15 JTDI
29+
* PB4 JREST
30+
* pb3 swo /DTO
31+
32+
* other pin
33+
*
34+
* PB2 ->BOOT0 button
35+
* PA8 MCO1
36+
* PA11 OTG1 D+ DP
37+
* PA10 OTG1 D- DN
38+
* PH0 HEXT IN
39+
* PH1 HEXT OUT
40+
*/
41+
42+
#define LED0 PD15
43+
#define LED1 PD14
44+
45+
// #define BEEPER PB11
46+
// #define BEEPER_INVERTED
47+
// #define BEEPER_PWM_FREQUENCY 2500 //0 Active BB | 2500Hz Passive BB
48+
49+
// *************** Gyro & ACC **********************
50+
#define USE_SPI
51+
#define USE_SPI_DEVICE_1
52+
53+
#define SPI1_SCK_PIN PA5
54+
#define SPI1_MISO_PIN PA6
55+
#define SPI1_MOSI_PIN PA7
56+
#define SPI1_NSS_PIN PA4
57+
58+
// MPU6000
59+
#define USE_IMU_MPU6000
60+
#define IMU_MPU6000_ALIGN CW90_DEG
61+
#define MPU6000_SPI_BUS BUS_SPI1
62+
#define MPU6000_CS_PIN SPI1_NSS_PIN
63+
// MPU6500
64+
#define USE_IMU_MPU6500
65+
#define IMU_MPU6500_ALIGN CW90_DEG
66+
#define MPU6500_SPI_BUS BUS_SPI1
67+
#define MPU6500_CS_PIN SPI1_NSS_PIN
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 SPI1_NSS_PIN
74+
75+
// MPU9250
76+
#define USE_IMU_MPU9250
77+
#define IMU_MPU9250_ALIGN CW90_DEG
78+
#define MPU9250_SPI_BUS BUS_SPI1
79+
#define MPU9250_CS_PIN SPI1_NSS_PIN
80+
81+
// BMI270
82+
#define USE_IMU_BMI270
83+
#define IMU_BMI270_ALIGN CW0_DEG
84+
#define BMI270_SPI_BUS BUS_SPI1
85+
#define BMI270_CS_PIN SPI1_NSS_PIN
86+
87+
//BMI088
88+
#define USE_IMU_BMI088
89+
90+
#define IMU_BMI088_ALIGN CW90_DEG
91+
#define BMI088_SPI_BUS BUS_SPI1
92+
93+
#define BMI088_GYRO_CS_PIN SPI1_NSS_PIN
94+
#define BMI088_GYRO_EXTI_PIN PA15
95+
#define BMI088_ACC_CS_PIN PC13
96+
#define BMI088_ACC_EXTI_PIN PD13
97+
98+
// *************** I2C/Baro/Mag/EXT*********************
99+
#define USE_I2C
100+
#define USE_I2C_DEVICE_3
101+
#define I2C3_SCL PC0 // SCL pad
102+
#define I2C3_SDA PC1 // SDA pad
103+
#define USE_I2C_PULLUP
104+
105+
#define USE_BARO
106+
#define BARO_I2C_BUS BUS_I2C3
107+
#define USE_BARO_BMP280
108+
#define USE_BARO_DPS310
109+
110+
#define USE_MAG
111+
#define MAG_I2C_BUS BUS_I2C3
112+
#define USE_MAG_ALL
113+
114+
// temperature sensors
115+
//#define TEMPERATURE_I2C_BUS BUS_I2C1
116+
117+
// air speed sensors
118+
#define PITOT_I2C_BUS BUS_I2C3
119+
120+
// ranger sensors
121+
#define USE_RANGEFINDER
122+
#define RANGEFINDER_I2C_BUS BUS_I2C3
123+
124+
// *************** OSD *****************************
125+
#define USE_SPI_DEVICE_2
126+
#define SPI2_SCK_PIN PD1//PB13 on LQFP64
127+
#define SPI2_MISO_PIN PD3//PB14 on LQFP64
128+
#define SPI2_MOSI_PIN PD4//PB15 on LQFP64
129+
#define SPI2_NSS_PIN PD5 //confirm on lqfp64
130+
#define SPI2_SCK_AF GPIO_MUX_6
131+
#define SPI2_MISO_AF GPIO_MUX_6
132+
#define SPI2_MOSI_AF GPIO_MUX_6
133+
134+
135+
#define USE_MAX7456
136+
#define MAX7456_SPI_BUS BUS_SPI2
137+
#define MAX7456_CS_PIN SPI2_NSS_PIN
138+
139+
140+
// *************** SD/BLACKBOX **************************
141+
#define USE_SPI_DEVICE_3
142+
#define SPI3_SCK_PIN PC10
143+
#define SPI3_MISO_PIN PC11
144+
#define SPI3_MOSI_PIN PC12
145+
#define SPI3_NSS_PIN PD6 //confirm on lqfp64
146+
147+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
148+
#define USE_FLASHFS
149+
#define USE_FLASH_M25P16
150+
#define M25P16_SPI_BUS BUS_SPI3
151+
#define M25P16_CS_PIN SPI3_NSS_PIN
152+
153+
#define USE_FLASH_W25N01G
154+
#define W25N01G_SPI_BUS BUS_SPI3
155+
#define W25N01G_CS_PIN SPI3_NSS_PIN
156+
157+
// *************** UART *****************************
158+
#define USE_VCP
159+
#define USB_DETECT_PIN PC14
160+
#define USE_USB_DETECT
161+
162+
#define USE_UART1
163+
#define UART1_RX_PIN PA10
164+
#define UART1_TX_PIN PA9
165+
166+
#define USE_UART2
167+
#define UART2_RX_PIN PA3
168+
#define UART2_TX_PIN PA2
169+
170+
#define USE_UART3
171+
#define UART3_RX_PIN PC5
172+
#define UART3_TX_PIN PC4
173+
174+
#define USE_UART4
175+
#define UART4_RX_PIN PA1
176+
#define UART4_TX_PIN PA0
177+
178+
179+
180+
#define USE_UART5
181+
#define UART5_RX_PIN PE11
182+
#define UART5_TX_PIN PE10
183+
184+
#define USE_UART7
185+
#define UART7_RX_PIN PE7
186+
#define UART7_TX_PIN PE8
187+
188+
189+
190+
#define USE_UART8
191+
#define UART8_RX_PIN PC3
192+
#define UART8_TX_PIN PC2
193+
194+
#define SERIAL_PORT_COUNT 8
195+
196+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
197+
#define SERIALRX_PROVIDER SERIALRX_CRSF
198+
#define SERIALRX_UART SERIAL_PORT_USART1
199+
200+
// *************** ADC *****************************
201+
#define USE_ADC
202+
#define ADC_INSTANCE ADC1
203+
204+
#define ADC1_DMA_STREAM DMA2_CHANNEL1
205+
#define ADC_CHANNEL_1_PIN PB0
206+
#define ADC_CHANNEL_2_PIN PB1
207+
//#define ADC_CHANNEL_3_PIN PB0
208+
#define VBAT_ADC_CHANNEL ADC_CHN_1
209+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
210+
//#define RSSI_ADC_CHANNEL ADC_CHN_3
211+
212+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
213+
214+
#define CURRENT_METER_SCALE 240
215+
#define CURRENT_METER_OFFSET 1870 //6s Battery
216+
//#define CURRENT_METER_OFFSET 1300 //4s Battery
217+
218+
#define USE_LED_STRIP
219+
#define WS2811_PIN PB10 //TIM2_CH3
220+
221+
// telemetry
222+
#define USE_SPEKTRUM_BIND
223+
#define BIND_PIN PA1 //UART4_RX_PIN
224+
225+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
226+
227+
#define TARGET_IO_PORTA 0xffff
228+
#define TARGET_IO_PORTB 0xffff
229+
#define TARGET_IO_PORTC 0xffff
230+
#define TARGET_IO_PORTD 0xffff
231+
#define TARGET_IO_PORTE 0xffff
232+
233+
#define MAX_PWM_OUTPUT_PORTS 12
234+
#define USE_DSHOT
235+
#define USE_ESC_SENSOR

0 commit comments

Comments
 (0)