NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
target.h
Go to the documentation of this file.
1 #pragma once
2 
3 #define USE_QUAD_MIXER_ONLY 0
4 #define UNIT_TEST
5 
6 #define USE_TILT 1
7 #define LED0_GPIO GPIOB
8 #define LED0_PIN Pin_3
9 #define LED0_PERIPHERAL RCC_AHBPeriph_GPIOB
10 
11 #define BEEP_GPIO GPIOC
12 #define BEEP_PIN Pin_15
13 #define BEEP_PERIPHERAL RCC_AHBPeriph_GPIOC
14 #define BEEPER_INVERTED
15 
16 #define USABLE_TIMER_CHANNEL_COUNT 17
17 
18 #define EXTI_CALLBACK_HANDLER_COUNT 2 // MPU data ready and MAG data ready
19 
20 #define USE_MPU_DATA_READY_SIGNAL
21 #define ENSURE_MPU_DATA_READY_IS_LOW
22 
23 #define USE_MAG_DATA_READY_SIGNAL
24 #define ENSURE_MAG_DATA_READY_IS_HIGH
25 
26 
27 #define GYRO
28 #define USE_GYRO_MPU6050
29 #define GYRO_MPU6050_ALIGN CW270_DEG
30 
31 #define ACC
32 #define USE_ACC_MPU6050
33 #define ACC_MPU6050_ALIGN CW270_DEG
34 
35 #define BARO
36 #define USE_BARO_MS5611
37 
38 #define USE_MAG 0
39 #define USE_MAG_AK8975
40 #define USE_MAG_HMC5883
41 #define MAG_HMC5883_ALIGN CW270_DEG
42 
43 //#define USE_FLASHFS
44 //#define USE_FLASH_M25P16
45 
46 #define USE_BEEPER 1
47 #define LED0
48 
49 //#define SONAR
50 #define SONAR_TRIGGER_PIN Pin_0 // RC_CH7 (PB0) - only 3.3v ( add a 1K Ohms resistor )
51 #define SONAR_TRIGGER_GPIO GPIOB
52 #define SONAR_ECHO_PIN Pin_1 // RC_CH8 (PB1) - only 3.3v ( add a 1K Ohms resistor )
53 #define SONAR_ECHO_GPIO GPIOB
54 #define SONAR_EXTI_LINE EXTI_Line1
55 #define SONAR_EXTI_PIN_SOURCE EXTI_PinSource1
56 #define SONAR_EXTI_IRQN EXTI1_IRQn
57 
58 #define USE_UART1
59 #define USE_UART2
60 #define USE_UART3
61 #define USE_SOFTSERIAL1
62 #define USE_SOFTSERIAL2
63 #define SERIAL_PORT_COUNT 8
64 
65 #ifndef UART1_GPIO
66 #define UART1_TX_PIN GPIO_Pin_9 // PA9
67 #define UART1_RX_PIN GPIO_Pin_10 // PA10
68 #define UART1_GPIO GPIOA
69 #define UART1_GPIO_AF GPIO_AF_7
70 #define UART1_TX_PINSOURCE GPIO_PinSource9
71 #define UART1_RX_PINSOURCE GPIO_PinSource10
72 #endif
73 
74 #define UART2_TX_PIN GPIO_Pin_14 // PA14 / SWCLK
75 #define UART2_RX_PIN GPIO_Pin_15 // PA15
76 #define UART2_GPIO GPIOA
77 #define UART2_GPIO_AF GPIO_AF_7
78 #define UART2_TX_PINSOURCE GPIO_PinSource14
79 #define UART2_RX_PINSOURCE GPIO_PinSource15
80 
81 #ifndef UART3_GPIO
82 #define UART3_TX_PIN GPIO_Pin_10 // PB10 (AF7)
83 #define UART3_RX_PIN GPIO_Pin_11 // PB11 (AF7)
84 #define UART3_GPIO_AF GPIO_AF_7
85 #define UART3_GPIO GPIOB
86 #define UART3_TX_PINSOURCE GPIO_PinSource10
87 #define UART3_RX_PINSOURCE GPIO_PinSource11
88 #endif
89 
90 #define SOFTSERIAL_1_TIMER TIM3
91 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 4 // PWM 5
92 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 5 // PWM 6
93 #define SOFTSERIAL_2_TIMER TIM3
94 #define SOFTSERIAL_2_TIMER_RX_HARDWARE 6 // PWM 7
95 #define SOFTSERIAL_2_TIMER_TX_HARDWARE 7 // PWM 8
96 
97 /*
98 #define USE_I2C
99 #define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA
100 
101 #define USE_SPI
102 #define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5
103 
104 #define M25P16_CS_GPIO GPIOB
105 #define M25P16_CS_PIN GPIO_Pin_12
106 #define M25P16_SPI_INSTANCE SPI2
107 
108 #define USE_ADC
109 #define BOARD_HAS_VOLTAGE_DIVIDER
110 */
111 
112 #define ADC_INSTANCE ADC2
113 #define ADC_DMA_CHANNEL DMA2_Channel1
114 #define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA2
115 
116 #define VBAT_ADC_GPIO GPIOA
117 #define VBAT_ADC_GPIO_PIN GPIO_Pin_4
118 #define VBAT_ADC_CHANNEL ADC_Channel_1
119 
120 #define CURRENT_METER_ADC_GPIO GPIOA
121 #define CURRENT_METER_ADC_GPIO_PIN GPIO_Pin_5
122 #define CURRENT_METER_ADC_CHANNEL ADC_Channel_2
123 
124 #define RSSI_ADC_GPIO GPIOB
125 #define RSSI_ADC_GPIO_PIN GPIO_Pin_2
126 #define RSSI_ADC_CHANNEL ADC_Channel_12
127 
128 #define LED_STRIP
129 #define LED_STRIP_TIMER TIM1
130 
131 #define WS2811_GPIO GPIOA
132 #define WS2811_GPIO_AHB_PERIPHERAL RCC_AHBPeriph_GPIOA
133 #define WS2811_GPIO_AF GPIO_AF_6
134 #define WS2811_PIN GPIO_Pin_8
135 #define WS2811_PIN_SOURCE GPIO_PinSource8
136 #define WS2811_TIMER TIM1
137 #define WS2811_TIMER_APB2_PERIPHERAL RCC_APB2Periph_TIM1
138 #define WS2811_DMA_CHANNEL DMA1_Channel2
139 #define WS2811_IRQ DMA1_Channel2_IRQn
140 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC2
141 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH2_HANDLER
142 
143 
144 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
145 
146 #define USE_BLACKBOX 0
147 //#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
148 
149 //#define DISPLAY
150 //#define GPS
151 //#define GTUNE
152 //#define SERIAL_RX
153 //#define TELEMETRY
154 #define USE_SERVOS
155 #define USE_CLI
156 
157 //#define SPEKTRUM_BIND
158 // UART3,
159 #define BIND_PORT GPIOB
160 #define BIND_PIN Pin_11
161 
162 //#define USE_SERIAL_4WAY_BLHELI_INTERFACE
163 
164 #define TARGET_BOARD_IDENTIFIER "SITL"
165 #define U_ID_0 'S'
166 #define U_ID_1 'I'
167 #define U_ID_2 'M'
168 
169 
170 /*
171 #define USE_QUAD_MIXER_ONLY 0
172 
173 #define TARGET_BOARD_IDENTIFIER "SITL"
174 #define U_ID_0 'S'
175 #define U_ID_1 'I'
176 #define U_ID_2 'M'
177 
178 #define ACC
179 #define USE_TILT 0
180 #define USE_MAG 0
181 #define SERIAL_PORT_COUNT 1
182 */