Fix KISSCC orientation // Remove unsupported softserial
[betaflight.git] / src / main / target / FISHDRONEF4 / target.h
blob08f693d2aaecdcb1d4d0cd9b5bfb640efc97984b
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "FDF4"
21 #define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
23 #define USBD_PRODUCT_STRING "FishDroneF4"
25 #define LED0 PC13
26 #define LED1 PC14
28 #define BEEPER PC15
29 #define BEEPER_INVERTED
31 #define INVERTER_PIN_USART6 PC8
33 #define USE_EXTI
34 #define MPU_INT_EXTI PC4
35 #define USE_MPU_DATA_READY_SIGNAL
37 // *************** Gyro & ACC **********************
38 #define USE_SPI
39 #define USE_SPI_DEVICE_1
41 #define MPU6500_CS_PIN PA4
42 #define MPU6500_SPI_INSTANCE SPI1
44 #define GYRO
45 #define USE_GYRO_SPI_MPU6500
46 #define GYRO_MPU6500_ALIGN CW90_DEG
48 #define ACC
49 #define USE_ACC_SPI_MPU6500
50 #define ACC_MPU6500_ALIGN CW90_DEG
52 // *************** UART *****************************
53 #define USE_VCP
54 #define VBUS_SENSING_PIN PA8
55 #define VBUS_SENSING_ENABLED
57 #define USE_UART1
58 #define UART1_RX_PIN PA10
59 #define UART1_TX_PIN PA9
61 #define USE_UART3
62 #define UART3_RX_PIN PB11
63 #define UART3_TX_PIN PB10
65 #define USE_UART6
66 #define UART6_RX_PIN PC7
67 #define UART6_TX_PIN PC6
69 #define SERIAL_PORT_COUNT 4 // VCP, USART1, USART3, USART6
71 #define USE_ESCSERIAL
72 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
74 // *************** OSD *****************************
75 #define USE_SPI_DEVICE_2
76 #define SPI2_NSS_PIN PB12
77 #define SPI2_SCK_PIN PB13
78 #define SPI2_MISO_PIN PC2
79 #define SPI2_MOSI_PIN PC3
81 #define OSD
82 #define USE_MAX7456
83 #define MAX7456_SPI_INSTANCE SPI2
84 #define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
86 // *************** FLASH *****************************
87 #define USE_SPI_DEVICE_3
88 #define SPI3_SCK_PIN PC10
89 #define SPI3_MISO_PIN PC11
90 #define SPI3_MOSI_PIN PC12
92 #define USE_FLASH_M25P16
93 #define USE_FLASHFS
94 #define M25P16_CS_PIN PD2
95 #define M25P16_SPI_INSTANCE SPI3
97 // *************** SDCARD *****************************
98 #define USE_SDCARD
100 #define SDCARD_DETECT_INVERTED
102 #define SDCARD_DETECT_PIN PB7
103 #define SDCARD_SPI_INSTANCE SPI3
104 #define SDCARD_SPI_CS_PIN PB9
106 // SPI3 is on the APB1 bus whose clock runs at 84MHz. Divide to under 400kHz for init:
107 #define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 328kHz
108 // Divide to under 25MHz for normal operation:
109 #define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4 // 21MHz
111 #define SDCARD_DMA_CHANNEL_TX DMA1_Stream5
112 #define SDCARD_DMA_CHANNEL_TX_COMPLETE_FLAG DMA_FLAG_TCIF5
113 #define SDCARD_DMA_CLK RCC_AHB1Periph_DMA1
114 #define SDCARD_DMA_CHANNEL DMA_Channel_0
116 // *************** RTC6705 *************************
117 #define USE_RTC6705
118 #define RTC6705_SPILE_PIN PB3
119 #define RTC6705_SPICLK_PIN PB4
120 #define RTC6705_SPIDATA_PIN PB5
122 // *************** ADC *****************************
123 #define USE_ADC
124 #define VBAT_ADC_PIN PC0
125 #define RSSI_ADC_PIN PC1
127 // *************** FEATURES ************************
128 #define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_OSD | FEATURE_BLACKBOX | FEATURE_VTX)
129 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
130 #define SERIALRX_PROVIDER SERIALRX_SBUS
131 #define SERIALRX_UART SERIAL_PORT_USART3
133 // *************** Others **************************
134 #define DISPLAY
135 #define LED_STRIP
136 #define OSD
138 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
140 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
142 #define USE_ESC_TELEMETRY
144 #define TARGET_IO_PORTA 0xffff
145 #define TARGET_IO_PORTB 0xffff
146 #define TARGET_IO_PORTC 0xffff
147 #define TARGET_IO_PORTD (BIT(2))
149 #define USABLE_TIMER_CHANNEL_COUNT 6
150 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) )