Cleanup CC3D/NAZE/OLIMEXINO ADC initialisation and PWM mapping. Fixes
[betaflight.git] / src / main / target / OLIMEXINO / target.h
blob34ec32a7dcd2e94fb843f15ae714fc5a4d3d50e0
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 "OLI1" // Olimexino
22 //#define OLIMEXINO_UNCUT_LED1_E_JUMPER
23 //#define OLIMEXINO_UNCUT_LED2_E_JUMPER
25 #ifdef OLIMEXINO_UNCUT_LED1_E_JUMPER
26 #define LED0_GPIO GPIOA
27 #define LED0_PIN Pin_5 // D13, PA5/SPI1_SCK/ADC5 - "LED1" on silkscreen, Green
28 #define LED0_PERIPHERAL RCC_APB2Periph_GPIOA
29 #define LED0
30 #endif
32 #ifdef OLIMEXINO_UNCUT_LED2_E_JUMPER
33 // "LED2" is using one of the PWM pins (CH2/PWM2), so we must not use PWM2 unless the jumper is cut. @See pwmInit()
34 #define LED1_GPIO GPIOA
35 #define LED1_PIN Pin_1 // D3, PA1/USART2_RTS/ADC1/TIM2_CH3 - "LED2" on silkscreen, Yellow
36 #define LED1_PERIPHERAL RCC_APB2Periph_GPIOA
37 #define LED1
38 #endif
40 #define GYRO
41 #define USE_FAKE_GYRO
42 //#define USE_GYRO_L3G4200D
43 //#define USE_GYRO_L3GD20
44 //#define USE_GYRO_MPU3050
45 #define USE_GYRO_MPU6050
46 //#define USE_GYRO_SPI_MPU6000
47 //#define USE_GYRO_SPI_MPU6500
49 #define ACC
50 #define USE_FAKE_ACC
51 //#define USE_ACC_ADXL345
52 //#define USE_ACC_BMA280
53 //#define USE_ACC_MMA8452
54 //#define USE_ACC_LSM303DLHC
55 #define USE_ACC_MPU6050
56 //#define USE_ACC_SPI_MPU6000
57 //#define USE_ACC_SPI_MPU6500
59 #define BARO
60 //#define USE_BARO_MS5611
61 #define USE_BARO_BMP085
63 #define MAG
64 #define USE_MAG_HMC5883
66 #define SONAR
68 #define USE_USART1
69 #define USE_USART2
70 #define USE_SOFTSERIAL1
71 #define USE_SOFTSERIAL2
72 #define SERIAL_PORT_COUNT 4
74 #define SOFTSERIAL_1_TIMER TIM3
75 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
76 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
77 #define SOFTSERIAL_2_TIMER TIM3
78 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
79 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
81 #define USE_I2C
82 #define I2C_DEVICE (I2CDEV_2)
84 // #define SOFT_I2C // enable to test software i2c
85 // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
86 // #define SOFT_I2C_PB67
88 #define USE_ADC
90 #define CURRENT_METER_ADC_GPIO GPIOB
91 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
92 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
94 #define VBAT_ADC_GPIO GPIOA
95 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
96 #define VBAT_ADC_CHANNEL ADC_Channel_4
98 #define RSSI_ADC_GPIO GPIOA
99 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
100 #define RSSI_ADC_CHANNEL ADC_Channel_1
102 #define EXTERNAL1_ADC_GPIO GPIOA
103 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5
104 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_5
107 #define SENSORS_SET (SENSOR_ACC | SENSOR_BARO | SENSOR_MAG)
109 #define GPS
110 #define LED_STRIP
111 #define LED_STRIP_TIMER TIM3
113 #define TELEMETRY
114 #define SERIAL_RX
115 #define AUTOTUNE