Removed feature SDCARD and BLACKBOX
[betaflight.git] / src / main / target / BLUEJAYF4 / target.h
bloba807a6f538636a9b8f12fddecf6ba803c27225c8
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 USBD_PRODUCT_STRING "BlueJayF4"
26 #define USE_HARDWARE_REVISION_DETECTION
27 #define HW_PIN PB2
29 #define BOARD_HAS_VOLTAGE_DIVIDER
31 #define LED0 PB6
32 #define LED1 PB5
33 #define LED2 PB4
35 #define BEEPER PC1
36 #define BEEPER_OPT PB7
37 #define BEEPER_INVERTED
39 #define INVERTER_PIN_UART6 PB15
40 //#define INVERTER_PIN_UART1 PC9
42 #define UART1_INVERTER PC9
44 // MPU6500 interrupt
45 #define USE_EXTI
46 #define MPU_INT_EXTI PC5
47 #define USE_MPU_DATA_READY_SIGNAL
48 //#define DEBUG_MPU_DATA_READY_INTERRUPT
50 #define MPU6500_CS_PIN PC4
51 #define MPU6500_SPI_INSTANCE SPI1
53 #define ACC
54 #define USE_ACC_MPU6500
55 #define USE_ACC_SPI_MPU6500
56 #define ACC_MPU6500_ALIGN CW0_DEG
58 #define GYRO
59 #define USE_GYRO_MPU6500
60 #define USE_GYRO_SPI_MPU6500
61 #define GYRO_MPU6500_ALIGN CW0_DEG
63 //#define MAG
64 //#define USE_MAG_AK8963
66 #define BARO
67 #define USE_BARO_MS5611
68 #define MS5611_I2C_INSTANCE I2CDEV_1
70 #define USE_SDCARD
72 #define SDCARD_DETECT_INVERTED
74 #define SDCARD_DETECT_PIN PD2
75 #define SDCARD_SPI_INSTANCE SPI3
76 #define SDCARD_SPI_CS_PIN PA15
78 // SPI2 is on the APB1 bus whose clock runs at 84MHz. Divide to under 400kHz for init:
79 #define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 328kHz
80 // Divide to under 25MHz for normal operation:
81 #define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4 // 21MHz
83 #define SDCARD_DMA_CHANNEL_TX DMA1_Stream5
84 #define SDCARD_DMA_CHANNEL_TX_COMPLETE_FLAG DMA_FLAG_TCIF5
85 #define SDCARD_DMA_CLK RCC_AHB1Periph_DMA1
86 #define SDCARD_DMA_CHANNEL DMA_Channel_0
88 // Performance logging for SD card operations:
89 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
91 #define M25P16_CS_PIN PB7
92 #define M25P16_SPI_INSTANCE SPI3
94 #define USE_FLASHFS
95 #define USE_FLASH_M25P16
97 #define USE_VCP
98 //#define VBUS_SENSING_PIN PA8
99 //#define VBUS_SENSING_ENABLED
101 #define USE_UART1
102 #define UART1_RX_PIN PA10
103 #define UART1_TX_PIN PA9
105 #define USE_UART3
106 #define UART3_RX_PIN PB11
107 #define UART3_TX_PIN PB10
109 #define USE_UART6
110 #define UART6_RX_PIN PC7
111 #define UART6_TX_PIN PC6
113 #define USE_SOFTSERIAL1
114 #define SOFTSERIAL1_RX_PIN PB0 // PWM5
115 #define SOFTSERIAL1_TX_PIN PB1 // PWM6
117 #define USE_SOFTSERIAL2
119 #define SERIAL_PORT_COUNT 6
121 #define USE_ESCSERIAL
122 #define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
124 #define USE_SPI
126 #define USE_SPI_DEVICE_1
127 #define SPI1_NSS_PIN PC4
128 #define SPI1_SCK_PIN PA5
129 #define SPI1_MISO_PIN PA6
130 #define SPI1_MOSI_PIN PA7
132 #define USE_SPI_DEVICE_3
133 #define SPI3_NSS_PIN PB3
134 #define SPI3_SCK_PIN PC10
135 #define SPI3_MISO_PIN PC11
136 #define SPI3_MOSI_PIN PC12
138 #define USE_I2C
139 #define USE_I2C_DEVICE_1
140 #define I2C_DEVICE (I2CDEV_1)
141 #define USE_I2C_PULLUP
143 #define USE_ADC
144 #define VBAT_ADC_PIN PC3
145 #define CURRENT_METER_ADC_PIN PC2
147 #define USE_ESC_SENSOR
149 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
151 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
152 #define SERIALRX_PROVIDER SERIALRX_SBUS
153 #define SERIALRX_UART SERIAL_PORT_USART6
155 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
157 #define SPEKTRUM_BIND_PIN UART3_RX_PIN
159 #define TARGET_IO_PORTA 0xffff
160 #define TARGET_IO_PORTB 0xffff
161 #define TARGET_IO_PORTC 0xffff
162 #define TARGET_IO_PORTD (BIT(2))
164 #define USABLE_TIMER_CHANNEL_COUNT 7
165 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(5) | TIM_N(8) | TIM_N(9) )