Cleanup CC3D/NAZE/OLIMEXINO ADC initialisation and PWM mapping. Fixes
[betaflight.git] / src / main / target / EUSTM32F103RC / target.h
blobccc9bebaa37303a80a2f07f2c20b3d1854b075e8
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_GPIO GPIOB
23 #define LED0_PIN Pin_3 // PB3 (LED)
24 #define LED0_PERIPHERAL RCC_APB2Periph_GPIOB
25 #define LED1_GPIO GPIOB
26 #define LED1_PIN Pin_4 // PB4 (LED)
27 #define LED1_PERIPHERAL RCC_APB2Periph_GPIOB
29 #define INVERTER_PIN Pin_2 // PB2 (BOOT1) abused as inverter select GPIO
30 #define INVERTER_GPIO GPIOB
31 #define INVERTER_PERIPHERAL RCC_APB2Periph_GPIOB
32 #define INVERTER_USART USART2
34 #define MPU6000_CS_GPIO GPIOB
35 #define MPU6000_CS_PIN GPIO_Pin_12
36 #define MPU6000_SPI_INSTANCE SPI2
38 #define MPU6500_CS_GPIO GPIOB
39 #define MPU6500_CS_PIN GPIO_Pin_12
40 #define MPU6500_SPI_INSTANCE SPI2
42 #define GYRO
43 #define USE_FAKE_GYRO
44 #define USE_GYRO_L3G4200D
45 //#define USE_GYRO_L3GD20
46 //#define USE_GYRO_MPU3050
47 #define USE_GYRO_MPU6050
48 #define USE_GYRO_SPI_MPU6000
49 #define USE_GYRO_SPI_MPU6500
51 #define GYRO_MPU6050_ALIGN CW0_DEG
53 #define ACC
54 #define USE_FAKE_ACC
55 #define USE_ACC_ADXL345
56 #define USE_ACC_BMA280
57 #define USE_ACC_MMA8452
58 #define USE_ACC_MPU6050
59 //#define USE_ACC_SPI_MPU6000
60 #define USE_ACC_SPI_MPU6500
62 #define ACC_MPU6050_ALIGN CW0_DEG
64 #define BARO
65 #define USE_BARO_MS5611
66 #define USE_BARO_BMP085
68 #define MAG
69 #define USE_MAG_HMC5883
70 #define USE_MAG_AK8975
72 #define MAG_AK8975_ALIGN CW180_DEG_FLIP
75 #define SONAR
76 #define LED0
77 #define LED1
78 #define DISPLAY
79 #define INVERTER
81 #define USE_USART1
82 #define USE_USART2
83 #define USE_SOFTSERIAL1
84 #define USE_SOFTSERIAL2
85 #define SERIAL_PORT_COUNT 4
87 #define SOFTSERIAL_1_TIMER TIM3
88 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
89 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
90 #define SOFTSERIAL_2_TIMER TIM3
91 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
92 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
94 #define USE_I2C
95 #define I2C_DEVICE (I2CDEV_2)
97 // #define SOFT_I2C // enable to test software i2c
98 // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
99 // #define SOFT_I2C_PB67
101 #define USE_ADC
103 #define CURRENT_METER_ADC_GPIO GPIOB
104 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
105 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
107 #define VBAT_ADC_GPIO GPIOA
108 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
109 #define VBAT_ADC_CHANNEL ADC_Channel_4
111 #define RSSI_ADC_GPIO GPIOA
112 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
113 #define RSSI_ADC_CHANNEL ADC_Channel_1
115 #define EXTERNAL1_ADC_GPIO GPIOA
116 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5
117 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_5
119 #define SENSORS_SET (SENSOR_ACC | SENSOR_BARO | SENSOR_MAG)
121 #define GPS
122 #define LED_STRIP
123 #define LED_STRIP_TIMER TIM3
125 #define BLACKBOX
126 #define TELEMETRY
127 #define SERIAL_RX
128 #define AUTOTUNE
130 #define SPEKTRUM_BIND
131 // USART2, PA3
132 #define BIND_PORT GPIOA
133 #define BIND_PIN Pin_3