Ensure that we don't initialise more motors than are defined in target.h. Make MAX_PW...
[betaflight.git] / src / main / target / EUSTM32F103RC / target.h
blobb8af178a9a403385e1f39b7cef5ab412b27a35f5
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 "EUF1"
22 #define LED0 PB3
23 #define LED1 PB4
25 #define INVERTER PB2
26 #define INVERTER_USART USART2
28 #define MPU6000_CS_PIN PB12
29 #define MPU6000_SPI_INSTANCE SPI2
31 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_APB2Periph_GPIOB
32 #define MPU6500_CS_PIN PB12
33 #define MPU6500_SPI_INSTANCE SPI2
35 #define GYRO
36 #define USE_FAKE_GYRO
37 #define USE_GYRO_L3G4200D
38 //#define USE_GYRO_L3GD20
39 //#define USE_GYRO_MPU3050
40 #define USE_GYRO_MPU6050
41 #define USE_GYRO_SPI_MPU6000
42 #define USE_GYRO_SPI_MPU6500
44 #define GYRO_MPU6050_ALIGN CW0_DEG
46 #define ACC
47 #define USE_FAKE_ACC
48 #define USE_ACC_ADXL345
49 #define USE_ACC_BMA280
50 #define USE_ACC_MMA8452
51 #define USE_ACC_MPU6050
52 //#define USE_ACC_SPI_MPU6000
53 #define USE_ACC_SPI_MPU6500
55 #define ACC_MPU6050_ALIGN CW0_DEG
57 #define BARO
58 #define USE_BARO_MS5611
59 #define USE_BARO_BMP085
60 #define USE_BARO_BMP280
62 #define MAG
63 #define USE_MAG_HMC5883
64 #define USE_MAG_AK8975
65 #define MAG_AK8975_ALIGN CW180_DEG_FLIP
67 #define SONAR
68 #define SONAR_TRIGGER_PIN PB0
69 #define SONAR_ECHO_PIN PB1
70 #define SONAR_TRIGGER_PIN_PWM PB8
71 #define SONAR_ECHO_PIN_PWM PB9
73 #define DISPLAY
75 #define USE_UART1
76 #define USE_UART2
77 #define USE_SOFTSERIAL1
78 #define USE_SOFTSERIAL2
79 #define SERIAL_PORT_COUNT 4
81 #define SOFTSERIAL_1_TIMER TIM3
82 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
83 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
84 #define SOFTSERIAL_2_TIMER TIM3
85 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
86 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
88 #define USE_I2C
89 #define I2C_DEVICE (I2CDEV_2)
91 // #define SOFT_I2C // enable to test software i2c
92 // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
93 // #define SOFT_I2C_PB67
95 #define USE_ADC
96 #define CURRENT_METER_ADC_PIN PB1
97 #define VBAT_ADC_PIN PA4
98 #define RSSI_ADC_PIN PA1
99 #define EXTERNAL1_ADC_PIN PA5
101 #define SPEKTRUM_BIND
102 // USART2, PA3
103 #define BIND_PIN PA3
105 // Number of available PWM outputs
106 #define MAX_PWM_OUTPUT_PORTS 10
108 // IO - stm32f103RCT6 in 64pin package (TODO)
109 #define TARGET_IO_PORTA 0xffff
110 #define TARGET_IO_PORTB 0xffff
111 #define TARGET_IO_PORTC 0xffff
112 #define TARGET_IO_PORTD (BIT(0)|BIT(1)|BIT(2))
114 #define USABLE_TIMER_CHANNEL_COUNT 14
115 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4))