Ensure that we don't initialise more motors than are defined in target.h. Make MAX_PW...
[betaflight.git] / src / main / target / STM32F3DISCOVERY / target.h
blob5e12cd36ba860322c7f2ee941d8b4d2af13bc42b
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 "SDF3" // STM Discovery F3
22 #define LED0 PE8 // Blue LEDs - PE8/PE12
23 #define LED0_INVERTED
24 #define LED1 PE10 // Orange LEDs - PE10/PE14
25 #define LED1_INVERTED
27 #define BEEPER PE9 // Red LEDs - PE9/PE13
28 #define BEEPER_INVERTED
30 #define USE_SPI
31 #define USE_SPI_DEVICE_1
32 #define USE_SPI_DEVICE_2
34 #define SPI2_NSS_PIN PB12
35 #define SPI2_SCK_PIN PB13
36 #define SPI2_MISO_PIN PB14
37 #define SPI2_MOSI_PIN PB15
39 #define GYRO
40 #define USE_GYRO_L3GD20
41 #define L3GD20_SPI SPI1
42 #define L3GD20_CS_PIN PE3
43 #define GYRO_L3GD20_ALIGN CW270_DEG
45 // Support the GY-91 MPU9250 dev board
46 #define USE_GYRO_MPU6500
47 #define USE_GYRO_SPI_MPU6500
48 #define MPU6500_CS_PIN PC14
49 #define MPU6500_SPI_INSTANCE SPI2
50 #define GYRO_MPU6500_ALIGN CW270_DEG_FLIP
52 #define ACC
53 #define USE_ACC_LSM303DLHC
54 #define USE_ACC_MPU6500
55 #define USE_ACC_SPI_MPU6500
56 #define ACC_MPU6500_ALIGN CW270_DEG_FLIP
58 #define MAG
59 #define USE_MAG_HMC5883
61 #define USE_VCP
62 #define USE_UART1
63 #define USE_UART2
64 #define SERIAL_PORT_COUNT 3
66 #define USE_I2C
67 #define I2C_DEVICE (I2CDEV_1)
69 #define USE_ADC
70 #define ADC_INSTANCE ADC1
71 #define VBAT_ADC_PIN PC0
72 #define CURRENT_METER_ADC_PIN PC1
73 #define RSSI_ADC_PIN PC2
74 #define EXTERNAL1_ADC_PIN PC3
76 #define LED_STRIP
77 #define WS2811_PIN PB8 // TIM16_CH1
78 #define WS2811_TIMER TIM16
79 #define WS2811_DMA_CHANNEL DMA1_Channel3
80 #define WS2811_IRQ DMA1_Channel3_IRQn
81 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
82 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
84 #define LED_STRIP_TIMER TIM16
86 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
88 // Number of available PWM outputs
89 #define MAX_PWM_OUTPUT_PORTS 12
91 // IO - 303 in 100pin package
92 #define TARGET_IO_PORTA 0xffff
93 #define TARGET_IO_PORTB 0xffff
94 #define TARGET_IO_PORTC 0xffff
95 #define TARGET_IO_PORTD 0xffff
96 #define TARGET_IO_PORTE 0xffff
97 #define TARGET_IO_PORTF 0x00ff
99 #define USABLE_TIMER_CHANNEL_COUNT 14
100 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(16) | TIM_N(17))