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 DEBUG_MODE DEBUG_ADC_INTERNAL
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 EEPROM_IN_EXTERNAL_FLASH
65 //#define EEPROM_IN_SDCARD
66 //#define EEPROM_IN_RAM
67 #if !defined(EEPROM_IN_RAM) && !defined(EEPROM_IN_SDCARD) && !defined(EEPROM_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)
133 #define USE_MAG_HMC5883
136 #define USE_BARO_BMP388
137 #define USE_BARO_BMP280
138 #define USE_BARO_MS5611
141 #define USE_GYRO_SPI_MPU6500
142 #define USE_MULTI_GYRO
143 #undef USE_GYRO_REGISTER_DUMP
146 #define USE_GYRO_EXTI
147 #define GYRO_1_EXTI_PIN PE15
148 #define GYRO_2_EXTI_PIN PD4
149 #define USE_MPU_DATA_READY_SIGNAL
150 #define ENSURE_MPU_DATA_READY_IS_LOW
153 #define GYRO_1_CS_PIN SPI2_NSS_PIN
154 #define GYRO_1_SPI_INSTANCE SPI2
156 #define GYRO_2_CS_PIN SPI3_NSS_PIN
157 #define GYRO_2_SPI_INSTANCE SPI3
160 #define USE_ACC_SPI_MPU6500
162 #define GYRO_1_ALIGN CW0_DEG_FLIP
163 #define GYRO_2_ALIGN CW0_DEG_FLIP
165 #define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1
168 #define USE_FLASH_TOOLS
169 #define USE_FLASH_W25N01G
170 #define FLASH_QUADSPI_INSTANCE QUADSPI
172 // SD card not present on hardware, but pins are reserved.
175 #define USE_SDCARD_SDIO
176 #define SDCARD_DETECT_PIN PD10
177 #define SDCARD_DETECT_INVERTED
178 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
180 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
184 #define USE_TRANSPONDER
186 // MAX7456 not present on hardware, but pins are reserved and available on stacking connector.
188 #define MAX7456_SPI_INSTANCE SPI4
189 #define MAX7456_SPI_CS_PIN SPI4_NSS_PIN
192 //#define UART1_TX_DMA_OPT 0
193 //#define UART2_TX_DMA_OPT 1
194 //#define UART3_TX_DMA_OPT 2
195 //#define UART4_TX_DMA_OPT 3
196 //#define UART5_TX_DMA_OPT 4
197 //#define UART6_TX_DMA_OPT 5
198 //#define UART7_TX_DMA_OPT 6
199 //#define UART8_TX_DMA_OPT 7
200 #define ADC1_DMA_OPT 8
201 #define ADC3_DMA_OPT 9
202 //#define ADC2_DMA_OPT 10 // ADC2 not used.
204 #define ADC1_DMA_STREAM DMA2_Stream0
205 #define ADC3_DMA_STREAM DMA2_Stream1
206 //#define ADC2_DMA_STREAM DMA2_Stream2 // ADC2 not used.
210 #define USE_ADC_INTERNAL // ADC3
212 #define ADC1_INSTANCE ADC1
213 #define ADC2_INSTANCE ADC2 // ADC2 not used
214 #define ADC3_INSTANCE ADC3 // ADC3 only for core temp and vrefint
216 #define RSSI_ADC_PIN PC4 // ADC123
217 #define VBAT_ADC_PIN PC1 // ADC12
218 #define CURRENT_METER_ADC_PIN PC0 // ADC123
219 #define EXTERNAL1_ADC_PIN PC5 // ADC12
221 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
222 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
224 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
225 #define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP)
227 #define TARGET_IO_PORTA 0xffff
228 #define TARGET_IO_PORTB 0xffff
229 #define TARGET_IO_PORTC 0xffff
230 #define TARGET_IO_PORTD 0xffff
231 #define TARGET_IO_PORTE 0xffff
232 #define TARGET_IO_PORTF 0xffff
233 #define TARGET_IO_PORTG 0xffff
235 #define USABLE_TIMER_CHANNEL_COUNT 19
237 #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) )