2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #define TARGET_BOARD_IDENTIFIER "SP7N"
24 #define USBD_PRODUCT_STRING "SPRacingH7NANO"
26 #define USE_TARGET_CONFIG
28 #define USE_SPRACING_PERSISTENT_RTC_WORKAROUND
33 #define BEEPER_PIN PD7
34 #define BEEPER_INVERTED
36 // Force two buttons to look at the single button so config reset on button works
38 #define BUTTON_A_PIN PE4
39 #define BUTTON_A_PIN_INVERTED // Active high
40 #define BUTTON_B_PIN PE4
41 #define BUTTON_B_PIN_INVERTED // Active high
44 #define USE_QUADSPI_DEVICE_1
46 #define QUADSPI1_SCK_PIN PB2
48 #define QUADSPI1_BK1_IO0_PIN PD11
49 #define QUADSPI1_BK1_IO1_PIN PD12
50 #define QUADSPI1_BK1_IO2_PIN PE2
51 #define QUADSPI1_BK1_IO3_PIN PD13
52 #define QUADSPI1_BK1_CS_PIN NONE
54 #define QUADSPI1_BK2_IO0_PIN PE7
55 #define QUADSPI1_BK2_IO1_PIN PE8
56 #define QUADSPI1_BK2_IO2_PIN PE9
57 #define QUADSPI1_BK2_IO3_PIN PE10
58 #define QUADSPI1_BK2_CS_PIN PB10
60 #define QUADSPI1_MODE QUADSPI_MODE_BK2_ONLY
61 #define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_NONE | QUADSPI_BK2_CS_SOFTWARE | QUADSPI_CS_MODE_SEPARATE)
63 #define USE_FLASH_CHIP
64 #define CONFIG_IN_EXTERNAL_FLASH
65 //#define CONFIG_IN_SDCARD
66 //#define CONFIG_IN_RAM
67 #if !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_SDCARD) && !defined(CONFIG_IN_EXTERNAL_FLASH)
68 #error "EEPROM storage location not defined"
74 #define UART1_RX_PIN PB15
75 #define UART1_TX_PIN PB14
78 #define UART2_RX_PIN NONE
79 #define UART2_TX_PIN PD5 // TX pin is bidirectional.
82 #define UART3_RX_PIN PD9
83 #define UART3_TX_PIN PD8
86 #define UART4_RX_PIN PD0
87 #define UART4_TX_PIN PD1
90 #define UART5_RX_PIN PB5
91 #define UART5_TX_PIN PB13
94 #define UART6_RX_PIN PC7 // aka M7
95 #define UART6_TX_PIN PC6 // aka M8
98 #define UART8_RX_PIN PE0
99 #define UART8_TX_PIN PE1
104 #define SERIAL_PORT_COUNT 8
108 #define USE_SPI_DEVICE_2
109 #define SPI2_SCK_PIN PD3
110 #define SPI2_MISO_PIN PC2
111 #define SPI2_MOSI_PIN PC3
112 #define SPI2_NSS_PIN PB12
114 #define USE_SPI_DEVICE_3
115 #define SPI3_SCK_PIN PB3
116 #define SPI3_MISO_PIN PB4
117 #define SPI3_MOSI_PIN PD6
118 #define SPI3_NSS_PIN PA15
120 #define USE_SPI_DEVICE_4
121 #define SPI4_SCK_PIN PE12
122 #define SPI4_MISO_PIN PE13
123 #define SPI4_MOSI_PIN PE14
124 #define SPI4_NSS_PIN PE11
127 #define USE_I2C_DEVICE_1
130 #define I2C_DEVICE (I2CDEV_1)
132 #define USE_I2C_DEVICE_4 // Shared with motor outputs 5/6
137 #define USE_MAG_HMC5883
138 #define USE_MAG_QMC5883
141 #define USE_BARO_BMP388
142 #define USE_BARO_BMP280
143 #define USE_BARO_MS5611
146 #define USE_GYRO_SPI_MPU6500
147 #define USE_MULTI_GYRO
148 #undef USE_GYRO_REGISTER_DUMP
150 #define GYRO_1_EXTI_PIN PE15
151 #define GYRO_2_EXTI_PIN PD4
152 #define ENSURE_MPU_DATA_READY_IS_LOW
155 #define GYRO_1_CS_PIN SPI2_NSS_PIN
156 #define GYRO_1_SPI_INSTANCE SPI2
158 #define GYRO_2_CS_PIN SPI3_NSS_PIN
159 #define GYRO_2_SPI_INSTANCE SPI3
162 #define USE_ACC_SPI_MPU6500
164 #define GYRO_1_ALIGN CW0_DEG_FLIP
165 #define GYRO_2_ALIGN CW0_DEG_FLIP
167 #define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1
170 #define USE_FLASH_TOOLS
171 #define USE_FLASH_W25N01G
172 #define FLASH_QUADSPI_INSTANCE QUADSPI
174 // SD card not present on hardware, but pins are reserved.
177 #define SDCARD_DETECT_PIN PD10
178 #define SDCARD_DETECT_INVERTED
179 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
181 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
185 #define USE_TRANSPONDER
187 // MAX7456 not present on hardware, but pins are reserved and available on stacking connector.
189 #define MAX7456_SPI_INSTANCE SPI4
190 #define MAX7456_SPI_CS_PIN SPI4_NSS_PIN
193 //#define UART1_TX_DMA_OPT 0
194 //#define UART2_TX_DMA_OPT 1
195 //#define UART3_TX_DMA_OPT 2
196 //#define UART4_TX_DMA_OPT 3
197 //#define UART5_TX_DMA_OPT 4
198 //#define UART6_TX_DMA_OPT 5
199 //#define UART7_TX_DMA_OPT 6
200 //#define UART8_TX_DMA_OPT 7
201 #define ADC1_DMA_OPT 8
202 #define ADC3_DMA_OPT 9
203 //#define ADC2_DMA_OPT 10 // ADC2 not used.
205 #define ADC1_DMA_STREAM DMA2_Stream0
206 #define ADC3_DMA_STREAM DMA2_Stream1
207 //#define ADC2_DMA_STREAM DMA2_Stream2 // ADC2 not used.
211 #define USE_ADC_INTERNAL // ADC3
213 #define RSSI_ADC_PIN PC4 // ADC123
214 #define VBAT_ADC_PIN PC1 // ADC12
215 #define CURRENT_METER_ADC_PIN PC0 // ADC123
216 #define EXTERNAL1_ADC_PIN PC5 // ADC12
218 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
219 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
221 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
222 #define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP)
224 #define TARGET_IO_PORTA 0xffff
225 #define TARGET_IO_PORTB 0xffff
226 #define TARGET_IO_PORTC 0xffff
227 #define TARGET_IO_PORTD 0xffff
228 #define TARGET_IO_PORTE 0xffff
229 #define TARGET_IO_PORTF 0xffff
230 #define TARGET_IO_PORTG 0xffff
232 #define USABLE_TIMER_CHANNEL_COUNT 19
234 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(12) | TIM_N(15) )