Skip to content

Commit f0fcd15

Browse files
authored
Merge pull request #10523 from iNavFlight/MrD_Add-targets-for-SEQUREH7-and-SEQUREH7V2
Add targets for SEQUREH7 and SEQUREH7V2
2 parents 17fc349 + a989944 commit f0fcd15

File tree

5 files changed

+244
-0
lines changed

5 files changed

+244
-0
lines changed

src/main/drivers/timer_def_stm32h7xx.h

+2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@
8787
#define DEF_TIM_DMA__BTCH_TIM15_CH2 NONE
8888

8989
#define DEF_TIM_DMA__BTCH_TIM16_CH1 DEF_TIM_DMA_FULL(DMA_REQUEST_TIM16_CH1)
90+
#define DEF_TIM_DMA__BTCH_TIM16_CH1N NONE
9091

9192
#define DEF_TIM_DMA__BTCH_TIM17_CH1 DEF_TIM_DMA_FULL(DMA_REQUEST_TIM17_CH1)
93+
#define DEF_TIM_DMA__BTCH_TIM17_CH1N NONE
9294

9395
// TIM_UP table
9496
#define DEF_TIM_DMA__BTCH_TIM1_UP DEF_TIM_DMA_FULL(DMA_REQUEST_TIM1_UP)
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target_stm32h743xi(SEQUREH7)
2+
target_stm32h743xi(SEQUREH7V2)

src/main/target/SEQUREH7/config.c

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
* This target has been autgenerated by bf2inav.py
18+
*/
19+
20+
#include <stdint.h>
21+
22+
#include "platform.h"
23+
24+
#include "fc/fc_msp_box.h"
25+
#include "fc/config.h"
26+
27+
#include "io/piniobox.h"
28+
29+
void targetConfiguration(void)
30+
{
31+
32+
}
33+

src/main/target/SEQUREH7/target.c

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
timerHardware_t timerHardware[] = {
30+
DEF_TIM(TIM3, CH1, PB4, TIM_USE_OUTPUT_AUTO, 0, 0), // S1
31+
DEF_TIM(TIM3, CH2, PB5, TIM_USE_OUTPUT_AUTO, 0, 1), // S2
32+
// DEF_TIM(TIM1, CH2N, PB0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3 - Timer used by LED
33+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3
34+
// DEF_TIM(TIM8, CH2N, PB0, TIM_USE_OUTPUT_AUTO, 0, 2), // S3
35+
// DEF_TIM(TIM1, CH3N, PB1, TIM_USE_OUTPUT_AUTO, 0, 3), // S4 - Timer used by LED
36+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 3), // S4
37+
// DEF_TIM(TIM8, CH3N, PB1, TIM_USE_OUTPUT_AUTO, 0, 3), // S4
38+
39+
DEF_TIM(TIM16, CH1N, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S5 // No DMA
40+
///DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S5 - Timer used by beeper - BF Timer // No DMA
41+
DEF_TIM(TIM17, CH1N, PB7, TIM_USE_OUTPUT_AUTO, 0, 0), // S6 // No DMA
42+
///DEF_TIM(TIM4, CH2, PB7, TIM_USE_OUTPUT_AUTO, 0, 0), // S6 - Timer used by beeper - BF Timer // No DMA
43+
DEF_TIM(TIM2, CH3, PB10, TIM_USE_OUTPUT_AUTO, 0, 0), // S7 // No DMA
44+
DEF_TIM(TIM2, CH4, PB11, TIM_USE_OUTPUT_AUTO, 0, 0), // S8 // No DMA
45+
46+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 0), // LED_2812
47+
DEF_TIM(TIM4, CH4, PD15, TIM_USE_BEEPER, 0, 0), // BEEPER PWM
48+
};
49+
50+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

src/main/target/SEQUREH7/target.h

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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+
#pragma once
19+
20+
#define USE_TARGET_CONFIG
21+
22+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY )
23+
24+
#if defined(SEQUREH7V2)
25+
#define TARGET_BOARD_IDENTIFIER "SQH7V2"
26+
#define USBD_PRODUCT_STRING "SEQUREH7V2"
27+
#else
28+
#define TARGET_BOARD_IDENTIFIER "SQH7"
29+
#define USBD_PRODUCT_STRING "SEQUREH7"
30+
#endif
31+
32+
// Beeper
33+
#define USE_BEEPER
34+
#define BEEPER PD15
35+
#define BEEPER_INVERTED
36+
37+
// Leds
38+
#define USE_LED_STRIP
39+
#define WS2811_PIN PA8
40+
#define LED0 PC13
41+
42+
// UARTs
43+
#define USB_IO
44+
#define USE_VCP
45+
46+
#define USE_UART1
47+
#define UART1_RX_PIN PA10
48+
#define UART1_TX_PIN PA9
49+
50+
#define USE_UART2
51+
#define UART2_RX_PIN PA3
52+
#define UART2_TX_PIN PA2
53+
54+
#define USE_UART4
55+
#define UART4_RX_PIN PA1
56+
#define UART4_TX_PIN PA0
57+
58+
#define USE_UART6
59+
#define UART6_RX_PIN PC7
60+
#define UART6_TX_PIN PC6
61+
62+
#define USE_UART7
63+
#define UART7_RX_PIN PE7
64+
#define UART7_TX_PIN PE8
65+
66+
#define USE_UART8 // ESC telemetry
67+
#define UART8_RX_PIN PE0
68+
#define UART8_TX_PIN PE0
69+
70+
#define SERIAL_PORT_COUNT 7
71+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
72+
#define SERIALRX_PROVIDER SERIALRX_CRSF
73+
74+
// SPI
75+
#define USE_SPI
76+
77+
#define USE_SPI_DEVICE_1
78+
#define SPI1_SCK_PIN PA5
79+
#define SPI1_MISO_PIN PA6
80+
#define SPI1_MOSI_PIN PA7
81+
82+
#define USE_SPI_DEVICE_2
83+
#define SPI2_SCK_PIN PB13
84+
#define SPI2_MISO_PIN PB14
85+
#define SPI2_MOSI_PIN PB15
86+
87+
#define USE_SPI_DEVICE_3
88+
#define SPI3_SCK_PIN PC10
89+
#define SPI3_MISO_PIN PC11
90+
#define SPI3_MOSI_PIN PC12
91+
92+
// I2C
93+
#define USE_I2C
94+
#define USE_I2C_DEVICE_1
95+
#define I2C1_SCL PB8
96+
#define I2C1_SDA PB9
97+
98+
// MAG
99+
#define USE_MAG
100+
#define USE_MAG_ALL
101+
102+
// ADC
103+
#define USE_ADC
104+
#define ADC_INSTANCE ADC3
105+
106+
#define ADC_CHANNEL_1_PIN PC3
107+
#define ADC_CHANNEL_2_PIN PC2
108+
109+
#define VBAT_ADC_CHANNEL ADC_CHN_1
110+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
111+
112+
#define CURRENT_METER_SCALE 1052
113+
114+
// Gyro & ACC
115+
#if defined(SEQUREH7V2)
116+
#define USE_IMU_ICM42605 // ICM42688P
117+
#define ICM42605_CS_PIN PB12
118+
#define ICM42605_SPI_BUS BUS_SPI2
119+
#define IMU_ICM42605_ALIGN CW90_DEG
120+
#else
121+
#define USE_IMU_MPU6000
122+
#define MPU6000_CS_PIN PB12
123+
#define MPU6000_SPI_BUS BUS_SPI2
124+
#define IMU_MPU6000_ALIGN CW0_DEG
125+
#endif
126+
127+
// BARO
128+
#define USE_BARO
129+
#define USE_BARO_ALL
130+
#define BARO_I2C_BUS BUS_I2C1
131+
132+
// OSD
133+
#define USE_MAX7456
134+
#define MAX7456_CS_PIN PA4
135+
#define MAX7456_SPI_BUS BUS_SPI1
136+
137+
// Blackbox
138+
#define USE_FLASHFS
139+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
140+
141+
#define USE_FLASH_M25P16
142+
#define M25P16_SPI_BUS BUS_SPI3
143+
#define M25P16_CS_PIN PA15
144+
145+
// Others
146+
#define MAX_PWM_OUTPUT_PORTS 8
147+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
148+
#define USE_DSHOT
149+
#define USE_ESC_SENSOR
150+
151+
#define TARGET_IO_PORTA 0xffff
152+
#define TARGET_IO_PORTB 0xffff
153+
#define TARGET_IO_PORTC 0xffff
154+
#define TARGET_IO_PORTD 0xffff
155+
#define TARGET_IO_PORTE 0xffff
156+
#define TARGET_IO_PORTF 0xffff
157+
#define TARGET_IO_PORTG 0xffff

0 commit comments

Comments
 (0)