Skip to content

Commit 47e0527

Browse files
Merge pull request #10805 from sensei-hacker/brother-h743
Brother h743
2 parents 3a16b52 + 7f09524 commit 47e0527

File tree

4 files changed

+273
-0
lines changed

4 files changed

+273
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32h743xi(BROTHERHOBBYH743)
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 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 "fc/fc_msp_box.h"
23+
#include "fc/config.h"
24+
25+
#include "io/piniobox.h"
26+
27+
void targetConfiguration(void)
28+
{
29+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
30+
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
31+
beeperConfigMutable()->pwmMode = true;
32+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 <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+
#include "drivers/pinio.h"
27+
#include "drivers/sensor.h"
28+
29+
BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);
30+
BUSDEV_REGISTER_SPI_TAG(busdev_icm42605_2, DEVHW_ICM42605, ICM42605_SPI_BUS_2, ICM42605_CS_PIN_2, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN_2);
31+
32+
timerHardware_t timerHardware[] = {
33+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1
34+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 1), // S2
35+
36+
DEF_TIM(TIM5, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3
37+
DEF_TIM(TIM5, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 3), // S4
38+
DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 4), // S5
39+
DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 5), // S6
40+
41+
DEF_TIM(TIM4, CH1, PD12, TIM_USE_OUTPUT_AUTO, 0, 6), // S7
42+
DEF_TIM(TIM4, CH2, PD13, TIM_USE_OUTPUT_AUTO, 0, 7), // S8
43+
DEF_TIM(TIM4, CH3, PD14, TIM_USE_OUTPUT_AUTO, 0, 0), // S9
44+
DEF_TIM(TIM4, CH4, PD15, TIM_USE_OUTPUT_AUTO, 0, 0), // S10 DMA_NONE
45+
46+
DEF_TIM(TIM15, CH1, PE5, TIM_USE_OUTPUT_AUTO, 0, 0), // S11
47+
DEF_TIM(TIM15, CH2, PE6, TIM_USE_OUTPUT_AUTO, 0, 0), // S12 DMA_NONE
48+
49+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 9), // LED_2812
50+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_BEEPER, 0, 0), // BEEPER PWM
51+
};
52+
53+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
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 "BROT"
28+
#define USBD_PRODUCT_STRING "BROTHERHOBBYH743"
29+
30+
#define USE_TARGET_CONFIG
31+
32+
#define LED0 PE9
33+
#define LED1 PA7
34+
35+
#define BEEPER PA15
36+
#define BEEPER_INVERTED
37+
#define BEEPER_PWM_FREQUENCY 2000
38+
39+
// *************** IMU generic ***********************
40+
#define USE_DUAL_GYRO
41+
#define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
42+
43+
// *************** SPI1 IMU0 ICM42605 ****************
44+
#define USE_SPI
45+
#define USE_SPI_DEVICE_1
46+
#define SPI1_SCK_PIN PA5
47+
#define SPI1_MISO_PIN PA6
48+
#define SPI1_MOSI_PIN PD7
49+
50+
#define USE_IMU_ICM42605
51+
52+
#define IMU_ICM42605_ALIGN CW90_DEG
53+
#define ICM42605_SPI_BUS BUS_SPI1
54+
#define ICM42605_CS_PIN PC15
55+
56+
// *************** SPI4 IMU1 ICM42605 **************
57+
#define USE_SPI_DEVICE_4
58+
#define SPI4_SCK_PIN PE12
59+
#define SPI4_MISO_PIN PE13
60+
#define SPI4_MOSI_PIN PE14
61+
62+
#define USE_IMU_ICM42605
63+
64+
#define IMU_ICM42605_ALIGN_2 CW0_DEG
65+
#define ICM42605_SPI_BUS_2 BUS_SPI4
66+
#define ICM42605_CS_PIN_2 PE11
67+
68+
// *************** SPI2 OSD ***********************
69+
#define USE_SPI_DEVICE_2
70+
#define SPI2_SCK_PIN PB13
71+
#define SPI2_MISO_PIN PB14
72+
#define SPI2_MOSI_PIN PB15
73+
74+
#define USE_MAX7456
75+
#define MAX7456_SPI_BUS BUS_SPI2
76+
#define MAX7456_CS_PIN PB12
77+
78+
// *************** SPI3 ************************
79+
#define USE_SPI_DEVICE_3
80+
#define SPI3_SCK_PIN PB3
81+
#define SPI3_MISO_PIN PB4
82+
#define SPI3_MOSI_PIN PB5
83+
84+
// *************** I2C /Baro/Mag *********************
85+
#define USE_I2C
86+
#define USE_I2C_DEVICE_1
87+
#define I2C1_SCL PB6
88+
#define I2C1_SDA PB7
89+
90+
#define USE_I2C_DEVICE_2
91+
#define I2C2_SCL PB10
92+
#define I2C2_SDA PB11
93+
94+
#define USE_BARO
95+
#define BARO_I2C_BUS BUS_I2C2
96+
#define USE_BARO_ALL
97+
98+
#define USE_MAG
99+
#define MAG_I2C_BUS BUS_I2C1
100+
#define USE_MAG_ALL
101+
102+
#define TEMPERATURE_I2C_BUS BUS_I2C1
103+
#define PITOT_I2C_BUS BUS_I2C1
104+
105+
#define USE_RANGEFINDER
106+
#define RANGEFINDER_I2C_BUS BUS_I2C1
107+
// *************** UART *****************************
108+
#define USE_VCP
109+
110+
#define USE_UART1
111+
#define UART1_TX_PIN PA9
112+
#define UART1_RX_PIN PA10
113+
114+
#define USE_UART2
115+
#define UART2_TX_PIN PD5
116+
#define UART2_RX_PIN PD6
117+
118+
#define USE_UART3
119+
#define UART3_TX_PIN PD8
120+
#define UART3_RX_PIN PD9
121+
122+
#define USE_UART4
123+
#define UART4_TX_PIN PB9
124+
#define UART4_RX_PIN PB8
125+
126+
#define USE_UART6
127+
#define UART6_TX_PIN PC6
128+
#define UART6_RX_PIN PC7
129+
130+
#define USE_UART7
131+
#define UART7_TX_PIN PE8
132+
#define UART7_RX_PIN PE7
133+
134+
#define USE_UART8
135+
#define UART8_TX_PIN PE1
136+
#define UART8_RX_PIN PE0
137+
138+
#define SERIAL_PORT_COUNT 8
139+
140+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
141+
#define SERIALRX_PROVIDER SERIALRX_CRSF
142+
#define SERIALRX_UART SERIAL_PORT_USART2
143+
144+
// *************** SDIO SD BLACKBOX*******************
145+
#define USE_SDCARD
146+
#define USE_SDCARD_SDIO
147+
#define SDCARD_SDIO_DEVICE SDIODEV_1
148+
#define SDCARD_SDIO_4BIT
149+
150+
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
151+
152+
// *************** ADC *****************************
153+
#define USE_ADC
154+
#define ADC_INSTANCE ADC1
155+
156+
#define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1
157+
#define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1
158+
#define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI
159+
160+
#define VBAT_ADC_CHANNEL ADC_CHN_1
161+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
162+
#define RSSI_ADC_CHANNEL ADC_CHN_3
163+
164+
// *************** PINIO ***************************
165+
#define USE_PINIO
166+
#define USE_PINIOBOX
167+
#define PINIO1_PIN PD10
168+
#define PINIO2_PIN PD11
169+
170+
// *************** LEDSTRIP ************************
171+
#define USE_LED_STRIP
172+
#define WS2811_PIN PA8
173+
174+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
175+
#define CURRENT_METER_SCALE 250
176+
177+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
178+
179+
#define TARGET_IO_PORTA (0xffff & ~(BIT(14) | BIT(13)))
180+
#define TARGET_IO_PORTB 0xffff
181+
#define TARGET_IO_PORTC 0xffff
182+
#define TARGET_IO_PORTD 0xffff
183+
#define TARGET_IO_PORTE 0xffff
184+
185+
#define MAX_PWM_OUTPUT_PORTS 15
186+
#define USE_DSHOT
187+
#define USE_ESC_SENSOR

0 commit comments

Comments
 (0)