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