33 #include <pios_config.h>
36 #if defined(PIOS_INCLUDE_ANNUNC)
44 .GPIO_Pin = GPIO_Pin_15,
45 .GPIO_Speed = GPIO_Speed_50MHz,
46 .GPIO_Mode = GPIO_Mode_OUT,
47 .GPIO_OType = GPIO_OType_PP,
48 .GPIO_PuPd = GPIO_PuPd_NOPULL
57 .GPIO_Pin = GPIO_Pin_14,
58 .GPIO_Speed = GPIO_Speed_50MHz,
59 .GPIO_Mode = GPIO_Mode_OUT,
60 .GPIO_OType = GPIO_OType_PP,
61 .GPIO_PuPd = GPIO_PuPd_NOPULL
72 .GPIO_Pin = GPIO_Pin_13,
73 .GPIO_Speed = GPIO_Speed_50MHz,
74 .GPIO_Mode = GPIO_Mode_OUT,
75 .GPIO_OType = GPIO_OType_PP,
76 .GPIO_PuPd = GPIO_PuPd_NOPULL
85 .num_annunciators =
NELEMENTS(pios_annuncs),
88 const struct pios_annunc_cfg * PIOS_BOARD_HW_DEFS_GetLedCfg (uint32_t
board_revision)
90 return &pios_annunc_cfg;
95 #if defined(PIOS_INCLUDE_SPI)
105 .SPI_Mode = SPI_Mode_Master,
106 .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
107 .SPI_DataSize = SPI_DataSize_8b,
108 .SPI_NSS = SPI_NSS_Soft,
109 .SPI_FirstBit = SPI_FirstBit_MSB,
110 .SPI_CRCPolynomial = 7,
111 .SPI_CPOL = SPI_CPOL_Low,
112 .SPI_CPHA = SPI_CPHA_1Edge,
113 .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8,
118 .GPIO_Pin = GPIO_Pin_3,
119 .GPIO_Speed = GPIO_Speed_50MHz,
120 .GPIO_Mode = GPIO_Mode_AF,
121 .GPIO_OType = GPIO_OType_PP,
122 .GPIO_PuPd = GPIO_PuPd_NOPULL
124 .pin_source = GPIO_PinSource3,
129 .GPIO_Pin = GPIO_Pin_4,
130 .GPIO_Speed = GPIO_Speed_50MHz,
131 .GPIO_Mode = GPIO_Mode_AF,
132 .GPIO_OType = GPIO_OType_PP,
133 .GPIO_PuPd = GPIO_PuPd_NOPULL
135 .pin_source = GPIO_PinSource4,
140 .GPIO_Pin = GPIO_Pin_5,
141 .GPIO_Speed = GPIO_Speed_50MHz,
142 .GPIO_Mode = GPIO_Mode_AF,
143 .GPIO_OType = GPIO_OType_PP,
144 .GPIO_PuPd = GPIO_PuPd_NOPULL
146 .pin_source = GPIO_PinSource5,
152 .GPIO_Pin = GPIO_Pin_4,
153 .GPIO_Speed = GPIO_Speed_50MHz,
154 .GPIO_Mode = GPIO_Mode_OUT,
155 .GPIO_OType = GPIO_OType_PP,
156 .GPIO_PuPd = GPIO_PuPd_UP
162 #if defined(PIOS_INCLUDE_FLASH)
167 .arena_size = 0x00002000,
168 .slot_size = 0x00000100,
186 uintptr_t pios_internal_flash_id;
189 .chip_id = &pios_internal_flash_id,
191 .sector_blocks = stm32f3_sectors,
192 .num_blocks =
NELEMENTS(stm32f3_sectors),
198 .chip_desc = &pios_flash_chip_internal,
207 .chip_desc = &pios_flash_chip_internal,
216 .chip_desc = &pios_flash_chip_internal,
225 .chip_desc = &pios_flash_chip_internal,
237 *num_partitions =
NELEMENTS(pios_flash_partition_table);
245 #if defined(PIOS_INCLUDE_USART)
249 #if defined(PIOS_INCLUDE_DSM)
255 static const struct pios_dsm_cfg pios_rxport_dsm_aux_cfg = {
259 .GPIO_Pin = GPIO_Pin_5,
260 .GPIO_Speed = GPIO_Speed_2MHz,
261 .GPIO_Mode = GPIO_Mode_OUT,
262 .GPIO_OType = GPIO_OType_PP,
263 .GPIO_PuPd = GPIO_PuPd_NOPULL
268 static const struct pios_dsm_cfg pios_uart2_dsm_aux_cfg = {
272 .GPIO_Pin = GPIO_Pin_15,
273 .GPIO_Speed = GPIO_Speed_2MHz,
274 .GPIO_Mode = GPIO_Mode_OUT,
275 .GPIO_OType = GPIO_OType_PP,
276 .GPIO_PuPd = GPIO_PuPd_NOPULL
281 static const struct pios_dsm_cfg pios_uart3_dsm_aux_cfg = {
285 .GPIO_Pin = GPIO_Pin_11,
286 .GPIO_Speed = GPIO_Speed_2MHz,
287 .GPIO_Mode = GPIO_Mode_OUT,
288 .GPIO_OType = GPIO_OType_PP,
289 .GPIO_PuPd = GPIO_PuPd_NOPULL
301 .NVIC_IRQChannel = USART2_IRQn,
303 .NVIC_IRQChannelSubPriority = 0,
304 .NVIC_IRQChannelCmd = ENABLE,
310 .GPIO_Pin = GPIO_Pin_15,
311 .GPIO_Speed = GPIO_Speed_2MHz,
312 .GPIO_Mode = GPIO_Mode_AF,
313 .GPIO_OType = GPIO_OType_PP,
314 .GPIO_PuPd = GPIO_PuPd_UP
316 .pin_source = GPIO_PinSource15,
321 .GPIO_Pin = GPIO_Pin_14,
322 .GPIO_Speed = GPIO_Speed_2MHz,
323 .GPIO_Mode = GPIO_Mode_AF,
324 .GPIO_OType = GPIO_OType_PP,
325 .GPIO_PuPd = GPIO_PuPd_DOWN
327 .pin_source = GPIO_PinSource14,
336 .NVIC_IRQChannel = USART3_IRQn,
338 .NVIC_IRQChannelSubPriority = 0,
339 .NVIC_IRQChannelCmd = ENABLE,
345 .GPIO_Pin = GPIO_Pin_11,
346 .GPIO_Speed = GPIO_Speed_2MHz,
347 .GPIO_Mode = GPIO_Mode_AF,
348 .GPIO_OType = GPIO_OType_PP,
349 .GPIO_PuPd = GPIO_PuPd_UP
351 .pin_source = GPIO_PinSource11,
356 .GPIO_Pin = GPIO_Pin_10,
357 .GPIO_Speed = GPIO_Speed_2MHz,
358 .GPIO_Mode = GPIO_Mode_AF,
359 .GPIO_OType = GPIO_OType_PP,
360 .GPIO_PuPd = GPIO_PuPd_DOWN
362 .pin_source = GPIO_PinSource10,
371 .NVIC_IRQChannel = USART1_IRQn,
373 .NVIC_IRQChannelSubPriority = 0,
374 .NVIC_IRQChannelCmd = ENABLE,
380 .GPIO_Pin = GPIO_Pin_5,
381 .GPIO_Speed = GPIO_Speed_2MHz,
382 .GPIO_Mode = GPIO_Mode_AF,
383 .GPIO_OType = GPIO_OType_PP,
384 .GPIO_PuPd = GPIO_PuPd_UP
386 .pin_source = GPIO_PinSource5,
391 .GPIO_Pin = GPIO_Pin_4,
392 .GPIO_Speed = GPIO_Speed_2MHz,
393 .GPIO_Mode = GPIO_Mode_AF,
394 .GPIO_OType = GPIO_OType_PP,
395 .GPIO_PuPd = GPIO_PuPd_DOWN
397 .pin_source = GPIO_PinSource4,
403 #if defined(PIOS_INCLUDE_COM)
409 #if defined(PIOS_INCLUDE_RTC)
413 #include <pios_rtc_priv.h>
415 void PIOS_RTC_IRQ_Handler (
void);
418 .
clksrc = RCC_RTCCLKSource_HSE_Div32,
422 .NVIC_IRQChannel = RTC_WKUP_IRQn,
424 .NVIC_IRQChannelSubPriority = 0,
425 .NVIC_IRQChannelCmd = ENABLE,
430 void PIOS_RTC_IRQ_Handler (
void)
442 .TIM_ClockDivision = TIM_CKD_DIV1,
443 .TIM_CounterMode = TIM_CounterMode_Up,
445 .TIM_RepetitionCounter = 0x0000,
450 .TIM_ClockDivision = TIM_CKD_DIV1,
451 .TIM_CounterMode = TIM_CounterMode_Up,
453 .TIM_RepetitionCounter = 0x0000,
461 .NVIC_IRQChannel = TIM2_IRQn,
463 .NVIC_IRQChannelSubPriority = 0,
464 .NVIC_IRQChannelCmd = ENABLE,
474 .NVIC_IRQChannel = TIM3_IRQn,
476 .NVIC_IRQChannelSubPriority = 0,
477 .NVIC_IRQChannelCmd = ENABLE,
487 .NVIC_IRQChannel = TIM1_CC_IRQn,
489 .NVIC_IRQChannelSubPriority = 0,
490 .NVIC_IRQChannelCmd = ENABLE,
499 .NVIC_IRQChannel = TIM1_BRK_TIM15_IRQn,
501 .NVIC_IRQChannelSubPriority = 0,
502 .NVIC_IRQChannelCmd = ENABLE,
512 .NVIC_IRQChannel = TIM1_UP_TIM16_IRQn,
514 .NVIC_IRQChannelSubPriority = 0,
515 .NVIC_IRQChannelCmd = ENABLE,
524 .NVIC_IRQChannel = TIM1_TRG_COM_TIM17_IRQn,
526 .NVIC_IRQChannelSubPriority = 0,
527 .NVIC_IRQChannelCmd = ENABLE,
545 .timer_chan = TIM_Channel_1,
550 .GPIO_Pin = GPIO_Pin_6,
551 .GPIO_Speed = GPIO_Speed_2MHz,
552 .GPIO_Mode = GPIO_Mode_AF,
553 .GPIO_OType = GPIO_OType_PP,
554 .GPIO_PuPd = GPIO_PuPd_UP
556 .pin_source = GPIO_PinSource6,
561 .timer_chan = TIM_Channel_2,
566 .GPIO_Pin = GPIO_Pin_7,
567 .GPIO_Speed = GPIO_Speed_2MHz,
568 .GPIO_Mode = GPIO_Mode_AF,
569 .GPIO_OType = GPIO_OType_PP,
570 .GPIO_PuPd = GPIO_PuPd_UP
572 .pin_source = GPIO_PinSource7,
577 .timer_chan = TIM_Channel_3,
582 .GPIO_Pin = GPIO_Pin_8,
583 .GPIO_Speed = GPIO_Speed_2MHz,
584 .GPIO_Mode = GPIO_Mode_AF,
585 .GPIO_OType = GPIO_OType_PP,
586 .GPIO_PuPd = GPIO_PuPd_UP
588 .pin_source = GPIO_PinSource8,
593 .timer_chan = TIM_Channel_4,
598 .GPIO_Pin = GPIO_Pin_9,
599 .GPIO_Speed = GPIO_Speed_2MHz,
600 .GPIO_Mode = GPIO_Mode_AF,
601 .GPIO_OType = GPIO_OType_PP,
602 .GPIO_PuPd = GPIO_PuPd_UP
604 .pin_source = GPIO_PinSource9,
619 .timer_chan = TIM_Channel_1,
624 .GPIO_Pin = GPIO_Pin_6,
625 .GPIO_Speed = GPIO_Speed_2MHz,
626 .GPIO_Mode = GPIO_Mode_AF,
627 .GPIO_OType = GPIO_OType_PP,
628 .GPIO_PuPd = GPIO_PuPd_UP
630 .pin_source = GPIO_PinSource6,
635 .timer_chan = TIM_Channel_2,
640 .GPIO_Pin = GPIO_Pin_7,
641 .GPIO_Speed = GPIO_Speed_2MHz,
642 .GPIO_Mode = GPIO_Mode_AF,
643 .GPIO_OType = GPIO_OType_PP,
644 .GPIO_PuPd = GPIO_PuPd_UP
646 .pin_source = GPIO_PinSource7,
651 .timer_chan = TIM_Channel_3,
656 .GPIO_Pin = GPIO_Pin_8,
657 .GPIO_Speed = GPIO_Speed_2MHz,
658 .GPIO_Mode = GPIO_Mode_AF,
659 .GPIO_OType = GPIO_OType_PP,
660 .GPIO_PuPd = GPIO_PuPd_UP
662 .pin_source = GPIO_PinSource8,
667 .timer_chan = TIM_Channel_4,
672 .GPIO_Pin = GPIO_Pin_9,
673 .GPIO_Speed = GPIO_Speed_2MHz,
674 .GPIO_Mode = GPIO_Mode_AF,
675 .GPIO_OType = GPIO_OType_PP,
676 .GPIO_PuPd = GPIO_PuPd_UP
678 .pin_source = GPIO_PinSource9,
684 #if defined(PIOS_INCLUDE_SERVO) && defined(PIOS_INCLUDE_TIM)
692 .TIM_OCMode = TIM_OCMode_PWM1,
693 .TIM_OutputState = TIM_OutputState_Enable,
694 .TIM_OutputNState = TIM_OutputNState_Disable,
696 .TIM_OCPolarity = TIM_OCPolarity_High,
697 .TIM_OCNPolarity = TIM_OCPolarity_High,
698 .TIM_OCIdleState = TIM_OCIdleState_Reset,
699 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
702 .num_channels =
NELEMENTS(pios_tim_servoport_v02_pins),
712 #if defined(PIOS_INCLUDE_PPM)
722 .timer_chan = TIM_Channel_1,
727 .GPIO_Pin = GPIO_Pin_8,
728 .GPIO_Speed = GPIO_Speed_2MHz,
729 .GPIO_Mode = GPIO_Mode_AF,
730 .GPIO_OType = GPIO_OType_PP,
731 .GPIO_PuPd = GPIO_PuPd_UP
733 .pin_source = GPIO_PinSource8,
742 #if defined(PIOS_INCLUDE_PPM)
746 .TIM_ICPolarity = TIM_ICPolarity_Rising,
747 .TIM_ICSelection = TIM_ICSelection_DirectTI,
748 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
750 .TIM_Channel = TIM_Channel_1,
753 .channels = pios_tim_rxport_ppm,
759 #if defined(PIOS_INCLUDE_ADC)
767 void PIOS_ADC_DMA_irq_handler(
void)
776 .
flags = (DMA1_FLAG_TC1 | DMA1_FLAG_TE1 | DMA1_FLAG_HT1 | DMA1_FLAG_GL1),
778 .NVIC_IRQChannel = DMA1_Channel1_IRQn,
780 .NVIC_IRQChannelSubPriority = 0,
781 .NVIC_IRQChannelCmd = ENABLE,
785 .channel = DMA1_Channel1,
787 .DMA_Priority = DMA_Priority_High,
791 .half_flag = DMA1_IT_HT1,
792 .full_flag = DMA1_IT_TC1,
796 {GPIOC,GPIO_Pin_0,ADC_Channel_6,
true},
797 {GPIOC,GPIO_Pin_1,ADC_Channel_7,
false},
798 {GPIOC,GPIO_Pin_2,ADC_Channel_8,
false},
800 .adc_dev_master = ADC1,
801 .adc_dev_slave = ADC2,
806 #if defined(PIOS_INCLUDE_RCVR)
810 #if defined(PIOS_INCLUDE_USB)
816 .NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn,
818 .NVIC_IRQChannelSubPriority = 0,
819 .NVIC_IRQChannelCmd = ENABLE,
829 return &pios_usb_main_cfg;
839 #if defined(PIOS_INCLUDE_WS2811)
846 .timer_chan = TIM_Channel_1,
848 .gpio_pin = GPIO_Pin_6,
850 .timer_dma_source = TIM_DMA_Update,
851 .dma_chan = DMA1_Channel3,
852 .dma_tcif = DMA1_FLAG_TC3,
853 .dma_irqn = DMA1_Channel3_IRQn,
857 #if defined(PIOS_INCLUDE_COM_MSG)
863 #if defined(PIOS_INCLUDE_USB_HID)
873 #if defined(PIOS_INCLUDE_USB_CDC)
890 #if defined(PIOS_INCLUDE_MPU)
898 .GPIO_Pin = GPIO_Pin_5,
899 .GPIO_Speed = GPIO_Speed_50MHz,
900 .GPIO_Mode = GPIO_Mode_IN,
901 .GPIO_OType = GPIO_OType_OD,
902 .GPIO_PuPd = GPIO_PuPd_NOPULL,
907 .NVIC_IRQChannel = EXTI9_5_IRQn,
909 .NVIC_IRQChannelSubPriority = 0,
910 .NVIC_IRQChannelCmd = ENABLE,
915 .EXTI_Line = EXTI_Line5,
916 .EXTI_Mode = EXTI_Mode_Interrupt,
917 .EXTI_Trigger = EXTI_Trigger_Rising,
918 .EXTI_LineCmd = ENABLE,
925 .default_samplerate = 1000,
Main PiOS header to include all the compiled in PiOS options.
COM MSG private definitions.
APIs for PIOS_USBHOOK layer.
static const struct pios_tim_clock_cfg tim_1_cfg
#define PIOS_IRQ_PRIO_HIGHEST
static const struct pios_tim_clock_cfg tim_3_cfg
#define PIOS_SERVOS_INITIAL_POSITION
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
static const struct pios_tim_clock_cfg tim_16_cfg
#define PIOS_IRQ_PRIO_MID
USART private definitions.
Spektrum/JR DSMx satellite receiver private structures.
static const TIM_TimeBaseInitTypeDef tim_2_3_time_base
const struct pios_exti_cfg * exti_cfg
static const struct pios_tim_clock_cfg tim_15_cfg
#define PIOS_SERVO_UPDATE_HZ
static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base
uintptr_t pios_internal_adc_id
#define PIOS_PERIPHERAL_APB1_CLOCK
const struct pios_annunc * annunciators
TIM_OCInitTypeDef tim_oc_init
USB COM HID private definitions.
static const struct pios_tim_channel pios_tim_servoport_v02_pins[]
Servo private structures.
TIM_ICInitTypeDef tim_ic_init
Defines the API to set up the HID-only USB descriptor config.
void PIOS_RTC_irq_handler(void)
#define PIOS_PERIPHERAL_APB2_CLOCK
bool PIOS_MPU_IRQHandler(void)
The IMU interrupt handler. Fetches new data from the IMU.
const struct pios_flash_driver * driver
const struct pios_flash_partition pios_flash_partition_table[]
#define PIOS_IRQ_PRIO_HIGH
USB COM CDC private definitions.
enum pios_flash_partition_labels label
#define PIOS_IRQ_PRIO_LOW
static const struct pios_tim_clock_cfg tim_17_cfg
#define PIOS_Assert(test)
static const struct pios_tim_channel pios_tim_servoport_v01_pins[]
static const struct pios_tim_clock_cfg tim_2_cfg
#define PIOS_ANNUNCIATOR_BUZZER
const struct pios_flash_driver pios_internal_flash_driver
USART private definitions.
#define PIOS_LED_HEARTBEAT
Defines the API to the board-specific USB data setup code.