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 "EUF1"
22 
23 #define USE_TILT 0
24 #define LED0_GPIO GPIOB
25 #define LED0_PIN Pin_3 // PB3 (LED)
26 #define LED0_PERIPHERAL RCC_APB2Periph_GPIOB
27 #define LED1_GPIO GPIOB
28 #define LED1_PIN Pin_4 // PB4 (LED)
29 #define LED1_PERIPHERAL RCC_APB2Periph_GPIOB
30 
31 #define INVERTER_PIN Pin_2 // PB2 (BOOT1) abused as inverter select GPIO
32 #define INVERTER_GPIO GPIOB
33 #define INVERTER_PERIPHERAL RCC_APB2Periph_GPIOB
34 #define INVERTER_USART USART2
35 
36 #define MPU6000_CS_GPIO GPIOB
37 #define MPU6000_CS_PIN GPIO_Pin_12
38 #define MPU6000_SPI_INSTANCE SPI2
39 
40 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_APB2Periph_GPIOB
41 #define MPU6500_CS_GPIO GPIOB
42 #define MPU6500_CS_PIN GPIO_Pin_12
43 #define MPU6500_SPI_INSTANCE SPI2
44 
45 #define GYRO
46 #define USE_FAKE_GYRO
47 #define USE_GYRO_L3G4200D
48 //#define USE_GYRO_L3GD20
49 //#define USE_GYRO_MPU3050
50 #define USE_GYRO_MPU6050
51 #define USE_GYRO_SPI_MPU6000
52 #define USE_GYRO_SPI_MPU6500
53 
54 #define GYRO_MPU6050_ALIGN CW0_DEG
55 
56 #define ACC
57 #define USE_FAKE_ACC
58 #define USE_ACC_ADXL345
59 #define USE_ACC_BMA280
60 #define USE_ACC_MMA8452
61 #define USE_ACC_MPU6050
62 //#define USE_ACC_SPI_MPU6000
63 #define USE_ACC_SPI_MPU6500
64 
65 #define ACC_MPU6050_ALIGN CW0_DEG
66 
67 #define BARO
68 #define USE_BARO_MS5611
69 #define USE_BARO_BMP085
70 
71 #define USE_MAG 1
72 #define USE_MAG_HMC5883
73 #define USE_MAG_AK8975
74 
75 #define MAG_AK8975_ALIGN CW180_DEG_FLIP
76 
77 
78 #define LED0
79 #define LED1
80 #define DISPLAY
81 #define INVERTER
82 
83 #define SONAR
84 #define SONAR_PWM_TRIGGER_PIN Pin_8 // PWM5 (PB8) - 5v tolerant
85 #define SONAR_PWM_TRIGGER_GPIO GPIOB
86 #define SONAR_PWM_ECHO_PIN Pin_9 // PWM6 (PB9) - 5v tolerant
87 #define SONAR_PWM_ECHO_GPIO GPIOB
88 #define SONAR_PWM_EXTI_LINE EXTI_Line9
89 #define SONAR_PWM_EXTI_PIN_SOURCE GPIO_PinSource9
90 #define SONAR_PWM_EXTI_IRQN EXTI9_5_IRQn
91 #define SONAR_TRIGGER_PIN Pin_0 // RX7 (PB0) - only 3.3v ( add a 1K Ohms resistor )
92 #define SONAR_TRIGGER_GPIO GPIOB
93 #define SONAR_ECHO_PIN Pin_1 // RX8 (PB1) - only 3.3v ( add a 1K Ohms resistor )
94 #define SONAR_ECHO_GPIO GPIOB
95 #define SONAR_EXTI_LINE EXTI_Line1
96 #define SONAR_EXTI_PIN_SOURCE GPIO_PinSource1
97 #define SONAR_EXTI_IRQN EXTI1_IRQn
98 
99 #define USE_UART1
100 #define USE_UART2
101 #define USE_UART3
102 #define USE_UART4
103 #define USE_UART5
104 #define USE_SOFTSERIAL1
105 #define USE_SOFTSERIAL2
106 #define SERIAL_PORT_COUNT 7
107 
108 #define SOFTSERIAL_1_TIMER TIM3
109 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
110 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
111 #define SOFTSERIAL_2_TIMER TIM3
112 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
113 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
114 
115 #define USE_I2C
116 #define I2C_DEVICE (I2CDEV_2)
117 
118 // #define SOFT_I2C // enable to test software i2c
119 // #define SOFT_I2C_PB1011 // If SOFT_I2C is enabled above, need to define pinout as well (I2C1 = PB67, I2C2 = PB1011)
120 // #define SOFT_I2C_PB67
121 
122 #define USE_ADC
123 
124 #define CURRENT_METER_ADC_GPIO GPIOB
125 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
126 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_9
127 
128 #define VBAT_ADC_GPIO GPIOA
129 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
130 #define VBAT_ADC_CHANNEL ADC_Channel_4
131 
132 #define RSSI_ADC_GPIO GPIOA
133 #define RSSI_ADC_GPIO_PIN GPIO_Pin_1
134 #define RSSI_ADC_CHANNEL ADC_Channel_1
135 
136 #define EXTERNAL1_ADC_GPIO GPIOA
137 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_5
138 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_5
139 
140 
141 #define LED_STRIP
142 #define LED_STRIP_TIMER TIM3
143 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC6
144 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH6_HANDLER
145 
146 #define BLACKBOX
147 #define GPS
148 #define GTUNE
149 #define TELEMETRY
150 #define SERIAL_RX
151 #define USE_SERVOS
152 #define USE_CLI
153 
154 #define SPEKTRUM_BIND
155 // UART2, PA3
156 #define BIND_PORT GPIOA
157 #define BIND_PIN Pin_3