Skip to content

Commit 0e90d05

Browse files
committed
New Target:XMAV_APH743V2
1 parent 76809d7 commit 0e90d05

4 files changed

Lines changed: 233 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32h743xi(XMAV_APH743V2)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
#include "platform.h"
20+
#include "config/config_master.h"
21+
#include "config/feature.h"
22+
#include "io/serial.h"
23+
#include "fc/config.h"
24+
#include "sensors/gyro.h"
25+
26+
27+
void targetConfiguration(void)
28+
{
29+
serialConfigMutable()->portConfigs[1].functionMask = FUNCTION_GPS;
30+
serialConfigMutable()->portConfigs[2].functionMask = FUNCTION_MSP;
31+
serialConfigMutable()->portConfigs[2].msp_baudrateIndex = BAUD_57600;
32+
serialConfigMutable()->portConfigs[3].functionMask = FUNCTION_MSP_OSD;
33+
serialConfigMutable()->portConfigs[7].functionMask = FUNCTION_ESCSERIAL;
34+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 "drivers/bus.h"
21+
#include "drivers/io.h"
22+
#include "drivers/pinio.h"
23+
#include "drivers/pwm_mapping.h"
24+
#include "drivers/sensor.h"
25+
#include "drivers/timer.h"
26+
#include "platform.h"
27+
28+
timerHardware_t timerHardware[] = {
29+
DEF_TIM(TIM1, CH1, PE9, TIM_USE_OUTPUT_AUTO, 0, 0), // S1
30+
DEF_TIM(TIM1, CH2, PE11, TIM_USE_OUTPUT_AUTO, 0, 1), // S2
31+
DEF_TIM(TIM1, CH3, PE13, TIM_USE_OUTPUT_AUTO, 0, 2), // S3
32+
DEF_TIM(TIM1, CH4, PE14, TIM_USE_OUTPUT_AUTO, 0, 3), // S4
33+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 4), // S5
34+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 5), // S6
35+
DEF_TIM(TIM2, CH3, PB10, TIM_USE_OUTPUT_AUTO, 0, 6), // S7
36+
DEF_TIM(TIM2, CH4, PB11, TIM_USE_OUTPUT_AUTO, 0, 7), // S8
37+
};
38+
39+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
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 "X743"
21+
22+
#define USBD_PRODUCT_STRING "AP-H743v2"
23+
24+
// *************** LED **********************
25+
#define LED0 PD15
26+
#define LED1 PD11
27+
#define LED2 PB15
28+
29+
// *************** SPI: Gyro & ACC & OSD **********************
30+
#define USE_SPI
31+
#define USE_SPI_DEVICE_1
32+
#define USE_SPI_DEVICE_3
33+
#define USE_SPI_DEVICE_4
34+
35+
#define SPI1_SCK_PIN PA5
36+
#define SPI1_MISO_PIN PA6
37+
#define SPI1_MOSI_PIN PA7
38+
39+
#define SPI3_SCK_PIN PB3
40+
#define SPI3_MISO_PIN PB4
41+
#define SPI3_MOSI_PIN PB2
42+
43+
#define SPI4_SCK_PIN PE2
44+
#define SPI4_MISO_PIN PE5
45+
#define SPI4_MOSI_PIN PE6
46+
47+
// #define USE_IMU_ICM42605
48+
// #define IMU_ICM42605_ALIGN CW0_DEG
49+
// #define ICM42605_SPI_BUS BUS_SPI4
50+
// #define ICM42605_CS_PIN PC13
51+
52+
#define USE_IMU_BMI088
53+
#define IMU_BMI088_ALIGN CW90_DEG
54+
#define BMI088_SPI_BUS BUS_SPI1
55+
#define BMI088_GYRO_CS_PIN PA3
56+
#define BMI088_ACC_CS_PIN PA2
57+
58+
#define USE_MAX7456
59+
#define MAX7456_SPI_BUS BUS_SPI3
60+
#define MAX7456_CS_PIN PA15
61+
62+
// *************** UART *****************************
63+
#define USE_VCP
64+
65+
#define USE_UART1
66+
#define UART1_RX_PIN PA10
67+
#define UART1_TX_PIN PA9
68+
69+
#define USE_UART2
70+
#define UART2_RX_PIN PD6
71+
#define UART2_TX_PIN PD5
72+
73+
#define USE_UART3
74+
#define UART3_RX_PIN PD9
75+
#define UART3_TX_PIN PD8
76+
77+
#define USE_UART4
78+
#define UART4_RX_PIN PB9
79+
#define UART4_TX_PIN PB8
80+
81+
#define USE_UART5
82+
#define UART5_RX_PIN PB12
83+
#define UART5_TX_PIN PB13
84+
#define INVERTER_PIN_UART5_RX PD14
85+
86+
#define USE_UART6
87+
#define UART6_RX_PIN PC7
88+
#define UART6_TX_PIN PC6
89+
90+
#define USE_UART7
91+
#define UART7_TX_PIN PE8
92+
#define UART7_RX_PIN PE7
93+
94+
#define USE_UART8
95+
#define UART8_RX_PIN PE0
96+
#define UART8_TX_PIN PE1
97+
98+
#define SERIAL_PORT_COUNT 9 //VCP, UART1, UART2, UART3, UART4, UART5, UART6, UART7, UART8
99+
100+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
101+
#define SERIALRX_PROVIDER SERIALRX_SBUS
102+
#define SERIALRX_UART SERIAL_PORT_USART5
103+
104+
// *************** I2C: BARO & MAG ****************************
105+
#define USE_I2C
106+
#define USE_I2C_DEVICE_1
107+
#define USE_I2C_DEVICE_4
108+
#define I2C1_SCL PB6
109+
#define I2C1_SDA PB7
110+
#define I2C4_SCL PD12
111+
#define I2C4_SDA PD13
112+
113+
#define USE_BARO
114+
#define USE_BARO_ALL
115+
#define BARO_I2C_BUS BUS_I2C1
116+
117+
#define USE_MAG
118+
#define MAG_I2C_BUS BUS_I2C1
119+
#define USE_MAG_ALL
120+
121+
#define TEMPERATURE_I2C_BUS BUS_I2C4
122+
#define PITOT_I2C_BUS BUS_I2C4
123+
124+
// *************** ENABLE OPTICAL FLOW & RANGEFINDER *****************************
125+
#define USE_RANGEFINDER
126+
#define USE_RANGEFINDER_MSP
127+
#define USE_OPFLOW
128+
#define USE_OPFLOW_MSP
129+
130+
// *************** SDIO SD BLACKBOX*******************
131+
#define USE_SDCARD
132+
#define USE_SDCARD_SDIO
133+
#define SDCARD_SDIO_DEVICE SDIODEV_1
134+
#define SDCARD_SDIO_4BIT
135+
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
136+
137+
// *************** ADC *****************************
138+
#define USE_ADC
139+
#define ADC_INSTANCE ADC1
140+
#define ADC_CHANNEL_4_PIN PC4
141+
#define ADC_CHANNEL_5_PIN PC5
142+
#define VBAT_ADC_CHANNEL ADC_CHN_4
143+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_5
144+
#define VBAT_SCALE_DEFAULT 1010
145+
#define CURRENT_METER_SCALE 402
146+
147+
#define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_CURRENT_METER | FEATURE_OSD | FEATURE_TELEMETRY)
148+
149+
#define USE_DSHOT
150+
#define USE_ESC_SENSOR
151+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
152+
153+
#define TARGET_IO_PORTA 0xffff
154+
#define TARGET_IO_PORTB 0xffff
155+
#define TARGET_IO_PORTC 0xffff
156+
#define TARGET_IO_PORTD 0xffff
157+
#define TARGET_IO_PORTE 0xffff
158+
159+
#define MAX_PWM_OUTPUT_PORTS 8

0 commit comments

Comments
 (0)