Set blackbox file handler to NULL after closing file
[inav.git] / src / main / target / IFLIGHT_BLITZ_H7_PRO / target.h
blob23fde63466ccaa7f8f5688fa85d6144da7ccc623
1 /*
2 * This file is part of INAV.
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.
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.
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/>.
19 #pragma once
21 #define TARGET_BOARD_IDENTIFIER "IB7P"
23 #define USBD_PRODUCT_STRING "IFLIGHT_BLITZ_H7_PRO"
25 #define USE_TARGET_CONFIG
27 #define LED0 PE3
28 #define LED1 PE4
30 #define BEEPER PA15
31 #define BEEPER_INVERTED
33 // SPI1
34 #define USE_SPI
35 #define USE_SPI_DEVICE_1
36 #define SPI1_SCK_PIN PA5
37 #define SPI1_MISO_PIN PA6
38 #define SPI1_MOSI_PIN PD7
40 // SPI2
41 #define USE_SPI_DEVICE_2
42 #define SPI2_SCK_PIN PB13
43 #define SPI2_MISO_PIN PB14
44 #define SPI2_MOSI_PIN PB15
46 // SPI3 - not connected
47 #define USE_SPI_DEVICE_3
48 #define SPI3_SCK_PIN PB3
49 #define SPI3_MISO_PIN PB4
50 #define SPI3_MOSI_PIN PB5
52 // SPI4 - GYRO2 not used in INAV
53 #define USE_SPI_DEVICE_4
54 #define SPI4_SCK_PIN PE12
55 #define SPI4_MISO_PIN PE13
56 #define SPI4_MOSI_PIN PE14
58 // ICM42605
59 #define USE_IMU_ICM42605
60 #define IMU_ICM42605_ALIGN CW0_DEG
61 #define ICM42605_SPI_BUS BUS_SPI1
62 #define ICM42605_CS_PIN PC15
64 // OSD
65 #define USE_MAX7456
66 #define MAX7456_SPI_BUS BUS_SPI2
67 #define MAX7456_CS_PIN PB12
69 // I2C
70 #define USE_I2C
71 #define USE_I2C_DEVICE_1
72 #define I2C1_SCL PB6
73 #define I2C1_SDA PB7
75 #define USE_I2C_DEVICE_2
76 #define I2C2_SCL PB10
77 #define I2C2_SDA PB11
79 #define USE_BARO
80 #define BARO_I2C_BUS BUS_I2C2
81 #define USE_BARO_ALL
83 #define USE_MAG
84 #define MAG_I2C_BUS BUS_I2C1
85 #define USE_MAG_ALL
87 #define TEMPERATURE_I2C_BUS BUS_I2C2
88 #define PITOT_I2C_BUS BUS_I2C2
90 #define USE_RANGEFINDER
91 #define RANGEFINDER_I2C_BUS BUS_I2C1
93 // *************** UART *****************************
94 #define USE_VCP
96 #define USE_UART1
97 #define UART1_TX_PIN PA9
98 #define UART1_RX_PIN PA10
100 #define USE_UART2
101 #define UART2_TX_PIN PD5
102 #define UART2_RX_PIN PD6
104 #define USE_UART3
105 #define UART3_TX_PIN PD8
106 #define UART3_RX_PIN PD9
108 #define USE_UART4
109 #define UART4_TX_PIN PB9
110 #define UART4_RX_PIN PB8
112 #define USE_UART6
113 #define UART6_TX_PIN PC6
114 #define UART6_RX_PIN PC7
116 #define USE_UART7
117 #define UART7_TX_PIN PE8
118 #define UART7_RX_PIN PE7
120 #define USE_UART8
121 #define UART8_TX_PIN PE1
122 #define UART8_RX_PIN PE0
124 #define SERIAL_PORT_COUNT 8
126 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
127 #define SERIALRX_PROVIDER SERIALRX_CRSF
128 #define SERIALRX_UART SERIAL_PORT_USART6
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
136 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
138 // *************** ADC *****************************
139 #define USE_ADC
140 #define ADC_INSTANCE ADC1
142 #define ADC_CHANNEL_1_PIN PC0 //ADC123 VBAT1
143 #define ADC_CHANNEL_2_PIN PC1 //ADC123 CURR1
144 #define ADC_CHANNEL_3_PIN PC5 //ADC12 RSSI
145 #define ADC_CHANNEL_4_PIN PC4 //ADC12 AirS
147 #define VBAT_ADC_CHANNEL ADC_CHN_1
148 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
149 #define RSSI_ADC_CHANNEL ADC_CHN_3
150 #define AIRSPEED_ADC_CHANNEL ADC_CHN_4
152 // *************** PINIO ***************************
153 #define USE_PINIO
154 #define USE_PINIOBOX
155 #define PINIO1_PIN PD10 // VTX power switcher
156 #define PINIO2_PIN PD11 // 2xCamera switcher
158 // *************** LEDSTRIP ************************
159 #define USE_LED_STRIP
160 #define WS2811_PIN PA8
162 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
163 #define CURRENT_METER_SCALE 212
164 #define VBAT_SCALE_DEFAULT 1135
166 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
168 #define TARGET_IO_PORTA 0xffff
169 #define TARGET_IO_PORTB 0xffff
170 #define TARGET_IO_PORTC 0xffff
171 #define TARGET_IO_PORTD 0xffff
172 #define TARGET_IO_PORTE 0xffff
174 #define MAX_PWM_OUTPUT_PORTS 12
175 #define USE_DSHOT
176 #define USE_ESC_SENSOR