Set blackbox file handler to NULL after closing file
[inav.git] / src / main / target / SKYSTARSF405HD / target.h
blob9b9805084f2eb3391794f9ee5f08ca3061d0964b
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/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "SS4D"
22 #define USBD_PRODUCT_STRING "SkystarsF405HD"
24 #define LED0 PC14 // green
25 #define LED1 PC15 // blue
27 #define BEEPER PC13
28 #define BEEPER_INVERTED
30 // *************** Gyro & ACC **********************
31 #define USE_SPI
32 #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_MPU6000
39 #define IMU_MPU6000_ALIGN CW180_DEG_FLIP
40 #define MPU6000_SPI_BUS BUS_SPI1
41 #define MPU6000_CS_PIN PA4
43 #define USE_IMU_BMI270
44 #define IMU_BMI270_ALIGN CW180_DEG_FLIP
45 #define BMI270_SPI_BUS BUS_SPI1
46 #define BMI270_CS_PIN PA4
48 #define USE_IMU_ICM42605
49 #define IMU_ICM42605_ALIGN CW180_DEG_FLIP
50 #define ICM42605_SPI_BUS BUS_SPI1
51 #define ICM42605_CS_PIN PA4
53 // *************** M25P256 flash ********************
54 #define USE_FLASHFS
55 #define USE_FLASH_M25P16
57 #define USE_SPI_DEVICE_3
58 #define SPI3_SCK_PIN PC10
59 #define SPI3_MISO_PIN PC11
60 #define SPI3_MOSI_PIN PB5
62 #define M25P16_SPI_BUS BUS_SPI3
63 #define M25P16_CS_PIN PA15
65 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
67 // *************** OSD & baro ***********************
68 #define USE_SPI_DEVICE_2
69 #define SPI2_SCK_PIN PB13
70 #define SPI2_MISO_PIN PB14
71 #define SPI2_MOSI_PIN PB15
73 #define USE_MAX7456
74 #define MAX7456_SPI_BUS BUS_SPI2
75 #define MAX7456_CS_PIN PB12
77 #define USE_BARO
78 #define USE_BARO_BMP280
79 #define BMP280_SPI_BUS BUS_SPI2
80 #define BMP280_CS_PIN PC5
82 // *************** UART *****************************
83 #define USE_VCP
85 #define USE_UART1
86 #define UART1_RX_PIN PA10
87 #define UART1_TX_PIN PA9
89 #define USE_UART2
90 #define UART2_RX_PIN PA3
91 #define UART2_TX_PIN PA2
93 #define USE_UART3
94 #define UART3_RX_PIN PB11
95 #define UART3_TX_PIN PB10
97 #define USE_UART4
98 #define UART4_RX_PIN PA1
99 #define UART4_TX_PIN PA0
101 #define USE_UART5
102 #define UART5_RX_PIN PD2
103 #define UART5_TX_PIN PC12
105 #define USE_UART6
106 #define UART6_RX_PIN PC7
107 #define UART6_TX_PIN PC6
109 #define SERIAL_PORT_COUNT 7
111 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
112 #define SERIALRX_PROVIDER SERIALRX_SBUS
113 #define SERIALRX_UART SERIAL_PORT_USART1
115 // *************** I2C ****************************
116 #define USE_I2C
117 #define USE_I2C_DEVICE_1
118 #define I2C1_SCL PB8
119 #define I2C1_SDA PB9
121 #define DEFAULT_I2C_BUS BUS_I2C1
123 #define USE_MAG
124 #define MAG_I2C_BUS DEFAULT_I2C_BUS
125 #define USE_MAG_ALL
127 #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
129 #define USE_RANGEFINDER
130 #define USE_RANGEFINDER_MSP
131 #define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
133 #define PITOT_I2C_BUS DEFAULT_I2C_BUS
135 // *************** ADC *****************************
136 #define USE_ADC
137 #define ADC_CHANNEL_1_PIN PC0
138 #define ADC_CHANNEL_2_PIN PC1
139 #define ADC_CHANNEL_3_PIN PC2
140 #define VBAT_ADC_CHANNEL ADC_CHN_1
141 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
142 #define RSSI_ADC_CHANNEL ADC_CHN_3
144 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY )
146 #define USE_LED_STRIP
147 #define WS2811_PIN PC8
149 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
151 #define TARGET_IO_PORTA 0xffff
152 #define TARGET_IO_PORTB 0xffff
153 #define TARGET_IO_PORTC 0xffff
154 #define TARGET_IO_PORTD 0xffff
156 #define USE_DSHOT
157 #define USE_ESC_SENSOR
159 #if defined(SKYSTARSF405HD2)
160 #define MAX_PWM_OUTPUT_PORTS 6
161 #else
162 #define MAX_PWM_OUTPUT_PORTS 4
163 #endif