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 #define TARGET_BOARD_IDENTIFIER "BJF4"
23 #define USE_TARGET_CONFIG
24 #define TARGET_VALIDATECONFIG
25 #define TARGET_PREINIT
27 #define USBD_PRODUCT_STRING "BlueJayF4"
29 #define USE_HARDWARE_REVISION_DETECTION
32 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
39 #define BEEPER_PIN PC1
40 #define BEEPER_INVERTED
42 #define INVERTER_PIN_UART6 PB15
43 //#define INVERTER_PIN_UART1 PC9 // Polarity depends on revision; handled in config.c
48 #define GYRO_1_EXTI_PIN PC5
49 #define USE_MPU_DATA_READY_SIGNAL
51 #define GYRO_1_CS_PIN PC4
52 #define GYRO_1_SPI_INSTANCE SPI1
55 #define USE_ACC_SPI_MPU6500
58 #define USE_GYRO_SPI_MPU6500
59 #define GYRO_1_ALIGN CW0_DEG
62 #define USE_MAG_HMC5883
63 #define USE_MAG_QMC5883
64 //#define USE_MAG_AK8963
65 #define USE_MAG_LIS3MDL
66 #define HMC5883_I2C_INSTANCE I2CDEV_1
69 #define USE_BARO_MS5611
70 #define MS5611_I2C_INSTANCE I2CDEV_1
73 #define USE_SDCARD_SPI
74 #define SDCARD_DETECT_INVERTED
75 #define SDCARD_DETECT_PIN PD2
76 #define SDCARD_SPI_INSTANCE SPI3
77 #define SDCARD_SPI_CS_PIN PA15
78 #define SPI3_TX_DMA_OPT 0 // DMA 1 Stream 5 Channel 0
80 // Performance logging for SD card operations:
81 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
83 #define FLASH_CS_PIN PB7
84 #define FLASH_SPI_INSTANCE SPI3
87 #define USE_FLASH_M25P16
90 //#define USB_DETECT_PIN PA8
91 //#define USE_USB_DETECT
94 #define UART1_RX_PIN PA10
95 #define UART1_TX_PIN PA9
98 #define UART3_RX_PIN PB11
99 #define UART3_TX_PIN PB10
102 #define UART6_RX_PIN PC7
103 #define UART6_TX_PIN PC6
105 // Provisioning for UART4 on motor outputs 1 & 2
106 // Keep pins NONE here to avoid UART4 showing up unless explicitly resource-mapped.
108 #define UART4_RX_PIN NONE // PA1
109 #define UART4_TX_PIN NONE // PA0
111 #define USE_SOFTSERIAL1
112 // Since PB0 (motor 5) and PB1 (motor 6) are assigned with N-channels, these pin can not handle input.
113 // Therefore, receiving function of SOFTSERIAL1 can only be assigned to PB3 (DEBUG).
114 // Default defined here is to use DEBUG for half-duplex serial, suitable for VTX (SmartAudio or Tramp) controls.
115 // For non-half-duplex requirement (full-duplex or simplex in either direction), assign PB3 to RX and PB0 or PB1 to TX.
116 #define SOFTSERIAL1_RX_PIN NONE
117 #define SOFTSERIAL1_TX_PIN PB3 // DEBUG
119 #define USE_SOFTSERIAL2
121 #define SERIAL_PORT_COUNT 7
123 #define USE_ESCSERIAL
124 #define ESCSERIAL_TIMER_TX_PIN PC7 // (HARDARE=0,PPM)
128 #define USE_SPI_DEVICE_1
129 #define SPI1_NSS_PIN PC4
130 #define SPI1_SCK_PIN PA5
131 #define SPI1_MISO_PIN PA6
132 #define SPI1_MOSI_PIN PA7
134 #define USE_SPI_DEVICE_3
135 #define SPI3_NSS_PIN PB7
136 #define SPI3_SCK_PIN PC10
137 #define SPI3_MISO_PIN PC11
138 #define SPI3_MOSI_PIN PC12
141 #define USE_I2C_DEVICE_1
142 #define I2C_DEVICE (I2CDEV_1)
145 #define USE_I2C_PULLUP
148 #define VBAT_ADC_PIN PC3
149 #define CURRENT_METER_ADC_PIN PC2
151 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
153 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
154 #define SERIALRX_PROVIDER SERIALRX_SBUS
155 #define SERIALRX_UART SERIAL_PORT_USART6
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 8
163 #define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) )