2 ******************************************************************************
4 * @file board_hw_defs.c.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013.
6 * @brief Defines board hardware for the OpenPilot OPLink Mini board.
7 * @see The GNU Public License (GPL) Version 3
9 *****************************************************************************/
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #if defined(PIOS_INCLUDE_LED)
29 #include <pios_led_priv.h>
30 static const struct pios_gpio pios_leds
[] = {
35 .GPIO_Pin
= GPIO_Pin_3
,
36 .GPIO_Mode
= GPIO_Mode_Out_PP
,
37 .GPIO_Speed
= GPIO_Speed_50MHz
,
46 .GPIO_Pin
= GPIO_Pin_5
,
47 .GPIO_Mode
= GPIO_Mode_Out_PP
,
48 .GPIO_Speed
= GPIO_Speed_50MHz
,
57 .GPIO_Pin
= GPIO_Pin_6
,
58 .GPIO_Mode
= GPIO_Mode_Out_PP
,
59 .GPIO_Speed
= GPIO_Speed_50MHz
,
68 .GPIO_Pin
= GPIO_Pin_7
,
69 .GPIO_Mode
= GPIO_Mode_Out_PP
,
70 .GPIO_Speed
= GPIO_Speed_50MHz
,
75 #ifdef PIOS_RFM22B_DEBUG_ON_TELEM
80 .GPIO_Pin
= GPIO_Pin_14
,
81 .GPIO_Mode
= GPIO_Mode_Out_PP
,
82 .GPIO_Speed
= GPIO_Speed_50MHz
,
90 .GPIO_Pin
= GPIO_Pin_15
,
91 .GPIO_Mode
= GPIO_Mode_Out_PP
,
92 .GPIO_Speed
= GPIO_Speed_50MHz
,
100 .GPIO_Pin
= GPIO_Pin_9
,
101 .GPIO_Mode
= GPIO_Mode_Out_PP
,
102 .GPIO_Speed
= GPIO_Speed_50MHz
,
110 .GPIO_Pin
= GPIO_Pin_10
,
111 .GPIO_Mode
= GPIO_Mode_Out_PP
,
112 .GPIO_Speed
= GPIO_Speed_50MHz
,
116 #endif /* ifdef PIOS_RFM22B_DEBUG_ON_TELEM */
119 static const struct pios_gpio_cfg pios_led_cfg
= {
121 .num_gpios
= NELEMENTS(pios_leds
),
124 const struct pios_gpio_cfg
*PIOS_BOARD_HW_DEFS_GetLedCfg(__attribute__((unused
)) uint32_t board_revision
)
126 return &pios_led_cfg
;
129 #endif /* PIOS_INCLUDE_LED */
131 #if defined(PIOS_INCLUDE_FLASH)
132 #include "pios_flashfs_logfs_priv.h"
133 #include "pios_flash_internal_priv.h"
135 static const struct pios_flash_internal_cfg flash_internal_cfg
= {};
137 static const struct flashfs_logfs_cfg flashfs_internal_cfg
= {
138 .fs_magic
= 0x99abcfef,
139 .total_fs_size
= EE_BANK_SIZE
, /* 2K bytes (2x1KB sectors) */
140 .arena_size
= 0x00002000, /* 4 * slot size = 1K bytes = 1 sector */
141 .slot_size
= 0x00000100, /* 256 bytes */
143 .start_offset
= EE_BANK_BASE
, /* start after the bootloader */
144 .sector_size
= 0x00000400, /* 1K bytes */
145 .page_size
= 0x00000400, /* 1K bytes */
148 #include "pios_flash.h"
150 #endif /* PIOS_INCLUDE_FLASH */
153 #if defined(PIOS_INCLUDE_SPI)
155 #include <pios_spi_priv.h>
159 * NOTE: Leave this declared as const data so that it ends up in the
160 * .rodata section (ie. Flash) rather than in the .bss section (RAM).
162 void PIOS_SPI_port_irq_handler(void);
163 void DMA1_Channel5_IRQHandler() __attribute__((alias("PIOS_SPI_port_irq_handler")));
164 void DMA1_Channel4_IRQHandler() __attribute__((alias("PIOS_SPI_port_irq_handler")));
166 static const struct pios_spi_cfg pios_spi_rfm22b_cfg
= {
170 .SPI_Mode
= SPI_Mode_Master
,
171 .SPI_Direction
= SPI_Direction_2Lines_FullDuplex
,
172 .SPI_DataSize
= SPI_DataSize_8b
,
173 .SPI_NSS
= SPI_NSS_Soft
,
174 .SPI_FirstBit
= SPI_FirstBit_MSB
,
175 .SPI_CRCPolynomial
= 0,
176 .SPI_CPOL
= SPI_CPOL_Low
,
177 .SPI_CPHA
= SPI_CPHA_1Edge
,
178 .SPI_BaudRatePrescaler
= SPI_BaudRatePrescaler_16
, // slowest SCLK
183 .ahb_clk
= RCC_AHBPeriph_DMA1
,
185 .flags
= (DMA1_FLAG_TC2
| DMA1_FLAG_TE2
| DMA1_FLAG_HT2
| DMA1_FLAG_GL2
),
187 .NVIC_IRQChannel
= DMA1_Channel2_IRQn
,
188 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_HIGH
,
189 .NVIC_IRQChannelSubPriority
= 0,
190 .NVIC_IRQChannelCmd
= ENABLE
,
195 .channel
= DMA1_Channel2
,
197 .DMA_PeripheralBaseAddr
= (uint32_t)&(SPI1
->DR
),
198 .DMA_DIR
= DMA_DIR_PeripheralSRC
,
199 .DMA_PeripheralInc
= DMA_PeripheralInc_Disable
,
200 .DMA_MemoryInc
= DMA_MemoryInc_Enable
,
201 .DMA_PeripheralDataSize
= DMA_PeripheralDataSize_Byte
,
202 .DMA_MemoryDataSize
= DMA_MemoryDataSize_Byte
,
203 .DMA_Mode
= DMA_Mode_Normal
,
204 .DMA_Priority
= DMA_Priority_Medium
,
205 .DMA_M2M
= DMA_M2M_Disable
,
209 .channel
= DMA1_Channel3
,
211 .DMA_PeripheralBaseAddr
= (uint32_t)&(SPI1
->DR
),
212 .DMA_DIR
= DMA_DIR_PeripheralDST
,
213 .DMA_PeripheralInc
= DMA_PeripheralInc_Disable
,
214 .DMA_MemoryInc
= DMA_MemoryInc_Enable
,
215 .DMA_PeripheralDataSize
= DMA_PeripheralDataSize_Byte
,
216 .DMA_MemoryDataSize
= DMA_MemoryDataSize_Byte
,
217 .DMA_Mode
= DMA_Mode_Normal
,
218 .DMA_Priority
= DMA_Priority_Medium
,
219 .DMA_M2M
= DMA_M2M_Disable
,
228 .GPIO_Pin
= GPIO_Pin_4
,
229 .GPIO_Speed
= GPIO_Speed_10MHz
,
230 .GPIO_Mode
= GPIO_Mode_Out_PP
,
237 .GPIO_Pin
= GPIO_Pin_5
,
238 .GPIO_Speed
= GPIO_Speed_10MHz
,
239 .GPIO_Mode
= GPIO_Mode_AF_PP
,
245 .GPIO_Pin
= GPIO_Pin_6
,
246 .GPIO_Speed
= GPIO_Speed_10MHz
,
247 .GPIO_Mode
= GPIO_Mode_IN_FLOATING
,
253 .GPIO_Pin
= GPIO_Pin_7
,
254 .GPIO_Speed
= GPIO_Speed_10MHz
,
255 .GPIO_Mode
= GPIO_Mode_AF_PP
,
260 uint32_t pios_spi_rfm22b_id
;
261 void PIOS_SPI_port_irq_handler(void)
263 /* Call into the generic code to handle the IRQ for this specific device */
264 PIOS_SPI_IRQ_Handler(pios_spi_rfm22b_id
);
267 #endif /* PIOS_INCLUDE_SPI */
269 #if defined(PIOS_INCLUDE_RFM22B)
271 #include <pios_rfm22b_priv.h>
273 static const struct pios_exti_cfg pios_exti_rfm22b_cfg __exti_config
= {
274 .vector
= PIOS_RFM22_EXT_Int
,
279 .GPIO_Pin
= GPIO_Pin_2
,
280 .GPIO_Mode
= GPIO_Mode_IN_FLOATING
,
285 .NVIC_IRQChannel
= EXTI2_IRQn
,
286 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_LOW
,
287 .NVIC_IRQChannelSubPriority
= 0,
288 .NVIC_IRQChannelCmd
= ENABLE
,
293 .EXTI_Line
= EXTI_Line2
,
294 .EXTI_Mode
= EXTI_Mode_Interrupt
,
295 .EXTI_Trigger
= EXTI_Trigger_Falling
,
296 .EXTI_LineCmd
= ENABLE
,
301 struct pios_rfm22b_cfg pios_rfm22b_cfg
= {
302 .spi_cfg
= &pios_spi_rfm22b_cfg
,
303 .exti_cfg
= &pios_exti_rfm22b_cfg
,
306 .gpio_direction
= GPIO0_TX_GPIO1_RX
,
309 // ! Compatibility layer for various hardware revisions
310 const struct pios_rfm22b_cfg
*PIOS_BOARD_HW_DEFS_GetRfm22bCfg(__attribute__((unused
)) uint32_t board_revision
)
312 return &pios_rfm22b_cfg
;
315 #if defined(PIOS_INCLUDE_OPENLRS)
317 #include <pios_openlrs_priv.h>
319 static const struct pios_exti_cfg pios_exti_openlrs_cfg __exti_config
= {
320 .vector
= PIOS_OpenLRS_EXT_Int
,
325 .GPIO_Pin
= GPIO_Pin_2
,
326 .GPIO_Mode
= GPIO_Mode_IN_FLOATING
,
331 .NVIC_IRQChannel
= EXTI2_IRQn
,
332 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_LOW
,
333 .NVIC_IRQChannelSubPriority
= 0,
334 .NVIC_IRQChannelCmd
= ENABLE
,
339 .EXTI_Line
= EXTI_Line2
,
340 .EXTI_Mode
= EXTI_Mode_Interrupt
,
341 .EXTI_Trigger
= EXTI_Trigger_Falling
,
342 .EXTI_LineCmd
= ENABLE
,
347 struct pios_openlrs_cfg pios_openlrs_cfg
= {
348 .spi_cfg
= &pios_spi_rfm22b_cfg
,
349 .exti_cfg
= &pios_exti_openlrs_cfg
,
352 // ! Compatibility layer for various hardware revisions
353 const struct pios_openlrs_cfg
*PIOS_BOARD_HW_DEFS_GetOpenLRSCfg(__attribute__((unused
)) uint32_t board_revision
)
355 return &pios_openlrs_cfg
;
358 #endif /* PIOS_INCLUDE_OpenLRS */
360 #endif /* PIOS_INCLUDE_RFM22B */
362 #if defined(PIOS_INCLUDE_ADC)
367 #include "pios_adc_priv.h"
368 extern void PIOS_ADC_handler(void);
369 void DMA1_Channel1_IRQHandler() __attribute__((alias("PIOS_ADC_handler")));
370 // Remap the ADC DMA handler to this one
371 static const struct pios_adc_cfg pios_adc_cfg
= {
373 .ahb_clk
= RCC_AHBPeriph_DMA1
,
375 .flags
= (DMA1_FLAG_TC1
| DMA1_FLAG_TE1
| DMA1_FLAG_HT1
| DMA1_FLAG_GL1
),
377 .NVIC_IRQChannel
= DMA1_Channel1_IRQn
,
378 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_HIGH
,
379 .NVIC_IRQChannelSubPriority
= 0,
380 .NVIC_IRQChannelCmd
= ENABLE
,
384 .channel
= DMA1_Channel1
,
386 .DMA_PeripheralBaseAddr
= (uint32_t)&ADC1
->DR
,
387 .DMA_DIR
= DMA_DIR_PeripheralSRC
,
388 .DMA_PeripheralInc
= DMA_PeripheralInc_Disable
,
389 .DMA_MemoryInc
= DMA_MemoryInc_Enable
,
390 .DMA_PeripheralDataSize
= DMA_PeripheralDataSize_Word
,
391 .DMA_MemoryDataSize
= DMA_MemoryDataSize_Word
,
392 .DMA_Mode
= DMA_Mode_Circular
,
393 .DMA_Priority
= DMA_Priority_High
,
394 .DMA_M2M
= DMA_M2M_Disable
,
398 .half_flag
= DMA1_IT_HT1
,
399 .full_flag
= DMA1_IT_TC1
,
402 struct pios_adc_dev pios_adc_devs
[] = {
404 .cfg
= &pios_adc_cfg
,
405 .callback_function
= NULL
,
409 uint8_t pios_adc_num_devices
= NELEMENTS(pios_adc_devs
);
411 void PIOS_ADC_handler()
413 PIOS_ADC_DMA_Handler();
416 #endif /* PIOS_INCLUDE_ADC */
418 #if defined(PIOS_INCLUDE_TIM)
420 #include "pios_tim_priv.h"
422 static const TIM_TimeBaseInitTypeDef tim_1_2_3_4_time_base
= {
423 .TIM_Prescaler
= (PIOS_MASTER_CLOCK
/ 1000000) - 1,
424 .TIM_ClockDivision
= TIM_CKD_DIV1
,
425 .TIM_CounterMode
= TIM_CounterMode_Up
,
426 .TIM_Period
= ((1000000 / PIOS_SERVO_UPDATE_HZ
) - 1),
427 .TIM_RepetitionCounter
= 0x0000,
430 static const struct pios_tim_clock_cfg tim_1_cfg
= {
432 .time_base_init
= &tim_1_2_3_4_time_base
,
435 .NVIC_IRQChannel
= TIM1_CC_IRQn
,
436 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_MID
,
437 .NVIC_IRQChannelSubPriority
= 0,
438 .NVIC_IRQChannelCmd
= ENABLE
,
443 static const struct pios_tim_clock_cfg tim_2_cfg
= {
445 .time_base_init
= &tim_1_2_3_4_time_base
,
448 .NVIC_IRQChannel
= TIM2_IRQn
,
449 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_MID
,
450 .NVIC_IRQChannelSubPriority
= 0,
451 .NVIC_IRQChannelCmd
= ENABLE
,
456 static const struct pios_tim_clock_cfg tim_3_cfg
= {
458 .time_base_init
= &tim_1_2_3_4_time_base
,
461 .NVIC_IRQChannel
= TIM3_IRQn
,
462 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_MID
,
463 .NVIC_IRQChannelSubPriority
= 0,
464 .NVIC_IRQChannelCmd
= ENABLE
,
469 static const struct pios_tim_clock_cfg tim_4_cfg
= {
471 .time_base_init
= &tim_1_2_3_4_time_base
,
474 .NVIC_IRQChannel
= TIM4_IRQn
,
475 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_MID
,
476 .NVIC_IRQChannelSubPriority
= 0,
477 .NVIC_IRQChannelCmd
= ENABLE
,
482 static const struct pios_tim_channel pios_tim_all_port_pins
[] = {
486 .timer_chan
= TIM_Channel_2
,
490 .GPIO_Pin
= GPIO_Pin_9
,
491 .GPIO_Mode
= GPIO_Mode_AF_PP
,
492 .GPIO_Speed
= GPIO_Speed_2MHz
,
499 .timer_chan
= TIM_Channel_3
,
503 .GPIO_Pin
= GPIO_Pin_10
,
504 .GPIO_Mode
= GPIO_Mode_AF_PP
,
505 .GPIO_Speed
= GPIO_Speed_2MHz
,
512 .timer_chan
= TIM_Channel_3
,
516 .GPIO_Pin
= GPIO_Pin_10
,
517 .GPIO_Mode
= GPIO_Mode_AF_PP
,
518 .GPIO_Speed
= GPIO_Speed_2MHz
,
521 .remap
= GPIO_PartialRemap2_TIM2
,
526 .timer_chan
= TIM_Channel_4
,
530 .GPIO_Pin
= GPIO_Pin_11
,
531 .GPIO_Mode
= GPIO_Mode_AF_PP
,
532 .GPIO_Speed
= GPIO_Speed_2MHz
,
535 .remap
= GPIO_PartialRemap2_TIM2
,
539 static const struct pios_tim_channel pios_tim_main_port_ppm
= {
541 .timer_chan
= TIM_Channel_3
,
545 .GPIO_Pin
= GPIO_Pin_10
,
546 .GPIO_Mode
= GPIO_Mode_IPD
,
547 .GPIO_Speed
= GPIO_Speed_2MHz
,
552 static const struct pios_tim_channel pios_tim_flexi_port_ppm
= {
554 .timer_chan
= TIM_Channel_4
,
558 .GPIO_Pin
= GPIO_Pin_11
,
559 .GPIO_Mode
= GPIO_Mode_IPD
,
560 .GPIO_Speed
= GPIO_Speed_2MHz
,
563 .remap
= GPIO_PartialRemap2_TIM2
,
566 #endif /* PIOS_INCLUDE_TIM */
568 #if defined(PIOS_INCLUDE_SERVO) && defined(PIOS_INCLUDE_TIM)
572 #include <pios_servo_priv.h>
574 const struct pios_servo_cfg pios_servo_main_cfg
= {
576 .TIM_OCMode
= TIM_OCMode_PWM1
,
577 .TIM_OutputState
= TIM_OutputState_Enable
,
578 .TIM_OutputNState
= TIM_OutputNState_Disable
,
579 .TIM_Pulse
= PIOS_SERVOS_INITIAL_POSITION
,
580 .TIM_OCPolarity
= TIM_OCPolarity_High
,
581 .TIM_OCNPolarity
= TIM_OCPolarity_High
,
582 .TIM_OCIdleState
= TIM_OCIdleState_Reset
,
583 .TIM_OCNIdleState
= TIM_OCNIdleState_Reset
,
585 .channels
= pios_tim_all_port_pins
,
589 const struct pios_servo_cfg pios_servo_flexi_cfg
= {
591 .TIM_OCMode
= TIM_OCMode_PWM1
,
592 .TIM_OutputState
= TIM_OutputState_Enable
,
593 .TIM_OutputNState
= TIM_OutputNState_Disable
,
594 .TIM_Pulse
= PIOS_SERVOS_INITIAL_POSITION
,
595 .TIM_OCPolarity
= TIM_OCPolarity_High
,
596 .TIM_OCNPolarity
= TIM_OCPolarity_High
,
597 .TIM_OCIdleState
= TIM_OCIdleState_Reset
,
598 .TIM_OCNIdleState
= TIM_OCNIdleState_Reset
,
600 .channels
= &(pios_tim_all_port_pins
[2]),
604 const struct pios_servo_cfg pios_servo_main_flexi_cfg
= {
606 .TIM_OCMode
= TIM_OCMode_PWM1
,
607 .TIM_OutputState
= TIM_OutputState_Enable
,
608 .TIM_OutputNState
= TIM_OutputNState_Disable
,
609 .TIM_Pulse
= PIOS_SERVOS_INITIAL_POSITION
,
610 .TIM_OCPolarity
= TIM_OCPolarity_High
,
611 .TIM_OCNPolarity
= TIM_OCPolarity_High
,
612 .TIM_OCIdleState
= TIM_OCIdleState_Reset
,
613 .TIM_OCNIdleState
= TIM_OCNIdleState_Reset
,
615 .channels
= pios_tim_all_port_pins
,
619 #endif /* PIOS_INCLUDE_SERVO && PIOS_INCLUDE_TIM */
624 #if defined(PIOS_INCLUDE_PPM)
625 #include <pios_ppm_priv.h>
627 const struct pios_ppm_cfg pios_ppm_main_cfg
= {
629 .TIM_ICPolarity
= TIM_ICPolarity_Rising
,
630 .TIM_ICSelection
= TIM_ICSelection_DirectTI
,
631 .TIM_ICPrescaler
= TIM_ICPSC_DIV1
,
634 .channels
= &pios_tim_main_port_ppm
,
638 const struct pios_ppm_cfg pios_ppm_flexi_cfg
= {
640 .TIM_ICPolarity
= TIM_ICPolarity_Rising
,
641 .TIM_ICSelection
= TIM_ICSelection_DirectTI
,
642 .TIM_ICPrescaler
= TIM_ICPSC_DIV1
,
645 .channels
= &pios_tim_flexi_port_ppm
,
649 #endif /* PIOS_INCLUDE_PPM */
654 #if defined(PIOS_INCLUDE_PPM_OUT)
655 #include <pios_ppm_out_priv.h>
657 const struct pios_ppm_out_cfg pios_main_ppm_out_cfg
= {
659 .TIM_OCMode
= TIM_OCMode_PWM1
,
660 .TIM_OutputState
= TIM_OutputState_Enable
,
661 .TIM_OutputNState
= TIM_OutputNState_Disable
,
662 .TIM_Pulse
= PIOS_SERVOS_INITIAL_POSITION
,
663 .TIM_OCPolarity
= TIM_OCPolarity_Low
,
664 .TIM_OCNPolarity
= TIM_OCPolarity_Low
,
665 .TIM_OCIdleState
= TIM_OCIdleState_Reset
,
666 .TIM_OCNIdleState
= TIM_OCNIdleState_Reset
,
668 .channel
= &(pios_tim_all_port_pins
[0]),
671 const struct pios_ppm_out_cfg pios_flexi_ppm_out_cfg
= {
673 .TIM_OCMode
= TIM_OCMode_PWM1
,
674 .TIM_OutputState
= TIM_OutputState_Enable
,
675 .TIM_OutputNState
= TIM_OutputNState_Disable
,
676 .TIM_Pulse
= PIOS_SERVOS_INITIAL_POSITION
,
677 .TIM_OCPolarity
= TIM_OCPolarity_Low
,
678 .TIM_OCNPolarity
= TIM_OCPolarity_Low
,
679 .TIM_OCIdleState
= TIM_OCIdleState_Reset
,
680 .TIM_OCNIdleState
= TIM_OCNIdleState_Reset
,
682 .channel
= &(pios_tim_all_port_pins
[2]),
685 #endif /* PIOS_INCLUDE_PPM_OUT */
687 #if defined(PIOS_INCLUDE_USART)
689 #include <pios_usart_priv.h>
694 static const struct pios_usart_cfg pios_usart_main_cfg
= {
699 .GPIO_Pin
= GPIO_Pin_10
,
700 .GPIO_Speed
= GPIO_Speed_2MHz
,
701 .GPIO_Mode
= GPIO_Mode_IPU
,
707 .GPIO_Pin
= GPIO_Pin_9
,
708 .GPIO_Speed
= GPIO_Speed_2MHz
,
709 .GPIO_Mode
= GPIO_Mode_AF_PP
,
714 static const struct pios_usart_cfg pios_usart_flexi_cfg
= {
719 .GPIO_Pin
= GPIO_Pin_11
,
720 .GPIO_Speed
= GPIO_Speed_2MHz
,
721 .GPIO_Mode
= GPIO_Mode_IPU
,
727 .GPIO_Pin
= GPIO_Pin_10
,
728 .GPIO_Speed
= GPIO_Speed_2MHz
,
729 .GPIO_Mode
= GPIO_Mode_AF_PP
,
734 #endif /* PIOS_INCLUDE_USART */
736 #if defined(PIOS_INCLUDE_COM)
738 #include <pios_com_priv.h>
740 #endif /* PIOS_INCLUDE_COM */
742 #if defined(PIOS_INCLUDE_RTC)
744 * Realtime Clock (RTC)
746 #include <pios_rtc_priv.h>
748 void PIOS_RTC_IRQ_Handler(void);
749 void RTC_IRQHandler() __attribute__((alias("PIOS_RTC_IRQ_Handler")));
750 static const struct pios_rtc_cfg pios_rtc_main_cfg
= {
751 .clksrc
= RCC_RTCCLKSource_HSE_Div128
,
755 .NVIC_IRQChannel
= RTC_IRQn
,
756 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_MID
,
757 .NVIC_IRQChannelSubPriority
= 0,
758 .NVIC_IRQChannelCmd
= ENABLE
,
763 void PIOS_RTC_IRQ_Handler(void)
765 PIOS_RTC_irq_handler();
768 #endif /* if defined(PIOS_INCLUDE_RTC) */
770 #if defined(PIOS_INCLUDE_RCVR)
771 #include "pios_rcvr_priv.h"
773 #endif /* PIOS_INCLUDE_RCVR */
775 #if defined(PIOS_INCLUDE_USB)
776 #include "pios_usb_priv.h"
778 static const struct pios_usb_cfg pios_usb_main_cfg
= {
781 .NVIC_IRQChannel
= USB_LP_CAN1_RX0_IRQn
,
782 .NVIC_IRQChannelPreemptionPriority
= PIOS_IRQ_PRIO_HIGH
,
783 .NVIC_IRQChannelSubPriority
= 0,
784 .NVIC_IRQChannelCmd
= ENABLE
,
790 .GPIO_Pin
= GPIO_Pin_8
,
791 .GPIO_Speed
= GPIO_Speed_10MHz
,
792 .GPIO_Mode
= GPIO_Mode_AF_OD
,
795 .vsense_active_low
= false
798 const struct pios_usb_cfg
*PIOS_BOARD_HW_DEFS_GetUsbCfg(__attribute__((unused
)) uint32_t board_revision
)
800 return &pios_usb_main_cfg
;
803 #include "pios_usb_board_data_priv.h"
804 #include "pios_usb_desc_hid_cdc_priv.h"
805 #include "pios_usb_desc_hid_only_priv.h"
807 #endif /* PIOS_INCLUDE_USB */
809 #if defined(PIOS_INCLUDE_COM_MSG)
811 #include <pios_com_msg_priv.h>
813 #endif /* PIOS_INCLUDE_COM_MSG */
815 #if defined(PIOS_INCLUDE_FLASH_EEPROM)
816 #include <pios_eeprom.h>
818 const struct pios_eeprom_cfg pios_eeprom_cfg
= {
819 .base_address
= PIOS_FLASH_EEPROM_ADDR
,
820 .max_size
= PIOS_FLASH_EEPROM_LEN
,
822 #endif /* PIOS_INCLUDE_FLASH_EEPROM */
824 #if defined(PIOS_INCLUDE_RFM22B)
825 #include <pios_rfm22b_priv.h>
827 #endif /* PIOS_INCLUDE_RFM22B */