Added common target header file.
[betaflight.git] / src / main / target / OLIMEXINO / target.h
blobbfa508e9680da0c1feaaadf816c75c3be9f03a81
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
67 #define SONAR_TRIGGER_PIN Pin_0 // RX7 (PB0) - only 3.3v ( add a 1K Ohms resistor )
68 #define SONAR_TRIGGER_GPIO GPIOB
69 #define SONAR_ECHO_PIN Pin_1 // RX8 (PB1) - only 3.3v ( add a 1K Ohms resistor )
70 #define SONAR_ECHO_GPIO GPIOB
71 #define SONAR_EXTI_LINE EXTI_Line1
72 #define SONAR_EXTI_PIN_SOURCE GPIO_PinSource1
73 #define SONAR_EXTI_IRQN EXTI1_IRQn
75 #define USE_USART1
76 #define USE_USART2
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
97 #define CURRENT_METER_ADC_GPIO GPIOB
98 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
99 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
101 #define VBAT_ADC_GPIO GPIOA
102 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
103 #define VBAT_ADC_CHANNEL ADC_Channel_4
105 #define RSSI_ADC_GPIO GPIOA
106 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
107 #define RSSI_ADC_CHANNEL ADC_Channel_1
109 #define EXTERNAL1_ADC_GPIO GPIOA
110 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5
111 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_5
113 #define GPS
114 #define GPS_PROTO_NMEA
115 #define GPS_PROTO_UBLOX
116 #define GPS_PROTO_I2C_NAV
117 #define GPS_PROTO_NAZA
119 #define LED_STRIP
120 #define LED_STRIP_TIMER TIM3
122 #define TELEMETRY
123 #define TELEMETRY_FRSKY
124 #define TELEMETRY_HOTT
125 #define TELEMETRY_SMARTPORT
126 #define TELEMETRY_LTM
128 #define SERIAL_RX
129 #define BLACKBOX
130 #define USE_SERVOS
131 #define USE_CLI