dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
board_hw_defs.c
Go to the documentation of this file.
1 
17 /*
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 3 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful, but
24  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26  * for more details.
27  *
28  * You should have received a copy of the GNU General Public License along
29  * with this program; if not, see <http://www.gnu.org/licenses/>
30  */
31 
32 #include <pios_config.h>
33 #include <pios_board_info.h>
34 
35 #if defined(PIOS_INCLUDE_ANNUNC)
36 
37 #include <pios_annunc_priv.h>
38 static const struct pios_annunc pios_annuncs[] = {
39  [PIOS_LED_HEARTBEAT] = {
40  .pin = {
41  .gpio = GPIOB,
42  .init = {
43  .GPIO_Pin = GPIO_Pin_4,
44  .GPIO_Speed = GPIO_Speed_50MHz,
45  .GPIO_Mode = GPIO_Mode_OUT,
46  .GPIO_OType = GPIO_OType_PP,
47  .GPIO_PuPd = GPIO_PuPd_NOPULL
48  },
49  },
50  .active_high = false,
51  },
52  [PIOS_LED_ALARM] = {
53  .pin = {
54  .gpio = GPIOB,
55  .init = {
56  .GPIO_Pin = GPIO_Pin_5,
57  .GPIO_Speed = GPIO_Speed_50MHz,
58  .GPIO_Mode = GPIO_Mode_OUT,
59  .GPIO_OType = GPIO_OType_PP,
60  .GPIO_PuPd = GPIO_PuPd_NOPULL
61  },
62  },
63  .active_high = false,
64  },
65 };
66 
67 static const struct pios_annunc_cfg pios_annunc_cfg = {
68  .annunciators = pios_annuncs,
69  .num_annunciators = NELEMENTS(pios_annuncs),
70 };
71 
72 const struct pios_annunc_cfg * PIOS_BOARD_HW_DEFS_GetLedCfg (uint32_t board_revision)
73 {
74  return &pios_annunc_cfg;
75 }
76 
77 #endif /* PIOS_INCLUDE_ANNUNC */
78 
79 
80 #if defined(PIOS_INCLUDE_I2C)
81 
82 #include <pios_i2c_priv.h>
83 
84 /*
85  * I2C Adapters
86  */
87 void PIOS_I2C_internal_ev_irq_handler(void);
88 void PIOS_I2C_internal_er_irq_handler(void);
89 void I2C2_EV_EXTI24_IRQHandler() __attribute__ ((alias ("PIOS_I2C_internal_ev_irq_handler")));
90 void I2C2_ER_IRQHandler() __attribute__ ((alias ("PIOS_I2C_internal_er_irq_handler")));
91 
92 static const struct pios_i2c_adapter_cfg pios_i2c_internal_cfg = {
93  .regs = I2C2,
94  .remap = GPIO_AF_4,
95  .init = {
96  .I2C_Mode = I2C_Mode_I2C,
97  .I2C_OwnAddress1 = 0,
98  .I2C_Ack = I2C_Ack_Enable,
99  .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
100  .I2C_DigitalFilter = 0x00,
101  .I2C_AnalogFilter = I2C_AnalogFilter_Enable,
102  .I2C_Timing = 0x00310309, //400kHz I2C @ 8MHz input -> PRESC=0x0, SCLDEL=0x3, SDADEL=0x1, SCLH=0x03, SCLL=0x09
103  },
104  .transfer_timeout_ms = 50,
105  .scl = {
106  .gpio = GPIOA,
107  .init = {
108  .GPIO_Pin = GPIO_Pin_9,
109  .GPIO_Mode = GPIO_Mode_AF,
110  .GPIO_Speed = GPIO_Speed_50MHz,
111  .GPIO_OType = GPIO_OType_PP,
112  .GPIO_PuPd = GPIO_PuPd_NOPULL,
113  },
114  .pin_source = GPIO_PinSource9,
115  },
116  .sda = {
117  .gpio = GPIOA,
118  .init = {
119  .GPIO_Pin = GPIO_Pin_10,
120  .GPIO_Mode = GPIO_Mode_AF,
121  .GPIO_Speed = GPIO_Speed_50MHz,
122  .GPIO_OType = GPIO_OType_PP,
123  .GPIO_PuPd = GPIO_PuPd_NOPULL,
124  },
125  .pin_source = GPIO_PinSource10,
126  },
127  .event = {
128  .flags = 0, /* FIXME: check this */
129  .init = {
130  .NVIC_IRQChannel = I2C2_EV_IRQn,
131  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
132  .NVIC_IRQChannelSubPriority = 0,
133  .NVIC_IRQChannelCmd = ENABLE,
134  },
135  },
136  .error = {
137  .flags = 0, /* FIXME: check this */
138  .init = {
139  .NVIC_IRQChannel = I2C2_ER_IRQn,
140  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
141  .NVIC_IRQChannelSubPriority = 0,
142  .NVIC_IRQChannelCmd = ENABLE,
143  },
144  },
145 };
146 
147 pios_i2c_t pios_i2c_internal_id;
148 void PIOS_I2C_internal_ev_irq_handler(void)
149 {
150  /* Call into the generic code to handle the IRQ for this specific device */
151  PIOS_I2C_EV_IRQ_Handler(pios_i2c_internal_id);
152 }
153 
154 void PIOS_I2C_internal_er_irq_handler(void)
155 {
156  /* Call into the generic code to handle the IRQ for this specific device */
157  PIOS_I2C_ER_IRQ_Handler(pios_i2c_internal_id);
158 }
159 
160 
161 
162 void PIOS_I2C_flexi_ev_irq_handler(void);
163 void PIOS_I2C_flexi_er_irq_handler(void);
164 void I2C1_EV_EXTI23_IRQHandler() __attribute__ ((alias ("PIOS_I2C_flexi_ev_irq_handler")));
165 void I2C1_ER_IRQHandler() __attribute__ ((alias ("PIOS_I2C_flexi_er_irq_handler")));
166 
167 static const struct pios_i2c_adapter_cfg pios_i2c_flexi_cfg = {
168  .regs = I2C1,
169  .remap = GPIO_AF_4,
170  .init = {
171  .I2C_Mode = I2C_Mode_I2C,
172  .I2C_OwnAddress1 = 0,
173  .I2C_Ack = I2C_Ack_Enable,
174  .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
175  .I2C_DigitalFilter = 0x00,
176  .I2C_AnalogFilter = I2C_AnalogFilter_Enable,
177  .I2C_Timing = 0x70310309, //50kHz I2C @ 8MHz input -> PRESC=0x7, SCLDEL=0x3, SDADEL=0x1, SCLH=0x03, SCLL=0x09
178  },
179  .transfer_timeout_ms = 50,
180  .scl = {
181  .gpio = GPIOB,
182  .init = {
183  .GPIO_Pin = GPIO_Pin_6,
184  .GPIO_Mode = GPIO_Mode_AF,
185  .GPIO_Speed = GPIO_Speed_50MHz,
186  .GPIO_OType = GPIO_OType_PP,
187  .GPIO_PuPd = GPIO_PuPd_NOPULL,
188  },
189  .pin_source = GPIO_PinSource6,
190  },
191  .sda = {
192  .gpio = GPIOB,
193  .init = {
194  .GPIO_Pin = GPIO_Pin_7,
195  .GPIO_Mode = GPIO_Mode_AF,
196  .GPIO_Speed = GPIO_Speed_50MHz,
197  .GPIO_OType = GPIO_OType_PP,
198  .GPIO_PuPd = GPIO_PuPd_NOPULL,
199  },
200  .pin_source = GPIO_PinSource7,
201  },
202  .event = {
203  .flags = 0, /* FIXME: check this */
204  .init = {
205  .NVIC_IRQChannel = I2C1_EV_IRQn,
206  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
207  .NVIC_IRQChannelSubPriority = 0,
208  .NVIC_IRQChannelCmd = ENABLE,
209  },
210  },
211  .error = {
212  .flags = 0, /* FIXME: check this */
213  .init = {
214  .NVIC_IRQChannel = I2C1_ER_IRQn,
215  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
216  .NVIC_IRQChannelSubPriority = 0,
217  .NVIC_IRQChannelCmd = ENABLE,
218  },
219  },
220 };
221 
222 pios_i2c_t pios_i2c_flexi_id;
223 void PIOS_I2C_flexi_ev_irq_handler(void)
224 {
225  /* Call into the generic code to handle the IRQ for this specific device */
226  PIOS_I2C_EV_IRQ_Handler(pios_i2c_flexi_id);
227 }
228 
229 void PIOS_I2C_flexi_er_irq_handler(void)
230 {
231  /* Call into the generic code to handle the IRQ for this specific device */
232  PIOS_I2C_ER_IRQ_Handler(pios_i2c_flexi_id);
233 }
234 
235 #endif /* PIOS_INCLUDE_I2C */
236 
237 #if defined(PIOS_INCLUDE_CAN)
238 #include "pios_can_priv.h"
239 static const struct pios_can_cfg pios_can_cfg = {
240  .regs = CAN1,
241  .init = {
242  // To make it easy to use both F3 and F4 use the other APB1 bus rate
243  // divided by 2. This matches the baud rate across devices
244  .CAN_Prescaler = 18-1,
246  .CAN_Mode = CAN_Mode_Normal,
248  .CAN_SJW = CAN_SJW_1tq,
252  .CAN_BS1 = CAN_BS1_9tq,
255  .CAN_BS2 = CAN_BS2_8tq,
257  .CAN_TTCM = DISABLE,
259  .CAN_ABOM = DISABLE,
261  .CAN_AWUM = DISABLE,
263  .CAN_NART = ENABLE,
265  .CAN_RFLM = DISABLE,
267  .CAN_TXFP = DISABLE,
269  },
270  .remap = GPIO_AF_9,
271  .tx = {
272  .gpio = GPIOB,
273  .init = {
274  .GPIO_Pin = GPIO_Pin_9,
275  .GPIO_Speed = GPIO_Speed_50MHz,
276  .GPIO_Mode = GPIO_Mode_AF,
277  .GPIO_OType = GPIO_OType_PP,
278  .GPIO_PuPd = GPIO_PuPd_UP
279  },
280  .pin_source = GPIO_PinSource9,
281  },
282  .rx = {
283  .gpio = GPIOB,
284  .init = {
285  .GPIO_Pin = GPIO_Pin_8,
286  .GPIO_Speed = GPIO_Speed_50MHz,
287  .GPIO_Mode = GPIO_Mode_AF,
288  .GPIO_OType = GPIO_OType_PP,
289  .GPIO_PuPd = GPIO_PuPd_UP
290  },
291  .pin_source = GPIO_PinSource8,
292  },
293  .rx_irq = {
294  .init = {
295  .NVIC_IRQChannel = CAN1_RX1_IRQn,
296  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
297  .NVIC_IRQChannelSubPriority = 0,
298  .NVIC_IRQChannelCmd = ENABLE,
299  },
300  },
301  .tx_irq = {
302  .init = {
303  .NVIC_IRQChannel = USB_HP_CAN1_TX_IRQn,
304  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
305  .NVIC_IRQChannelSubPriority = 0,
306  .NVIC_IRQChannelCmd = ENABLE,
307  },
308  },
309 };
310 #endif /* PIOS_INCLUDE_CAN */
311 
312 #if defined(PIOS_INCLUDE_FLASH)
313 #include "pios_flashfs_logfs_priv.h"
314 
315 static const struct flashfs_logfs_cfg flashfs_internal_settings_cfg = {
316  .fs_magic = 0x9ae1ee11,
317  .arena_size = 0x00002000, /* 32 * slot size = 8K bytes = 4 sectors */
318  .slot_size = 0x00000100, /* 256 bytes */
319 };
320 
322 
323 static const struct pios_flash_internal_cfg flash_internal_cfg = {
324 };
325 
326 #include "pios_flash_priv.h"
327 
328 static const struct pios_flash_sector_range stm32f3_sectors[] = {
329  {
330  .base_sector = 0,
331  .last_sector = 127,
332  .sector_size = FLASH_SECTOR_2KB,
333  },
334 };
335 
336 uintptr_t pios_internal_flash_id;
337 static const struct pios_flash_chip pios_flash_chip_internal = {
339  .chip_id = &pios_internal_flash_id,
340  .page_size = 16, /* 128-bit rows */
341  .sector_blocks = stm32f3_sectors,
342  .num_blocks = NELEMENTS(stm32f3_sectors),
343 };
344 
345 static const struct pios_flash_partition pios_flash_partition_table[] = {
346  {
348  .chip_desc = &pios_flash_chip_internal,
349  .first_sector = 0,
350  .last_sector = 7,
351  .chip_offset = 0,
352  .size = (7 - 0 + 1) * FLASH_SECTOR_2KB,
353  },
354 
355  {
357  .chip_desc = &pios_flash_chip_internal,
358  .first_sector = 8,
359  .last_sector = 15,
360  .chip_offset = (8 * FLASH_SECTOR_2KB),
361  .size = (15 - 8 + 1) * FLASH_SECTOR_2KB,
362  },
363 
364  {
366  .chip_desc = &pios_flash_chip_internal,
367  .first_sector = 16,
368  .last_sector = 23,
369  .chip_offset = (16 * FLASH_SECTOR_2KB),
370  .size = (23 - 16 + 1) * FLASH_SECTOR_2KB,
371  },
372 
373  {
374  .label = FLASH_PARTITION_LABEL_FW,
375  .chip_desc = &pios_flash_chip_internal,
376  .first_sector = 24,
377  .last_sector = 127,
378  .chip_offset = (24 * FLASH_SECTOR_2KB),
379  .size = (127 - 24 + 1) * FLASH_SECTOR_2KB,
380  },
381 };
382 
383 const struct pios_flash_partition * PIOS_BOARD_HW_DEFS_GetPartitionTable (uint32_t board_revision, uint32_t * num_partitions)
384 {
385  PIOS_Assert(num_partitions);
386 
387  *num_partitions = NELEMENTS(pios_flash_partition_table);
389 }
390 
391 #endif /* PIOS_INCLUDE_FLASH */
392 
393 
394 
395 #if defined(PIOS_INCLUDE_USART)
396 
397 #include "pios_usart_priv.h"
398 
399 #if defined(PIOS_INCLUDE_DSM)
400 /*
401  * Spektrum/JR DSM USART
402  */
403 #include <pios_dsm_priv.h>
404 
405 static const struct pios_dsm_cfg pios_rcvr_dsm_aux_cfg = {
406  .bind = {
407  .gpio = GPIOA,
408  .init = {
409  .GPIO_Pin = GPIO_Pin_3,
410  .GPIO_Speed = GPIO_Speed_2MHz,
411  .GPIO_Mode = GPIO_Mode_OUT,
412  .GPIO_OType = GPIO_OType_PP,
413  .GPIO_PuPd = GPIO_PuPd_NOPULL
414  },
415  },
416 };
417 
418 static const struct pios_dsm_cfg pios_flexi_dsm_aux_cfg = {
419  .bind = {
420  .gpio = GPIOB,
421  .init = {
422  .GPIO_Pin = GPIO_Pin_7,
423  .GPIO_Speed = GPIO_Speed_2MHz,
424  .GPIO_Mode = GPIO_Mode_OUT,
425  .GPIO_OType = GPIO_OType_PP,
426  .GPIO_PuPd = GPIO_PuPd_NOPULL
427  },
428  },
429 };
430 
431 static const struct pios_dsm_cfg pios_main_dsm_aux_cfg = {
432  .bind = {
433  .gpio = GPIOB,
434  .init = {
435  .GPIO_Pin = GPIO_Pin_11,
436  .GPIO_Speed = GPIO_Speed_2MHz,
437  .GPIO_Mode = GPIO_Mode_OUT,
438  .GPIO_OType = GPIO_OType_PP,
439  .GPIO_PuPd = GPIO_PuPd_NOPULL
440  },
441  },
442 };
443 
444 #endif /* PIOS_INCLUDE_DSM */
445 
446 static const struct pios_usart_cfg pios_flexi_usart_cfg = {
447  .regs = USART1,
448  .remap = GPIO_AF_7,
449  .irq = {
450  .init = {
451  .NVIC_IRQChannel = USART1_IRQn,
452  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
453  .NVIC_IRQChannelSubPriority = 0,
454  .NVIC_IRQChannelCmd = ENABLE,
455  },
456  },
457  .rx = {
458  .gpio = GPIOB,
459  .init = {
460  .GPIO_Pin = GPIO_Pin_7,
461  .GPIO_Speed = GPIO_Speed_2MHz,
462  .GPIO_Mode = GPIO_Mode_AF,
463  .GPIO_OType = GPIO_OType_PP,
464  .GPIO_PuPd = GPIO_PuPd_UP
465  },
466  .pin_source = GPIO_PinSource7,
467  },
468  .tx = {
469  .gpio = GPIOB,
470  .init = {
471  .GPIO_Pin = GPIO_Pin_6,
472  .GPIO_Speed = GPIO_Speed_2MHz,
473  .GPIO_Mode = GPIO_Mode_AF,
474  .GPIO_OType = GPIO_OType_PP,
475  .GPIO_PuPd = GPIO_PuPd_DOWN
476  },
477  .pin_source = GPIO_PinSource6,
478  },
479 };
480 
481 static const struct pios_usart_cfg pios_main_usart_cfg = {
482  .regs = USART3,
483  .remap = GPIO_AF_7,
484  .irq = {
485  .init = {
486  .NVIC_IRQChannel = USART3_IRQn,
487  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
488  .NVIC_IRQChannelSubPriority = 0,
489  .NVIC_IRQChannelCmd = ENABLE,
490  },
491  },
492  .rx = {
493  .gpio = GPIOB,
494  .init = {
495  .GPIO_Pin = GPIO_Pin_11,
496  .GPIO_Speed = GPIO_Speed_2MHz,
497  .GPIO_Mode = GPIO_Mode_AF,
498  .GPIO_OType = GPIO_OType_PP,
499  .GPIO_PuPd = GPIO_PuPd_UP
500  },
501  .pin_source = GPIO_PinSource11,
502  },
503  .tx = {
504  .gpio = GPIOB,
505  .init = {
506  .GPIO_Pin = GPIO_Pin_10,
507  .GPIO_Speed = GPIO_Speed_2MHz,
508  .GPIO_Mode = GPIO_Mode_AF,
509  .GPIO_OType = GPIO_OType_PP,
510  .GPIO_PuPd = GPIO_PuPd_DOWN
511  },
512  .pin_source = GPIO_PinSource10,
513  },
514 };
515 
516 static const struct pios_usart_cfg pios_rcvr_usart_cfg = {
517  .regs = USART2,
518  .remap = GPIO_AF_7,
519  .irq = {
520  .init = {
521  .NVIC_IRQChannel = USART2_IRQn,
522  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
523  .NVIC_IRQChannelSubPriority = 0,
524  .NVIC_IRQChannelCmd = ENABLE,
525  },
526  },
527  .rx = {
528  .gpio = GPIOA,
529  .init = {
530  .GPIO_Pin = GPIO_Pin_3,
531  .GPIO_Speed = GPIO_Speed_2MHz,
532  .GPIO_Mode = GPIO_Mode_AF,
533  .GPIO_OType = GPIO_OType_PP,
534  .GPIO_PuPd = GPIO_PuPd_UP
535  },
536  .pin_source = GPIO_PinSource3,
537  },
538 };
539 
540 #endif /* PIOS_INCLUDE_USART */
541 
542 #if defined(PIOS_INCLUDE_COM)
543 
544 #include "pios_com_priv.h"
545 
546 #endif /* PIOS_INCLUDE_COM */
547 
548 #if defined(PIOS_INCLUDE_RTC)
549 /*
550  * Realtime Clock (RTC)
551  */
552 #include <pios_rtc_priv.h>
553 
554 void PIOS_RTC_IRQ_Handler (void);
555 void RTC_WKUP_IRQHandler() __attribute__ ((alias ("PIOS_RTC_IRQ_Handler")));
556 static const struct pios_rtc_cfg pios_rtc_main_cfg = {
557  .clksrc = RCC_RTCCLKSource_HSE_Div32,
558  .prescaler = 25 - 1, // 8MHz / 32 / 16 / 25 == 625Hz
559  .irq = {
560  .init = {
561  .NVIC_IRQChannel = RTC_WKUP_IRQn,
562  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
563  .NVIC_IRQChannelSubPriority = 0,
564  .NVIC_IRQChannelCmd = ENABLE,
565  },
566  },
567 };
568 
569 void PIOS_RTC_IRQ_Handler (void)
570 {
572 }
573 
574 #endif
575 
576 
577 #include "pios_tim_priv.h"
578 
579 static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base = {
580  .TIM_Prescaler = (PIOS_PERIPHERAL_APB2_CLOCK / 1000000) - 1,
581  .TIM_ClockDivision = TIM_CKD_DIV1,
582  .TIM_CounterMode = TIM_CounterMode_Up,
583  .TIM_Period = ((1000000 / PIOS_SERVO_UPDATE_HZ) - 1),
584  .TIM_RepetitionCounter = 0x0000,
585 };
586 
587 static const TIM_TimeBaseInitTypeDef tim_2_3_time_base = {
588  .TIM_Prescaler = (PIOS_PERIPHERAL_APB1_CLOCK / 1000000 * 2) - 1,
589  .TIM_ClockDivision = TIM_CKD_DIV1,
590  .TIM_CounterMode = TIM_CounterMode_Up,
591  .TIM_Period = ((1000000 / PIOS_SERVO_UPDATE_HZ) - 1),
592  .TIM_RepetitionCounter = 0x0000,
593 };
594 
595 static const struct pios_tim_clock_cfg tim_2_cfg = {
596  .timer = TIM2,
597  .time_base_init = &tim_2_3_time_base,
598  .irq = {
599  .init = {
600  .NVIC_IRQChannel = TIM2_IRQn,
601  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
602  .NVIC_IRQChannelSubPriority = 0,
603  .NVIC_IRQChannelCmd = ENABLE,
604  },
605  },
606 };
607 
608 static const struct pios_tim_clock_cfg tim_3_cfg = {
609  .timer = TIM3,
610  .time_base_init = &tim_2_3_time_base,
611  .irq = {
612  .init = {
613  .NVIC_IRQChannel = TIM3_IRQn,
614  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
615  .NVIC_IRQChannelSubPriority = 0,
616  .NVIC_IRQChannelCmd = ENABLE,
617  },
618  },
619 };
620 
621 static const struct pios_tim_clock_cfg tim_1_cfg = {
622  .timer = TIM1,
623  .time_base_init = &tim_1_15_16_17_time_base,
624  .irq = {
625  .init = {
626  .NVIC_IRQChannel = TIM1_CC_IRQn,
627  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
628  .NVIC_IRQChannelSubPriority = 0,
629  .NVIC_IRQChannelCmd = ENABLE,
630  },
631  },
632 };
633 static const struct pios_tim_clock_cfg tim_15_cfg = {
634  .timer = TIM15,
635  .time_base_init = &tim_1_15_16_17_time_base,
636  .irq = {
637  .init = {
638  .NVIC_IRQChannel = TIM1_BRK_TIM15_IRQn,
639  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
640  .NVIC_IRQChannelSubPriority = 0,
641  .NVIC_IRQChannelCmd = ENABLE,
642  },
643  },
644 };
645 
646 static const struct pios_tim_clock_cfg tim_16_cfg = {
647  .timer = TIM16,
648  .time_base_init = &tim_1_15_16_17_time_base,
649  .irq = {
650  .init = {
651  .NVIC_IRQChannel = TIM1_UP_TIM16_IRQn,
652  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
653  .NVIC_IRQChannelSubPriority = 0,
654  .NVIC_IRQChannelCmd = ENABLE,
655  },
656  },
657 };
658 static const struct pios_tim_clock_cfg tim_17_cfg = {
659  .timer = TIM17,
660  .time_base_init = &tim_1_15_16_17_time_base,
661  .irq = {
662  .init = {
663  .NVIC_IRQChannel = TIM1_TRG_COM_TIM17_IRQn,
664  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
665  .NVIC_IRQChannelSubPriority = 0,
666  .NVIC_IRQChannelCmd = ENABLE,
667  },
668  },
669 };
670 
671  /* OUTPUTS
672  1: TIM15_CH2 (PB15)
673  2: TIM15_CH1 (PB14)
674  3: TIM1_CH1 (PA8)
675  4: TIM3_CH3 (PB0)
676  5: TIM16_CH1 (PA6)
677  6: TIM2_CH3 (PA2)
678  7: TIM3_CH4 (PB1)
679  8: TIM17_CH1 (PA7)
680  9: TIM3_CH2 (PA4)
681  10: TIM2_CH2 (PA1)
682  */
683 
685  { // Ch1 TIM15_CH2 (PB15)
686  .timer = TIM15,
687  .timer_chan = TIM_Channel_2,
688  .remap = GPIO_AF_1,
689  .pin = {
690  .gpio = GPIOB,
691  .init = {
692  .GPIO_Pin = GPIO_Pin_15,
693  .GPIO_Speed = GPIO_Speed_2MHz,
694  .GPIO_Mode = GPIO_Mode_AF,
695  .GPIO_OType = GPIO_OType_PP,
696  .GPIO_PuPd = GPIO_PuPd_UP
697  },
698  .pin_source = GPIO_PinSource15,
699  },
700  },
701  { // Ch2 TIM15_CH1 (PB14)
702  .timer = TIM15,
703  .timer_chan = TIM_Channel_1,
704  .remap = GPIO_AF_1,
705  .pin = {
706  .gpio = GPIOB,
707  .init = {
708  .GPIO_Pin = GPIO_Pin_14,
709  .GPIO_Speed = GPIO_Speed_2MHz,
710  .GPIO_Mode = GPIO_Mode_AF,
711  .GPIO_OType = GPIO_OType_PP,
712  .GPIO_PuPd = GPIO_PuPd_UP
713  },
714  .pin_source = GPIO_PinSource14,
715  },
716  },
717  { // Ch3 TIM1_CH1 (PA8)
718  .timer = TIM1,
719  .timer_chan = TIM_Channel_1,
720  .remap = GPIO_AF_6,
721  .pin = {
722  .gpio = GPIOA,
723  .init = {
724  .GPIO_Pin = GPIO_Pin_8,
725  .GPIO_Speed = GPIO_Speed_2MHz,
726  .GPIO_Mode = GPIO_Mode_AF,
727  .GPIO_OType = GPIO_OType_PP,
728  .GPIO_PuPd = GPIO_PuPd_UP
729  },
730  .pin_source = GPIO_PinSource8,
731  },
732  },
733  { // Ch4 TIM3_CH3 (PB0)
734  .timer = TIM3,
735  .timer_chan = TIM_Channel_3,
736  .remap = GPIO_AF_2,
737  .pin = {
738  .gpio = GPIOB,
739  .init = {
740  .GPIO_Pin = GPIO_Pin_0,
741  .GPIO_Speed = GPIO_Speed_2MHz,
742  .GPIO_Mode = GPIO_Mode_AF,
743  .GPIO_OType = GPIO_OType_PP,
744  .GPIO_PuPd = GPIO_PuPd_UP
745  },
746  .pin_source = GPIO_PinSource0,
747  },
748  },
749  { // Ch5 TIM16_CH1 (PA6)
750  .timer = TIM16,
751  .timer_chan = TIM_Channel_1,
752  .remap = GPIO_AF_1,
753  .pin = {
754  .gpio = GPIOA,
755  .init = {
756  .GPIO_Pin = GPIO_Pin_6,
757  .GPIO_Speed = GPIO_Speed_2MHz,
758  .GPIO_Mode = GPIO_Mode_AF,
759  .GPIO_OType = GPIO_OType_PP,
760  .GPIO_PuPd = GPIO_PuPd_UP
761  },
762  .pin_source = GPIO_PinSource6,
763  },
764  },
765  { // Ch6 TIM2_CH3 (PA2)
766  .timer = TIM2,
767  .timer_chan = TIM_Channel_3,
768  .remap = GPIO_AF_1,
769  .pin = {
770  .gpio = GPIOA,
771  .init = {
772  .GPIO_Pin = GPIO_Pin_2,
773  .GPIO_Speed = GPIO_Speed_2MHz,
774  .GPIO_Mode = GPIO_Mode_AF,
775  .GPIO_OType = GPIO_OType_PP,
776  .GPIO_PuPd = GPIO_PuPd_UP
777  },
778  .pin_source = GPIO_PinSource2,
779  },
780  },
781  { // Ch7 TIM3_CH4 (PB1)
782  .timer = TIM3,
783  .timer_chan = TIM_Channel_4,
784  .remap = GPIO_AF_2,
785  .pin = {
786  .gpio = GPIOB,
787  .init = {
788  .GPIO_Pin = GPIO_Pin_1,
789  .GPIO_Speed = GPIO_Speed_2MHz,
790  .GPIO_Mode = GPIO_Mode_AF,
791  .GPIO_OType = GPIO_OType_PP,
792  .GPIO_PuPd = GPIO_PuPd_UP
793  },
794  .pin_source = GPIO_PinSource1,
795  },
796  },
797  { // Ch8 TIM17_CH1 (PA7)
798  .timer = TIM17,
799  .timer_chan = TIM_Channel_1,
800  .remap = GPIO_AF_1,
801  .pin = {
802  .gpio = GPIOA,
803  .init = {
804  .GPIO_Pin = GPIO_Pin_7,
805  .GPIO_Speed = GPIO_Speed_2MHz,
806  .GPIO_Mode = GPIO_Mode_AF,
807  .GPIO_OType = GPIO_OType_PP,
808  .GPIO_PuPd = GPIO_PuPd_UP
809  },
810  .pin_source = GPIO_PinSource7,
811  },
812  },
813  { // Ch9 TIM3_CH2 (PA4)
814  .timer = TIM3,
815  .timer_chan = TIM_Channel_2,
816  .remap = GPIO_AF_2,
817  .pin = {
818  .gpio = GPIOA,
819  .init = {
820  .GPIO_Pin = GPIO_Pin_4,
821  .GPIO_Speed = GPIO_Speed_2MHz,
822  .GPIO_Mode = GPIO_Mode_AF,
823  .GPIO_OType = GPIO_OType_PP,
824  .GPIO_PuPd = GPIO_PuPd_UP
825  },
826  .pin_source = GPIO_PinSource4,
827  },
828  },
829  { // Ch10 TIM2_CH2 (PA1)
830  .timer = TIM2,
831  .timer_chan = TIM_Channel_2,
832  .remap = GPIO_AF_1,
833  .pin = {
834  .gpio = GPIOA,
835  .init = {
836  .GPIO_Pin = GPIO_Pin_1,
837  .GPIO_Speed = GPIO_Speed_2MHz,
838  .GPIO_Mode = GPIO_Mode_AF,
839  .GPIO_OType = GPIO_OType_PP,
840  .GPIO_PuPd = GPIO_PuPd_UP
841  },
842  .pin_source = GPIO_PinSource1,
843  },
844  },
845 };
846 
847 
848 #if defined(PIOS_INCLUDE_SERVO) && defined(PIOS_INCLUDE_TIM)
849 /*
850  * Servo outputs
851  */
852 #include <pios_servo_priv.h>
853 
855  .tim_oc_init = {
856  .TIM_OCMode = TIM_OCMode_PWM1,
857  .TIM_OutputState = TIM_OutputState_Enable,
858  .TIM_OutputNState = TIM_OutputNState_Disable,
859  .TIM_Pulse = PIOS_SERVOS_INITIAL_POSITION,
860  .TIM_OCPolarity = TIM_OCPolarity_High,
861  .TIM_OCNPolarity = TIM_OCPolarity_High,
862  .TIM_OCIdleState = TIM_OCIdleState_Reset,
863  .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
864  },
865  .channels = pios_tim_servoport_v02_pins,
866  .num_channels = NELEMENTS(pios_tim_servoport_v02_pins),
867 };
868 
869 struct pios_servo_cfg pios_servo_slow_cfg = {
870  .tim_oc_init = {
871  .TIM_OCMode = TIM_OCMode_PWM1,
872  .TIM_OutputState = TIM_OutputState_Enable,
873  .TIM_OutputNState = TIM_OutputNState_Disable,
874  .TIM_Pulse = PIOS_SERVOS_INITIAL_POSITION,
875  .TIM_OCPolarity = TIM_OCPolarity_High,
876  .TIM_OCNPolarity = TIM_OCPolarity_High,
877  .TIM_OCIdleState = TIM_OCIdleState_Reset,
878  .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
879  },
880  .force_1MHz = true,
881  .channels = pios_tim_servoport_v02_pins,
882  .num_channels = NELEMENTS(pios_tim_servoport_v02_pins),
883 };
884 
885 #endif /* PIOS_INCLUDE_SERVO && PIOS_INCLUDE_TIM */
886 
887 
888 
889 /*
890  * PWM Inputs
891  */
892 #if defined(PIOS_INCLUDE_PWM) || defined(PIOS_INCLUDE_PPM)
893 #include <pios_pwm_priv.h>
894 
895 /*
896  * INPUTS
897  1: TIM2_CH4 (PA3)
898  */
899 static const struct pios_tim_channel pios_tim_rcvrport_ppm[] = {
900  {
901  .timer = TIM2,
902  .timer_chan = TIM_Channel_4,
903  .remap = GPIO_AF_1,
904  .pin = {
905  .gpio = GPIOA,
906  .init = {
907  .GPIO_Pin = GPIO_Pin_3,
908  .GPIO_Speed = GPIO_Speed_2MHz,
909  .GPIO_Mode = GPIO_Mode_AF,
910  .GPIO_OType = GPIO_OType_PP,
911  .GPIO_PuPd = GPIO_PuPd_UP
912  },
913  .pin_source = GPIO_PinSource3,
914  },
915  },
916 };
917 static const struct pios_tim_channel pios_tim_rcvrport_pwm[] = {
918  { // Ch10 TIM2_CH2 (PA1)
919  .timer = TIM2,
920  .timer_chan = TIM_Channel_2,
921  .remap = GPIO_AF_1,
922  .pin = {
923  .gpio = GPIOA,
924  .init = {
925  .GPIO_Pin = GPIO_Pin_1,
926  .GPIO_Speed = GPIO_Speed_2MHz,
927  .GPIO_Mode = GPIO_Mode_AF,
928  .GPIO_OType = GPIO_OType_PP,
929  .GPIO_PuPd = GPIO_PuPd_UP
930  },
931  .pin_source = GPIO_PinSource1,
932  },
933  },
934  { // Ch8 TIM17_CH1 (PA7)
935  .timer = TIM17,
936  .timer_chan = TIM_Channel_1,
937  .remap = GPIO_AF_1,
938  .pin = {
939  .gpio = GPIOA,
940  .init = {
941  .GPIO_Pin = GPIO_Pin_7,
942  .GPIO_Speed = GPIO_Speed_2MHz,
943  .GPIO_Mode = GPIO_Mode_AF,
944  .GPIO_OType = GPIO_OType_PP,
945  .GPIO_PuPd = GPIO_PuPd_UP
946  },
947  .pin_source = GPIO_PinSource7,
948  },
949  },
950 };
951 
952 #endif
953 /*
954  * PWM Inputs
955  */
956 #if defined(PIOS_INCLUDE_PWM)
957 
958 static struct pios_pwm_cfg pios_pwm_cfg = {
959  .tim_ic_init = {
960  .TIM_ICPolarity = TIM_ICPolarity_Rising,
961  .TIM_ICSelection = TIM_ICSelection_DirectTI,
962  .TIM_ICPrescaler = TIM_ICPSC_DIV1,
963  .TIM_ICFilter = 0x0,
964  },
965  .channels = pios_tim_rcvrport_pwm,
966  .num_channels = 1,
967 };
968 #endif
969 /*
970  * PPM Input
971  */
972 #if defined(PIOS_INCLUDE_PPM)
973 #include <pios_ppm_priv.h>
974 static const struct pios_ppm_cfg pios_ppm_cfg = {
975  .tim_ic_init = {
976  .TIM_ICPolarity = TIM_ICPolarity_Rising,
977  .TIM_ICSelection = TIM_ICSelection_DirectTI,
978  .TIM_ICPrescaler = TIM_ICPSC_DIV1,
979  .TIM_ICFilter = 0x0,
980  .TIM_Channel = TIM_Channel_4,
981  },
982  /* Use only the first channel for ppm */
983  .channels = pios_tim_rcvrport_ppm,
984  .num_channels = 1,
985 };
986 
987 #endif //PPM
988 
989 #if defined(PIOS_INCLUDE_ADC)
990 #include "pios_adc_priv.h"
991 #include "pios_internal_adc_priv.h"
992 
993 uintptr_t pios_internal_adc_id;
994 
995 void DMA1_Channel1_IRQHandler(void) __attribute__((alias("PIOS_ADC_DMA_irq_handler")));
996 
997 void PIOS_ADC_DMA_irq_handler(void)
998 {
999  /* Call into the generic code to handle the IRQ for this specific device */
1000  PIOS_INTERNAL_ADC_DMA_Handler(pios_internal_adc_id);
1001 }
1002 
1008 static struct pios_internal_adc_cfg internal_adc_cfg = {
1009  .dma = {
1010  .irq = {
1011  .flags = (DMA1_FLAG_TC1 | DMA1_FLAG_TE1 | DMA1_FLAG_HT1 | DMA1_FLAG_GL1),
1012  .init = {
1013  .NVIC_IRQChannel = DMA1_Channel1_IRQn,
1014  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH,
1015  .NVIC_IRQChannelSubPriority = 0,
1016  .NVIC_IRQChannelCmd = ENABLE,
1017  },
1018  },
1019  .rx = {
1020  .channel = DMA1_Channel1,
1021  .init = {
1022  .DMA_Priority = DMA_Priority_High,
1023  },
1024  }
1025  },
1026  .half_flag = DMA1_IT_HT1,
1027  .full_flag = DMA1_IT_TC1,
1028  .oversampling = 32,
1029  .adc_pins = {
1030  {GPIOA,GPIO_Pin_1,ADC_Channel_2,true},
1031  {GPIOA,GPIO_Pin_4,ADC_Channel_1,false},
1032  {GPIOA,GPIO_Pin_7,ADC_Channel_4,false},
1033  },
1034  .adc_pin_count = 3,
1035  .adc_dev_master = ADC1,
1036  .adc_dev_slave = ADC2,
1037 };
1038 
1039 #endif /* PIOS_INCLUDE_ADC */
1040 
1041 #if defined(PIOS_INCLUDE_RCVR)
1042 #include "pios_rcvr_priv.h"
1043 #endif /* PIOS_INCLUDE_RCVR */
1044 
1045 #if defined(PIOS_INCLUDE_USB)
1046 #include "pios_usb_priv.h"
1047 
1048 static const struct pios_usb_cfg pios_usb_main_cfg = {
1049  .irq = {
1050  .init = {
1051  .NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn,
1052  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_LOW,
1053  .NVIC_IRQChannelSubPriority = 0,
1054  .NVIC_IRQChannelCmd = ENABLE,
1055  },
1056  },
1057  .vsense = {
1058  .gpio = GPIOB,
1059  .init = {
1060  .GPIO_Pin = GPIO_Pin_3,
1061  .GPIO_Speed = GPIO_Speed_2MHz,
1062  .GPIO_Mode = GPIO_Mode_IN,
1063  .GPIO_OType = GPIO_OType_OD,
1064  .GPIO_PuPd = GPIO_PuPd_DOWN,
1065  },
1066  }
1067 };
1068 
1069 const struct pios_usb_cfg * PIOS_BOARD_HW_DEFS_GetUsbCfg (uint32_t board_revision)
1070 {
1071  return &pios_usb_main_cfg;
1072 }
1073 
1074 #include "pios_usb_board_data_priv.h"
1077 #include "pios_usbhook.h"
1078 
1079 #endif /* PIOS_INCLUDE_USB */
1080 
1081 #if defined(PIOS_INCLUDE_COM_MSG)
1082 
1083 #include <pios_com_msg_priv.h>
1084 
1085 #endif /* PIOS_INCLUDE_COM_MSG */
1086 
1087 #if defined(PIOS_INCLUDE_USB_HID)
1088 #include <pios_usb_hid_priv.h>
1089 
1090 const struct pios_usb_hid_cfg pios_usb_hid_cfg = {
1091  .data_if = 0,
1092  .data_rx_ep = 1,
1093  .data_tx_ep = 1,
1094 };
1095 #endif /* PIOS_INCLUDE_USB_HID */
1096 
1097 #if defined(PIOS_INCLUDE_USB_CDC)
1098 #include <pios_usb_cdc_priv.h>
1099 
1100 const struct pios_usb_cdc_cfg pios_usb_cdc_cfg = {
1101  .ctrl_if = 1,
1102  .ctrl_tx_ep = 2,
1103 
1104  .data_if = 2,
1105  .data_rx_ep = 3,
1106  .data_tx_ep = 3,
1107 };
1108 #endif /* PIOS_INCLUDE_USB_CDC */
1109 
1110 
1114 #if defined(PIOS_INCLUDE_MS5611)
1115 #include "pios_ms5611_priv.h"
1116 static const struct pios_ms5611_cfg pios_ms5611_cfg = {
1118  .temperature_interleaving = 1,
1119 };
1120 #endif /* PIOS_INCLUDE_MS5611 */
1121 
1125 #if defined(PIOS_INCLUDE_MPU)
1126 #include "pios_mpu.h"
1127 static const struct pios_exti_cfg pios_exti_mpu_cfg __exti_config = {
1128  .vector = PIOS_MPU_IRQHandler,
1129  .line = EXTI_Line15,
1130  .pin = {
1131  .gpio = GPIOA,
1132  .init = {
1133  .GPIO_Pin = GPIO_Pin_15,
1134  .GPIO_Speed = GPIO_Speed_50MHz,
1135  .GPIO_Mode = GPIO_Mode_IN,
1136  .GPIO_OType = GPIO_OType_OD,
1137  .GPIO_PuPd = GPIO_PuPd_NOPULL,
1138  },
1139  },
1140  .irq = {
1141  .init = {
1142  .NVIC_IRQChannel = EXTI15_10_IRQn,
1143  .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
1144  .NVIC_IRQChannelSubPriority = 0,
1145  .NVIC_IRQChannelCmd = ENABLE,
1146  },
1147  },
1148  .exti = {
1149  .init = {
1150  .EXTI_Line = EXTI_Line15, // matches above GPIO pin
1151  .EXTI_Mode = EXTI_Mode_Interrupt,
1152  .EXTI_Trigger = EXTI_Trigger_Rising,
1153  .EXTI_LineCmd = ENABLE,
1154  },
1155  },
1156 };
1157 
1158 static struct pios_mpu_cfg pios_mpu_cfg = {
1159  .exti_cfg = &pios_exti_mpu_cfg,
1160  .default_samplerate = 500,
1161  .orientation = PIOS_MPU_TOP_180DEG,
1162  .use_internal_mag = true,
1163 };
1164 #endif /* PIOS_INCLUDE_MPU */
1165 
struct stm32_gpio pin
MS5611 functions header.
CAN_TypeDef * regs
Definition: pios_can_priv.h:36
static const struct pios_tim_channel pios_tim_servoport_v02_pins[]
#define NELEMENTS(x)
Definition: pios.h:192
struct stm32_gpio bind
#define FLASH_SECTOR_2KB
COM private definitions.
COM MSG private definitions.
APIs for PIOS_USBHOOK layer.
TIM_ICInitTypeDef tim_ic_init
Definition: pios_pwm_priv.h:39
GPIO_TypeDef * gpio
Definition: pios_stm32.h:60
I2C_TypeDef * regs
Definition: pios_i2c_priv.h:37
ADC private definitions.
#define PIOS_IRQ_PRIO_HIGHEST
Definition: pios_board.h:172
PiOS CAN interface header.
#define PIOS_SERVOS_INITIAL_POSITION
Definition: pios_board.h:210
static const struct pios_tim_clock_cfg tim_17_cfg
Defines the API to set up the HID + CDC USB descriptor config.
void PIOS_INTERNAL_ADC_DMA_Handler()
#define RTC_WKUP_IRQHandler
#define DMA1_Channel1_IRQHandler
#define PIOS_LED_ALARM
Definition: pios_board.h:86
#define PIOS_IRQ_PRIO_MID
Definition: pios_board.h:170
Configuration structure for the MS5611 driver.
USART private definitions.
struct stm32_irq irq
Definition: pios_stm32.h:54
Spektrum/JR DSMx satellite receiver private structures.
enum pios_ms5611_osr oversampling
#define I2C2_ER_IRQHandler
const struct pios_exti_cfg * exti_cfg
Definition: pios_mpu.h:140
static const struct pios_tim_clock_cfg tim_16_cfg
#define PIOS_SERVO_UPDATE_HZ
Definition: pios_board.h:209
TIM_TypeDef * timer
Definition: pios_tim_priv.h:7
uintptr_t pios_internal_adc_id
Definition: pios_board.c:51
struct pios_i2c_adapter * pios_i2c_t
Definition: pios_i2c.h:48
static const struct pios_tim_channel pios_tim_rcvrport_ppm[]
#define PIOS_PERIPHERAL_APB1_CLOCK
Definition: pios_board.h:154
const struct pios_annunc * annunciators
void PIOS_I2C_EV_IRQ_Handler(pios_i2c_t i2c_id)
ppm private structures.
NVIC_InitTypeDef init
Definition: pios_stm32.h:36
#define I2C1_ER_IRQHandler
USART_TypeDef * regs
USB private definitions.
TIM_OCInitTypeDef tim_oc_init
USB COM HID private definitions.
ADC private definitions.
Servo private structures.
#define I2C2_EV_EXTI24_IRQHandler
void PIOS_I2C_ER_IRQ_Handler(pios_i2c_t i2c_id)
TIM_ICInitTypeDef tim_ic_init
Definition: pios_ppm_priv.h:37
static const struct pios_tim_clock_cfg tim_3_cfg
static const TIM_TimeBaseInitTypeDef tim_2_3_time_base
Defines the API to set up the HID-only USB descriptor config.
uint32_t flags
Definition: pios_stm32.h:35
void PIOS_RTC_irq_handler(void)
#define PIOS_PERIPHERAL_APB2_CLOCK
Definition: pios_board.h:164
bool PIOS_MPU_IRQHandler(void)
The IMU interrupt handler. Fetches new data from the IMU.
const struct pios_flash_driver * driver
static const struct pios_tim_clock_cfg tim_1_cfg
const struct pios_flash_partition pios_flash_partition_table[]
Definition: unittest_init.c:50
#define I2C1_EV_EXTI23_IRQHandler
#define PIOS_IRQ_PRIO_HIGH
Definition: pios_board.h:171
TIM_TypeDef * timer
Definition: pios_tim_priv.h:14
USB COM CDC private definitions.
uint32_t clksrc
Definition: pios_rtc_priv.h:37
static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base
enum pios_flash_partition_labels label
board_revision
Definition: board_hw_defs.c:35
#define PIOS_IRQ_PRIO_LOW
Definition: pios_board.h:169
#define PIOS_Assert(test)
Definition: pios_debug.h:52
static const struct pios_tim_clock_cfg tim_15_cfg
LED private definitions.
struct stm32_irq irq
Definition: pios_usb_priv.h:37
const struct pios_flash_driver pios_internal_flash_driver
USART private definitions.
#define PIOS_LED_HEARTBEAT
Definition: pios_board.h:85
#define __exti_config
Definition: pios_exti.h:48
static const struct pios_tim_clock_cfg tim_2_cfg
Defines the API to the board-specific USB data setup code.