NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
target.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight 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.
8  *
9  * Ninjaflight 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.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #define USE_QUAD_MIXER_ONLY 0
21 #define TARGET_BOARD_IDENTIFIER "OLI1" // Olimexino
22 
23 //#define OLIMEXINO_UNCUT_LED1_E_JUMPER
24 //#define OLIMEXINO_UNCUT_LED2_E_JUMPER
25 
26 #ifdef OLIMEXINO_UNCUT_LED1_E_JUMPER
27 #define LED0_GPIO GPIOA
28 #define LED0_PIN Pin_5 // D13, PA5/SPI1_SCK/ADC5 - "LED1" on silkscreen, Green
29 #define LED0_PERIPHERAL RCC_APB2Periph_GPIOA
30 #define LED0
31 #endif
32 
33 #ifdef OLIMEXINO_UNCUT_LED2_E_JUMPER
34 // "LED2" is using one of the PWM pins (CH2/PWM2), so we must not use PWM2 unless the jumper is cut. @See pwmInit()
35 #define LED1_GPIO GPIOA
36 #define LED1_PIN Pin_1 // D3, PA1/UART2_RTS/ADC1/TIM2_CH3 - "LED2" on silkscreen, Yellow
37 #define LED1_PERIPHERAL RCC_APB2Periph_GPIOA
38 #define LED1
39 #endif
40 
41 #define USE_TILT 0
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
50 
51 #define ACC
52 #define USE_FAKE_ACC
53 //#define USE_ACC_ADXL345
54 //#define USE_ACC_BMA280
55 //#define USE_ACC_MMA8452
56 //#define USE_ACC_LSM303DLHC
57 #define USE_ACC_MPU6050
58 //#define USE_ACC_SPI_MPU6000
59 //#define USE_ACC_SPI_MPU6500
60 
61 #define BARO
62 //#define USE_BARO_MS5611
63 #define USE_BARO_BMP085
64 
65 #define USE_MAG 1
66 #define USE_MAG_HMC5883
67 
68 #define SONAR
69 #define SONAR_TRIGGER_PIN Pin_0 // RX7 (PB0) - only 3.3v ( add a 1K Ohms resistor )
70 #define SONAR_TRIGGER_GPIO GPIOB
71 #define SONAR_ECHO_PIN Pin_1 // RX8 (PB1) - only 3.3v ( add a 1K Ohms resistor )
72 #define SONAR_ECHO_GPIO GPIOB
73 #define SONAR_EXTI_LINE EXTI_Line1
74 #define SONAR_EXTI_PIN_SOURCE GPIO_PinSource1
75 #define SONAR_EXTI_IRQN EXTI1_IRQn
76 
77 #define USE_UART1
78 #define USE_UART2
79 #define USE_SOFTSERIAL1
80 #define USE_SOFTSERIAL2
81 #define SERIAL_PORT_COUNT 4
82 
83 #define SOFTSERIAL_1_TIMER TIM3
84 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
85 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
86 #define SOFTSERIAL_2_TIMER TIM3
87 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
88 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
89 
90 #define USE_I2C
91 #define I2C_DEVICE (I2CDEV_2)
92 
93 // #define SOFT_I2C // enable to test software i2c
94 // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
95 // #define SOFT_I2C_PB67
96 
97 #define USE_ADC
98 
99 #define CURRENT_METER_ADC_GPIO GPIOB
100 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
101 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
102 
103 #define VBAT_ADC_GPIO GPIOA
104 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
105 #define VBAT_ADC_CHANNEL ADC_Channel_4
106 
107 #define RSSI_ADC_GPIO GPIOA
108 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
109 #define RSSI_ADC_CHANNEL ADC_Channel_1
110 
111 #define EXTERNAL1_ADC_GPIO GPIOA
112 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5
113 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_5
114 
115 #define GPS
116 
117 #define LED_STRIP
118 #define LED_STRIP_TIMER TIM3
119 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC6
120 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH6_HANDLER
121 
122 #define TELEMETRY
123 #define SERIAL_RX
124 #define BLACKBOX
125 #define USE_SERVOS
126 #define USE_CLI