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 "MOTO" // MotoLab
23 #define USE_CLI
24 
25 #define LED0_GPIO GPIOB
26 #define LED0_PIN Pin_5 // Blue LEDs - PB5
27 #define LED0_PERIPHERAL RCC_AHBPeriph_GPIOB
28 #define LED1_GPIO GPIOB
29 #define LED1_PIN Pin_9 // Green LEDs - PB9
30 #define LED1_PERIPHERAL RCC_AHBPeriph_GPIOB
31 
32 #define BEEP_GPIO GPIOA
33 #define BEEP_PIN Pin_0
34 #define BEEP_PERIPHERAL RCC_AHBPeriph_GPIOA
35 #define BEEPER_INVERTED
36 #define USE_BEEPER 1
37 
38 #define USABLE_TIMER_CHANNEL_COUNT 9
39 
40 // MPU6050 interrupts
41 #define EXTI15_10_CALLBACK_HANDLER_COUNT 1 // MPU data ready
42 #define USE_MPU_DATA_READY_SIGNAL
43 //#define ENSURE_MPU_DATA_READY_IS_LOW
44 
45 #define GYRO
46 #define ACC
47 
48 #define USE_GYRO_MPU6050
49 #define GYRO_MPU6050_ALIGN CW180_DEG
50 #define USE_ACC_MPU6050
51 #define ACC_MPU6050_ALIGN CW180_DEG
52 
53 #define USE_GYRO_SPI_MPU6000
54 #define GYRO_MPU6000_ALIGN CW180_DEG
55 #define USE_ACC_SPI_MPU6000
56 #define ACC_MPU6000_ALIGN CW180_DEG
57 
58 #define MPU6000_CS_GPIO GPIOB
59 #define MPU6000_CS_PIN GPIO_Pin_12
60 #define MPU6000_SPI_INSTANCE SPI2
61 
62 //#define BARO
63 //#define USE_BARO_MS5611
64 
65 #define USE_MAG 0
66 //#define USE_MAG_HMC5883
67 
68 #define LED0
69 
70 #define USB_IO
71 #define USE_VCP
72 #define USE_UART1
73 #define USE_UART2
74 #define USE_UART3
75 #define SERIAL_PORT_COUNT 4
76 
77 #define UART1_TX_PIN GPIO_Pin_6 // PB6
78 #define UART1_RX_PIN GPIO_Pin_7 // PB7
79 #define UART1_GPIO GPIOB
80 #define UART1_GPIO_AF GPIO_AF_7
81 #define UART1_TX_PINSOURCE GPIO_PinSource6
82 #define UART1_RX_PINSOURCE GPIO_PinSource7
83 
84 #define UART2_TX_PIN GPIO_Pin_3 // PB3
85 #define UART2_RX_PIN GPIO_Pin_4 // PB4
86 #define UART2_GPIO GPIOB
87 #define UART2_GPIO_AF GPIO_AF_7
88 #define UART2_TX_PINSOURCE GPIO_PinSource3
89 #define UART2_RX_PINSOURCE GPIO_PinSource4
90 
91 #define UART3_TX_PIN GPIO_Pin_10 // PB10 (AF7)
92 #define UART3_RX_PIN GPIO_Pin_11 // PB11 (AF7)
93 #define UART3_GPIO_AF GPIO_AF_7
94 #define UART3_GPIO GPIOB
95 #define UART3_TX_PINSOURCE GPIO_PinSource10
96 #define UART3_RX_PINSOURCE GPIO_PinSource11
97 
98 #define USE_I2C
99 #define I2C_DEVICE (I2CDEV_2) // SDA (PA10/AF4), SCL (PA9/AF4)
100 
101 #define I2C2_SCL_GPIO GPIOA
102 #define I2C2_SCL_GPIO_AF GPIO_AF_4
103 #define I2C2_SCL_PIN GPIO_Pin_9
104 #define I2C2_SCL_PIN_SOURCE GPIO_PinSource9
105 #define I2C2_SCL_CLK_SOURCE RCC_AHBPeriph_GPIOA
106 #define I2C2_SDA_GPIO GPIOA
107 #define I2C2_SDA_GPIO_AF GPIO_AF_4
108 #define I2C2_SDA_PIN GPIO_Pin_10
109 #define I2C2_SDA_PIN_SOURCE GPIO_PinSource10
110 #define I2C2_SDA_CLK_SOURCE RCC_AHBPeriph_GPIOA
111 
112 #define USE_SPI
113 #define USE_SPI_DEVICE_2
114 
115 #define M25P16_CS_GPIO GPIOB
116 #define M25P16_CS_PIN GPIO_Pin_12
117 #define M25P16_SPI_INSTANCE SPI2
118 
119 //#define SENSORS_SET (SENSOR_ACC | SENSOR_BARO | SENSOR_GPS | SENSOR_MAG)
120 #define SENSORS_SET (SENSOR_ACC)
121 
122 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
123 
124 #define TELEMETRY
125 #define BLACKBOX
126 #define SERIAL_RX
127 //#define GPS
128 #define GTUNE
129 #define DISPLAY
130 #define USE_SERVOS
131 #define USE_FLASHFS
132 #define USE_FLASH_M25P16
133 
134 #define USE_ADC
135 #define BOARD_HAS_VOLTAGE_DIVIDER
136 
137 #define ADC_INSTANCE ADC2
138 #define ADC_DMA_CHANNEL DMA2_Channel1
139 #define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA2
140 
141 #define VBAT_ADC_GPIO GPIOA
142 #define VBAT_ADC_GPIO_PIN GPIO_Pin_5
143 #define VBAT_ADC_CHANNEL ADC_Channel_2
144 
145 //#define CURRENT_METER_ADC_GPIO GPIOA
146 //#define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_5
147 //#define CURRENT_METER_ADC_CHANNEL ADC_Channel_2
148 
149 #define RSSI_ADC_GPIO GPIOB
150 #define RSSI_ADC_GPIO_PIN GPIO_Pin_2
151 #define RSSI_ADC_CHANNEL ADC_Channel_12
152 
153 #define LED_STRIP
154 #define LED_STRIP_TIMER TIM16
155 
156 #define USE_LED_STRIP_ON_DMA1_CHANNEL3
157 #define WS2811_GPIO GPIOB
158 #define WS2811_GPIO_AHB_PERIPHERAL RCC_AHBPeriph_GPIOB
159 #define WS2811_GPIO_AF GPIO_AF_1
160 #define WS2811_PIN GPIO_Pin_8 // TIM16_CH1
161 #define WS2811_PIN_SOURCE GPIO_PinSource8
162 #define WS2811_TIMER TIM16
163 #define WS2811_TIMER_APB2_PERIPHERAL RCC_APB2Periph_TIM16
164 #define WS2811_DMA_CHANNEL DMA1_Channel3
165 #define WS2811_IRQ DMA1_Channel3_IRQn
166 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC3
167 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH3_HANDLER
168 
169 #define SPEKTRUM_BIND
170 // UART2, PB4
171 #define BIND_PORT GPIOB
172 #define BIND_PIN Pin_4
173 
174 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
175