Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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 
257 /***************************************************************************************************/
258 /************************************** I2C *************************************************/
259 /***************************************************************************************************/
260 #define I2C1_GPIO_PORT GPIOB
261 #define I2C1_GPIO_SCL GPIO8
262 #define I2C1_GPIO_SDA GPIO9
263 
264 #define I2C2_GPIO_PORT GPIOB
265 #define I2C2_GPIO_SCL GPIO10
266 #define I2C2_GPIO_SDA GPIO11
267 
268 //#define I2C3_GPIO_PORT_SCL GPIOA
269 //#define I2C3_GPIO_SCL GPIO8
270 //#define I2C3_GPIO_PORT_SDA GPIOC
271 //#define I2C3_GPIO_SDA GPIO9
272 
273 
274 /***************************************************************************************************/
275 /************************************** ADC *************************************************/
276 /***************************************************************************************************/
277 
278 #define USE_AD_TIM2 1
279 
280 // For experimenting only
281 #define USE_ADC_1 1
282 #define USE_ADC_2 1
283 #define USE_ADC_3 1
284 #define USE_ADC_4 1
285 #define USE_ADC_5 1
286 #define USE_ADC_6 1
287 //#define USE_ADC_7 1
288 
289 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file */
290 #ifndef ADC_CHANNEL_VSUPPLY
291 #define ADC_CHANNEL_VSUPPLY ADC_4
292 #endif
293 #if !defined(USE_ADC_4)
294 #define USE_ADC_4 1
295 #endif
296 
297 #define DefaultVoltageOfAdc(adc) (0.00485*adc)
298 
299 /* provide defines that can be used to access the ADC_x in the code or airframe file
300  * these directly map to the index number of the 4 adc channels defined above
301  * 4th (index 3) is used for bat monitoring by default
302  */
303 
304 // AUX 1
305 #if USE_ADC_1
306 #define AD1_1_CHANNEL 9
307 #define ADC_1 AD1_1 // THIS CHANNEL USES THE ADC 1 CONVERTER
308 #define ADC_1_GPIO_PORT GPIOB
309 #define ADC_1_GPIO_PIN GPIO1
310 #endif
311 
312 // AUX 2
313 #if USE_ADC_2
314 #define AD1_2_CHANNEL 15
315 #define ADC_2 AD1_2 // THIS CHANNEL USES THE ADC 1 CONVERTER
316 #define ADC_2_GPIO_PORT GPIOC
317 #define ADC_2_GPIO_PIN GPIO5
318 #endif
319 
320 // AUX 3
321 #if USE_ADC_3
322 #define AD2_1_CHANNEL 14
323 #define ADC_3 AD2_1 // THIS CHANNEL USES THE ADC 2 CONVERTER
324 #define ADC_3_GPIO_PORT GPIOC
325 #define ADC_3_GPIO_PIN GPIO4
326 #endif
327 
328 // BAT
329 #if USE_ADC_4
330 #define AD2_2_CHANNEL 4
331 #define ADC_4 AD2_2 // THIS CHANNEL USES THE ADC 2 CONVERTER
332 #define ADC_4_GPIO_PORT GPIOA
333 #define ADC_4_GPIO_PIN GPIO4
334 #endif
335 
336 #if USE_ADC_5
337 #define AD3_1_CHANNEL 11
338 #define ADC_5 AD3_1 // THIS CHANNEL USES THE ADC 3 CONVERTER
339 #define ADC_5_GPIO_PORT GPIOC
340 #define ADC_5_GPIO_PIN GPIO1
341 #endif
342 
343 #if USE_ADC_6
344 #define AD3_2_CHANNEL 12
345 #define ADC_6 AD3_2 // THIS CHANNEL USES THE ADC 3 CONVERTER
346 #define ADC_6_GPIO_PORT GPIOC
347 #define ADC_6_GPIO_PIN GPIO2
348 #endif
349 
350 
351 /***************************************************************************************************/
352 /************************************ ACTUATORS ************************************************/
353 /***************************************************************************************************/
354 
355 /* Default actuators driver */
356 #define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
357 #define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
358 #define ActuatorsDefaultInit() ActuatorsPwmInit()
359 #define ActuatorsDefaultCommit() ActuatorsPwmCommit()
360 
361 
362 /***************************************************************************************************/
363 /********************************** SERVO PWM *************************************************/
364 /***************************************************************************************************/
365 
366 #define PWM_USE_TIM1 1
367 //#define PWM_USE_TIM3 1
368 #define PWM_USE_TIM5 1
369 #define PWM_USE_TIM9 1
370 #define PWM_USE_TIM12 1
371 
372 #define USE_PWM0 1
373 #define USE_PWM1 1
374 #define USE_PWM2 1
375 #define USE_PWM3 1
376 #define USE_PWM4 1
377 #define USE_PWM5 1
378 #define USE_PWM6 1
379 #define USE_PWM7 1
380 #define USE_PWM8 1
381 #define USE_PWM9 1
382 #if USE_SPI2
383 #define USE_PWM10 0
384 #define USE_PWM11 0
385 #else
386 #define USE_PWM10 1
387 #define USE_PWM11 1
388 #endif
389 
390 #define ACTUATORS_PWM_NB 12
391 
392 // PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
393 #if USE_PWM0
394 #define PWM_SERVO_0 0
395 #define PWM_SERVO_0_TIMER TIM1
396 #define PWM_SERVO_0_GPIO GPIOE
397 #define PWM_SERVO_0_PIN GPIO9
398 #define PWM_SERVO_0_AF GPIO_AF1
399 #define PWM_SERVO_0_OC TIM_OC1
400 #define PWM_SERVO_0_OC_BIT (1<<0)
401 #else
402 #define PWM_SERVO_0_OC_BIT 0
403 #endif
404 
405 #if USE_PWM1
406 #define PWM_SERVO_1 1
407 #define PWM_SERVO_1_TIMER TIM1
408 #define PWM_SERVO_1_GPIO GPIOE
409 #define PWM_SERVO_1_PIN GPIO11
410 #define PWM_SERVO_1_AF GPIO_AF1
411 #define PWM_SERVO_1_OC TIM_OC2
412 #define PWM_SERVO_1_OC_BIT (1<<1)
413 #else
414 #define PWM_SERVO_1_OC_BIT 0
415 #endif
416 
417 #if USE_PWM2
418 #define PWM_SERVO_2 2
419 #define PWM_SERVO_2_TIMER TIM1
420 #define PWM_SERVO_2_GPIO GPIOE
421 #define PWM_SERVO_2_PIN GPIO13
422 #define PWM_SERVO_2_AF GPIO_AF1
423 #define PWM_SERVO_2_OC TIM_OC3
424 #define PWM_SERVO_2_OC_BIT (1<<2)
425 #else
426 #define PWM_SERVO_2_OC_BIT 0
427 #endif
428 
429 #if USE_PWM3
430 #define PWM_SERVO_3 3
431 #define PWM_SERVO_3_TIMER TIM1
432 #define PWM_SERVO_3_GPIO GPIOE
433 #define PWM_SERVO_3_PIN GPIO14
434 #define PWM_SERVO_3_AF GPIO_AF1
435 #define PWM_SERVO_3_OC TIM_OC4
436 #define PWM_SERVO_3_OC_BIT (1<<3)
437 #else
438 #define PWM_SERVO_3_OC_BIT 0
439 #endif
440 
441 #if USE_PWM4
442 #define PWM_SERVO_4 4
443 #define PWM_SERVO_4_TIMER TIM9
444 #define PWM_SERVO_4_GPIO GPIOE
445 #define PWM_SERVO_4_PIN GPIO5
446 #define PWM_SERVO_4_AF GPIO_AF3
447 #define PWM_SERVO_4_OC TIM_OC1
448 #define PWM_SERVO_4_OC_BIT (1<<0)
449 #else
450 #define PWM_SERVO_4_OC_BIT 0
451 #endif
452 
453 #if USE_PWM5
454 #define PWM_SERVO_5 5
455 #define PWM_SERVO_5_TIMER TIM9
456 #define PWM_SERVO_5_GPIO GPIOE
457 #define PWM_SERVO_5_PIN GPIO6
458 #define PWM_SERVO_5_AF GPIO_AF3
459 #define PWM_SERVO_5_OC TIM_OC2
460 #define PWM_SERVO_5_OC_BIT (1<<1)
461 #else
462 #define PWM_SERVO_5_OC_BIT 0
463 #endif
464 
465 
466 #if USE_PWM6
467 #define PWM_SERVO_6 6
468 #define PWM_SERVO_6_TIMER TIM5
469 #define PWM_SERVO_6_GPIO GPIOA
470 #define PWM_SERVO_6_PIN GPIO3
471 #define PWM_SERVO_6_AF GPIO_AF2
472 #define PWM_SERVO_6_OC TIM_OC4
473 #define PWM_SERVO_6_OC_BIT (1<<3)
474 #else
475 #define PWM_SERVO_6_OC_BIT 0
476 #endif
477 
478 #if USE_PWM7
479 #define PWM_SERVO_7 7
480 #define PWM_SERVO_7_TIMER TIM5
481 #define PWM_SERVO_7_GPIO GPIOA
482 #define PWM_SERVO_7_PIN GPIO2
483 #define PWM_SERVO_7_AF GPIO_AF2
484 #define PWM_SERVO_7_OC TIM_OC3
485 #define PWM_SERVO_7_OC_BIT (1<<2)
486 #else
487 #define PWM_SERVO_7_OC_BIT 0
488 #endif
489 
490 #if USE_PWM8
491 #define PWM_SERVO_8 8
492 #define PWM_SERVO_8_TIMER TIM5
493 #define PWM_SERVO_8_GPIO GPIOA
494 #define PWM_SERVO_8_PIN GPIO1
495 #define PWM_SERVO_8_AF GPIO_AF2
496 #define PWM_SERVO_8_OC TIM_OC2
497 #define PWM_SERVO_8_OC_BIT (1<<1)
498 #else
499 #define PWM_SERVO_8_OC_BIT 0
500 #endif
501 
502 #if USE_PWM9
503 #define PWM_SERVO_9 9
504 #define PWM_SERVO_9_TIMER TIM5
505 #define PWM_SERVO_9_GPIO GPIOA
506 #define PWM_SERVO_9_PIN GPIO0
507 #define PWM_SERVO_9_AF GPIO_AF2
508 #define PWM_SERVO_9_OC TIM_OC1
509 #define PWM_SERVO_9_OC_BIT (1<<0)
510 #else
511 #define PWM_SERVO_9_OC_BIT 0
512 #endif
513 
514 /* PWM10 AND PWM11 cannot be used if SPI2 is active. */
515 #if USE_PWM10
516 #define PWM_SERVO_10 10
517 #define PWM_SERVO_10_TIMER TIM12
518 #define PWM_SERVO_10_GPIO GPIOB
519 #define PWM_SERVO_10_PIN GPIO14
520 #define PWM_SERVO_10_AF GPIO_AF9
521 #define PWM_SERVO_10_OC TIM_OC1
522 #define PWM_SERVO_10_OC_BIT (1<<0)
523 #else
524 #define PWM_SERVO_10_OC_BIT 0
525 #endif
526 
527 #if USE_PWM11
528 #define PWM_SERVO_11 11
529 #define PWM_SERVO_11_TIMER TIM12
530 #define PWM_SERVO_11_GPIO GPIOB
531 #define PWM_SERVO_11_PIN GPIO15
532 #define PWM_SERVO_11_AF GPIO_AF9
533 #define PWM_SERVO_11_OC TIM_OC2
534 #define PWM_SERVO_11_OC_BIT (1<<1)
535 #else
536 #define PWM_SERVO_11_OC_BIT 0
537 #endif
538 
539 #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)
540 #define PWM_TIM9_CHAN_MASK (PWM_SERVO_4_OC_BIT|PWM_SERVO_5_OC_BIT)
541 #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)
542 #define PWM_TIM12_CHAN_MASK (PWM_SERVO_10_OC_BIT|PWM_SERVO_11_OC_BIT)
543 
544 /***************************************************************************************************/
545 /*********************************** PPM INPUT *************************************************/
546 /***************************************************************************************************/
547 
548 /*
549 #define USE_PPM_TIM1 1
550 
551 #define PPM_CHANNEL TIM_IC1
552 #define PPM_TIMER_INPUT TIM_IC_IN_TI1
553 #define PPM_IRQ NVIC_TIM1_CC_IRQ
554 #define PPM_IRQ2 NVIC_TIM1_UP_TIM10_IRQ
555 // Capture/Compare InteruptEnable and InterruptFlag
556 #define PPM_CC_IE TIM_DIER_CC1IE
557 #define PPM_CC_IF TIM_SR_CC1IF
558 #define PPM_GPIO_PORT GPIOA
559 #define PPM_GPIO_PIN GPIO8
560 #define PPM_GPIO_AF GPIO_AF1
561 */
562 
563 #define USE_PPM_TIM8 1
564 
565 #define PPM_CHANNEL TIM_IC4
566 #define PPM_TIMER_INPUT TIM_IC_IN_TI4
567 #define PPM_IRQ NVIC_TIM8_CC_IRQ
568 #define PPM_IRQ2 NVIC_TIM8_UP_TIM13_IRQ
569 // Capture/Compare InteruptEnable and InterruptFlag
570 #define PPM_CC_IE TIM_DIER_CC4IE
571 #define PPM_CC_IF TIM_SR_CC4IF
572 #define PPM_GPIO_PORT GPIOC
573 #define PPM_GPIO_PIN GPIO9
574 #define PPM_GPIO_AF GPIO_AF3
575 
576 /***************************************************************************************************/
577 /********************************* SPECTRUM UART *************************************************/
578 /***************************************************************************************************/
579 
580 /* The line that is pulled low at power up to initiate the bind process */
581 #define SPEKTRUM_BIND_PIN GPIO8
582 #define SPEKTRUM_BIND_PIN_PORT GPIOA
583 
584 #define SPEKTRUM_UART1_RCC RCC_USART1
585 #define SPEKTRUM_UART1_BANK GPIOA
586 #define SPEKTRUM_UART1_PIN GPIO10
587 #define SPEKTRUM_UART1_AF GPIO_AF7
588 #define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
589 #define SPEKTRUM_UART1_ISR usart1_isr
590 #define SPEKTRUM_UART1_DEV USART1
591 
592 
593 #endif /* CONFIG_STM32F4_DISCOVERY_H */