Create release.yml
[betaflight.git] / src / main / target / STM32F3DISCOVERY / target.h
blob07464fae5b7182d0fb31b969da11a5febf8b78b7
1 /*
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)
8 * any later version.
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 * Supports the GY-91 MPU9250 and BMP280 development board via SPI1
24 * Put the MAX7456 on SPI2 instead of an SDCARD
25 * MAX7456 CS -> PB12 (default)
26 * Uses the default pins for SPI2:
27 * #define SPI2_NSS_PIN PB12
28 * #define SPI2_SCK_PIN PB13
29 * #define SPI2_MISO_PIN PB14
30 * #define SPI2_MOSI_PIN PB15
32 * @author Nathan Tsoi
35 #pragma once
37 #define TARGET_BOARD_IDENTIFIER "SDF3" // STM Discovery F3
39 #define USE_SENSOR_NAMES
41 #define CURRENT_TARGET_CPU_VOLTAGE 3.0
43 #define LED0_PIN PE8 // Blue LEDs - PE8/PE12
44 #define LED0_INVERTED
45 #define LED1_PIN PE10 // Orange LEDs - PE10/PE14
46 #define LED1_INVERTED
48 #define USE_BEEPER
49 #define BEEPER_PIN PD12
50 #define BEEPER_PWM_HZ 2000 // Beeper PWM frequency in Hz
52 #define USE_SPI
53 #define USE_SPI_DEVICE_1
54 #define USE_SPI_DEVICE_2
56 #define SPI2_NSS_PIN PB12
57 #define SPI2_SCK_PIN PB13
58 #define SPI2_MISO_PIN PB14
59 #define SPI2_MOSI_PIN PB15
61 //#define USE_SD_CARD
63 //#define SD_DETECT_PIN PC14
64 //#define SD_CS_PIN PB12
65 //#define SD_SPI_INSTANCE SPI2
67 #define USE_FLASHFS
68 #define USE_FLASH_M25P16
70 #define FLASH_CS_PIN PB12
71 #define FLASH_SPI_INSTANCE SPI2
72 // SPI1
73 // PB5 SPI1_MOSI
74 // PB4 SPI1_MISO
75 // PB3 SPI1_SCK
76 // PA15 SPI1_NSS
78 // SPI2
79 // PB15 SPI2_MOSI
80 // PB14 SPI2_MISO
81 // PB13 SPI2_SCK
82 // PB12 SPI2_NSS
84 #define USE_GYRO
86 // The on-board gyro
87 #define USE_GYRO_L3GD20
88 #define GYRO_1_SPI_INSTANCE SPI1
89 #define GYRO_1_CS_PIN PE3
90 #define GYRO_1_ALIGN CW270_DEG
92 #define USE_EXTI
93 #define USE_GYRO_EXTI
94 #define GYRO_1_EXTI_PIN PE1
95 #define USE_MPU_DATA_READY_SIGNAL
97 // Other gyros:
98 #define USE_FAKE_GYRO
99 //#define USE_GYRO_L3G4200D
100 #define USE_GYRO_MPU3050
101 #define USE_GYRO_MPU6050
102 #define USE_GYRO_MPU6500
103 #define USE_GYRO_SPI_MPU6000
104 #define USE_GYRO_SPI_MPU6500
105 #define USE_GYRO_SPI_MPU9250
106 #define USE_ACCGYRO_BMI160
108 #define USE_ACC
110 // The on-board acc:
111 #define USE_I2C
112 #define USE_I2C_DEVICE_1
113 #define I2C_DEVICE (I2CDEV_1)
115 #define MPU_I2C_INSTANCE (I2CDEV_1)
116 #define USE_ACC_LSM303DLHC
118 #define USE_FAKE_ACC
119 //#define USE_ACC_ADXL345
120 //#define USE_ACC_BMA280
121 //#define USE_ACC_MMA8452
122 #define USE_ACC_MPU6050
123 #define USE_ACC_MPU6000
124 #define USE_ACC_SPI_MPU6000
125 #define USE_ACC_MPU6500
126 #define USE_ACC_SPI_MPU6500
127 #define USE_ACC_MPU9250
128 #define USE_ACC_SPI_MPU9250
130 #define USE_BARO
131 #define USE_FAKE_BARO
132 #define USE_BARO_BMP085
133 #define USE_BARO_BMP280
134 #define USE_BARO_MS5611
136 //#define USE_MAX7456
137 //#define MAX7456_SPI_INSTANCE SPI2
138 //#define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
140 //#define USE_SDCARD
141 //#define SDCARD_SPI_INSTANCE SPI2
142 //#define SDCARD_SPI_CS_PIN PB12
143 //// Note, this is the same DMA channel as UART1_RX. Luckily we don't use DMA for USART Rx.
144 //#define SDCARD_DMA_CHANNEL_TX DMA1_Channel5
145 // Performance logging for SD card operations:
146 // #define AFATFS_USE_INTROSPECTIVE_LOGGING
148 #define USE_MAG
149 #define USE_FAKE_MAG
150 #define USE_MAG_AK8963
151 #define USE_MAG_AK8975
152 #define USE_MAG_HMC5883
153 #define USE_MAG_QMC5883
155 #define USE_VCP
156 #define USE_UART1
157 #define USE_UART2
158 #define USE_UART3
159 #define USE_UART4
160 #define USE_UART5
161 //#define USE_SOFTSERIAL1
162 //#define USE_SOFTSERIAL2
164 #define SERIAL_PORT_COUNT 6
166 #define USE_ESCSERIAL
167 #define ESCSERIAL_TIMER_TX_PIN PB8 // (HARDARE=0,PPM)
169 #define UART3_TX_PIN PB10 // PB10 (AF7)
170 #define UART3_RX_PIN PB11 // PB11 (AF7)
172 #define USE_ADC
173 #define ADC_INSTANCE ADC1
174 #define VBAT_ADC_PIN PC0
175 #define CURRENT_METER_ADC_PIN PC1
176 #define RSSI_ADC_PIN PC2
177 #define EXTERNAL1_ADC_PIN PC3
179 #define USE_RANGEFINDER
180 #define USE_RANGEFINDER_HCSR04
181 #define RANGEFINDER_HCSR04_TRIGGER_PIN PB0
182 #define RANGEFINDER_HCSR04_ECHO_PIN PB1
184 #define MAX_SUPPORTED_MOTORS 12
186 // IO - 303 in 100pin package
187 #define TARGET_IO_PORTA 0xffff
188 #define TARGET_IO_PORTB 0xffff
189 #define TARGET_IO_PORTC 0xffff
190 #define TARGET_IO_PORTD 0xffff
191 #define TARGET_IO_PORTE 0xffff
192 #define TARGET_IO_PORTF 0x00ff
194 #define USABLE_TIMER_CHANNEL_COUNT 14
195 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(16) | TIM_N(17))