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 "SP7Z"
24 #define USBD_PRODUCT_STRING "SPRacingH7ZERO"
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 PB10
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 NONE
60 #define QUADSPI1_MODE QUADSPI_MODE_BK1_ONLY
61 #define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_HARDWARE | QUADSPI_BK2_CS_NONE | QUADSPI_CS_MODE_LINKED)
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 // Connected to BMP388 only
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
144 #define USE_GYRO_SPI_MPU6500
145 #define USE_MULTI_GYRO
146 #undef USE_GYRO_REGISTER_DUMP
148 #define GYRO_1_EXTI_PIN PD4
149 #define GYRO_2_EXTI_PIN PE15
150 #define ENSURE_MPU_DATA_READY_IS_LOW
153 #define GYRO_1_CS_PIN SPI3_NSS_PIN
154 #define GYRO_1_SPI_INSTANCE SPI3
156 #define GYRO_2_CS_PIN SPI2_NSS_PIN
157 #define GYRO_2_SPI_INSTANCE SPI2
160 #define USE_ACC_SPI_MPU6500
162 #define GYRO_1_ALIGN CW180_DEG
163 #define GYRO_2_ALIGN CW90_DEG
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
173 #define USE_SDCARD_SDIO
174 #define SDCARD_DETECT_PIN PD10
175 #define SDCARD_DETECT_INVERTED
176 #define SDIO_DEVICE SDIODEV_1
177 #define SDIO_USE_4BIT true
178 #define SDIO_CK_PIN PC12
179 #define SDIO_CMD_PIN PD2
180 #define SDIO_D0_PIN PC8
181 #define SDIO_D1_PIN PC9
182 #define SDIO_D2_PIN PC10
183 #define SDIO_D3_PIN PC11
185 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
188 #define USE_TRANSPONDER
191 #define MAX7456_SPI_INSTANCE SPI4
192 #define MAX7456_SPI_CS_PIN SPI4_NSS_PIN
195 //#define UART1_TX_DMA_OPT 0
196 //#define UART2_TX_DMA_OPT 1
197 //#define UART3_TX_DMA_OPT 2
198 //#define UART4_TX_DMA_OPT 3
199 //#define UART5_TX_DMA_OPT 4
200 //#define UART6_TX_DMA_OPT 5
201 //#define UART7_TX_DMA_OPT 6
202 //#define UART8_TX_DMA_OPT 7
203 #define ADC1_DMA_OPT 8
204 #define ADC3_DMA_OPT 9
205 //#define ADC2_DMA_OPT 10 // ADC2 not used.
207 #define ADC1_DMA_STREAM DMA2_Stream0
208 #define ADC3_DMA_STREAM DMA2_Stream1
209 //#define ADC2_DMA_STREAM DMA2_Stream2 // ADC2 not used.
213 #define USE_ADC_INTERNAL // ADC3
215 #define RSSI_ADC_PIN PC0 // ADC123
216 #define VBAT_ADC_PIN PC4 // ADC123
217 #define CURRENT_METER_ADC_PIN PC1 // ADC12
218 #define EXTERNAL1_ADC_PIN PC5 // ADC12
220 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
221 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
223 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
224 #define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP)
226 #define TARGET_IO_PORTA 0xffff
227 #define TARGET_IO_PORTB 0xffff
228 #define TARGET_IO_PORTC 0xffff
229 #define TARGET_IO_PORTD 0xffff
230 #define TARGET_IO_PORTE 0xffff
231 #define TARGET_IO_PORTF 0xffff
232 #define TARGET_IO_PORTG 0xffff
234 #define USABLE_TIMER_CHANNEL_COUNT 19
236 #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) )