Configurable SDCARD, and clean up of DMA.
[betaflight.git] / src / main / target / ANYFCF7 / target.h
blobdddadcb51de9905fc3157b2cd1216c4219a83b37
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 "ANY7"
22 #define USBD_PRODUCT_STRING "AnyFCF7"
24 #define LED0_PIN PB7
25 #define LED1_PIN PB6
27 #define BEEPER PB2 // Unused pin, can be mapped to elsewhere
28 #define BEEPER_INVERTED
30 #define MPU6000_CS_PIN PA4
31 #define MPU6000_SPI_INSTANCE SPI1
33 #define USE_ACC
34 #define USE_ACC_SPI_MPU6000
35 #define ACC_MPU6000_ALIGN CW270_DEG
37 #define USE_GYRO
38 #define USE_GYRO_SPI_MPU6000
39 #define GYRO_MPU6000_ALIGN CW270_DEG
41 // MPU6000 interrupts
42 #define USE_MPU_DATA_READY_SIGNAL
43 #define MPU_INT_EXTI PC4
44 #define USE_EXTI
46 #define USE_MAG
47 #define USE_MAG_HMC5883
48 #define MAG_I2C_INSTANCE (I2CDEV_2)
50 //#define MAG_HMC5883_ALIGN CW270_DEG_FLIP
51 //#define MAG_HMC5883_ALIGN CW90_DEG
53 #define USE_BARO
54 #define USE_BARO_MS5611
55 #define USE_BARO_BMP280
56 #define BARO_I2C_INSTANCE (I2CDEV_2)
58 #define USABLE_TIMER_CHANNEL_COUNT 16
60 #define USE_VCP
61 #define VBUS_SENSING_PIN PA8
63 #define USE_UART1
64 #define UART1_RX_PIN PA10
65 #define UART1_TX_PIN PA9
67 #define USE_UART2
68 #define UART2_RX_PIN PD6
69 #define UART2_TX_PIN PD5
71 #define USE_UART3
72 #define UART3_RX_PIN PD9
73 #define UART3_TX_PIN PD8
75 #define USE_UART4
76 #define UART4_RX_PIN PC11
77 #define UART4_TX_PIN PC10
79 #define USE_UART5
80 #define UART5_RX_PIN PD2
81 #define UART5_TX_PIN PC12
83 #define USE_UART6
84 #define UART6_RX_PIN PC7
85 #define UART6_TX_PIN PC6
87 #define USE_UART7
88 #define UART7_RX_PIN PE7
89 #define UART7_TX_PIN PE8
91 #define USE_UART8
92 #define UART8_RX_PIN PE0
93 #define UART8_TX_PIN PE1
95 #define USE_SOFTSERIAL1
96 #define USE_SOFTSERIAL2
98 #define SERIAL_PORT_COUNT 11 //VCP, USART1, USART2, USART3, UART4, UART5, USART6, USART7, USART8, SOFTSERIAL x 2
100 #define USE_ESCSERIAL
101 #define ESCSERIAL_TIMER_TX_PIN PB14 // (Hardware=0, PPM)
103 #define USE_SPI
104 #define USE_SPI_DEVICE_1
105 #define USE_SPI_DEVICE_3
106 #define USE_SPI_DEVICE_4
108 #define SPI1_NSS_PIN PA4
109 #define SPI1_SCK_PIN PA5
110 #define SPI1_MISO_PIN PA6
111 #define SPI1_MOSI_PIN PA7
113 #define SPI3_NSS_PIN PD2
114 #define SPI3_SCK_PIN PC10
115 #define SPI3_MISO_PIN PC11
116 #define SPI3_MOSI_PIN PC12
118 #define SPI4_NSS_PIN PE11
119 #define SPI4_SCK_PIN PE12
120 #define SPI4_MISO_PIN PE13
121 #define SPI4_MOSI_PIN PE14
123 #define USE_OSD
124 #define USE_MAX7456
125 #define MAX7456_SPI_INSTANCE SPI3
126 #define MAX7456_SPI_CS_PIN SPI3_NSS_PIN
127 #define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz
128 #define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
130 #define USE_SDCARD
131 #define SDCARD_DETECT_INVERTED
132 #define SDCARD_DETECT_PIN PD3
134 #define SDCARD_SPI_INSTANCE SPI4
135 #define SDCARD_SPI_CS_PIN SPI4_NSS_PIN
137 #define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 422kHz
138 // Divide to under 25MHz for normal operation:
139 #define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 8 // 27MHz
141 #define SDCARD_DMA_STREAM_TX_FULL DMA2_Stream1
142 #define SDCARD_DMA_CHANNEL 4
144 #define USE_I2C
145 #define USE_I2C_DEVICE_2 // External I2C
146 #define USE_I2C_DEVICE_4 // Onboard I2C
147 #define I2C_DEVICE (I2CDEV_2)
149 #define USE_ADC
150 #define VBAT_ADC_PIN PC0
151 #define CURRENT_METER_ADC_PIN PC1
152 #define RSSI_ADC_GPIO_PIN PC2
154 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
156 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
157 #define SERIALRX_PROVIDER SERIALRX_SBUS
159 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
161 #define TARGET_IO_PORTA 0xffff
162 #define TARGET_IO_PORTB 0xffff
163 #define TARGET_IO_PORTC 0xffff
164 #define TARGET_IO_PORTD 0xffff
165 #define TARGET_IO_PORTE 0xffff
167 #define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(12) | TIM_N(8) | TIM_N(9) | TIM_N(10) | TIM_N(11))