Add Winbond 25Q128 flash driver
[betaflight.git] / src / main / target / FURYF4 / target.h
blob017deca1bdfe1740fdb887a3175f230810928db7
1 /*
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)
8 * any later version.
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/>.
21 #pragma once
23 #define USE_LATE_TASK_STATISTICS
25 #ifdef FURYF4OSD
26 #define TARGET_BOARD_IDENTIFIER "FY4O"
27 #define USBD_PRODUCT_STRING "FuryF4OSD"
28 #else
29 #define TARGET_BOARD_IDENTIFIER "FYF4"
30 #define USBD_PRODUCT_STRING "FuryF4"
31 #endif
33 #define LED0_PIN PB5
34 #define LED1_PIN PB4
36 #define USE_BEEPER
37 #define BEEPER_PIN PA8
38 #define BEEPER_INVERTED
40 #define INVERTER_PIN_UART1 PC0 // PC0 used as inverter select GPIO
42 // MPU6000 interrupts
43 #define USE_EXTI
44 #define USE_GYRO_EXTI
45 #define GYRO_1_EXTI_PIN PC4
46 #define USE_MPU_DATA_READY_SIGNAL
48 #define GYRO_1_CS_PIN PA4
49 #define GYRO_1_SPI_INSTANCE SPI1
51 #define USE_GYRO
52 #define USE_GYRO_SPI_MPU6000
53 #define USE_GYRO_SPI_MPU6500
54 #define USE_GYRO_SPI_ICM20689
55 #define GYRO_1_ALIGN CW180_DEG
57 #define USE_ACC
58 #define USE_ACC_SPI_MPU6000
59 #define USE_ACC_SPI_MPU6500
60 #define USE_ACC_SPI_ICM20689
62 #define USE_BARO
63 #define USE_BARO_MS5611
64 #define USE_BARO_BMP280
65 #define MS5611_I2C_INSTANCE I2CDEV_1
67 #define USE_MAG
68 #define USE_MAG_HMC5883
69 #define USE_MAG_QMC5883
70 #define USE_MAG_LIS3MDL
72 #ifdef FURYF4OSD
73 #define USE_MAX7456
74 #define MAX7456_SPI_INSTANCE SPI2
75 #define MAX7456_SPI_CS_PIN PB12
77 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
79 #define DEFAULT_FEATURES FEATURE_OSD
81 #else
83 #define USE_SDCARD
84 #define USE_SDCARD_SPI
85 #define SDCARD_DETECT_INVERTED
86 #define SDCARD_DETECT_PIN PD2
87 #define SDCARD_SPI_INSTANCE SPI2
88 #define SDCARD_SPI_CS_PIN PB12
89 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
90 #define SPI2_TX_DMA_OPT 0 // DMA 1 Stream 4 Channel 0
91 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
93 #endif
95 #define USE_FLASHFS
96 #define USE_FLASH_M25P16
97 #define FLASH_CS_PIN PB3
98 #define FLASH_SPI_INSTANCE SPI3
100 #define USE_VCP
101 #define USB_DETECT_PIN PC5
102 #define USE_USB_DETECT
104 #define USE_UART1
105 #define UART1_RX_PIN PA10
106 #define UART1_TX_PIN PA9
108 #define USE_UART3
109 #define UART3_RX_PIN PB11
110 #define UART3_TX_PIN PB10
112 #define USE_UART6
113 #define UART6_RX_PIN PC7
114 #define UART6_TX_PIN PC6
116 #define USE_SOFTSERIAL1
117 #define USE_SOFTSERIAL2
119 #define SERIAL_PORT_COUNT 6 //VCP, USART1, USART3, USART6, SOFTSERIAL x 2
121 #define USE_ESCSERIAL
122 #define ESCSERIAL_TIMER_TX_PIN PC9 // (HARDARE=0,PPM)
124 #define USE_SPI
126 #define USE_SPI_DEVICE_1
128 #define USE_SPI_DEVICE_2
129 #define SPI2_NSS_PIN PB12
130 #define SPI2_SCK_PIN PB13
131 #define SPI2_MISO_PIN PB14
132 #define SPI2_MOSI_PIN PB15
134 #define USE_SPI_DEVICE_3
135 #define SPI3_NSS_PIN PB3
136 #define SPI3_SCK_PIN PC10
137 #define SPI3_MISO_PIN PC11
138 #define SPI3_MOSI_PIN PC12
140 #define USE_I2C
141 #define USE_I2C_DEVICE_1
142 #define I2C_DEVICE (I2CDEV_1)
143 #define USE_I2C_PULLUP
144 #define I2C1_SCL PB6
145 #define I2C1_SDA PB7
147 #define USE_ADC
148 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
149 #define VBAT_ADC_PIN PC1
150 #define RSSI_ADC_PIN PC2
151 #define CURRENT_METER_ADC_PIN PC3
153 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
154 #define SERIALRX_UART SERIAL_PORT_USART1
155 #define SERIALRX_PROVIDER SERIALRX_SBUS
157 #define TARGET_IO_PORTA 0xffff
158 #define TARGET_IO_PORTB 0xffff
159 #define TARGET_IO_PORTC 0xffff
160 #define TARGET_IO_PORTD (BIT(2))
162 #define USABLE_TIMER_CHANNEL_COUNT 7
163 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(11) )