Fix KISSCC orientation // Remove unsupported softserial
[betaflight.git] / src / main / target / BLUEJAYF4 / target.h
blobdb082c2e4b47b1076e2d114dddc61faf579a39a1
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
19 #define TARGET_BOARD_IDENTIFIER "BJF4"
20 #define TARGET_CONFIG
21 #define TARGET_VALIDATECONFIG
22 #define TARGET_PREINIT
24 #define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
26 #define USBD_PRODUCT_STRING "BlueJayF4"
28 #define USE_HARDWARE_REVISION_DETECTION
29 #define HW_PIN PB2
31 #define BOARD_HAS_VOLTAGE_DIVIDER
33 #define LED0 PB6
34 #define LED1 PB5
35 #define LED2 PB4
37 #define BEEPER PC1
38 #define BEEPER_OPT PB7
39 #define BEEPER_INVERTED
41 #define INVERTER_PIN_USART6 PB15
42 //#define INVERTER_PIN_USART1 PC9
44 #define UART1_INVERTER PC9
46 // MPU6500 interrupt
47 #define USE_EXTI
48 #define MPU_INT_EXTI PC5
49 #define USE_MPU_DATA_READY_SIGNAL
50 //#define DEBUG_MPU_DATA_READY_INTERRUPT
52 #define MPU6500_CS_PIN PC4
53 #define MPU6500_SPI_INSTANCE SPI1
55 #define ACC
56 #define USE_ACC_MPU6500
57 #define USE_ACC_SPI_MPU6500
58 #define ACC_MPU6500_ALIGN CW0_DEG
60 #define GYRO
61 #define USE_GYRO_MPU6500
62 #define USE_GYRO_SPI_MPU6500
63 #define GYRO_MPU6500_ALIGN CW0_DEG
65 //#define MAG
66 //#define USE_MAG_AK8963
68 #define BARO
69 #define USE_BARO_MS5611
70 #define MS5611_I2C_INSTANCE I2CDEV_1
72 #define USE_SDCARD
74 #define SDCARD_DETECT_INVERTED
76 #define SDCARD_DETECT_PIN PD2
77 #define SDCARD_SPI_INSTANCE SPI3
78 #define SDCARD_SPI_CS_PIN PA15
80 // SPI2 is on the APB1 bus whose clock runs at 84MHz. Divide to under 400kHz for init:
81 #define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 328kHz
82 // Divide to under 25MHz for normal operation:
83 #define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4 // 21MHz
85 #define SDCARD_DMA_CHANNEL_TX DMA1_Stream5
86 #define SDCARD_DMA_CHANNEL_TX_COMPLETE_FLAG DMA_FLAG_TCIF5
87 #define SDCARD_DMA_CLK RCC_AHB1Periph_DMA1
88 #define SDCARD_DMA_CHANNEL DMA_Channel_0
90 // Performance logging for SD card operations:
91 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
93 #define M25P16_CS_PIN PB7
94 #define M25P16_SPI_INSTANCE SPI3
96 #define USE_FLASHFS
97 #define USE_FLASH_M25P16
99 #define USE_VCP
100 //#define VBUS_SENSING_PIN PA8
101 //#define VBUS_SENSING_ENABLED
103 #define USE_UART1
104 #define UART1_RX_PIN PA10
105 #define UART1_TX_PIN PA9
107 #define USE_UART3
108 #define UART3_RX_PIN PB11
109 #define UART3_TX_PIN PB10
111 #define USE_UART6
112 #define UART6_RX_PIN PC7
113 #define UART6_TX_PIN PC6
115 #define USE_SOFTSERIAL1
116 #define SERIAL_PORT_COUNT 5
118 #define USE_ESCSERIAL
119 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
121 #define SOFTSERIAL_1_TIMER TIM3
122 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
123 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
126 #define USE_ESCSERIAL
127 #define ESCSERIAL_TIMER_TX_HARDWARE 0
129 #define USE_SPI
131 #define USE_SPI_DEVICE_1
132 #define SPI1_NSS_PIN PC4
133 #define SPI1_SCK_PIN PA5
134 #define SPI1_MISO_PIN PA6
135 #define SPI1_MOSI_PIN PA7
137 #define USE_SPI_DEVICE_3
138 #define SPI3_NSS_PIN PB3
139 #define SPI3_SCK_PIN PC10
140 #define SPI3_MISO_PIN PC11
141 #define SPI3_MOSI_PIN PC12
143 #define USE_I2C
144 #define I2C_DEVICE (I2CDEV_1)
145 #define USE_I2C_PULLUP
147 #define USE_ADC
148 #define VBAT_ADC_PIN PC3
149 #define CURRENT_METER_ADC_PIN PC2
151 #define USE_ESC_SENSOR
152 #define LED_STRIP
154 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
156 #define DEFAULT_FEATURES FEATURE_BLACKBOX
157 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
158 #define SERIALRX_PROVIDER SERIALRX_SBUS
159 #define SERIALRX_UART SERIAL_PORT_USART6
161 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
163 #define SPEKTRUM_BIND
164 #define BIND_PIN PB11
166 #define TARGET_IO_PORTA 0xffff
167 #define TARGET_IO_PORTB 0xffff
168 #define TARGET_IO_PORTC 0xffff
169 #define TARGET_IO_PORTD (BIT(2))
171 #define USABLE_TIMER_CHANNEL_COUNT 7
172 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(9) )