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/>.
22 #if defined(FF_FORTINIF4_REV03)
23 #define TARGET_BOARD_IDENTIFIER "FOR3"
24 #define USBD_PRODUCT_STRING "FortiniF4_Rev03"
26 #define TARGET_BOARD_IDENTIFIER "FORT"
27 #define USBD_PRODUCT_STRING "FortiniF4"
29 #define USE_TARGET_CONFIG
30 #define USE_HARDWARE_REVISION_DETECTION
33 /*--------------LED----------------*/
35 #if defined(FF_FORTINIF4_REV03)
40 /*---------------------------------*/
42 /*------------BEEPER---------------*/
44 #if defined(FF_FORTINIF4_REV03)
45 #define BEEPER_PIN PB3
47 #define BEEPER_PIN PB4
49 #define BEEPER_INVERTED
50 /*---------------------------------*/
52 /*------------SENSORS--------------*/
56 #define GYRO_1_EXTI_PIN PC4
57 #define USE_MPU_DATA_READY_SIGNAL
58 #define ENSURE_MPU_DATA_READY_IS_LOW
61 #define USE_GYRO_SPI_MPU6000
62 #define USE_GYRO_SPI_MPU6500
63 #define USE_GYRO_SPI_ICM20689
64 #define GYRO_1_ALIGN CW180_DEG
66 #define GYRO_1_SPI_INSTANCE SPI1
68 #if defined(FF_FORTINIF4_REV03)
69 #define GYRO_1_CS_PIN PA4
71 #define GYRO_1_CS_PIN PA8
75 #define USE_ACC_SPI_MPU6000
76 #define USE_ACC_SPI_MPU6500
77 #define USE_ACC_SPI_ICM20689
79 /*---------------------------------*/
81 #if !defined(FF_FORTINIF4_REV03)
82 /*------------FLASH----------------*/
83 #define FLASH_CS_PIN PB3
84 #define FLASH_SPI_INSTANCE SPI3
87 #define USE_FLASH_M25P16
88 /*---------------------------------*/
91 /*-------------OSD-----------------*/
93 #if defined(FF_FORTINIF4_REV03)
94 #define MAX7456_SPI_INSTANCE SPI2
95 #define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
97 #define MAX7456_SPI_INSTANCE SPI3
98 #define MAX7456_SPI_CS_PIN SPI3_NSS_PIN
100 /*---------------------------------*/
102 /*-----------USB-UARTs-------------*/
104 //#define USB_DETECT_PIN NONE
105 //#define USE_USB_DETECT
108 #if defined(FF_FORTINIF4_REV03)
109 #define UART1_RX_PIN PB7
111 #define UART1_RX_PIN PA10
113 #define UART1_TX_PIN PA9
116 #define UART4_TX_PIN PA0
117 #define UART4_RX_PIN PA1
120 #define UART5_RX_PIN PD2
121 #define UART5_TX_PIN PC12
124 #define UART6_RX_PIN PC7
125 #define UART6_TX_PIN PC6
127 #if defined(FF_FORTINIF4_REV03)
129 #define UART2_RX_PIN PA3
130 #define UART2_TX_PIN PA2
133 #define UART3_RX_PIN PC11
134 #define UART3_TX_PIN PC10
135 #define INVERTER_PIN_UART3 PC15
137 #define SERIAL_PORT_COUNT 7
140 #define UART3_RX_PIN PB11
141 #define UART3_TX_PIN PB10
142 #define INVERTER_PIN_UART3 PC15
144 #define SERIAL_PORT_COUNT 6
146 /*---------------------------------*/
148 /*-------------SPIs----------------*/
151 #define USE_SPI_DEVICE_1
152 #if defined(FF_FORTINIF4_REV03)
153 #define SPI1_NSS_PIN PA4
155 #define SPI1_NSS_PIN PA8
157 #define SPI1_SCK_PIN PA5
158 #define SPI1_MISO_PIN PA6
159 #define SPI1_MOSI_PIN PA7
161 #if defined(FF_FORTINIF4_REV03)
162 #define USE_SPI_DEVICE_2
163 #define SPI2_NSS_PIN PB12
164 #define SPI2_SCK_PIN PB13
165 #define SPI2_MISO_PIN PB14
166 #define SPI2_MOSI_PIN PB15
168 #define USE_SPI_DEVICE_3
169 #define SPI3_NSS_PIN PB3
170 #define SPI3_SCK_PIN PC10
171 #define SPI3_MISO_PIN PC11
172 #define SPI3_MOSI_PIN PC12
174 /*---------------------------------*/
176 #if defined(FF_FORTINIF4_REV03)
177 /*-------------I2C-----------------*/
179 #define USE_I2C_PULLUP
180 #define USE_I2C_DEVICE_3
181 #define I2C_DEVICE (I2CDEV_3)
184 /*---------------------------------*/
187 /*-------------ADCs----------------*/
189 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
190 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
191 #define VBAT_ADC_PIN PC2
192 #define CURRENT_METER_ADC_PIN PC1
193 /*---------------------------------*/
195 /*-------------ESCs----------------*/
196 #define USE_ESCSERIAL
197 #define ESCSERIAL_TIMER_TX_PIN PB0 // (HARDARE=0)
198 /*---------------------------------*/
200 /*--------DEFAULT VALUES-----------*/
201 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
202 #define SERIALRX_PROVIDER SERIALRX_SBUS
203 #define SERIALRX_UART SERIAL_PORT_USART3
205 #define TARGET_IO_PORTA 0xffff
206 #define TARGET_IO_PORTB 0xffff
207 #define TARGET_IO_PORTC 0xffff
208 #define TARGET_IO_PORTD (BIT(2))
209 /*---------------------------------*/
211 /*--------------TIMERS-------------*/
212 #if defined(FF_FORTINIF4_REV03)
213 #define USABLE_TIMER_CHANNEL_COUNT 7
214 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) )
216 #define USABLE_TIMER_CHANNEL_COUNT 6
217 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4) )
219 /*---------------------------------*/