32 #include <pios_config.h>
35 #if defined(PIOS_INCLUDE_ANNUNC)
43 .GPIO_Pin = GPIO_Pin_9,
44 .GPIO_Speed = GPIO_Speed_50MHz,
45 .GPIO_Mode = GPIO_Mode_OUT,
46 .GPIO_OType = GPIO_OType_PP,
47 .GPIO_PuPd = GPIO_PuPd_NOPULL
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
69 .GPIO_Pin = GPIO_Pin_0,
70 .GPIO_Speed = GPIO_Speed_2MHz,
71 .GPIO_Mode = GPIO_Mode_OUT,
72 .GPIO_OType = GPIO_OType_PP,
73 .GPIO_PuPd = GPIO_PuPd_DOWN
83 .num_annunciators =
NELEMENTS(pios_annuncs),
86 const struct pios_annunc_cfg * PIOS_BOARD_HW_DEFS_GetLedCfg (uint32_t
board_revision)
88 return &pios_annunc_cfg;
93 #if defined(PIOS_INCLUDE_SPI)
103 .SPI_Mode = SPI_Mode_Master,
104 .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
105 .SPI_DataSize = SPI_DataSize_8b,
106 .SPI_NSS = SPI_NSS_Soft,
107 .SPI_FirstBit = SPI_FirstBit_MSB,
108 .SPI_CRCPolynomial = 7,
109 .SPI_CPOL = SPI_CPOL_Low,
110 .SPI_CPHA = SPI_CPHA_1Edge,
111 .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8,
116 .GPIO_Pin = GPIO_Pin_13,
117 .GPIO_Speed = GPIO_Speed_50MHz,
118 .GPIO_Mode = GPIO_Mode_AF,
119 .GPIO_OType = GPIO_OType_PP,
120 .GPIO_PuPd = GPIO_PuPd_NOPULL
122 .pin_source = GPIO_PinSource13,
127 .GPIO_Pin = GPIO_Pin_14,
128 .GPIO_Speed = GPIO_Speed_50MHz,
129 .GPIO_Mode = GPIO_Mode_AF,
130 .GPIO_OType = GPIO_OType_PP,
131 .GPIO_PuPd = GPIO_PuPd_NOPULL
133 .pin_source = GPIO_PinSource14,
138 .GPIO_Pin = GPIO_Pin_15,
139 .GPIO_Speed = GPIO_Speed_50MHz,
140 .GPIO_Mode = GPIO_Mode_AF,
141 .GPIO_OType = GPIO_OType_PP,
142 .GPIO_PuPd = GPIO_PuPd_NOPULL
144 .pin_source = GPIO_PinSource15,
150 .GPIO_Pin = GPIO_Pin_12,
151 .GPIO_Speed = GPIO_Speed_50MHz,
152 .GPIO_Mode = GPIO_Mode_OUT,
153 .GPIO_OType = GPIO_OType_PP,
154 .GPIO_PuPd = GPIO_PuPd_UP
160 #if defined(PIOS_INCLUDE_FLASH)
165 .arena_size = 0x00002000,
166 .slot_size = 0x00000100,
184 uintptr_t pios_internal_flash_id;
187 .chip_id = &pios_internal_flash_id,
189 .sector_blocks = stm32f3_sectors,
190 .num_blocks =
NELEMENTS(stm32f3_sectors),
196 .chip_desc = &pios_flash_chip_internal,
205 .chip_desc = &pios_flash_chip_internal,
214 .chip_desc = &pios_flash_chip_internal,
223 .chip_desc = &pios_flash_chip_internal,
235 *num_partitions =
NELEMENTS(pios_flash_partition_table);
241 #if defined(PIOS_INCLUDE_USART)
245 #if defined(PIOS_INCLUDE_DSM)
255 .GPIO_Pin = GPIO_Pin_7,
256 .GPIO_Speed = GPIO_Speed_2MHz,
257 .GPIO_Mode = GPIO_Mode_OUT,
258 .GPIO_OType = GPIO_OType_PP,
259 .GPIO_PuPd = GPIO_PuPd_NOPULL
268 .GPIO_Pin = GPIO_Pin_4,
269 .GPIO_Speed = GPIO_Speed_2MHz,
270 .GPIO_Mode = GPIO_Mode_OUT,
271 .GPIO_OType = GPIO_OType_PP,
272 .GPIO_PuPd = GPIO_PuPd_NOPULL
281 .GPIO_Pin = GPIO_Pin_11,
282 .GPIO_Speed = GPIO_Speed_2MHz,
283 .GPIO_Mode = GPIO_Mode_OUT,
284 .GPIO_OType = GPIO_OType_PP,
285 .GPIO_PuPd = GPIO_PuPd_NOPULL
297 .NVIC_IRQChannel = USART1_IRQn,
299 .NVIC_IRQChannelSubPriority = 0,
300 .NVIC_IRQChannelCmd = ENABLE,
306 .GPIO_Pin = GPIO_Pin_7,
307 .GPIO_Speed = GPIO_Speed_2MHz,
308 .GPIO_Mode = GPIO_Mode_AF,
309 .GPIO_OType = GPIO_OType_PP,
310 .GPIO_PuPd = GPIO_PuPd_UP
312 .pin_source = GPIO_PinSource7,
317 .GPIO_Pin = GPIO_Pin_6,
318 .GPIO_Speed = GPIO_Speed_2MHz,
319 .GPIO_Mode = GPIO_Mode_AF,
320 .GPIO_OType = GPIO_OType_PP,
321 .GPIO_PuPd = GPIO_PuPd_DOWN
323 .pin_source = GPIO_PinSource6,
332 .NVIC_IRQChannel = USART2_IRQn,
334 .NVIC_IRQChannelSubPriority = 0,
335 .NVIC_IRQChannelCmd = ENABLE,
341 .GPIO_Pin = GPIO_Pin_4,
342 .GPIO_Speed = GPIO_Speed_2MHz,
343 .GPIO_Mode = GPIO_Mode_AF,
344 .GPIO_OType = GPIO_OType_PP,
345 .GPIO_PuPd = GPIO_PuPd_UP
347 .pin_source = GPIO_PinSource4,
352 .GPIO_Pin = GPIO_Pin_3,
353 .GPIO_Speed = GPIO_Speed_2MHz,
354 .GPIO_Mode = GPIO_Mode_AF,
355 .GPIO_OType = GPIO_OType_PP,
356 .GPIO_PuPd = GPIO_PuPd_DOWN
358 .pin_source = GPIO_PinSource3,
367 .NVIC_IRQChannel = USART3_IRQn,
369 .NVIC_IRQChannelSubPriority = 0,
370 .NVIC_IRQChannelCmd = ENABLE,
376 .GPIO_Pin = GPIO_Pin_11,
377 .GPIO_Speed = GPIO_Speed_2MHz,
378 .GPIO_Mode = GPIO_Mode_AF,
379 .GPIO_OType = GPIO_OType_PP,
380 .GPIO_PuPd = GPIO_PuPd_UP
382 .pin_source = GPIO_PinSource11,
387 .GPIO_Pin = GPIO_Pin_10,
388 .GPIO_Speed = GPIO_Speed_2MHz,
389 .GPIO_Mode = GPIO_Mode_AF,
390 .GPIO_OType = GPIO_OType_PP,
391 .GPIO_PuPd = GPIO_PuPd_DOWN
393 .pin_source = GPIO_PinSource10,
398 #if defined(PIOS_INCLUDE_COM)
404 #if defined(PIOS_INCLUDE_RTC)
408 #include <pios_rtc_priv.h>
410 void PIOS_RTC_IRQ_Handler (
void);
413 .
clksrc = RCC_RTCCLKSource_HSE_Div32,
417 .NVIC_IRQChannel = RTC_WKUP_IRQn,
419 .NVIC_IRQChannelSubPriority = 0,
420 .NVIC_IRQChannelCmd = ENABLE,
425 void PIOS_RTC_IRQ_Handler (
void)
437 .TIM_ClockDivision = TIM_CKD_DIV1,
438 .TIM_CounterMode = TIM_CounterMode_Up,
440 .TIM_RepetitionCounter = 0x0000,
445 .TIM_ClockDivision = TIM_CKD_DIV1,
446 .TIM_CounterMode = TIM_CounterMode_Up,
448 .TIM_RepetitionCounter = 0x0000,
456 .NVIC_IRQChannel = TIM2_IRQn,
458 .NVIC_IRQChannelSubPriority = 0,
459 .NVIC_IRQChannelCmd = ENABLE,
469 .NVIC_IRQChannel = TIM3_IRQn,
471 .NVIC_IRQChannelSubPriority = 0,
472 .NVIC_IRQChannelCmd = ENABLE,
482 .NVIC_IRQChannel = TIM1_CC_IRQn,
484 .NVIC_IRQChannelSubPriority = 0,
485 .NVIC_IRQChannelCmd = ENABLE,
494 .NVIC_IRQChannel = TIM1_BRK_TIM15_IRQn,
496 .NVIC_IRQChannelSubPriority = 0,
497 .NVIC_IRQChannelCmd = ENABLE,
507 .NVIC_IRQChannel = TIM1_UP_TIM16_IRQn,
509 .NVIC_IRQChannelSubPriority = 0,
510 .NVIC_IRQChannelCmd = ENABLE,
519 .NVIC_IRQChannel = TIM1_TRG_COM_TIM17_IRQn,
521 .NVIC_IRQChannelSubPriority = 0,
522 .NVIC_IRQChannelCmd = ENABLE,
545 .timer_chan = TIM_Channel_2,
550 .GPIO_Pin = GPIO_Pin_4,
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_PinSource4,
561 .timer_chan = TIM_Channel_1,
566 .GPIO_Pin = GPIO_Pin_6,
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_PinSource6,
577 .timer_chan = TIM_Channel_3,
582 .GPIO_Pin = GPIO_Pin_0,
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_PinSource0,
593 .timer_chan = TIM_Channel_4,
598 .GPIO_Pin = GPIO_Pin_1,
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_PinSource1,
609 .timer_chan = TIM_Channel_2,
614 .GPIO_Pin = GPIO_Pin_1,
615 .GPIO_Speed = GPIO_Speed_2MHz,
616 .GPIO_Mode = GPIO_Mode_AF,
617 .GPIO_OType = GPIO_OType_PP,
618 .GPIO_PuPd = GPIO_PuPd_UP
620 .pin_source = GPIO_PinSource1,
625 .timer_chan = TIM_Channel_3,
630 .GPIO_Pin = GPIO_Pin_2,
631 .GPIO_Speed = GPIO_Speed_2MHz,
632 .GPIO_Mode = GPIO_Mode_AF,
633 .GPIO_OType = GPIO_OType_PP,
634 .GPIO_PuPd = GPIO_PuPd_UP
636 .pin_source = GPIO_PinSource2,
641 .timer_chan = TIM_Channel_2,
646 .GPIO_Pin = GPIO_Pin_3,
647 .GPIO_Speed = GPIO_Speed_2MHz,
648 .GPIO_Mode = GPIO_Mode_AF,
649 .GPIO_OType = GPIO_OType_PP,
650 .GPIO_PuPd = GPIO_PuPd_UP
652 .pin_source = GPIO_PinSource3,
657 .timer_chan = TIM_Channel_1,
662 .GPIO_Pin = GPIO_Pin_8,
663 .GPIO_Speed = GPIO_Speed_2MHz,
664 .GPIO_Mode = GPIO_Mode_AF,
665 .GPIO_OType = GPIO_OType_PP,
666 .GPIO_PuPd = GPIO_PuPd_UP
668 .pin_source = GPIO_PinSource8,
674 #if defined(PIOS_INCLUDE_SERVO) && defined(PIOS_INCLUDE_TIM)
682 .TIM_OCMode = TIM_OCMode_PWM1,
683 .TIM_OutputState = TIM_OutputState_Enable,
684 .TIM_OutputNState = TIM_OutputNState_Disable,
686 .TIM_OCPolarity = TIM_OCPolarity_High,
687 .TIM_OCNPolarity = TIM_OCPolarity_High,
688 .TIM_OCIdleState = TIM_OCIdleState_Reset,
689 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
692 .num_channels =
NELEMENTS(pios_tim_servoport_pins),
702 #if defined(PIOS_INCLUDE_PWM) || defined(PIOS_INCLUDE_PPM)
712 .timer_chan = TIM_Channel_1,
717 .GPIO_Pin = GPIO_Pin_7,
718 .GPIO_Speed = GPIO_Speed_2MHz,
719 .GPIO_Mode = GPIO_Mode_AF,
720 .GPIO_OType = GPIO_OType_PP,
721 .GPIO_PuPd = GPIO_PuPd_UP
723 .pin_source = GPIO_PinSource8,
733 #if defined(PIOS_INCLUDE_PPM)
737 .TIM_ICPolarity = TIM_ICPolarity_Rising,
738 .TIM_ICSelection = TIM_ICSelection_DirectTI,
739 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
741 .TIM_Channel = TIM_Channel_1,
750 #if defined(PIOS_INCLUDE_ADC)
763 void PIOS_ADC_DMA_irq_handler(
void)
772 .
flags = (DMA2_FLAG_TC1 | DMA2_FLAG_TE1 | DMA2_FLAG_HT1 | DMA2_FLAG_GL1),
774 .NVIC_IRQChannel = DMA2_Channel1_IRQn,
776 .NVIC_IRQChannelSubPriority = 0,
777 .NVIC_IRQChannelCmd = ENABLE,
781 .channel = DMA2_Channel1,
783 .DMA_Priority = DMA_Priority_High,
787 .half_flag = DMA2_IT_HT1,
788 .full_flag = DMA2_IT_TC1,
792 {GPIOB,GPIO_Pin_2,ADC_Channel_12,
true},
793 {GPIOA,GPIO_Pin_5,ADC_Channel_2,
true},
795 .adc_dev_master = ADC2,
799 #if defined(PIOS_INCLUDE_RCVR)
803 #if defined(PIOS_INCLUDE_USB)
809 .NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn,
811 .NVIC_IRQChannelSubPriority = 0,
812 .NVIC_IRQChannelCmd = ENABLE,
819 .GPIO_Pin = GPIO_Pin_3,
820 .GPIO_Speed = GPIO_Speed_2MHz,
821 .GPIO_Mode = GPIO_Mode_IN,
822 .GPIO_OType = GPIO_OType_OD,
823 .GPIO_PuPd = GPIO_PuPd_DOWN,
831 return &pios_usb_main_cfg;
841 #if defined(PIOS_INCLUDE_COM_MSG)
847 #if defined(PIOS_INCLUDE_USB_HID)
857 #if defined(PIOS_INCLUDE_USB_CDC)
870 #if defined(PIOS_INCLUDE_MPU)
878 .GPIO_Pin = GPIO_Pin_15,
879 .GPIO_Speed = GPIO_Speed_50MHz,
880 .GPIO_Mode = GPIO_Mode_IN,
881 .GPIO_OType = GPIO_OType_OD,
882 .GPIO_PuPd = GPIO_PuPd_NOPULL,
887 .NVIC_IRQChannel = EXTI15_10_IRQn,
889 .NVIC_IRQChannelSubPriority = 0,
890 .NVIC_IRQChannelCmd = ENABLE,
895 .EXTI_Line = EXTI_Line15,
896 .EXTI_Mode = EXTI_Mode_Interrupt,
897 .EXTI_Trigger = EXTI_Trigger_Rising,
898 .EXTI_LineCmd = ENABLE,
905 .default_samplerate = 500,
static const struct pios_tim_clock_cfg tim_1_cfg
#define DMA2_Channel1_IRQHandler
COM MSG private definitions.
APIs for PIOS_USBHOOK layer.
static const struct pios_tim_clock_cfg tim_16_cfg
#define PIOS_IRQ_PRIO_HIGHEST
#define PIOS_SERVOS_INITIAL_POSITION
static const struct pios_tim_clock_cfg tim_3_cfg
Defines the API to set up the HID + CDC USB descriptor config.
static const struct pios_tim_clock_cfg tim_17_cfg
void PIOS_INTERNAL_ADC_DMA_Handler()
#define RTC_WKUP_IRQHandler
static const TIM_TimeBaseInitTypeDef tim_2_3_time_base
#define PIOS_IRQ_PRIO_MID
USART private definitions.
Spektrum/JR DSMx satellite receiver private structures.
const struct pios_exti_cfg * exti_cfg
#define PIOS_SERVO_UPDATE_HZ
uintptr_t pios_internal_adc_id
static const struct pios_tim_channel pios_tim_rcvrport_ppm[]
#define PIOS_PERIPHERAL_APB1_CLOCK
const struct pios_annunc * annunciators
static const struct pios_tim_channel pios_tim_servoport_pins[]
static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base
TIM_OCInitTypeDef tim_oc_init
USB COM HID private definitions.
Servo private structures.
TIM_ICInitTypeDef tim_ic_init
Defines the API to set up the HID-only USB descriptor config.
static const struct pios_tim_clock_cfg tim_2_cfg
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
#define PIOS_Assert(test)
#define PIOS_ANNUNCIATOR_BUZZER
static const struct pios_tim_clock_cfg tim_15_cfg
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.