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 USE_TILT 0
22 #define TARGET_BOARD_IDENTIFIER "LUX"
23 #define BOARD_HAS_VOLTAGE_DIVIDER
24 
25 #define LED0_GPIO GPIOC
26 #define LED0_PIN Pin_15
27 #define LED0_PERIPHERAL RCC_AHBPeriph_GPIOC
28 
29 #define LED1_GPIO GPIOC
30 #define LED1_PIN Pin_14
31 #define LED1_PERIPHERAL RCC_AHBPeriph_GPIOC
32 
33 #define LED2_GPIO GPIOC
34 #define LED2_PIN Pin_13
35 #define LED2_PERIPHERAL RCC_AHBPeriph_GPIOC
36 
37 #define BEEP_GPIO GPIOB
38 #define BEEP_PIN Pin_13
39 #define BEEP_PERIPHERAL RCC_AHBPeriph_GPIOB
40 #define BEEPER_INVERTED
41 
42 #define MPU6500_CS_GPIO_CLK_PERIPHERAL RCC_AHBPeriph_GPIOA
43 #define MPU6500_CS_GPIO GPIOA
44 #define MPU6500_CS_PIN GPIO_Pin_4
45 #define MPU6500_SPI_INSTANCE SPI1
46 
47 #define USE_SPI
48 #define USE_SPI_DEVICE_1
49 
50 #define SPI1_GPIO GPIOB
51 #define SPI1_GPIO_PERIPHERAL RCC_AHBPeriph_GPIOB
52 #define SPI1_SCK_PIN GPIO_Pin_3
53 #define SPI1_SCK_PIN_SOURCE GPIO_PinSource3
54 #define SPI1_MISO_PIN GPIO_Pin_4
55 #define SPI1_MISO_PIN_SOURCE GPIO_PinSource4
56 #define SPI1_MOSI_PIN GPIO_Pin_5
57 #define SPI1_MOSI_PIN_SOURCE GPIO_PinSource5
58 
59 #define USABLE_TIMER_CHANNEL_COUNT 11
60 
61 #define EXTI_CALLBACK_HANDLER_COUNT 1 // MPU data ready
62 
63 #define GYRO
64 #define USE_GYRO_MPU6500
65 #define USE_GYRO_SPI_MPU6500
66 #define GYRO_MPU6500_ALIGN CW270_DEG
67 
68 #define ACC
69 #define USE_ACC_MPU6500
70 #define USE_ACC_SPI_MPU6500
71 #define ACC_MPU6500_ALIGN CW270_DEG
72 
73 #define USE_MAG 0
74 
75 #define USE_BEEPER 1
76 #define LED0
77 #define LED1
78 #define LED2
79 
80 #define USB_IO
81 
82 #define USE_VCP
83 #define USE_UART1
84 #define USE_UART2
85 #define USE_UART3
86 #define SERIAL_PORT_COUNT 4
87 
88 #define UART1_TX_PIN GPIO_Pin_4
89 #define UART1_RX_PIN GPIO_Pin_5
90 #define UART1_GPIO GPIOC
91 #define UART1_GPIO_AF GPIO_AF_7
92 #define UART1_TX_PINSOURCE GPIO_PinSource4
93 #define UART1_RX_PINSOURCE GPIO_PinSource5
94 
95 #define UART2_TX_PIN GPIO_Pin_14
96 #define UART2_RX_PIN GPIO_Pin_15
97 #define UART2_GPIO GPIOA
98 #define UART2_GPIO_AF GPIO_AF_7
99 #define UART2_TX_PINSOURCE GPIO_PinSource14
100 #define UART2_RX_PINSOURCE GPIO_PinSource15
101 
102 #define UART3_TX_PIN GPIO_Pin_10
103 #define UART3_RX_PIN GPIO_Pin_11
104 #define UART3_GPIO GPIOB
105 #define UART3_GPIO_AF GPIO_AF_7
106 #define UART3_TX_PINSOURCE GPIO_PinSource10
107 #define UART3_RX_PINSOURCE GPIO_PinSource11
108 
109 #define USE_I2C
110 #define I2C_DEVICE (I2CDEV_2)
111 
112 #define USE_ADC
113 
114 #define ADC_INSTANCE ADC1
115 #define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA1
116 #define ADC_DMA_CHANNEL DMA1_Channel1
117 
118 #define VBAT_ADC_GPIO GPIOC
119 #define VBAT_ADC_GPIO_PIN GPIO_Pin_0
120 #define VBAT_ADC_CHANNEL ADC_Channel_6
121 
122 #define CURRENT_METER_ADC_GPIO GPIOC
123 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_1
124 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_7
125 
126 #define RSSI_ADC_GPIO GPIOC
127 #define RSSI_ADC_GPIO_PIN GPIO_Pin_2
128 #define RSSI_ADC_CHANNEL ADC_Channel_8
129 
130 #define EXTERNAL1_ADC_GPIO GPIOC
131 #define EXTERNAL1_ADC_GPIO_PIN GPIO_Pin_3
132 #define EXTERNAL1_ADC_CHANNEL ADC_Channel_9
133 
134 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
135 
136 #define BLACKBOX
137 #define GPS
138 #define GTUNE
139 #define LED_STRIP
140 
141 #define LED_STRIP_TIMER TIM16
142 
143 #define WS2811_GPIO GPIOA
144 #define WS2811_GPIO_AHB_PERIPHERAL RCC_AHBPeriph_GPIOA
145 #define WS2811_GPIO_AF GPIO_AF_1
146 #define WS2811_PIN GPIO_Pin_6 // TIM16_CH1
147 #define WS2811_PIN_SOURCE GPIO_PinSource6
148 #define WS2811_TIMER TIM16
149 #define WS2811_TIMER_APB2_PERIPHERAL RCC_APB2Periph_TIM16
150 #define WS2811_DMA_CHANNEL DMA1_Channel3
151 #define WS2811_IRQ DMA1_Channel3_IRQn
152 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
153 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
154 
155 
156 // MPU6500 interrupt
157 //#define DEBUG_MPU_DATA_READY_INTERRUPT
158 #define USE_MPU_DATA_READY_SIGNAL
159 #define ENSURE_MPU_DATA_READY_IS_LOW
160 
161 #define TELEMETRY
162 #define SERIAL_RX
163 #define USE_SERVOS
164 #define USE_CLI
165 
166 #define SPEKTRUM_BIND
167 // USART1, PC5
168 #define BIND_PORT GPIOC
169 #define BIND_PIN Pin_5
170 
171 #define USE_SERIAL_4WAY_BLHELI_INTERFACE