Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stm32f4_discovery.h
Go to the documentation of this file.
1 /*
2  * STM32F4 DISCOVERY BOARD DEFINITIONS FOR THE PAPARAZZI AUTOPILOT.
3  *
4  * DISCOVERY USED FOR THE AUTOPILOT PINS
5  * PA0 = PWM9 + user-wake up button switch b1 normaly open.
6  * PA1 = PWM8
7  * PA2 = PWM7
8  * PA3 = PWM6
9  * PA4 = ADC_4 (ADC12 IN 4)+CS43L22 DAC out, capacitively coupled+100Kohm, should not interfere.
10  * PA5 = SPI1 SCK if STM32F4_DISCOVERY_SPI1_FOR_LIS302
11  * PA6 = SPI1 MISO if STM32F4_DISCOVERY_SPI1_FOR_LIS302
12  * PA7 = SPI1 MOSI if STM32F4_DISCOVERY_SPI1_FOR_LIS302
13  * PA8 = SPECTRUM BIND
14  * PA9 = FREE (ONLY if usb is not active during runtime, PC0 must be high or input )
15  * PA10 = UART1 RX (Spektrum input)
16  * PA11 = FREE if usb is not active during runtime
17  * PA12 = FREE if usb is not active during runtime
18  * PA13 = FREE
19  * PA14 = FREE
20  * PA15 = FREE
21  *
22  * PB0 = FREE
23  * PB1 = ADC_1 (ADC12 IN 9)
24  * PB2 = FREE
25  * PB3 = SPI1 SCL
26  * PB4 = SPI1 MISO
27  * PB5 = SPI1 MOSI
28  * PB6 = UART1 TX + 4K7 Ohm pull up resistor normaly used for i2c
29  * PB7 = UART1 RX
30  * PB8 = I2C1 SCL
31  * PB9 = I2C1 SDA + 4K7 Ohm pull up resistor normaly used for i2c
32  * PB10 = I2C2 SCL + MP45DT02 MEMS MIC clock in
33  * PB11 = I2C2 SDA
34  * PB12 = FREE
35  * PB13 = SPI2 SCL
36  * PB14 = PWM 10 OR SPI2 MISO
37  * PB15 = PWM 11 OR SPI2 MOSI
38  *
39  * PC0 = CANNOT BE USED, pulled up to 3.3v (10Kohm), low = usb power on directly applied to PA9)
40  * PC1 = ADC_5 (ADC123 IN 11)
41  * PC2 = ADC_6 (ADC123 IN 12)
42  * PC3 = CANNOT BE USED (MEMS microphone output)
43  * PC4 = ADC_3 (ADC12 IN 14)
44  * PC5 = ADC_2 (ADC12 IN 15)
45  * PC6 = UART6 TX
46  * PC7 = UART6 RX
47  * PC8 = FREE
48  * PC9 = PPM INPUT FROM RC RECEIVER
49  * PC10 = UART4 TX OR SPI3 SCL
50  * PC11 = UART4 RX OR SPI3 MISO
51  * PC12 = UART5 TX OR SPI3 MOSI
52  * PC13 = FREE max 3ma sink
53  * PC14 = FREE max 3ma sink, short circuit the relevant PCB bridge with solder to activate
54  * PC15 = FREE max 3ma sink, short circuit the relevant PCB bridge with solder to activate
55  *
56  * PD0 = FREE
57  * PD1 = FREE
58  * PD2 = UART5 RX
59  * PD3 = FREE
60  * PD4 = FREE
61  * PD5 = UART2 TX (usb power management fault output open drain)
62  * PD6 = UART2 RX
63  * PD7 = FREE
64  * PD8 = UART3 TX
65  * PD9 = UART3 RX
66  * PD10 = FREE
67  * PD11 = FREE
68  * PD12 = LED_4
69  * PD13 = LED_3
70  * PD14 = LED_5
71  * PD15 = LED_6
72  *
73  * PE0 = CANNOT BE USED (Accel int output)
74  * PE1 = CANNOT BE USED (Accel int output)
75  * PE2 = SPI SLAVE 0
76  * PE3 = SPI SLAVE 2 (used for the LIS302DL accel spi/i2c select pin)
77  * PE4 = FREE
78  * PE5 = PWM4
79  * PE6 = PWM5
80  * PE7 = SPI SLAVE 1
81  * PE8 = FREE
82  * PE9 = PWM0
83  * PE10 = FREE
84  * PE11 = PWM1
85  * PE12 = FREE
86  * PE13 = PWM2
87  * PE14 = PWM3
88  * PE15 = FREE
89  *
90  * PH0 = CRYSTAL - OSC IN
91  * PH1 = CRYSTAL - OSC OUT
92  */
93 
94 #ifndef CONFIG_STM32F4_DISCOVERY_H
95 #define CONFIG_STM32F4_DISCOVERY_H
96 
97 #define BOARD_STM32F4_DISCOVERY
98 
99 /* STM32F4_DISCOVERY has a 8MHz external clock and 168MHz internal. */
100 #define EXT_CLK 8000000
101 #define AHB_CLK 168000000
102 
103 /*
104  * Onboard LEDs
105  */
106 
107 /* orange, on PD13 */
108 #ifndef USE_LED_3
109 #define USE_LED_3 1
110 #endif
111 #define LED_3_GPIO GPIOD
112 #define LED_3_GPIO_PIN GPIO13
113 #define LED_3_AFIO_REMAP ((void)0)
114 #define LED_3_GPIO_ON gpio_set
115 #define LED_3_GPIO_OFF gpio_clear
116 
117 /* green, on PD12 */
118 #ifndef USE_LED_4
119 #define USE_LED_4 1
120 #endif
121 #define LED_4_GPIO GPIOD
122 #define LED_4_GPIO_PIN GPIO12
123 #define LED_4_AFIO_REMAP ((void)0)
124 #define LED_4_GPIO_ON gpio_set
125 #define LED_4_GPIO_OFF gpio_clear
126 
127 /* red, PD14 */
128 #ifndef USE_LED_5
129 #define USE_LED_5 1
130 #endif
131 #define LED_5_GPIO GPIOD
132 #define LED_5_GPIO_PIN GPIO14
133 #define LED_5_AFIO_REMAP ((void)0)
134 #define LED_5_GPIO_ON gpio_set
135 #define LED_5_GPIO_OFF gpio_clear
136 
137 /* blue, PD15 */
138 #ifndef USE_LED_6
139 #define USE_LED_6 1
140 #endif
141 #define LED_6_GPIO GPIOD
142 #define LED_6_GPIO_PIN GPIO15
143 #define LED_6_AFIO_REMAP ((void)0)
144 #define LED_6_GPIO_ON gpio_set
145 #define LED_6_GPIO_OFF gpio_clear
146 
147 
148 
149 /*
150 // LED 9 (Green) of the STM32F4 discovery board same as USB power (VBUS).
151 #ifndef USE_LED_9
152 #define USE_LED_9 1
153 #endif
154 #define LED_9_GPIO GPIOA
155 #define LED_9_GPIO_PIN GPIO9
156 #define LED_9_AFIO_REMAP ((void)0)
157 #define LED_9_GPIO_ON gpio_set
158 #define LED_9_GPIO_OFF gpio_clear
159 */
160 
161 
162 /***************************************************************************************************/
163 /************************************** UART *************************************************/
164 /***************************************************************************************************/
165 
166 // If you don't need all those uarts comment a uart block out to free pins.
167 #define UART1_GPIO_AF GPIO_AF7
168 #define UART1_GPIO_PORT_TX GPIOB
169 #define UART1_GPIO_TX GPIO6
170 #define UART1_GPIO_PORT_RX GPIOB
171 #define UART1_GPIO_RX GPIO7
172 
173 // UART2 is used for the Spectrum rx input also
174 #define UART2_GPIO_AF GPIO_AF7
175 #define UART2_GPIO_PORT_TX GPIOD
176 #define UART2_GPIO_TX GPIO5
177 #define UART2_GPIO_PORT_RX GPIOD
178 #define UART2_GPIO_RX GPIO6
179 
180 #define UART3_GPIO_AF GPIO_AF7
181 #define UART3_GPIO_PORT_TX GPIOD
182 #define UART3_GPIO_TX GPIO8
183 #define UART3_GPIO_PORT_RX GPIOD
184 #define UART3_GPIO_RX GPIO9
185 
186 // UARTS 4 AND 5 CANT BE USED IF SPI3 IS NEEDED
187 #if !USE_SPI3
188 #define UART4_GPIO_AF GPIO_AF8
189 #define UART4_GPIO_PORT_TX GPIOC
190 #define UART4_GPIO_TX GPIO10
191 #define UART4_GPIO_PORT_RX GPIOC
192 #define UART4_GPIO_RX GPIO11
193 
194 #define UART5_GPIO_AF GPIO_AF8
195 #define UART5_GPIO_PORT_TX GPIOC
196 #define UART5_GPIO_TX GPIO12
197 #define UART5_GPIO_PORT_RX GPIOD
198 #define UART5_GPIO_RX GPIO2
199 #endif
200 
201 #define UART6_GPIO_AF GPIO_AF8
202 #define UART6_GPIO_PORT_TX GPIOC
203 #define UART6_GPIO_TX GPIO6
204 #define UART6_GPIO_PORT_RX GPIOC
205 #define UART6_GPIO_RX GPIO7
206 
207 
208 /***************************************************************************************************/
209 /************************************** SPI *************************************************/
210 /***************************************************************************************************/
211 
212 #if STM32F4_DISCOVERY_SPI1_FOR_LIS302
213 #define SPI1_GPIO_AF GPIO_AF5
214 #define SPI1_GPIO_PORT_SCK GPIOA
215 #define SPI1_GPIO_SCK GPIO5
216 #define SPI1_GPIO_PORT_MISO GPIOA
217 #define SPI1_GPIO_MISO GPIO6
218 #define SPI1_GPIO_PORT_MOSI GPIOA
219 #define SPI1_GPIO_MOSI GPIO7
220 #else
221 #define SPI1_GPIO_AF GPIO_AF5
222 #define SPI1_GPIO_PORT_SCK GPIOB
223 #define SPI1_GPIO_SCK GPIO3
224 #define SPI1_GPIO_PORT_MISO GPIOB
225 #define SPI1_GPIO_MISO GPIO4
226 #define SPI1_GPIO_PORT_MOSI GPIOB
227 #define SPI1_GPIO_MOSI GPIO5
228 
229 #endif
230 
231 /* CANNOT BE USED IF PWM CHANNELS 10 & 11 ARE ACTIVE !!! */
232 #define SPI2_GPIO_AF GPIO_AF5
233 #define SPI2_GPIO_PORT_SCK GPIOB
234 #define SPI2_GPIO_SCK GPIO13
235 #define SPI2_GPIO_PORT_MISO GPIOB
236 #define SPI2_GPIO_MISO GPIO14
237 #define SPI2_GPIO_PORT_MOSI GPIOB
238 #define SPI2_GPIO_MOSI GPIO15
239 
240 /* CANNOT BE USED IF UARTS 4 & 5 ARE ACTIVE !!! */
241 #define SPI3_GPIO_AF GPIO_AF6
242 #define SPI3_GPIO_PORT_SCK GPIOC
243 #define SPI3_GPIO_SCK GPIO10
244 #define SPI3_GPIO_PORT_MISO GPIOC
245 #define SPI3_GPIO_MISO GPIO11
246 #define SPI3_GPIO_PORT_MOSI GPIOC
247 #define SPI3_GPIO_MOSI GPIO12
248 
249 #define SPI_SELECT_SLAVE0_PORT GPIOE
250 #define SPI_SELECT_SLAVE0_PIN GPIO2
251 #define SPI_SELECT_SLAVE1_PORT GPIOE
252 #define SPI_SELECT_SLAVE1_PIN GPIO7
253 #define SPI_SELECT_SLAVE2_PORT GPIOE
254 #define SPI_SELECT_SLAVE2_PIN GPIO3
255 
256 #define SPI1_GPIO_PORT_NSS GPIOA
257 #define SPI1_GPIO_NSS GPIO4
258 
259 #define SPI2_GPIO_PORT_NSS GPIOB
260 #define SPI2_GPIO_NSS GPIO12
261 
262 #define SPI3_GPIO_PORT_NSS GPIOA
263 #define SPI3_GPIO_NSS GPIO15
264 
265 /***************************************************************************************************/
266 /************************************** I2C *************************************************/
267 /***************************************************************************************************/
268 #define I2C1_GPIO_PORT GPIOB
269 #define I2C1_GPIO_SCL GPIO8
270 #define I2C1_GPIO_SDA GPIO9
271 
272 #define I2C2_GPIO_PORT GPIOB
273 #define I2C2_GPIO_SCL GPIO10
274 #define I2C2_GPIO_SDA GPIO11
275 
276 //#define I2C3_GPIO_PORT_SCL GPIOA
277 //#define I2C3_GPIO_SCL GPIO8
278 //#define I2C3_GPIO_PORT_SDA GPIOC
279 //#define I2C3_GPIO_SDA GPIO9
280 
281 
282 /***************************************************************************************************/
283 /************************************** ADC *************************************************/
284 /***************************************************************************************************/
285 
286 #define USE_AD_TIM2 1
287 
288 // For experimenting only
289 #define USE_ADC_1 1
290 #define USE_ADC_2 1
291 #define USE_ADC_3 1
292 #define USE_ADC_4 1
293 #define USE_ADC_5 1
294 #define USE_ADC_6 1
295 //#define USE_ADC_7 1
296 
297 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file */
298 #ifndef ADC_CHANNEL_VSUPPLY
299 #define ADC_CHANNEL_VSUPPLY ADC_4
300 #endif
301 #if !defined(USE_ADC_4)
302 #define USE_ADC_4 1
303 #endif
304 
305 #define DefaultVoltageOfAdc(adc) (0.00485*adc)
306 
307 /* provide defines that can be used to access the ADC_x in the code or airframe file
308  * these directly map to the index number of the 4 adc channels defined above
309  * 4th (index 3) is used for bat monitoring by default
310  */
311 
312 // AUX 1
313 #if USE_ADC_1
314 #define AD1_1_CHANNEL 9
315 #define ADC_1 AD1_1 // THIS CHANNEL USES THE ADC 1 CONVERTER
316 #define ADC_1_GPIO_PORT GPIOB
317 #define ADC_1_GPIO_PIN GPIO1
318 #endif
319 
320 // AUX 2
321 #if USE_ADC_2
322 #define AD1_2_CHANNEL 15
323 #define ADC_2 AD1_2 // THIS CHANNEL USES THE ADC 1 CONVERTER
324 #define ADC_2_GPIO_PORT GPIOC
325 #define ADC_2_GPIO_PIN GPIO5
326 #endif
327 
328 // AUX 3
329 #if USE_ADC_3
330 #define AD2_1_CHANNEL 14
331 #define ADC_3 AD2_1 // THIS CHANNEL USES THE ADC 2 CONVERTER
332 #define ADC_3_GPIO_PORT GPIOC
333 #define ADC_3_GPIO_PIN GPIO4
334 #endif
335 
336 // BAT
337 #if USE_ADC_4
338 #define AD2_2_CHANNEL 4
339 #define ADC_4 AD2_2 // THIS CHANNEL USES THE ADC 2 CONVERTER
340 #define ADC_4_GPIO_PORT GPIOA
341 #define ADC_4_GPIO_PIN GPIO4
342 #endif
343 
344 #if USE_ADC_5
345 #define AD3_1_CHANNEL 11
346 #define ADC_5 AD3_1 // THIS CHANNEL USES THE ADC 3 CONVERTER
347 #define ADC_5_GPIO_PORT GPIOC
348 #define ADC_5_GPIO_PIN GPIO1
349 #endif
350 
351 #if USE_ADC_6
352 #define AD3_2_CHANNEL 12
353 #define ADC_6 AD3_2 // THIS CHANNEL USES THE ADC 3 CONVERTER
354 #define ADC_6_GPIO_PORT GPIOC
355 #define ADC_6_GPIO_PIN GPIO2
356 #endif
357 
358 
359 /***************************************************************************************************/
360 /************************************ ACTUATORS ************************************************/
361 /***************************************************************************************************/
362 
363 /* Default actuators driver */
364 #define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
365 #define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
366 #define ActuatorsDefaultInit() ActuatorsPwmInit()
367 #define ActuatorsDefaultCommit() ActuatorsPwmCommit()
368 
369 
370 /***************************************************************************************************/
371 /********************************** SERVO PWM *************************************************/
372 /***************************************************************************************************/
373 
374 #define PWM_USE_TIM1 1
375 //#define PWM_USE_TIM3 1
376 #define PWM_USE_TIM5 1
377 #define PWM_USE_TIM9 1
378 #define PWM_USE_TIM12 1
379 
380 #define USE_PWM0 1
381 #define USE_PWM1 1
382 #define USE_PWM2 1
383 #define USE_PWM3 1
384 #define USE_PWM4 1
385 #define USE_PWM5 1
386 #define USE_PWM6 1
387 #define USE_PWM7 1
388 #define USE_PWM8 1
389 #define USE_PWM9 1
390 #if USE_SPI2
391 #define USE_PWM10 0
392 #define USE_PWM11 0
393 #else
394 #define USE_PWM10 1
395 #define USE_PWM11 1
396 #endif
397 
398 #define ACTUATORS_PWM_NB 12
399 
400 // PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
401 #if USE_PWM0
402 #define PWM_SERVO_0 0
403 #define PWM_SERVO_0_TIMER TIM1
404 #define PWM_SERVO_0_GPIO GPIOE
405 #define PWM_SERVO_0_PIN GPIO9
406 #define PWM_SERVO_0_AF GPIO_AF1
407 #define PWM_SERVO_0_OC TIM_OC1
408 #define PWM_SERVO_0_OC_BIT (1<<0)
409 #else
410 #define PWM_SERVO_0_OC_BIT 0
411 #endif
412 
413 #if USE_PWM1
414 #define PWM_SERVO_1 1
415 #define PWM_SERVO_1_TIMER TIM1
416 #define PWM_SERVO_1_GPIO GPIOE
417 #define PWM_SERVO_1_PIN GPIO11
418 #define PWM_SERVO_1_AF GPIO_AF1
419 #define PWM_SERVO_1_OC TIM_OC2
420 #define PWM_SERVO_1_OC_BIT (1<<1)
421 #else
422 #define PWM_SERVO_1_OC_BIT 0
423 #endif
424 
425 #if USE_PWM2
426 #define PWM_SERVO_2 2
427 #define PWM_SERVO_2_TIMER TIM1
428 #define PWM_SERVO_2_GPIO GPIOE
429 #define PWM_SERVO_2_PIN GPIO13
430 #define PWM_SERVO_2_AF GPIO_AF1
431 #define PWM_SERVO_2_OC TIM_OC3
432 #define PWM_SERVO_2_OC_BIT (1<<2)
433 #else
434 #define PWM_SERVO_2_OC_BIT 0
435 #endif
436 
437 #if USE_PWM3
438 #define PWM_SERVO_3 3
439 #define PWM_SERVO_3_TIMER TIM1
440 #define PWM_SERVO_3_GPIO GPIOE
441 #define PWM_SERVO_3_PIN GPIO14
442 #define PWM_SERVO_3_AF GPIO_AF1
443 #define PWM_SERVO_3_OC TIM_OC4
444 #define PWM_SERVO_3_OC_BIT (1<<3)
445 #else
446 #define PWM_SERVO_3_OC_BIT 0
447 #endif
448 
449 #if USE_PWM4
450 #define PWM_SERVO_4 4
451 #define PWM_SERVO_4_TIMER TIM9
452 #define PWM_SERVO_4_GPIO GPIOE
453 #define PWM_SERVO_4_PIN GPIO5
454 #define PWM_SERVO_4_AF GPIO_AF3
455 #define PWM_SERVO_4_OC TIM_OC1
456 #define PWM_SERVO_4_OC_BIT (1<<0)
457 #else
458 #define PWM_SERVO_4_OC_BIT 0
459 #endif
460 
461 #if USE_PWM5
462 #define PWM_SERVO_5 5
463 #define PWM_SERVO_5_TIMER TIM9
464 #define PWM_SERVO_5_GPIO GPIOE
465 #define PWM_SERVO_5_PIN GPIO6
466 #define PWM_SERVO_5_AF GPIO_AF3
467 #define PWM_SERVO_5_OC TIM_OC2
468 #define PWM_SERVO_5_OC_BIT (1<<1)
469 #else
470 #define PWM_SERVO_5_OC_BIT 0
471 #endif
472 
473 
474 #if USE_PWM6
475 #define PWM_SERVO_6 6
476 #define PWM_SERVO_6_TIMER TIM5
477 #define PWM_SERVO_6_GPIO GPIOA
478 #define PWM_SERVO_6_PIN GPIO3
479 #define PWM_SERVO_6_AF GPIO_AF2
480 #define PWM_SERVO_6_OC TIM_OC4
481 #define PWM_SERVO_6_OC_BIT (1<<3)
482 #else
483 #define PWM_SERVO_6_OC_BIT 0
484 #endif
485 
486 #if USE_PWM7
487 #define PWM_SERVO_7 7
488 #define PWM_SERVO_7_TIMER TIM5
489 #define PWM_SERVO_7_GPIO GPIOA
490 #define PWM_SERVO_7_PIN GPIO2
491 #define PWM_SERVO_7_AF GPIO_AF2
492 #define PWM_SERVO_7_OC TIM_OC3
493 #define PWM_SERVO_7_OC_BIT (1<<2)
494 #else
495 #define PWM_SERVO_7_OC_BIT 0
496 #endif
497 
498 #if USE_PWM8
499 #define PWM_SERVO_8 8
500 #define PWM_SERVO_8_TIMER TIM5
501 #define PWM_SERVO_8_GPIO GPIOA
502 #define PWM_SERVO_8_PIN GPIO1
503 #define PWM_SERVO_8_AF GPIO_AF2
504 #define PWM_SERVO_8_OC TIM_OC2
505 #define PWM_SERVO_8_OC_BIT (1<<1)
506 #else
507 #define PWM_SERVO_8_OC_BIT 0
508 #endif
509 
510 #if USE_PWM9
511 #define PWM_SERVO_9 9
512 #define PWM_SERVO_9_TIMER TIM5
513 #define PWM_SERVO_9_GPIO GPIOA
514 #define PWM_SERVO_9_PIN GPIO0
515 #define PWM_SERVO_9_AF GPIO_AF2
516 #define PWM_SERVO_9_OC TIM_OC1
517 #define PWM_SERVO_9_OC_BIT (1<<0)
518 #else
519 #define PWM_SERVO_9_OC_BIT 0
520 #endif
521 
522 /* PWM10 AND PWM11 cannot be used if SPI2 is active. */
523 #if USE_PWM10
524 #define PWM_SERVO_10 10
525 #define PWM_SERVO_10_TIMER TIM12
526 #define PWM_SERVO_10_GPIO GPIOB
527 #define PWM_SERVO_10_PIN GPIO14
528 #define PWM_SERVO_10_AF GPIO_AF9
529 #define PWM_SERVO_10_OC TIM_OC1
530 #define PWM_SERVO_10_OC_BIT (1<<0)
531 #else
532 #define PWM_SERVO_10_OC_BIT 0
533 #endif
534 
535 #if USE_PWM11
536 #define PWM_SERVO_11 11
537 #define PWM_SERVO_11_TIMER TIM12
538 #define PWM_SERVO_11_GPIO GPIOB
539 #define PWM_SERVO_11_PIN GPIO15
540 #define PWM_SERVO_11_AF GPIO_AF9
541 #define PWM_SERVO_11_OC TIM_OC2
542 #define PWM_SERVO_11_OC_BIT (1<<1)
543 #else
544 #define PWM_SERVO_11_OC_BIT 0
545 #endif
546 
547 #define PWM_TIM1_CHAN_MASK (PWM_SERVO_0_OC_BIT|PWM_SERVO_1_OC_BIT|PWM_SERVO_2_OC_BIT|PWM_SERVO_3_OC_BIT)
548 #define PWM_TIM9_CHAN_MASK (PWM_SERVO_4_OC_BIT|PWM_SERVO_5_OC_BIT)
549 #define PWM_TIM5_CHAN_MASK (PWM_SERVO_6_OC_BIT|PWM_SERVO_7_OC_BIT|PWM_SERVO_8_OC_BIT|PWM_SERVO_9_OC_BIT)
550 #define PWM_TIM12_CHAN_MASK (PWM_SERVO_10_OC_BIT|PWM_SERVO_11_OC_BIT)
551 
552 /***************************************************************************************************/
553 /*********************************** PPM INPUT *************************************************/
554 /***************************************************************************************************/
555 
556 /*
557 #define USE_PPM_TIM1 1
558 
559 #define PPM_CHANNEL TIM_IC1
560 #define PPM_TIMER_INPUT TIM_IC_IN_TI1
561 #define PPM_IRQ NVIC_TIM1_CC_IRQ
562 #define PPM_IRQ2 NVIC_TIM1_UP_TIM10_IRQ
563 // Capture/Compare InteruptEnable and InterruptFlag
564 #define PPM_CC_IE TIM_DIER_CC1IE
565 #define PPM_CC_IF TIM_SR_CC1IF
566 #define PPM_GPIO_PORT GPIOA
567 #define PPM_GPIO_PIN GPIO8
568 #define PPM_GPIO_AF GPIO_AF1
569 */
570 
571 #define USE_PPM_TIM8 1
572 
573 #define PPM_CHANNEL TIM_IC4
574 #define PPM_TIMER_INPUT TIM_IC_IN_TI4
575 #define PPM_IRQ NVIC_TIM8_CC_IRQ
576 #define PPM_IRQ2 NVIC_TIM8_UP_TIM13_IRQ
577 // Capture/Compare InteruptEnable and InterruptFlag
578 #define PPM_CC_IE TIM_DIER_CC4IE
579 #define PPM_CC_IF TIM_SR_CC4IF
580 #define PPM_GPIO_PORT GPIOC
581 #define PPM_GPIO_PIN GPIO9
582 #define PPM_GPIO_AF GPIO_AF3
583 
584 /***************************************************************************************************/
585 /********************************* SPECTRUM UART *************************************************/
586 /***************************************************************************************************/
587 
588 /* The line that is pulled low at power up to initiate the bind process */
589 #define SPEKTRUM_BIND_PIN GPIO8
590 #define SPEKTRUM_BIND_PIN_PORT GPIOA
591 
592 #define SPEKTRUM_UART1_RCC RCC_USART1
593 #define SPEKTRUM_UART1_BANK GPIOA
594 #define SPEKTRUM_UART1_PIN GPIO10
595 #define SPEKTRUM_UART1_AF GPIO_AF7
596 #define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
597 #define SPEKTRUM_UART1_ISR usart1_isr
598 #define SPEKTRUM_UART1_DEV USART1
599 
600 
601 #endif /* CONFIG_STM32F4_DISCOVERY_H */