30 #include <pios_config.h>
33 #if defined(PIOS_INCLUDE_ANNUNC)
41 .GPIO_Pin = GPIO_Pin_9,
42 .GPIO_Speed = GPIO_Speed_2MHz,
43 .GPIO_Mode = GPIO_Mode_OUT,
44 .GPIO_OType = GPIO_OType_PP,
45 .GPIO_PuPd = GPIO_PuPd_NOPULL,
54 .GPIO_Pin = GPIO_Pin_14,
55 .GPIO_Speed = GPIO_Speed_2MHz,
56 .GPIO_Mode = GPIO_Mode_OUT,
57 .GPIO_OType = GPIO_OType_PP,
58 .GPIO_PuPd = GPIO_PuPd_NOPULL,
67 .GPIO_Pin = GPIO_Pin_13,
68 .GPIO_Speed = GPIO_Speed_50MHz,
69 .GPIO_Mode = GPIO_Mode_OUT,
70 .GPIO_OType = GPIO_OType_PP,
71 .GPIO_PuPd = GPIO_PuPd_NOPULL
80 .num_annunciators =
NELEMENTS(pios_annuncs),
83 const struct pios_annunc_cfg * PIOS_BOARD_HW_DEFS_GetLedCfg (uint32_t
board_revision)
85 return &pios_annunc_cfg;
90 #if defined(PIOS_INCLUDE_SPI)
99 .remap = GPIO_AF_SPI2,
101 .SPI_Mode = SPI_Mode_Master,
102 .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
103 .SPI_DataSize = SPI_DataSize_8b,
104 .SPI_NSS = SPI_NSS_Soft,
105 .SPI_FirstBit = SPI_FirstBit_MSB,
106 .SPI_CRCPolynomial = 7,
107 .SPI_CPOL = SPI_CPOL_Low,
108 .SPI_CPHA = SPI_CPHA_1Edge,
109 .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8,
114 .GPIO_Pin = GPIO_Pin_13,
115 .GPIO_Speed = GPIO_Speed_100MHz,
116 .GPIO_Mode = GPIO_Mode_AF,
117 .GPIO_OType = GPIO_OType_PP,
118 .GPIO_PuPd = GPIO_PuPd_NOPULL
120 .pin_source = GPIO_PinSource13,
125 .GPIO_Pin = GPIO_Pin_14,
126 .GPIO_Speed = GPIO_Speed_100MHz,
127 .GPIO_Mode = GPIO_Mode_AF,
128 .GPIO_OType = GPIO_OType_PP,
129 .GPIO_PuPd = GPIO_PuPd_NOPULL
131 .pin_source = GPIO_PinSource14,
136 .GPIO_Pin = GPIO_Pin_15,
137 .GPIO_Speed = GPIO_Speed_100MHz,
138 .GPIO_Mode = GPIO_Mode_AF,
139 .GPIO_OType = GPIO_OType_PP,
140 .GPIO_PuPd = GPIO_PuPd_NOPULL
142 .pin_source = GPIO_PinSource15,
148 .GPIO_Pin = GPIO_Pin_10,
149 .GPIO_Speed = GPIO_Speed_100MHz,
150 .GPIO_Mode = GPIO_Mode_OUT,
151 .GPIO_OType = GPIO_OType_PP,
152 .GPIO_PuPd = GPIO_PuPd_NOPULL
165 .remap = GPIO_AF_SPI1,
167 .SPI_Mode = SPI_Mode_Master,
168 .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
169 .SPI_DataSize = SPI_DataSize_8b,
170 .SPI_NSS = SPI_NSS_Soft,
171 .SPI_FirstBit = SPI_FirstBit_MSB,
172 .SPI_CRCPolynomial = 7,
173 .SPI_CPOL = SPI_CPOL_High,
174 .SPI_CPHA = SPI_CPHA_2Edge,
175 .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32,
180 .GPIO_Pin = GPIO_Pin_5,
181 .GPIO_Speed = GPIO_Speed_100MHz,
182 .GPIO_Mode = GPIO_Mode_AF,
183 .GPIO_OType = GPIO_OType_PP,
184 .GPIO_PuPd = GPIO_PuPd_NOPULL
186 .pin_source = GPIO_PinSource5,
191 .GPIO_Pin = GPIO_Pin_6,
192 .GPIO_Speed = GPIO_Speed_100MHz,
193 .GPIO_Mode = GPIO_Mode_AF,
194 .GPIO_OType = GPIO_OType_PP,
195 .GPIO_PuPd = GPIO_PuPd_NOPULL
197 .pin_source = GPIO_PinSource6,
202 .GPIO_Pin = GPIO_Pin_7,
203 .GPIO_Speed = GPIO_Speed_100MHz,
204 .GPIO_Mode = GPIO_Mode_AF,
205 .GPIO_OType = GPIO_OType_PP,
206 .GPIO_PuPd = GPIO_PuPd_NOPULL
208 .pin_source = GPIO_PinSource7,
214 .GPIO_Pin = GPIO_Pin_2,
215 .GPIO_Speed = GPIO_Speed_100MHz,
216 .GPIO_Mode = GPIO_Mode_OUT,
217 .GPIO_OType = GPIO_OType_PP,
218 .GPIO_PuPd = GPIO_PuPd_NOPULL
227 #if defined(PIOS_INCLUDE_I2C)
229 #include <pios_i2c_priv.h>
231 void PIOS_I2C_internal_ev_irq_handler(
void);
232 void PIOS_I2C_internal_er_irq_handler(
void);
239 .remap = GPIO_AF_I2C1,
241 .I2C_Mode = I2C_Mode_I2C,
242 .I2C_OwnAddress1 = 0,
243 .I2C_Ack = I2C_Ack_Enable,
244 .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
245 .I2C_DutyCycle = I2C_DutyCycle_2,
246 .I2C_ClockSpeed = 400000,
248 .transfer_timeout_ms = 50,
252 .GPIO_Pin = GPIO_Pin_6,
253 .GPIO_Mode = GPIO_Mode_AF,
254 .GPIO_Speed = GPIO_Speed_50MHz,
255 .GPIO_OType = GPIO_OType_OD,
256 .GPIO_PuPd = GPIO_PuPd_UP,
258 .pin_source = GPIO_PinSource6,
263 .GPIO_Pin = GPIO_Pin_7,
264 .GPIO_Mode = GPIO_Mode_AF,
265 .GPIO_Speed = GPIO_Speed_50MHz,
266 .GPIO_OType = GPIO_OType_OD,
267 .GPIO_PuPd = GPIO_PuPd_UP,
269 .pin_source = GPIO_PinSource7,
274 .NVIC_IRQChannel = I2C1_EV_IRQn,
276 .NVIC_IRQChannelSubPriority = 0,
277 .NVIC_IRQChannelCmd = ENABLE,
283 .NVIC_IRQChannel = I2C1_ER_IRQn,
285 .NVIC_IRQChannelSubPriority = 0,
286 .NVIC_IRQChannelCmd = ENABLE,
292 void PIOS_I2C_internal_ev_irq_handler(
void)
298 void PIOS_I2C_internal_er_irq_handler(
void)
304 void PIOS_I2C_external_ev_irq_handler(
void);
305 void PIOS_I2C_external_er_irq_handler(
void);
312 .remap = GPIO_AF_I2C2,
314 .I2C_Mode = I2C_Mode_I2C,
315 .I2C_OwnAddress1 = 0,
316 .I2C_Ack = I2C_Ack_Enable,
317 .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
318 .I2C_DutyCycle = I2C_DutyCycle_2,
319 .I2C_ClockSpeed = 400000,
321 .transfer_timeout_ms = 50,
325 .GPIO_Pin = GPIO_Pin_10,
326 .GPIO_Mode = GPIO_Mode_AF,
327 .GPIO_Speed = GPIO_Speed_50MHz,
328 .GPIO_OType = GPIO_OType_OD,
329 .GPIO_PuPd = GPIO_PuPd_UP,
331 .pin_source = GPIO_PinSource10,
336 .GPIO_Pin = GPIO_Pin_11,
337 .GPIO_Mode = GPIO_Mode_AF,
338 .GPIO_Speed = GPIO_Speed_50MHz,
339 .GPIO_OType = GPIO_OType_OD,
340 .GPIO_PuPd = GPIO_PuPd_UP,
342 .pin_source = GPIO_PinSource11,
347 .NVIC_IRQChannel = I2C2_EV_IRQn,
349 .NVIC_IRQChannelSubPriority = 0,
350 .NVIC_IRQChannelCmd = ENABLE,
356 .NVIC_IRQChannel = I2C2_ER_IRQn,
358 .NVIC_IRQChannelSubPriority = 0,
359 .NVIC_IRQChannelCmd = ENABLE,
365 void PIOS_I2C_external_ev_irq_handler(
void)
371 void PIOS_I2C_external_er_irq_handler(
void)
379 #if defined(PIOS_INCLUDE_FLASH)
384 .arena_size = 0x00004000,
385 .slot_size = 0x00000100,
414 uintptr_t pios_internal_flash_id;
417 .chip_id = &pios_internal_flash_id,
419 .sector_blocks = stm32f4_sectors,
420 .num_blocks =
NELEMENTS(stm32f4_sectors),
426 .chip_desc = &pios_flash_chip_internal,
435 .chip_desc = &pios_flash_chip_internal,
446 .chip_desc = &pios_flash_chip_internal,
457 .chip_desc = &pios_flash_chip_internal,
473 *num_partitions =
NELEMENTS(pios_flash_partition_table);
479 #if defined(PIOS_INCLUDE_USART)
483 #if defined(PIOS_INCLUDE_DSM)
489 static const struct pios_dsm_cfg pios_usart1_dsm_aux_cfg = {
493 .GPIO_Pin = GPIO_Pin_10,
494 .GPIO_Speed = GPIO_Speed_2MHz,
495 .GPIO_Mode = GPIO_Mode_OUT,
496 .GPIO_OType = GPIO_OType_PP,
497 .GPIO_PuPd = GPIO_PuPd_NOPULL
502 static const struct pios_dsm_cfg pios_usart2_dsm_aux_cfg = {
506 .GPIO_Pin = GPIO_Pin_3,
507 .GPIO_Speed = GPIO_Speed_2MHz,
508 .GPIO_Mode = GPIO_Mode_OUT,
509 .GPIO_OType = GPIO_OType_PP,
510 .GPIO_PuPd = GPIO_PuPd_NOPULL
515 static const struct pios_dsm_cfg pios_usart3_dsm_aux_cfg = {
519 .GPIO_Pin = GPIO_Pin_11,
520 .GPIO_Speed = GPIO_Speed_2MHz,
521 .GPIO_Mode = GPIO_Mode_OUT,
522 .GPIO_OType = GPIO_OType_PP,
523 .GPIO_PuPd = GPIO_PuPd_NOPULL
528 static const struct pios_dsm_cfg pios_usart4_dsm_aux_cfg = {
532 .GPIO_Pin = GPIO_Pin_1,
533 .GPIO_Speed = GPIO_Speed_2MHz,
534 .GPIO_Mode = GPIO_Mode_OUT,
535 .GPIO_OType = GPIO_OType_PP,
536 .GPIO_PuPd = GPIO_PuPd_NOPULL
541 static const struct pios_dsm_cfg pios_usart5_dsm_aux_cfg = {
545 .GPIO_Pin = GPIO_Pin_2,
546 .GPIO_Speed = GPIO_Speed_2MHz,
547 .GPIO_Mode = GPIO_Mode_OUT,
548 .GPIO_OType = GPIO_OType_PP,
549 .GPIO_PuPd = GPIO_PuPd_NOPULL
558 .remap = GPIO_AF_USART1,
561 .NVIC_IRQChannel = USART1_IRQn,
563 .NVIC_IRQChannelSubPriority = 0,
564 .NVIC_IRQChannelCmd = ENABLE,
570 .GPIO_Pin = GPIO_Pin_10,
571 .GPIO_Speed = GPIO_Speed_2MHz,
572 .GPIO_Mode = GPIO_Mode_AF,
573 .GPIO_OType = GPIO_OType_PP,
574 .GPIO_PuPd = GPIO_PuPd_UP
576 .pin_source = GPIO_PinSource10,
581 .GPIO_Pin = GPIO_Pin_9,
582 .GPIO_Speed = GPIO_Speed_2MHz,
583 .GPIO_Mode = GPIO_Mode_AF,
584 .GPIO_OType = GPIO_OType_PP,
585 .GPIO_PuPd = GPIO_PuPd_UP
587 .pin_source = GPIO_PinSource9,
593 .remap = GPIO_AF_USART2,
596 .NVIC_IRQChannel = USART2_IRQn,
598 .NVIC_IRQChannelSubPriority = 0,
599 .NVIC_IRQChannelCmd = ENABLE,
605 .GPIO_Pin = GPIO_Pin_3,
606 .GPIO_Speed = GPIO_Speed_2MHz,
607 .GPIO_Mode = GPIO_Mode_AF,
608 .GPIO_OType = GPIO_OType_PP,
609 .GPIO_PuPd = GPIO_PuPd_UP
611 .pin_source = GPIO_PinSource3,
616 .GPIO_Pin = GPIO_Pin_2,
617 .GPIO_Speed = GPIO_Speed_2MHz,
618 .GPIO_Mode = GPIO_Mode_AF,
619 .GPIO_OType = GPIO_OType_PP,
620 .GPIO_PuPd = GPIO_PuPd_UP
622 .pin_source = GPIO_PinSource2,
628 .remap = GPIO_AF_USART3,
631 .NVIC_IRQChannel = USART3_IRQn,
633 .NVIC_IRQChannelSubPriority = 0,
634 .NVIC_IRQChannelCmd = ENABLE,
640 .GPIO_Pin = GPIO_Pin_11,
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_PinSource11,
651 .GPIO_Pin = GPIO_Pin_10,
652 .GPIO_Speed = GPIO_Speed_2MHz,
653 .GPIO_Mode = GPIO_Mode_AF,
654 .GPIO_OType = GPIO_OType_PP,
655 .GPIO_PuPd = GPIO_PuPd_UP
657 .pin_source = GPIO_PinSource10,
663 .remap = GPIO_AF_UART4,
666 .NVIC_IRQChannel = UART4_IRQn,
668 .NVIC_IRQChannelSubPriority = 0,
669 .NVIC_IRQChannelCmd = ENABLE,
675 .GPIO_Pin = GPIO_Pin_1,
676 .GPIO_Speed = GPIO_Speed_2MHz,
677 .GPIO_Mode = GPIO_Mode_AF,
678 .GPIO_OType = GPIO_OType_PP,
679 .GPIO_PuPd = GPIO_PuPd_UP
681 .pin_source = GPIO_PinSource1,
686 .GPIO_Pin = GPIO_Pin_0,
687 .GPIO_Speed = GPIO_Speed_2MHz,
688 .GPIO_Mode = GPIO_Mode_AF,
689 .GPIO_OType = GPIO_OType_PP,
690 .GPIO_PuPd = GPIO_PuPd_UP
692 .pin_source = GPIO_PinSource0,
698 .remap = GPIO_AF_UART5,
701 .NVIC_IRQChannel = UART5_IRQn,
703 .NVIC_IRQChannelSubPriority = 0,
704 .NVIC_IRQChannelCmd = ENABLE,
710 .GPIO_Pin = GPIO_Pin_2,
711 .GPIO_Speed = GPIO_Speed_2MHz,
712 .GPIO_Mode = GPIO_Mode_AF,
713 .GPIO_OType = GPIO_OType_PP,
714 .GPIO_PuPd = GPIO_PuPd_UP
716 .pin_source = GPIO_PinSource2,
721 .GPIO_Pin = GPIO_Pin_12,
722 .GPIO_Speed = GPIO_Speed_2MHz,
723 .GPIO_Mode = GPIO_Mode_AF,
724 .GPIO_OType = GPIO_OType_PP,
725 .GPIO_PuPd = GPIO_PuPd_UP
727 .pin_source = GPIO_PinSource12,
733 #if defined(PIOS_INCLUDE_COM)
739 #if defined(PIOS_INCLUDE_RTC)
743 #include <pios_rtc_priv.h>
745 void PIOS_RTC_IRQ_Handler (
void);
748 .
clksrc = RCC_RTCCLKSource_HSE_Div8,
754 .NVIC_IRQChannel = RTC_WKUP_IRQn,
756 .NVIC_IRQChannelSubPriority = 0,
757 .NVIC_IRQChannelCmd = ENABLE,
762 void PIOS_RTC_IRQ_Handler (
void)
775 .TIM_Prescaler = (PIOS_PERIPHERAL_APB1_COUNTER_CLOCK / 1000000) - 1,
776 .TIM_ClockDivision = TIM_CKD_DIV1,
777 .TIM_CounterMode = TIM_CounterMode_Up,
778 .TIM_Period = 0xFFFF,
779 .TIM_RepetitionCounter = 0x0000,
787 .NVIC_IRQChannel = TIM5_IRQn,
789 .NVIC_IRQChannelSubPriority = 0,
790 .NVIC_IRQChannelCmd = ENABLE,
799 .TIM_Prescaler = (PIOS_PERIPHERAL_APB1_COUNTER_CLOCK / 1000000) - 1,
800 .TIM_ClockDivision = TIM_CKD_DIV1,
801 .TIM_CounterMode = TIM_CounterMode_Up,
803 .TIM_RepetitionCounter = 0x0000,
808 .TIM_Prescaler = (PIOS_PERIPHERAL_APB2_COUNTER_CLOCK / 1000000) - 1,
809 .TIM_ClockDivision = TIM_CKD_DIV1,
810 .TIM_CounterMode = TIM_CounterMode_Up,
812 .TIM_RepetitionCounter = 0x0000,
820 .NVIC_IRQChannel = TIM3_IRQn,
822 .NVIC_IRQChannelSubPriority = 0,
823 .NVIC_IRQChannelCmd = ENABLE,
833 .NVIC_IRQChannel = TIM8_CC_IRQn,
835 .NVIC_IRQChannelSubPriority = 0,
836 .NVIC_IRQChannelCmd = ENABLE,
846 .NVIC_IRQChannel = TIM2_IRQn,
848 .NVIC_IRQChannelSubPriority = 0,
849 .NVIC_IRQChannelCmd = ENABLE,
859 .NVIC_IRQChannel = TIM1_CC_IRQn,
861 .NVIC_IRQChannelSubPriority = 0,
862 .NVIC_IRQChannelCmd = ENABLE,
872 .NVIC_IRQChannel = TIM4_IRQn,
874 .NVIC_IRQChannelSubPriority = 0,
875 .NVIC_IRQChannelCmd = ENABLE,
898 .timer_chan = TIM_Channel_1,
899 .remap = GPIO_AF_TIM3,
903 .GPIO_Pin = GPIO_Pin_6,
904 .GPIO_Speed = GPIO_Speed_2MHz,
905 .GPIO_Mode = GPIO_Mode_AF,
906 .GPIO_OType = GPIO_OType_PP,
907 .GPIO_PuPd = GPIO_PuPd_NOPULL
909 .pin_source = GPIO_PinSource6,
914 .timer_chan = TIM_Channel_2,
915 .remap = GPIO_AF_TIM8,
919 .GPIO_Pin = GPIO_Pin_7,
920 .GPIO_Speed = GPIO_Speed_2MHz,
921 .GPIO_Mode = GPIO_Mode_AF,
922 .GPIO_OType = GPIO_OType_PP,
923 .GPIO_PuPd = GPIO_PuPd_NOPULL
925 .pin_source = GPIO_PinSource7,
930 .timer_chan = TIM_Channel_3,
931 .remap = GPIO_AF_TIM8,
935 .GPIO_Pin = GPIO_Pin_8,
936 .GPIO_Speed = GPIO_Speed_2MHz,
937 .GPIO_Mode = GPIO_Mode_AF,
938 .GPIO_OType = GPIO_OType_PP,
939 .GPIO_PuPd = GPIO_PuPd_NOPULL
941 .pin_source = GPIO_PinSource8,
946 .timer_chan = TIM_Channel_4,
947 .remap = GPIO_AF_TIM8,
951 .GPIO_Pin = GPIO_Pin_9,
952 .GPIO_Speed = GPIO_Speed_2MHz,
953 .GPIO_Mode = GPIO_Mode_AF,
954 .GPIO_OType = GPIO_OType_PP,
955 .GPIO_PuPd = GPIO_PuPd_NOPULL
957 .pin_source = GPIO_PinSource9,
962 .timer_chan = TIM_Channel_1,
963 .remap = GPIO_AF_TIM2,
967 .GPIO_Pin = GPIO_Pin_15,
968 .GPIO_Speed = GPIO_Speed_2MHz,
969 .GPIO_Mode = GPIO_Mode_AF,
970 .GPIO_OType = GPIO_OType_PP,
971 .GPIO_PuPd = GPIO_PuPd_NOPULL
973 .pin_source = GPIO_PinSource15,
978 .timer_chan = TIM_Channel_1,
979 .remap = GPIO_AF_TIM1,
983 .GPIO_Pin = GPIO_Pin_8,
984 .GPIO_Speed = GPIO_Speed_2MHz,
985 .GPIO_Mode = GPIO_Mode_AF,
986 .GPIO_OType = GPIO_OType_PP,
987 .GPIO_PuPd = GPIO_PuPd_NOPULL
989 .pin_source = GPIO_PinSource8,
994 .timer_chan = TIM_Channel_3,
995 .remap = GPIO_AF_TIM4,
999 .GPIO_Pin = GPIO_Pin_8,
1000 .GPIO_Speed = GPIO_Speed_2MHz,
1001 .GPIO_Mode = GPIO_Mode_AF,
1002 .GPIO_OType = GPIO_OType_PP,
1003 .GPIO_PuPd = GPIO_PuPd_NOPULL
1005 .pin_source = GPIO_PinSource8,
1013 .timer_chan = TIM_Channel_1,
1014 .remap = GPIO_AF_TIM3,
1018 .GPIO_Pin = GPIO_Pin_6,
1019 .GPIO_Speed = GPIO_Speed_2MHz,
1020 .GPIO_Mode = GPIO_Mode_AF,
1021 .GPIO_OType = GPIO_OType_PP,
1022 .GPIO_PuPd = GPIO_PuPd_NOPULL
1024 .pin_source = GPIO_PinSource6,
1029 .timer_chan = TIM_Channel_2,
1030 .remap = GPIO_AF_TIM8,
1034 .GPIO_Pin = GPIO_Pin_7,
1035 .GPIO_Speed = GPIO_Speed_2MHz,
1036 .GPIO_Mode = GPIO_Mode_AF,
1037 .GPIO_OType = GPIO_OType_PP,
1038 .GPIO_PuPd = GPIO_PuPd_NOPULL
1040 .pin_source = GPIO_PinSource7,
1045 .timer_chan = TIM_Channel_3,
1046 .remap = GPIO_AF_TIM8,
1050 .GPIO_Pin = GPIO_Pin_8,
1051 .GPIO_Speed = GPIO_Speed_2MHz,
1052 .GPIO_Mode = GPIO_Mode_AF,
1053 .GPIO_OType = GPIO_OType_PP,
1054 .GPIO_PuPd = GPIO_PuPd_NOPULL
1056 .pin_source = GPIO_PinSource8,
1061 .timer_chan = TIM_Channel_4,
1062 .remap = GPIO_AF_TIM8,
1066 .GPIO_Pin = GPIO_Pin_9,
1067 .GPIO_Speed = GPIO_Speed_2MHz,
1068 .GPIO_Mode = GPIO_Mode_AF,
1069 .GPIO_OType = GPIO_OType_PP,
1070 .GPIO_PuPd = GPIO_PuPd_NOPULL
1072 .pin_source = GPIO_PinSource9,
1077 .timer_chan = TIM_Channel_1,
1078 .remap = GPIO_AF_TIM2,
1082 .GPIO_Pin = GPIO_Pin_15,
1083 .GPIO_Speed = GPIO_Speed_2MHz,
1084 .GPIO_Mode = GPIO_Mode_AF,
1085 .GPIO_OType = GPIO_OType_PP,
1086 .GPIO_PuPd = GPIO_PuPd_NOPULL
1088 .pin_source = GPIO_PinSource15,
1093 .timer_chan = TIM_Channel_3,
1094 .remap = GPIO_AF_TIM4,
1098 .GPIO_Pin = GPIO_Pin_8,
1099 .GPIO_Speed = GPIO_Speed_2MHz,
1100 .GPIO_Mode = GPIO_Mode_AF,
1101 .GPIO_OType = GPIO_OType_PP,
1102 .GPIO_PuPd = GPIO_PuPd_NOPULL
1104 .pin_source = GPIO_PinSource8,
1109 #if defined(PIOS_INCLUDE_DMASHOT)
1127 .stream = DMA1_Stream2,
1128 .channel = DMA_Channel_5,
1129 .tcif = DMA_FLAG_TCIF2
1133 .stream = DMA2_Stream1,
1134 .channel = DMA_Channel_7,
1135 .tcif = DMA_FLAG_TCIF1
1139 .stream = DMA1_Stream1,
1140 .channel = DMA_Channel_3,
1141 .tcif = DMA_FLAG_TCIF1
1145 .stream = DMA2_Stream5,
1146 .channel = DMA_Channel_6,
1147 .tcif = DMA_FLAG_TCIF5
1151 .stream = DMA1_Stream6,
1152 .channel = DMA_Channel_2,
1153 .tcif = DMA_FLAG_TCIF6
1160 .stream = DMA1_Stream2,
1161 .channel = DMA_Channel_5,
1162 .tcif = DMA_FLAG_TCIF2
1166 .stream = DMA2_Stream1,
1167 .channel = DMA_Channel_7,
1168 .tcif = DMA_FLAG_TCIF1
1172 .stream = DMA1_Stream1,
1173 .channel = DMA_Channel_3,
1174 .tcif = DMA_FLAG_TCIF1
1178 .stream = DMA1_Stream6,
1179 .channel = DMA_Channel_2,
1180 .tcif = DMA_FLAG_TCIF6
1185 .
timer_cfg = &dmashot_tim_cfg_without_led_string[0],
1186 .num_timers =
NELEMENTS(dmashot_tim_cfg_without_led_string)
1190 .
timer_cfg = &dmashot_tim_cfg_with_led_string[0],
1191 .num_timers =
NELEMENTS(dmashot_tim_cfg_with_led_string)
1194 #endif // defined(PIOS_INCLUDE_DMASHOT)
1196 #if defined(PIOS_INCLUDE_SERVO) && defined(PIOS_INCLUDE_TIM)
1202 static const struct pios_servo_cfg pios_servo_cfg_without_led_string = {
1204 .TIM_OCMode = TIM_OCMode_PWM1,
1205 .TIM_OutputState = TIM_OutputState_Enable,
1206 .TIM_OutputNState = TIM_OutputNState_Disable,
1208 .TIM_OCPolarity = TIM_OCPolarity_High,
1209 .TIM_OCNPolarity = TIM_OCPolarity_High,
1210 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1211 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1214 .num_channels =
NELEMENTS(pios_tim_outputs_pins_without_led_string),
1217 static const struct pios_servo_cfg pios_servo_cfg_with_led_string = {
1219 .TIM_OCMode = TIM_OCMode_PWM1,
1220 .TIM_OutputState = TIM_OutputState_Enable,
1221 .TIM_OutputNState = TIM_OutputNState_Disable,
1223 .TIM_OCPolarity = TIM_OCPolarity_High,
1224 .TIM_OCNPolarity = TIM_OCPolarity_High,
1225 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1226 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1229 .num_channels =
NELEMENTS(pios_tim_outputs_pins_with_led_string),
1241 .timer_chan = TIM_Channel_4,
1242 .remap = GPIO_AF_TIM5,
1246 .GPIO_Pin = GPIO_Pin_3,
1247 .GPIO_Speed = GPIO_Speed_2MHz,
1248 .GPIO_Mode = GPIO_Mode_AF,
1249 .GPIO_OType = GPIO_OType_PP,
1250 .GPIO_PuPd = GPIO_PuPd_UP
1252 .pin_source = GPIO_PinSource3,
1260 #if defined(PIOS_INCLUDE_PPM)
1268 .TIM_ICPolarity = TIM_ICPolarity_Rising,
1269 .TIM_ICSelection = TIM_ICSelection_DirectTI,
1270 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
1271 .TIM_ICFilter = 0x0,
1272 .TIM_Channel = TIM_Channel_4,
1274 .channels = &pios_tim_rcvrport_ppm[0],
1280 #if defined(PIOS_INCLUDE_RCVR)
1284 #if defined(PIOS_INCLUDE_USB)
1290 .NVIC_IRQChannel = OTG_FS_IRQn,
1292 .NVIC_IRQChannelSubPriority = 0,
1293 .NVIC_IRQChannelCmd = ENABLE,
1303 return &pios_usb_main_cfg;
1313 #if defined(PIOS_INCLUDE_COM_MSG)
1319 #if defined(PIOS_INCLUDE_USB_HID) && !defined(PIOS_INCLUDE_USB_CDC)
1329 #if defined(PIOS_INCLUDE_USB_HID) && defined(PIOS_INCLUDE_USB_CDC)
1343 const struct pios_usb_hid_cfg pios_usb_hid_cfg = {
1350 #if defined(PIOS_INCLUDE_ADC)
1354 void PIOS_ADC_DMA_irq_handler(
void);
1360 .flags = (DMA_FLAG_TCIF0 | DMA_FLAG_TEIF0 | DMA_FLAG_HTIF0),
1362 .NVIC_IRQChannel = DMA2_Stream0_IRQn,
1364 .NVIC_IRQChannelSubPriority = 0,
1365 .NVIC_IRQChannelCmd = ENABLE,
1369 .channel = DMA2_Stream0,
1371 .DMA_Channel = DMA_Channel_0,
1372 .DMA_PeripheralBaseAddr = (uint32_t)&ADC1->DR
1376 .half_flag = DMA_IT_HTIF0,
1377 .full_flag = DMA_IT_TCIF0,
1379 { GPIOC, GPIO_Pin_4, ADC_Channel_14 }, \
1380 { GPIOC, GPIO_Pin_5, ADC_Channel_15 }, \
1381 { GPIOB, GPIO_Pin_1, ADC_Channel_9 }, \
1386 void PIOS_ADC_DMA_irq_handler(
void)
1398 #if defined(PIOS_INCLUDE_WS2811)
1410 .TIM_Prescaler = (PIOS_PERIPHERAL_APB2_COUNTER_CLOCK / 12000000) - 1,
1411 .TIM_ClockDivision = TIM_CKD_DIV1,
1412 .TIM_CounterMode = TIM_CounterMode_Up,
1416 .NVIC_IRQChannel = DMA2_Stream6_IRQn,
1418 .NVIC_IRQChannelSubPriority = 0,
1419 .NVIC_IRQChannelCmd = ENABLE,
1421 .bit_clear_dma_tcif = DMA_IT_TCIF6,
1425 .gpio_pin = GPIO_Pin_8,
1426 .bit_set_dma_stream = DMA2_Stream4,
1427 .bit_set_dma_channel = DMA_Channel_6,
1428 .bit_clear_dma_stream = DMA2_Stream6,
1429 .bit_clear_dma_channel = DMA_Channel_0,
1433 #if defined(PIOS_INCLUDE_DAC)
1447 .TIM_Prescaler = (PIOS_PERIPHERAL_APB1_COUNTER_CLOCK / 600000) - 1,
1448 .TIM_ClockDivision = TIM_CKD_DIV1,
1449 .TIM_CounterMode = TIM_CounterMode_Up,
1453 .NVIC_IRQChannel = DMA1_Stream5_IRQn,
1455 .NVIC_IRQChannelSubPriority = 0,
1456 .NVIC_IRQChannelCmd = ENABLE,
1459 .gpio_pin = GPIO_Pin_4,
1460 .dma_stream = DMA1_Stream5,
1461 .dma_channel = DMA_Channel_7,
1462 .dac_channel = DAC_Channel_1,
1463 .dac_trigger = DAC_Trigger_T6_TRGO,
1464 .dac_outreg = (uintptr_t) (&DAC->DHR12L1),
1465 .dma_tcif = DMA_IT_TCIF5,
1473 #if defined(PIOS_INCLUDE_MPU)
1481 .GPIO_Pin = GPIO_Pin_3,
1482 .GPIO_Speed = GPIO_Speed_100MHz,
1483 .GPIO_Mode = GPIO_Mode_IN,
1484 .GPIO_OType = GPIO_OType_OD,
1485 .GPIO_PuPd = GPIO_PuPd_NOPULL,
1490 .NVIC_IRQChannel = EXTI3_IRQn,
1492 .NVIC_IRQChannelSubPriority = 0,
1493 .NVIC_IRQChannelCmd = ENABLE,
1498 .EXTI_Line = EXTI_Line3,
1499 .EXTI_Mode = EXTI_Mode_Interrupt,
1500 .EXTI_Trigger = EXTI_Trigger_Rising,
1501 .EXTI_LineCmd = ENABLE,
1508 .default_samplerate = 1000,
1516 #ifdef PIOS_INCLUDE_BMP280
1524 #ifdef PIOS_INCLUDE_HMC5883
1536 #ifdef PIOS_INCLUDE_HMC5983_I2C
const struct pios_exti_cfg * exti_cfg
static const struct pios_tim_clock_cfg tim_2_cfg
const struct pios_dmashot_timer_cfg * timer_cfg
#define PIOS_HMC5883_ODR_75
#define DMA1_Stream5_IRQHandler
static const TIM_TimeBaseInitTypeDef tim_1_8_time_base
#define I2C2_EV_IRQHandler
HMC5983 functions header.
static const struct pios_tim_clock_cfg tim_8_cfg
COM MSG private definitions.
APIs for PIOS_USBHOOK layer.
#define PIOS_HMC5883_MODE_CONTINUOUS
static const struct pios_tim_clock_cfg tim_4_cfg
#define PIOS_IRQ_PRIO_HIGHEST
Configuration structure for the BMP280 driver.
#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 PIOS_IRQ_PRIO_MID
USART private definitions.
#define DMA2_Stream0_IRQHandler
Spektrum/JR DSMx satellite receiver private structures.
#define I2C2_ER_IRQHandler
static const struct pios_tim_clock_cfg tim_3_cfg
#define FLASH_SECTOR_64KB
const struct pios_exti_cfg * exti_cfg
#define PIOS_SERVO_UPDATE_HZ
#define PIOS_HMC5983_MEASCONF_NORMAL
Configuration struct holding all timer configurations.
Configuration struct to assign a DMA channel and stream to a timer, and optionally specify a master t...
const struct pios_exti_cfg * exti_cfg
static const TIM_TimeBaseInitTypeDef tim_5_time_base
#define PIOS_HMC5983_MODE_CONTINUOUS
struct pios_i2c_adapter * pios_i2c_t
static const struct pios_tim_clock_cfg tim_1_cfg
const struct pios_annunc * annunciators
void PIOS_I2C_EV_IRQ_Handler(pios_i2c_t i2c_id)
static const struct pios_tim_channel pios_tim_outputs_pins_with_led_string[]
#define PIOS_HMC5883_GAIN_1_9
ADC_TypeDef * adc_dev_master
#define PIOS_HMC5983_ODR_75
#define I2C1_ER_IRQHandler
TIM_OCInitTypeDef tim_oc_init
USB COM HID private definitions.
#define I2C1_EV_IRQHandler
Servo private structures.
#define FLASH_SECTOR_16KB
NVIC_InitTypeDef interrupt
#define PIOS_HMC5983_GAIN_1_9
void PIOS_I2C_ER_IRQ_Handler(pios_i2c_t i2c_id)
TIM_ICInitTypeDef tim_ic_init
#define DMA2_Stream6_IRQHandler
Defines the API to set up the HID-only USB descriptor config.
static const struct pios_tim_channel pios_tim_rcvrport_ppm[]
NVIC_InitTypeDef interrupt
#define PIOS_HMC5883_MEASCONF_NORMAL
void PIOS_RTC_irq_handler(void)
void PIOS_WS2811_dma_interrupt_handler(ws2811_dev_t dev)
Handles a DMA completion interrupt on bit_clear_dma_stream.
struct dac_dev_s * dac_dev_t
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[]
static const struct pios_tim_channel pios_tim_outputs_pins_without_led_string[]
#define PIOS_IRQ_PRIO_HIGH
USB COM CDC private definitions.
enum pios_flash_partition_labels label
static const TIM_TimeBaseInitTypeDef tim_2_3_4_time_base
#define PIOS_IRQ_PRIO_LOW
#define PIOS_Assert(test)
void PIOS_DAC_dma_interrupt_handler(dac_dev_t dev)
Handles a DMA completion interrupt on dma_stream.
#define BMP280_HIGH_RESOLUTION
#define PIOS_ANNUNCIATOR_BUZZER
#define FLASH_SECTOR_128KB
static const struct pios_tim_clock_cfg tim_5_cfg
const struct pios_flash_driver pios_internal_flash_driver
USART private definitions.
#define PIOS_LED_HEARTBEAT
#define PIOS_HMC5983_AVERAGING_1
Defines the API to the board-specific USB data setup code.