Skip to content

Commit 987e5dc

Browse files
Arwaydayhaslinghuisot0totosirisinferi
authored
Add HWH7 (STM32H743) config – initial (#893)
* Add XROTOR-H7 (STM32H743) config – initial Add target config for HW XROTOR-H7 (STM32H743). Dual SPI ICM-42688P IMUs with external CLKIN; MPU6000 drivers kept for backward compatibility. Barometer on I2C2 (supports BMP280 / MS5611 / DPS310); external magnetometer can share I2C2. MAX7456 OSD on SPI3. SDMMC (SDIO 4-bit) Blackbox enabled and set as default device. Motors on TIM1/TIM4, servos on TIM15, beeper PWM 3 kHz (inverted), LED strip enabled. Default ports: CRSF on USART1, MSP-DisplayPort on USART2, MSP on USART3, GPS on UART4, ESC telemetry on USART8. ADC: VBAT/CURR plus two external channels; defaults set (voltage scale 110, current scale 170, offset −350). Complete timer map and DMA options provided to avoid conflicts; DSHOT bitbang enabled. SWD enabled; PINIO defaults for “CAM 1,2” and “SW_VTX”. * Rename board to HWH7; set MANUFACTURER_ID to HOWI - Optimized/standardized macros and defaults * Change file name to match BOARD_NAME * 更新 config.h Co-authored-by: Mark Haslinghuis <[email protected]> * Update configs/HWH7/config.h Due to the default orientation issue between the MPU6000 and the ICM42688P, the MPU6000 driver has been removed. Co-authored-by: ot0tot <[email protected]> * Update configs/HWH7/config.h Remove unused barometers Co-authored-by: ot0tot <[email protected]> * Update config.h Correct the erroneous current scale and offset values. * Update configs/HWH7/config.h Remove the macro that enables the ESC telemetry (feedback) interface by default. Co-authored-by: ot0tot <[email protected]> * Update configs/HWH7/config.h Remove the default voltage-divider (VBAT) ratio setting. Co-authored-by: ot0tot <[email protected]> * Update config.h Add essential comments to ease review. * Update config.h Fix incorrect macro definitions; optimize timer configuration. * 更新 config.h Co-authored-by: Osiris Inferi <[email protected]> * Update configs/HWH7/config.h Co-authored-by: ot0tot <[email protected]> * Update configs/HWH7/config.h Co-authored-by: ot0tot <[email protected]> * Update configs/HWH7/config.h Remove default receiver UART configuration. Co-authored-by: ot0tot <[email protected]> * Revert BEEPER PWM removal * Update configs/HWH7/config.h Delete useless macros. Co-authored-by: ot0tot <[email protected]> --------- Co-authored-by: Mark Haslinghuis <[email protected]> Co-authored-by: ot0tot <[email protected]> Co-authored-by: Osiris Inferi <[email protected]>
1 parent 217552c commit 987e5dc

File tree

1 file changed

+197
-0
lines changed

1 file changed

+197
-0
lines changed

configs/HWH7/config.h

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
/*
2+
- This file is part of Betaflight.
3+
*
4+
- Betaflight is free software. You can redistribute this software
5+
- and/or modify this software under the terms of the GNU General
6+
- Public License as published by the Free Software Foundation,
7+
- either version 3 of the License, or (at your option) any later
8+
- version.
9+
*
10+
- Betaflight is distributed in the hope that it will be useful,
11+
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
*
14+
- See the GNU General Public License for more details.
15+
*
16+
- You should have received a copy of the GNU General Public
17+
- License along with this software.
18+
*
19+
- If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
22+
#pragma once
23+
24+
#define FC_TARGET_MCU STM32H743
25+
#define BOARD_NAME HWH7
26+
#define MANUFACTURER_ID HOWI
27+
28+
//Gyroscope
29+
#define USE_ACC
30+
#define USE_ACC_SPI_ICM42688P
31+
32+
#define USE_GYRO
33+
#define USE_GYRO_SPI_ICM42688P
34+
35+
//barometer
36+
#define USE_BARO
37+
#define USE_BARO_DPS310
38+
#define BARO_I2C_INSTANCE I2CDEV_2
39+
#define MAG_I2C_INSTANCE I2CDEV_2
40+
41+
//LED
42+
#define LED0_PIN PB2
43+
#define LED_STRIP_PIN PA0 // TIM2_CH1/TIM5_CH1/UART4_TX
44+
45+
//BEEPER
46+
#define BEEPER_PIN PA1 // TIM2_CH2/TIM5_CH2
47+
#define BEEPER_PWM_HZ 3000
48+
#define BEEPER_INVERTED
49+
50+
//motor
51+
#define MOTOR1_PIN PE14 // TIM1_CH4
52+
#define MOTOR2_PIN PE13 // TIM1_CH3
53+
#define MOTOR3_PIN PE11 // TIM1_CH2
54+
#define MOTOR4_PIN PE9 // TIM1_CH1
55+
#define MOTOR5_PIN PD12 // TIM4_CH1
56+
#define MOTOR6_PIN PD13 // TIM4_CH2
57+
#define MOTOR7_PIN PD14 // TIM4_CH3
58+
#define MOTOR8_PIN PD15 // TIM4_CH4
59+
60+
//steering engine
61+
#define SERVO1_PIN PE5 // TIM15_CH1
62+
#define SERVO2_PIN PE6 // TIM15_CH2
63+
64+
//I2C
65+
#define I2C2_SCL_PIN PB10 // I2C2_SCL/TIM2_CH3/USART3_TX
66+
#define I2C2_SDA_PIN PB11 // I2C2_SDA/TIM2_CH4/USART3_RX
67+
68+
//ICM Clock
69+
#define USE_GYRO_CLKIN
70+
#define GYRO_1_CLKIN_PIN PB8 // TIM16_CH1,
71+
#define GYRO_2_CLKIN_PIN PB9 // TIM17_CH1
72+
73+
#define DEFAULT_GYRO_TO_USE GYRO_CONFIG_USE_GYRO_BOTH
74+
75+
//ICM-42688 (1)
76+
#define SPI1_SCK_PIN PA5
77+
#define SPI1_SDI_PIN PA6
78+
#define SPI1_SDO_PIN PA7
79+
80+
#define GYRO_1_CS_PIN PA4
81+
#define GYRO_1_EXTI_PIN PC14
82+
#define GYRO_1_SPI_INSTANCE SPI1
83+
#define GYRO_1_ALIGN CW0_DEG
84+
85+
//ICM-42688 (2)
86+
#define SPI2_SCK_PIN PD3
87+
#define SPI2_SDI_PIN PC2
88+
#define SPI2_SDO_PIN PC3
89+
90+
#define GYRO_2_CS_PIN PB12
91+
#define GYRO_2_EXTI_PIN PC15
92+
#define GYRO_2_SPI_INSTANCE SPI2
93+
#define GYRO_2_ALIGN CW270_DEG
94+
95+
//UART
96+
#define UART1_TX_PIN PA9 //
97+
#define UART1_RX_PIN PA10 //
98+
#define UART2_TX_PIN PA2 //
99+
#define UART2_RX_PIN PA3 //
100+
#define UART3_TX_PIN PD8 // BLUETOOTH
101+
#define UART3_RX_PIN PD9 //
102+
#define UART4_TX_PIN PD1 // 仅串口功能
103+
#define UART4_RX_PIN PD0 // 仅串口功能
104+
#define UART5_TX_PIN PB6 //
105+
#define UART5_RX_PIN PB5 //
106+
#define UART6_TX_PIN PC6 //
107+
#define UART6_RX_PIN PC7 //
108+
#define UART7_TX_PIN PE8 //
109+
#define UART7_RX_PIN PE7 //
110+
#define UART8_TX_PIN PE1 //
111+
#define UART8_RX_PIN PE0 //
112+
113+
//AT7456E
114+
#define USE_MAX7456
115+
#define SPI3_SCK_PIN PB3
116+
#define SPI3_SDI_PIN PB4
117+
#define SPI3_SDO_PIN PD6
118+
#define MAX7456_SPI_CS_PIN PA15
119+
#define MAX7456_SPI_INSTANCE SPI3
120+
121+
//Flash external/SDMMC
122+
#define USE_SDCARD
123+
#define SDCARD_DETECT_PIN NONE
124+
#define SDIO_DEVICE SDIODEV_1
125+
#define SDIO_USE_4BIT 1
126+
127+
#define SDIO_CK_PIN PC12
128+
#define SDIO_CMD_PIN PD2
129+
#define SDIO_D0_PIN PC8
130+
#define SDIO_D1_PIN PC9
131+
#define SDIO_D2_PIN PC10
132+
#define SDIO_D3_PIN PC11
133+
134+
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_SDCARD
135+
136+
//ADC
137+
#define ADC_VBAT_PIN PC0 // ADC123_INP10,
138+
#define ADC_CURR_PIN PC1 // ADC123_INP11,
139+
#define ADC_EXTERNAL1_PIN PC4 // ADC12_INP4,
140+
#define ADC_EXTERNAL2_PIN PC5 // ADC12_INP8, CU2
141+
142+
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
143+
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
144+
#define DEFAULT_CURRENT_METER_SCALE 117
145+
146+
// Debug
147+
#define USE_SWDIO_PIN PA13
148+
#define USE_SWCLK_PIN PA14
149+
150+
//TIME MAP
151+
#define TIMER_PIN_MAPPING \
152+
TIMER_PIN_MAP(0, MOTOR1_PIN, 1, 1) \
153+
TIMER_PIN_MAP(1, MOTOR2_PIN, 1, 2) \
154+
TIMER_PIN_MAP(2, MOTOR3_PIN, 1, 3) \
155+
TIMER_PIN_MAP(3, MOTOR4_PIN, 1, 4) \
156+
TIMER_PIN_MAP(4, MOTOR5_PIN, 1, 5) \
157+
TIMER_PIN_MAP(5, MOTOR6_PIN, 1, 6) \
158+
TIMER_PIN_MAP(6, MOTOR7_PIN, 1, 7) \
159+
TIMER_PIN_MAP(7, MOTOR8_PIN, 1, -1) \
160+
TIMER_PIN_MAP(8, SERVO1_PIN, 1, -1) \
161+
TIMER_PIN_MAP(9, SERVO2_PIN, 1, -1) \
162+
TIMER_PIN_MAP(10, GYRO_1_CLKIN_PIN, 1, -1) \
163+
TIMER_PIN_MAP(11, GYRO_2_CLKIN_PIN, 1, -1) \
164+
TIMER_PIN_MAP(12, BEEPER_PIN, 2, -1) \
165+
TIMER_PIN_MAP(13, LED_STRIP_PIN, 1, 0)
166+
167+
#define DEFAULT_DSHOT_BITBANG DSHOT_BITBANG_ON
168+
169+
//DMA
170+
#define TIMUP1_DMA_OPT 8
171+
#define TIMUP4_DMA_OPT 9
172+
#define ADC1_DMA_OPT 11
173+
#define ADC3_DMA_OPT 12
174+
175+
//Default Pin switch
176+
#define PINIO1_PIN PE2
177+
#define PINIO1_BOX 40
178+
#define BOX_USER1_NAME "CAM 1,2"
179+
180+
#define PINIO2_PIN PE4
181+
#define PINIO2_BOX 41
182+
#define PINIO2_CONFIG 129
183+
#define BOX_USER2_NAME "SW_VTX"
184+
185+
#define PINIO3_PIN PD10
186+
#define PINIO3_BOX 0
187+
#define PINIO3_CONFIG 129
188+
189+
//Default Module
190+
#define SERIALRX_PROVIDER SERIALRX_CRSF
191+
#ifdef USE_OSD_HD
192+
#define MSP_DISPLAYPORT_UART SERIAL_PORT_USART2
193+
#endif
194+
#define MSP_UART SERIAL_PORT_USART3
195+
#ifdef USE_GPS
196+
#define GPS_UART SERIAL_PORT_UART4
197+
#endif

0 commit comments

Comments
 (0)