Skip to content

Commit 16d2b10

Browse files
Merge pull request #11279 from sunyanmeng963/inav9.0-add-blueberryH743
Add target BLUEBERRYH743
2 parents f69f353 + a66b346 commit 16d2b10

File tree

4 files changed

+298
-0
lines changed

4 files changed

+298
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target_stm32h743xi(BLUEBERRYH743)
2+
target_stm32h743xi(BLUEBERRYH743HD)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
#include "io/serial.h"
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+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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_mpu6000, DEVHW_MPU6000, MPU6000_SPI_BUS, MPU6000_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN);
30+
BUSDEV_REGISTER_SPI_TAG(busdev_icm42688, DEVHW_ICM42605, MPU6000_SPI_BUS, MPU6000_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN);
31+
BUSDEV_REGISTER_SPI_TAG(busdev_icm20602, DEVHW_MPU6500, MPU6500_SPI_BUS, MPU6500_CS_PIN, NONE, 1, DEVFLAGS_NONE, IMU_MPU6500_ALIGN);
32+
BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 2, DEVFLAGS_NONE, IMU_ICM42605_ALIGN);
33+
34+
timerHardware_t timerHardware[] = {
35+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1
36+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 1), // S2
37+
38+
DEF_TIM(TIM5, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3
39+
DEF_TIM(TIM5, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 3), // S4
40+
DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 4), // S5
41+
DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 5), // S6
42+
43+
DEF_TIM(TIM4, CH1, PD12, TIM_USE_OUTPUT_AUTO, 0, 6), // S7
44+
DEF_TIM(TIM4, CH2, PD13, TIM_USE_OUTPUT_AUTO, 0, 7), // S8
45+
DEF_TIM(TIM4, CH3, PD14, TIM_USE_OUTPUT_AUTO, 0, 0), // S9
46+
DEF_TIM(TIM4, CH4, PD15, TIM_USE_OUTPUT_AUTO, 0, 0), // S10 DMA_NONE
47+
48+
DEF_TIM(TIM15, CH1, PE5, TIM_USE_OUTPUT_AUTO, 0, 0), // S11
49+
DEF_TIM(TIM15, CH2, PE6, TIM_USE_OUTPUT_AUTO, 0, 0), // S12 DMA_NONE
50+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_BEEPER, 0, 0), // BEEPER PWM
51+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 9), // LED_2812
52+
53+
};
54+
55+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
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+
19+
#pragma once
20+
21+
#define TARGET_BOARD_IDENTIFIER "BB43"
22+
23+
#if defined(BLUEBERRYH743HD)
24+
#define USBD_PRODUCT_STRING "BLUEBERRYH743HD"
25+
#else
26+
#define USBD_PRODUCT_STRING "BLUEBERRYH743"
27+
#endif
28+
29+
#define USE_TARGET_CONFIG
30+
31+
#define LED0 PE3
32+
#define LED1 PE4
33+
34+
#define BEEPER PA15
35+
#define BEEPER_INVERTED
36+
37+
// *************** IMU generic ***********************
38+
#define USE_DUAL_GYRO
39+
#define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
40+
41+
// *************** SPI1 IMU0 MPU6000 ****************
42+
#define USE_SPI
43+
#define USE_SPI_DEVICE_1
44+
#define SPI1_SCK_PIN PA5
45+
#define SPI1_MISO_PIN PA6
46+
#define SPI1_MOSI_PIN PD7
47+
48+
#define USE_IMU_MPU6000
49+
50+
#define IMU_MPU6000_ALIGN CW0_DEG_FLIP
51+
#define MPU6000_SPI_BUS BUS_SPI1
52+
#define MPU6000_CS_PIN PC15
53+
54+
// *************** SPI4 IMU1 ICM20602 **************
55+
#define USE_SPI_DEVICE_4
56+
#define SPI4_SCK_PIN PE12
57+
#define SPI4_MISO_PIN PE13
58+
#define SPI4_MOSI_PIN PE14
59+
60+
#define USE_IMU_MPU6500
61+
62+
#define IMU_MPU6500_ALIGN CW0_DEG_FLIP
63+
#define MPU6500_SPI_BUS BUS_SPI4
64+
#define MPU6500_CS_PIN PE11
65+
66+
// *************** SPI4 IMU2 ICM42605 **************
67+
#define USE_IMU_ICM42605
68+
69+
#define IMU_ICM42605_ALIGN CW90_DEG_FLIP
70+
#define ICM42605_SPI_BUS BUS_SPI4
71+
#define ICM42605_CS_PIN PC13
72+
73+
// *************** SPI2 OSD ***********************
74+
#define USE_SPI_DEVICE_2
75+
#define SPI2_SCK_PIN PB13
76+
#define SPI2_MISO_PIN PB14
77+
#define SPI2_MOSI_PIN PB15
78+
79+
#if defined(BLUEBERRYH743)
80+
#define USE_MAX7456
81+
#define MAX7456_SPI_BUS BUS_SPI2
82+
#define MAX7456_CS_PIN PB12
83+
#endif
84+
85+
// *************** SPI3 SPARE for external RM3100 ***********
86+
#define USE_SPI_DEVICE_3
87+
#define SPI3_SCK_PIN PB3
88+
#define SPI3_MISO_PIN PB4
89+
#define SPI3_MOSI_PIN PB5
90+
91+
#define USE_MAG_RM3100
92+
#define RM3100_CS_PIN PE2 //CS2 pad
93+
// PD4 //CS1 pad
94+
#define RM3100_SPI_BUS BUS_SPI3
95+
96+
// *************** I2C /Baro/Mag *********************
97+
#define USE_I2C
98+
#define USE_I2C_DEVICE_1
99+
#define I2C1_SCL PB6
100+
#define I2C1_SDA PB7
101+
102+
#define USE_I2C_DEVICE_2
103+
#define I2C2_SCL PB10
104+
#define I2C2_SDA PB11
105+
106+
#define USE_BARO
107+
#define BARO_I2C_BUS BUS_I2C2
108+
#define USE_BARO_BMP280
109+
#define USE_BARO_MS5611
110+
#define USE_BARO_DPS310
111+
#define USE_BARO_SPL06
112+
113+
#define USE_MAG
114+
#define MAG_I2C_BUS BUS_I2C1
115+
#define USE_MAG_ALL
116+
117+
#define TEMPERATURE_I2C_BUS BUS_I2C2
118+
#define PITOT_I2C_BUS BUS_I2C2
119+
120+
#define USE_RANGEFINDER
121+
#define RANGEFINDER_I2C_BUS BUS_I2C1
122+
123+
// *************** UART *****************************
124+
#define USE_VCP
125+
126+
#define USE_UART1
127+
#define UART1_TX_PIN PA9
128+
#define UART1_RX_PIN PA10
129+
130+
#define USE_UART2
131+
#define UART2_TX_PIN PD5
132+
#define UART2_RX_PIN PD6
133+
134+
#define USE_UART3
135+
#define UART3_TX_PIN PD8
136+
#define UART3_RX_PIN PD9
137+
138+
#define USE_UART4
139+
#define UART4_TX_PIN PB9
140+
#define UART4_RX_PIN PB8
141+
142+
#define USE_UART6
143+
#define UART6_TX_PIN PC6
144+
#define UART6_RX_PIN PC7
145+
146+
#define USE_UART7
147+
#define UART7_TX_PIN PE8
148+
#define UART7_RX_PIN PE7
149+
150+
#define USE_UART8
151+
#define UART8_TX_PIN PE1
152+
#define UART8_RX_PIN PE0
153+
154+
155+
#define SERIAL_PORT_COUNT 8
156+
157+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
158+
#define SERIALRX_PROVIDER SERIALRX_CRSF
159+
#define SERIALRX_UART SERIAL_PORT_USART6
160+
161+
// *************** SDIO SD BLACKBOX*******************
162+
#define USE_SDCARD
163+
#define USE_SDCARD_SDIO
164+
#define SDCARD_SDIO_DEVICE SDIODEV_1
165+
#define SDCARD_SDIO_4BIT
166+
167+
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
168+
169+
// *************** ADC *****************************
170+
#define USE_ADC
171+
#define ADC_INSTANCE ADC1
172+
173+
#define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1
174+
#define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1
175+
#define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI
176+
#define ADC_CHANNEL_4_PIN PC4 //ADC12 AirS
177+
#define ADC_CHANNEL_5_PIN PA4 //ADC12 VB2
178+
#define ADC_CHANNEL_6_PIN PA7 //ADC12 CU2
179+
180+
#define VBAT_ADC_CHANNEL ADC_CHN_1
181+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
182+
#define RSSI_ADC_CHANNEL ADC_CHN_3
183+
#define AIRSPEED_ADC_CHANNEL ADC_CHN_4
184+
185+
// *************** PINIO ***************************
186+
#define USE_PINIO
187+
#define USE_PINIOBOX
188+
#define PINIO1_PIN PD10 // VTX power switcher
189+
#define PINIO2_PIN PD11 // 2xCamera switcher
190+
191+
// *************** LEDSTRIP ************************
192+
#define USE_LED_STRIP
193+
#define WS2811_PIN PA8
194+
195+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
196+
#define CURRENT_METER_SCALE 250
197+
#define CURRENT_METER_OFFSET 400
198+
199+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
200+
201+
#define TARGET_IO_PORTA (0xffff & ~(BIT(14) | BIT(13)))
202+
#define TARGET_IO_PORTB 0xffff
203+
#define TARGET_IO_PORTC 0xffff
204+
#define TARGET_IO_PORTD 0xffff
205+
#define TARGET_IO_PORTE 0xffff
206+
207+
#define MAX_PWM_OUTPUT_PORTS 15
208+
#define USE_DSHOT
209+
#define USE_ESC_SENSOR
210+

0 commit comments

Comments
 (0)