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/>.
20 #define TARGET_BOARD_IDENTIFIER "SS4D"
22 #define USBD_PRODUCT_STRING "SkystarsF405HD"
24 #define LED0 PC14 // green
25 #define LED1 PC15 // blue
28 #define BEEPER_INVERTED
30 // *************** Gyro & ACC **********************
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 MPU6000_SPI_BUS BUS_SPI1
40 #define MPU6000_CS_PIN PA4
42 #define USE_IMU_BMI270
43 #define BMI270_SPI_BUS BUS_SPI1
44 #define BMI270_CS_PIN PA4
46 #define USE_IMU_ICM42605
47 #define ICM42605_SPI_BUS BUS_SPI1
48 #define ICM42605_CS_PIN PA4
50 // *************** M25P256 flash ********************
52 #define USE_FLASH_M25P16
54 #define USE_SPI_DEVICE_3
55 #define SPI3_SCK_PIN PC10
56 #define SPI3_MISO_PIN PC11
57 #define SPI3_MOSI_PIN PB5
59 #define M25P16_SPI_BUS BUS_SPI3
60 #define M25P16_CS_PIN PA15
62 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
64 // *************** OSD & baro ***********************
65 #define USE_SPI_DEVICE_2
66 #define SPI2_SCK_PIN PB13
67 #define SPI2_MISO_PIN PB14
68 #define SPI2_MOSI_PIN PB15
71 #define MAX7456_SPI_BUS BUS_SPI2
72 #define MAX7456_CS_PIN PB12
75 #define USE_BARO_BMP280
76 #define BMP280_SPI_BUS BUS_SPI2
77 #define BMP280_CS_PIN PC5
79 // *************** UART *****************************
83 #define UART1_RX_PIN PA10
84 #define UART1_TX_PIN PA9
87 #define UART2_RX_PIN PA3
88 #define UART2_TX_PIN PA2
91 #define UART3_RX_PIN PB11
92 #define UART3_TX_PIN PB10
95 #define UART4_RX_PIN PA1
96 #define UART4_TX_PIN PA0
99 #define UART5_RX_PIN PD2
100 #define UART5_TX_PIN PC12
103 #define UART6_RX_PIN PC7
104 #define UART6_TX_PIN PC6
106 #define SERIAL_PORT_COUNT 7
108 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL
109 #define SERIALRX_PROVIDER SERIALRX_SBUS
110 #define SERIALRX_UART SERIAL_PORT_USART1
112 // *************** I2C ****************************
114 #define USE_I2C_DEVICE_1
118 #define DEFAULT_I2C_BUS BUS_I2C1
121 #define MAG_I2C_BUS DEFAULT_I2C_BUS
124 #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS
126 #define USE_RANGEFINDER
127 #define USE_RANGEFINDER_MSP
128 #define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS
130 #define PITOT_I2C_BUS DEFAULT_I2C_BUS
132 // *************** ADC *****************************
134 #define ADC_CHANNEL_1_PIN PC0
135 #define ADC_CHANNEL_2_PIN PC1
136 #define ADC_CHANNEL_3_PIN PC2
137 #define VBAT_ADC_CHANNEL ADC_CHN_1
138 #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
139 #define RSSI_ADC_CHANNEL ADC_CHN_3
141 #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY )
143 #define USE_LED_STRIP
144 #define WS2811_PIN PC8
146 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
148 #define TARGET_IO_PORTA 0xffff
149 #define TARGET_IO_PORTB 0xffff
150 #define TARGET_IO_PORTC 0xffff
151 #define TARGET_IO_PORTD 0xffff
154 #define USE_ESC_SENSOR
156 #if defined(SKYSTARSF405HD2) || defined(SKYSTARSF405AIO)
157 #define MAX_PWM_OUTPUT_PORTS 6
159 #define MAX_PWM_OUTPUT_PORTS 4
162 #if defined(SKYSTARSF405AIO)
163 #define IMU_MPU6000_ALIGN CW0_DEG
164 #define IMU_BMI270_ALIGN CW0_DEG
165 #define IMU_ICM42605_ALIGN CW0_DEG
167 #define IMU_MPU6000_ALIGN CW180_DEG_FLIP
168 #define IMU_BMI270_ALIGN CW180_DEG_FLIP
169 #define IMU_ICM42605_ALIGN CW180_DEG_FLIP