Set blackbox file handler to NULL after closing file
[inav.git] / src / main / target / FLYCOLORF7MINI / target.h
blob938913d648872f93dced119e492e12dca2b78093
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 "FL7M"
22 #define USBD_PRODUCT_STRING "Flycolor F7 Mini"
24 #define LED0 PC15
26 #define BEEPER PC14
27 #define BEEPER_INVERTED
29 // *************** SPI1 Gyro & ACC *******************
30 #define USE_TARGET_IMU_HARDWARE_DESCRIPTORS
32 #define USE_SPI
33 #define USE_SPI_DEVICE_1
34 #define SPI1_SCK_PIN PA5
35 #define SPI1_MISO_PIN PA6
36 #define SPI1_MOSI_PIN PA7
38 #define USE_IMU_MPU6500
39 #define IMU_MPU6500_ALIGN CW180_DEG_FLIP
40 #define MPU6500_CS_PIN PA4
41 #define MPU6500_SPI_BUS BUS_SPI1
43 // *************** I2C /Baro/Mag *********************
44 #define USE_I2C
45 #define USE_I2C_DEVICE_1
46 #define I2C1_SCL PB6
47 #define I2C1_SDA PB7
49 #define USE_I2C_DEVICE_2
50 #define I2C2_SCL PB10
51 #define I2C2_SDA PB11
53 #define USE_BARO
54 #define BARO_I2C_BUS BUS_I2C1
55 #define USE_BARO_BMP280
56 #define USE_BARO_MS5611
57 #define USE_BARO_DPS310
59 #define USE_MAG
60 #define MAG_I2C_BUS BUS_I2C2
61 #define USE_MAG_ALL
63 #define TEMPERATURE_I2C_BUS BUS_I2C2
64 #define PITOT_I2C_BUS BUS_I2C2
66 #define USE_RANGEFINDER
67 #define RANGEFINDER_I2C_BUS BUS_I2C2
69 // *************** SPI2 OSD ***********************
70 #define USE_SPI_DEVICE_2
71 #define SPI2_SCK_PIN PB13
72 #define SPI2_MISO_PIN PB14
73 #define SPI2_MOSI_PIN PB15
75 #define USE_MAX7456
76 #define MAX7456_SPI_BUS BUS_SPI2
77 #define MAX7456_CS_PIN PB12
79 // *************** SPI3 SD BLACKBOX*******************
80 #define USE_SPI_DEVICE_3
81 #define SPI3_SCK_PIN PC10
82 #define SPI3_MISO_PIN PC11
83 #define SPI3_MOSI_PIN PB5
85 #define USE_FLASHFS
86 #define USE_FLASH_M25P16
87 #define M25P16_SPI_BUS BUS_SPI3
88 #define M25P16_CS_PIN PC13
89 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
91 // *************** UART *****************************
92 #define USE_VCP
94 #define USE_UART1
95 #define UART1_TX_PIN PA9
96 #define UART1_RX_PIN PA10
98 #define USE_UART2
99 #define UART2_TX_PIN PA2
100 #define UART2_RX_PIN PA3
102 #define USE_UART4
103 #define UART4_TX_PIN PA0
104 #define UART4_RX_PIN PA1
106 #define USE_UART5
107 #define UART5_TX_PIN PC12
108 #define UART5_RX_PIN PD2
110 #define USE_UART6
111 #define UART6_TX_PIN PC6
112 #define UART6_RX_PIN PC7
114 #define SERIAL_PORT_COUNT 6
116 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
117 #define SERIALRX_PROVIDER SERIALRX_SBUS
118 #define SERIALRX_UART SERIAL_PORT_USART4
120 // *************** ADC *****************************
121 #define USE_ADC
122 #define ADC_INSTANCE ADC1
123 #define ADC1_DMA_STREAM DMA2_Stream0
125 #define ADC_CHANNEL_1_PIN PC1
126 #define ADC_CHANNEL_2_PIN PC2
127 #define ADC_CHANNEL_3_PIN PC0
129 #define VBAT_ADC_CHANNEL ADC_CHN_1
130 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_3
131 #define RSSI_ADC_CHANNEL ADC_CHN_2
133 // *************** PINIO ***************************
134 #define USE_PINIO
135 #define USE_PINIOBOX
136 #define PINIO1_PIN PB8
137 #define PINIO1_FLAGS PINIO_FLAGS_INVERTED
139 // *************** LEDSTRIP ************************
140 #define USE_LED_STRIP
141 #define WS2811_PIN PA8
143 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
144 #define CURRENT_METER_SCALE 250
145 #define CURRENT_METER_OFFSET 0
147 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
149 #define TARGET_IO_PORTA 0xffff
150 #define TARGET_IO_PORTB 0xffff
151 #define TARGET_IO_PORTC 0xffff
152 #define TARGET_IO_PORTD 0xffff
154 #define MAX_PWM_OUTPUT_PORTS 6
155 #define USE_DSHOT
156 #define USE_SERIALSHOT
157 #define USE_ESC_SENSOR