31 #include <pios_config.h>
34 #if defined(PIOS_INCLUDE_ANNUNC)
42 .GPIO_Pin = GPIO_Pin_13,
43 .GPIO_Speed = GPIO_Speed_2MHz,
44 .GPIO_Mode = GPIO_Mode_OUT,
45 .GPIO_OType = GPIO_OType_PP,
46 .GPIO_PuPd = GPIO_PuPd_DOWN
56 .GPIO_Pin = GPIO_Pin_14,
57 .GPIO_Speed = GPIO_Speed_2MHz,
58 .GPIO_Mode = GPIO_Mode_OUT,
59 .GPIO_OType = GPIO_OType_PP,
60 .GPIO_PuPd = GPIO_PuPd_DOWN
71 .GPIO_Pin = GPIO_Pin_4,
72 .GPIO_Speed = GPIO_Speed_2MHz,
73 .GPIO_Mode = GPIO_Mode_OUT,
74 .GPIO_OType = GPIO_OType_PP,
75 .GPIO_PuPd = GPIO_PuPd_DOWN
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;
96 #if defined(PIOS_INCLUDE_SPI)
105 .remap = GPIO_AF_SPI2,
107 .SPI_Mode = SPI_Mode_Master,
108 .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
109 .SPI_DataSize = SPI_DataSize_8b,
110 .SPI_NSS = SPI_NSS_Soft,
111 .SPI_FirstBit = SPI_FirstBit_MSB,
112 .SPI_CRCPolynomial = 7,
113 .SPI_CPOL = SPI_CPOL_High,
114 .SPI_CPHA = SPI_CPHA_2Edge,
115 .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2,
120 .GPIO_Pin = GPIO_Pin_13,
121 .GPIO_Speed = GPIO_Speed_100MHz,
122 .GPIO_Mode = GPIO_Mode_AF,
123 .GPIO_OType = GPIO_OType_PP,
124 .GPIO_PuPd = GPIO_PuPd_NOPULL
126 .pin_source = GPIO_PinSource13,
131 .GPIO_Pin = GPIO_Pin_2,
132 .GPIO_Speed = GPIO_Speed_50MHz,
133 .GPIO_Mode = GPIO_Mode_AF,
134 .GPIO_OType = GPIO_OType_PP,
135 .GPIO_PuPd = GPIO_PuPd_NOPULL
137 .pin_source = GPIO_PinSource2,
142 .GPIO_Pin = GPIO_Pin_3,
143 .GPIO_Speed = GPIO_Speed_50MHz,
144 .GPIO_Mode = GPIO_Mode_AF,
145 .GPIO_OType = GPIO_OType_PP,
146 .GPIO_PuPd = GPIO_PuPd_NOPULL
148 .pin_source = GPIO_PinSource3,
154 .GPIO_Pin = GPIO_Pin_12,
155 .GPIO_Speed = GPIO_Speed_50MHz,
156 .GPIO_Mode = GPIO_Mode_OUT,
157 .GPIO_OType = GPIO_OType_PP,
158 .GPIO_PuPd = GPIO_PuPd_UP
168 static const struct pios_spi_cfg pios_spi_gyro_accel_cfg = {
170 .remap = GPIO_AF_SPI1,
172 .SPI_Mode = SPI_Mode_Master,
173 .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
174 .SPI_DataSize = SPI_DataSize_8b,
175 .SPI_NSS = SPI_NSS_Soft,
176 .SPI_FirstBit = SPI_FirstBit_MSB,
177 .SPI_CRCPolynomial = 7,
178 .SPI_CPOL = SPI_CPOL_High,
179 .SPI_CPHA = SPI_CPHA_2Edge,
180 .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_32,
185 .GPIO_Pin = GPIO_Pin_5,
186 .GPIO_Speed = GPIO_Speed_100MHz,
187 .GPIO_Mode = GPIO_Mode_AF,
188 .GPIO_OType = GPIO_OType_PP,
189 .GPIO_PuPd = GPIO_PuPd_NOPULL
191 .pin_source = GPIO_PinSource5,
196 .GPIO_Pin = GPIO_Pin_6,
197 .GPIO_Speed = GPIO_Speed_100MHz,
198 .GPIO_Mode = GPIO_Mode_AF,
199 .GPIO_OType = GPIO_OType_PP,
200 .GPIO_PuPd = GPIO_PuPd_NOPULL
202 .pin_source = GPIO_PinSource6,
207 .GPIO_Pin = GPIO_Pin_7,
208 .GPIO_Speed = GPIO_Speed_100MHz,
209 .GPIO_Mode = GPIO_Mode_AF,
210 .GPIO_OType = GPIO_OType_PP,
211 .GPIO_PuPd = GPIO_PuPd_NOPULL
213 .pin_source = GPIO_PinSource7,
219 .GPIO_Pin = GPIO_Pin_4,
220 .GPIO_Speed = GPIO_Speed_100MHz,
221 .GPIO_Mode = GPIO_Mode_OUT,
222 .GPIO_OType = GPIO_OType_PP,
223 .GPIO_PuPd = GPIO_PuPd_UP
233 #if defined(PIOS_INCLUDE_I2C)
235 #include <pios_i2c_priv.h>
241 void PIOS_I2C_usart1_ev_irq_handler(
void);
242 void PIOS_I2C_usart1_er_irq_handler(
void);
248 .remap = GPIO_AF_I2C1,
250 .I2C_Mode = I2C_Mode_I2C,
251 .I2C_OwnAddress1 = 0,
252 .I2C_Ack = I2C_Ack_Enable,
253 .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
254 .I2C_DutyCycle = I2C_DutyCycle_2,
255 .I2C_ClockSpeed = 400000,
257 .transfer_timeout_ms = 50,
261 .GPIO_Pin = GPIO_Pin_6,
262 .GPIO_Mode = GPIO_Mode_AF,
263 .GPIO_Speed = GPIO_Speed_50MHz,
264 .GPIO_OType = GPIO_OType_OD,
265 .GPIO_PuPd = GPIO_PuPd_NOPULL,
267 .pin_source = GPIO_PinSource6,
272 .GPIO_Pin = GPIO_Pin_7,
273 .GPIO_Mode = GPIO_Mode_AF,
274 .GPIO_Speed = GPIO_Speed_50MHz,
275 .GPIO_OType = GPIO_OType_OD,
276 .GPIO_PuPd = GPIO_PuPd_NOPULL,
278 .pin_source = GPIO_PinSource7,
283 .NVIC_IRQChannel = I2C1_EV_IRQn,
285 .NVIC_IRQChannelSubPriority = 0,
286 .NVIC_IRQChannelCmd = ENABLE,
292 .NVIC_IRQChannel = I2C1_ER_IRQn,
294 .NVIC_IRQChannelSubPriority = 0,
295 .NVIC_IRQChannelCmd = ENABLE,
301 void PIOS_I2C_usart1_ev_irq_handler(
void)
307 void PIOS_I2C_usart1_er_irq_handler(
void)
316 void PIOS_I2C_usart3_ev_irq_handler(
void);
317 void PIOS_I2C_usart3_er_irq_handler(
void);
323 .remap = GPIO_AF_I2C2,
325 .I2C_Mode = I2C_Mode_I2C,
326 .I2C_OwnAddress1 = 0,
327 .I2C_Ack = I2C_Ack_Enable,
328 .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
329 .I2C_DutyCycle = I2C_DutyCycle_2,
330 .I2C_ClockSpeed = 400000,
332 .transfer_timeout_ms = 50,
336 .GPIO_Pin = GPIO_Pin_10,
337 .GPIO_Mode = GPIO_Mode_AF,
338 .GPIO_Speed = GPIO_Speed_50MHz,
339 .GPIO_OType = GPIO_OType_OD,
340 .GPIO_PuPd = GPIO_PuPd_NOPULL,
342 .pin_source = GPIO_PinSource10,
347 .GPIO_Pin = GPIO_Pin_11,
348 .GPIO_Mode = GPIO_Mode_AF,
349 .GPIO_Speed = GPIO_Speed_50MHz,
350 .GPIO_OType = GPIO_OType_OD,
351 .GPIO_PuPd = GPIO_PuPd_NOPULL,
353 .pin_source = GPIO_PinSource11,
358 .NVIC_IRQChannel = I2C2_EV_IRQn,
360 .NVIC_IRQChannelSubPriority = 0,
361 .NVIC_IRQChannelCmd = ENABLE,
367 .NVIC_IRQChannel = I2C2_ER_IRQn,
369 .NVIC_IRQChannelSubPriority = 0,
370 .NVIC_IRQChannelCmd = ENABLE,
376 void PIOS_I2C_usart3_ev_irq_handler(
void)
382 void PIOS_I2C_usart3_er_irq_handler(
void)
390 void PIOS_I2C_internal_ev_irq_handler(
void);
391 void PIOS_I2C_internal_er_irq_handler(
void);
397 .remap = GPIO_AF_I2C3,
399 .I2C_Mode = I2C_Mode_I2C,
400 .I2C_OwnAddress1 = 0,
401 .I2C_Ack = I2C_Ack_Enable,
402 .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
403 .I2C_DutyCycle = I2C_DutyCycle_2,
404 .I2C_ClockSpeed = 400000,
406 .transfer_timeout_ms = 50,
410 .GPIO_Pin = GPIO_Pin_8,
411 .GPIO_Mode = GPIO_Mode_AF,
412 .GPIO_Speed = GPIO_Speed_50MHz,
413 .GPIO_OType = GPIO_OType_OD,
414 .GPIO_PuPd = GPIO_PuPd_NOPULL,
416 .pin_source = GPIO_PinSource8,
421 .GPIO_Pin = GPIO_Pin_9,
422 .GPIO_Mode = GPIO_Mode_AF,
423 .GPIO_Speed = GPIO_Speed_50MHz,
424 .GPIO_OType = GPIO_OType_OD,
425 .GPIO_PuPd = GPIO_PuPd_NOPULL,
427 .pin_source = GPIO_PinSource9,
432 .NVIC_IRQChannel = I2C3_EV_IRQn,
434 .NVIC_IRQChannelSubPriority = 0,
435 .NVIC_IRQChannelCmd = ENABLE,
441 .NVIC_IRQChannel = I2C3_ER_IRQn,
443 .NVIC_IRQChannelSubPriority = 0,
444 .NVIC_IRQChannelCmd = ENABLE,
450 void PIOS_I2C_internal_ev_irq_handler(
void)
456 void PIOS_I2C_internal_er_irq_handler(
void)
466 #if defined(PIOS_INCLUDE_FLASH)
471 .arena_size = 0x00004000,
472 .slot_size = 0x00000100,
475 #if defined(PIOS_INCLUDE_FLASH_JEDEC)
480 .expect_memorytype = 0x20,
481 .expect_capacity = 0x16,
482 .sector_erase = 0x20,
486 #if defined(PIOS_INCLUDE_FLASH_INTERNAL)
495 #if defined(PIOS_INCLUDE_FLASH_INTERNAL)
515 uintptr_t pios_internal_flash_id;
518 .chip_id = &pios_internal_flash_id,
520 .sector_blocks = stm32f4_sectors,
521 .num_blocks =
NELEMENTS(stm32f4_sectors),
525 #if defined(PIOS_INCLUDE_FLASH_JEDEC)
534 uintptr_t pios_external_flash_id;
537 .chip_id = &pios_external_flash_id,
539 .sector_blocks = mx25_sectors,
545 #if defined(PIOS_INCLUDE_FLASH_INTERNAL)
548 .chip_desc = &pios_flash_chip_internal,
559 .chip_desc = &pios_flash_chip_internal,
567 .chip_desc = &pios_flash_chip_internal,
578 #if defined(PIOS_INCLUDE_FLASH_JEDEC)
581 .chip_desc = &pios_flash_chip_external,
590 .chip_desc = &pios_flash_chip_external,
599 .chip_desc = &pios_flash_chip_external,
612 *num_partitions =
NELEMENTS(pios_flash_partition_table);
618 #if defined(PIOS_INCLUDE_USART)
622 #if defined(PIOS_INCLUDE_DSM)
628 static const struct pios_dsm_cfg pios_usart1_dsm_aux_cfg = {
632 .GPIO_Pin = GPIO_Pin_7,
633 .GPIO_Speed = GPIO_Speed_2MHz,
634 .GPIO_Mode = GPIO_Mode_OUT,
635 .GPIO_OType = GPIO_OType_PP,
636 .GPIO_PuPd = GPIO_PuPd_NOPULL
641 static const struct pios_dsm_cfg pios_usart2_dsm_aux_cfg = {
645 .GPIO_Pin = GPIO_Pin_3,
646 .GPIO_Speed = GPIO_Speed_2MHz,
647 .GPIO_Mode = GPIO_Mode_OUT,
648 .GPIO_OType = GPIO_OType_PP,
649 .GPIO_PuPd = GPIO_PuPd_NOPULL
654 static const struct pios_dsm_cfg pios_usart3_dsm_aux_cfg = {
658 .GPIO_Pin = GPIO_Pin_11,
659 .GPIO_Speed = GPIO_Speed_2MHz,
660 .GPIO_Mode = GPIO_Mode_OUT,
661 .GPIO_OType = GPIO_OType_PP,
662 .GPIO_PuPd = GPIO_PuPd_NOPULL
667 static const struct pios_dsm_cfg pios_usart4_dsm_aux_cfg = {
671 .GPIO_Pin = GPIO_Pin_11,
672 .GPIO_Speed = GPIO_Speed_2MHz,
673 .GPIO_Mode = GPIO_Mode_OUT,
674 .GPIO_OType = GPIO_OType_PP,
675 .GPIO_PuPd = GPIO_PuPd_NOPULL
680 static const struct pios_dsm_cfg pios_usart5_dsm_aux_cfg = {
684 .GPIO_Pin = GPIO_Pin_2,
685 .GPIO_Speed = GPIO_Speed_2MHz,
686 .GPIO_Mode = GPIO_Mode_OUT,
687 .GPIO_OType = GPIO_OType_PP,
688 .GPIO_PuPd = GPIO_PuPd_NOPULL
693 static const struct pios_dsm_cfg pios_inportserial_dsm_aux_cfg = {
697 .GPIO_Pin = GPIO_Pin_7,
698 .GPIO_Speed = GPIO_Speed_2MHz,
699 .GPIO_Mode = GPIO_Mode_OUT,
700 .GPIO_OType = GPIO_OType_PP,
701 .GPIO_PuPd = GPIO_PuPd_NOPULL
708 #if defined(PIOS_INCLUDE_SBUS)
712 static const struct pios_sbus_cfg pios_usart2_sbus_aux_cfg = {
717 .GPIO_Pin = GPIO_Pin_2,
718 .GPIO_Speed = GPIO_Speed_2MHz,
719 .GPIO_Mode = GPIO_Mode_OUT,
720 .GPIO_OType = GPIO_OType_PP,
721 .GPIO_PuPd = GPIO_PuPd_NOPULL
724 .gpio_inv_enable = Bit_SET,
731 .remap = GPIO_AF_USART1,
734 .NVIC_IRQChannel = USART1_IRQn,
736 .NVIC_IRQChannelSubPriority = 0,
737 .NVIC_IRQChannelCmd = ENABLE,
743 .GPIO_Pin = GPIO_Pin_7,
744 .GPIO_Speed = GPIO_Speed_2MHz,
745 .GPIO_Mode = GPIO_Mode_AF,
746 .GPIO_OType = GPIO_OType_PP,
747 .GPIO_PuPd = GPIO_PuPd_UP
749 .pin_source = GPIO_PinSource7,
754 .GPIO_Pin = GPIO_Pin_6,
755 .GPIO_Speed = GPIO_Speed_2MHz,
756 .GPIO_Mode = GPIO_Mode_AF,
757 .GPIO_OType = GPIO_OType_PP,
758 .GPIO_PuPd = GPIO_PuPd_UP
760 .pin_source = GPIO_PinSource6,
766 .remap = GPIO_AF_USART2,
769 .NVIC_IRQChannel = USART2_IRQn,
771 .NVIC_IRQChannelSubPriority = 0,
772 .NVIC_IRQChannelCmd = ENABLE,
778 .GPIO_Pin = GPIO_Pin_3,
779 .GPIO_Speed = GPIO_Speed_2MHz,
780 .GPIO_Mode = GPIO_Mode_AF,
781 .GPIO_OType = GPIO_OType_PP,
782 .GPIO_PuPd = GPIO_PuPd_UP
784 .pin_source = GPIO_PinSource3,
789 .GPIO_Pin = GPIO_Pin_2,
790 .GPIO_Speed = GPIO_Speed_2MHz,
791 .GPIO_Mode = GPIO_Mode_AF,
792 .GPIO_OType = GPIO_OType_PP,
793 .GPIO_PuPd = GPIO_PuPd_UP
795 .pin_source = GPIO_PinSource2,
801 .remap = GPIO_AF_USART3,
804 .NVIC_IRQChannel = USART3_IRQn,
806 .NVIC_IRQChannelSubPriority = 0,
807 .NVIC_IRQChannelCmd = ENABLE,
813 .GPIO_Pin = GPIO_Pin_11,
814 .GPIO_Speed = GPIO_Speed_2MHz,
815 .GPIO_Mode = GPIO_Mode_AF,
816 .GPIO_OType = GPIO_OType_PP,
817 .GPIO_PuPd = GPIO_PuPd_UP
819 .pin_source = GPIO_PinSource11,
824 .GPIO_Pin = GPIO_Pin_10,
825 .GPIO_Speed = GPIO_Speed_2MHz,
826 .GPIO_Mode = GPIO_Mode_AF,
827 .GPIO_OType = GPIO_OType_PP,
828 .GPIO_PuPd = GPIO_PuPd_UP
830 .pin_source = GPIO_PinSource10,
836 .remap = GPIO_AF_UART4,
839 .NVIC_IRQChannel = UART4_IRQn,
841 .NVIC_IRQChannelSubPriority = 0,
842 .NVIC_IRQChannelCmd = ENABLE,
848 .GPIO_Pin = GPIO_Pin_11,
849 .GPIO_Speed = GPIO_Speed_2MHz,
850 .GPIO_Mode = GPIO_Mode_AF,
851 .GPIO_OType = GPIO_OType_PP,
852 .GPIO_PuPd = GPIO_PuPd_UP
854 .pin_source = GPIO_PinSource11,
859 .GPIO_Pin = GPIO_Pin_10,
860 .GPIO_Speed = GPIO_Speed_2MHz,
861 .GPIO_Mode = GPIO_Mode_AF,
862 .GPIO_OType = GPIO_OType_PP,
863 .GPIO_PuPd = GPIO_PuPd_UP
865 .pin_source = GPIO_PinSource10,
871 .remap = GPIO_AF_UART5,
874 .NVIC_IRQChannel = UART5_IRQn,
876 .NVIC_IRQChannelSubPriority = 0,
877 .NVIC_IRQChannelCmd = ENABLE,
883 .GPIO_Pin = GPIO_Pin_2,
884 .GPIO_Speed = GPIO_Speed_2MHz,
885 .GPIO_Mode = GPIO_Mode_AF,
886 .GPIO_OType = GPIO_OType_PP,
887 .GPIO_PuPd = GPIO_PuPd_UP
889 .pin_source = GPIO_PinSource2,
894 .GPIO_Pin = GPIO_Pin_12,
895 .GPIO_Speed = GPIO_Speed_2MHz,
896 .GPIO_Mode = GPIO_Mode_AF,
897 .GPIO_OType = GPIO_OType_PP,
898 .GPIO_PuPd = GPIO_PuPd_UP
900 .pin_source = GPIO_PinSource12,
904 static const struct pios_usart_cfg pios_usart_inportserial_cfg = {
906 .remap = GPIO_AF_USART6,
909 .NVIC_IRQChannel = USART6_IRQn,
911 .NVIC_IRQChannelSubPriority = 0,
912 .NVIC_IRQChannelCmd = ENABLE,
918 .GPIO_Pin = GPIO_Pin_7,
919 .GPIO_Speed = GPIO_Speed_2MHz,
920 .GPIO_Mode = GPIO_Mode_AF,
921 .GPIO_OType = GPIO_OType_PP,
922 .GPIO_PuPd = GPIO_PuPd_UP
924 .pin_source = GPIO_PinSource7,
929 .GPIO_Pin = GPIO_Pin_6,
930 .GPIO_Speed = GPIO_Speed_2MHz,
931 .GPIO_Mode = GPIO_Mode_AF,
932 .GPIO_OType = GPIO_OType_PP,
933 .GPIO_PuPd = GPIO_PuPd_UP
935 .pin_source = GPIO_PinSource6,
941 #if defined(PIOS_INCLUDE_COM)
947 #if defined(PIOS_INCLUDE_RTC)
951 #include <pios_rtc_priv.h>
953 void PIOS_RTC_IRQ_Handler (
void);
956 .
clksrc = RCC_RTCCLKSource_HSE_Div16,
962 .NVIC_IRQChannel = RTC_WKUP_IRQn,
964 .NVIC_IRQChannelSubPriority = 0,
965 .NVIC_IRQChannelCmd = ENABLE,
970 void PIOS_RTC_IRQ_Handler (
void)
983 .TIM_Prescaler = (PIOS_PERIPHERAL_APB1_COUNTER_CLOCK / 1000000) - 1,
984 .TIM_ClockDivision = TIM_CKD_DIV1,
985 .TIM_CounterMode = TIM_CounterMode_Up,
986 .TIM_Period = 0xFFFF,
987 .TIM_RepetitionCounter = 0x0000,
991 .TIM_Prescaler = (PIOS_PERIPHERAL_APB2_COUNTER_CLOCK / 1000000) - 1,
992 .TIM_ClockDivision = TIM_CKD_DIV1,
993 .TIM_CounterMode = TIM_CounterMode_Up,
994 .TIM_Period = 0xFFFF,
995 .TIM_RepetitionCounter = 0x0000,
1003 .NVIC_IRQChannel = TIM2_IRQn,
1005 .NVIC_IRQChannelSubPriority = 0,
1006 .NVIC_IRQChannelCmd = ENABLE,
1016 .NVIC_IRQChannel = TIM5_IRQn,
1018 .NVIC_IRQChannelSubPriority = 0,
1019 .NVIC_IRQChannelCmd = ENABLE,
1029 .NVIC_IRQChannel = TIM1_CC_IRQn,
1031 .NVIC_IRQChannelSubPriority = 0,
1032 .NVIC_IRQChannelCmd = ENABLE,
1037 .NVIC_IRQChannel = TIM1_UP_TIM10_IRQn,
1039 .NVIC_IRQChannelSubPriority = 0,
1040 .NVIC_IRQChannelCmd = ENABLE,
1050 .NVIC_IRQChannel = TIM8_CC_IRQn,
1052 .NVIC_IRQChannelSubPriority = 0,
1053 .NVIC_IRQChannelCmd = ENABLE,
1058 .NVIC_IRQChannel = TIM8_UP_TIM13_IRQn,
1060 .NVIC_IRQChannelSubPriority = 0,
1061 .NVIC_IRQChannelCmd = ENABLE,
1070 .TIM_Prescaler = (PIOS_PERIPHERAL_APB1_COUNTER_CLOCK / 1000000) - 1,
1071 .TIM_ClockDivision = TIM_CKD_DIV1,
1072 .TIM_CounterMode = TIM_CounterMode_Up,
1074 .TIM_RepetitionCounter = 0x0000,
1079 .TIM_Prescaler = (PIOS_PERIPHERAL_APB2_COUNTER_CLOCK / 1000000) - 1,
1080 .TIM_ClockDivision = TIM_CKD_DIV1,
1081 .TIM_CounterMode = TIM_CounterMode_Up,
1083 .TIM_RepetitionCounter = 0x0000,
1091 .NVIC_IRQChannel = TIM3_IRQn,
1093 .NVIC_IRQChannelSubPriority = 0,
1094 .NVIC_IRQChannelCmd = ENABLE,
1104 .NVIC_IRQChannel = TIM1_UP_TIM10_IRQn,
1106 .NVIC_IRQChannelSubPriority = 0,
1107 .NVIC_IRQChannelCmd = ENABLE,
1117 .NVIC_IRQChannel = TIM1_TRG_COM_TIM11_IRQn,
1119 .NVIC_IRQChannelSubPriority = 0,
1120 .NVIC_IRQChannelCmd = ENABLE,
1130 .NVIC_IRQChannel = TIM8_BRK_TIM12_IRQn,
1132 .NVIC_IRQChannelSubPriority = 0,
1133 .NVIC_IRQChannelCmd = ENABLE,
1156 .timer_chan = TIM_Channel_1,
1157 .remap = GPIO_AF_TIM3,
1161 .GPIO_Pin = GPIO_Pin_4,
1162 .GPIO_Speed = GPIO_Speed_2MHz,
1163 .GPIO_Mode = GPIO_Mode_AF,
1164 .GPIO_OType = GPIO_OType_PP,
1165 .GPIO_PuPd = GPIO_PuPd_UP
1167 .pin_source = GPIO_PinSource4,
1172 .timer_chan = TIM_Channel_2,
1173 .remap = GPIO_AF_TIM3,
1177 .GPIO_Pin = GPIO_Pin_5,
1178 .GPIO_Speed = GPIO_Speed_2MHz,
1179 .GPIO_Mode = GPIO_Mode_AF,
1180 .GPIO_OType = GPIO_OType_PP,
1181 .GPIO_PuPd = GPIO_PuPd_UP
1183 .pin_source = GPIO_PinSource5,
1188 .timer_chan = TIM_Channel_3,
1189 .remap = GPIO_AF_TIM3,
1193 .GPIO_Pin = GPIO_Pin_0,
1194 .GPIO_Speed = GPIO_Speed_2MHz,
1195 .GPIO_Mode = GPIO_Mode_AF,
1196 .GPIO_OType = GPIO_OType_PP,
1197 .GPIO_PuPd = GPIO_PuPd_UP
1199 .pin_source = GPIO_PinSource0,
1204 .timer_chan = TIM_Channel_4,
1205 .remap = GPIO_AF_TIM3,
1209 .GPIO_Pin = GPIO_Pin_1,
1210 .GPIO_Speed = GPIO_Speed_2MHz,
1211 .GPIO_Mode = GPIO_Mode_AF,
1212 .GPIO_OType = GPIO_OType_PP,
1213 .GPIO_PuPd = GPIO_PuPd_UP
1215 .pin_source = GPIO_PinSource1,
1220 .timer_chan = TIM_Channel_1,
1221 .remap = GPIO_AF_TIM12,
1225 .GPIO_Pin = GPIO_Pin_14,
1226 .GPIO_Speed = GPIO_Speed_2MHz,
1227 .GPIO_Mode = GPIO_Mode_AF,
1228 .GPIO_OType = GPIO_OType_PP,
1229 .GPIO_PuPd = GPIO_PuPd_UP
1231 .pin_source = GPIO_PinSource14,
1236 .timer_chan = TIM_Channel_2,
1237 .remap = GPIO_AF_TIM12,
1241 .GPIO_Pin = GPIO_Pin_15,
1242 .GPIO_Speed = GPIO_Speed_2MHz,
1243 .GPIO_Mode = GPIO_Mode_AF,
1244 .GPIO_OType = GPIO_OType_PP,
1245 .GPIO_PuPd = GPIO_PuPd_UP
1247 .pin_source = GPIO_PinSource15,
1252 .timer_chan = TIM_Channel_1,
1253 .remap = GPIO_AF_TIM10,
1257 .GPIO_Pin = GPIO_Pin_8,
1258 .GPIO_Speed = GPIO_Speed_2MHz,
1259 .GPIO_Mode = GPIO_Mode_AF,
1260 .GPIO_OType = GPIO_OType_PP,
1261 .GPIO_PuPd = GPIO_PuPd_UP
1263 .pin_source = GPIO_PinSource8,
1268 .timer_chan = TIM_Channel_1,
1269 .remap = GPIO_AF_TIM11,
1273 .GPIO_Pin = GPIO_Pin_9,
1274 .GPIO_Speed = GPIO_Speed_2MHz,
1275 .GPIO_Mode = GPIO_Mode_AF,
1276 .GPIO_OType = GPIO_OType_PP,
1277 .GPIO_PuPd = GPIO_PuPd_UP
1279 .pin_source = GPIO_PinSource9,
1307 .timer_chan = TIM_Channel_1,
1308 .remap = GPIO_AF_TIM3,
1312 .GPIO_Pin = GPIO_Pin_4,
1313 .GPIO_Speed = GPIO_Speed_2MHz,
1314 .GPIO_Mode = GPIO_Mode_AF,
1315 .GPIO_OType = GPIO_OType_PP,
1316 .GPIO_PuPd = GPIO_PuPd_UP
1318 .pin_source = GPIO_PinSource4,
1323 .timer_chan = TIM_Channel_2,
1324 .remap = GPIO_AF_TIM3,
1328 .GPIO_Pin = GPIO_Pin_5,
1329 .GPIO_Speed = GPIO_Speed_2MHz,
1330 .GPIO_Mode = GPIO_Mode_AF,
1331 .GPIO_OType = GPIO_OType_PP,
1332 .GPIO_PuPd = GPIO_PuPd_UP
1334 .pin_source = GPIO_PinSource5,
1339 .timer_chan = TIM_Channel_3,
1340 .remap = GPIO_AF_TIM3,
1344 .GPIO_Pin = GPIO_Pin_0,
1345 .GPIO_Speed = GPIO_Speed_2MHz,
1346 .GPIO_Mode = GPIO_Mode_AF,
1347 .GPIO_OType = GPIO_OType_PP,
1348 .GPIO_PuPd = GPIO_PuPd_UP
1350 .pin_source = GPIO_PinSource0,
1355 .timer_chan = TIM_Channel_4,
1356 .remap = GPIO_AF_TIM3,
1360 .GPIO_Pin = GPIO_Pin_1,
1361 .GPIO_Speed = GPIO_Speed_2MHz,
1362 .GPIO_Mode = GPIO_Mode_AF,
1363 .GPIO_OType = GPIO_OType_PP,
1364 .GPIO_PuPd = GPIO_PuPd_UP
1366 .pin_source = GPIO_PinSource1,
1371 .timer_chan = TIM_Channel_1,
1372 .remap = GPIO_AF_TIM12,
1376 .GPIO_Pin = GPIO_Pin_14,
1377 .GPIO_Speed = GPIO_Speed_2MHz,
1378 .GPIO_Mode = GPIO_Mode_AF,
1379 .GPIO_OType = GPIO_OType_PP,
1380 .GPIO_PuPd = GPIO_PuPd_UP
1382 .pin_source = GPIO_PinSource14,
1387 .timer_chan = TIM_Channel_2,
1388 .remap = GPIO_AF_TIM12,
1392 .GPIO_Pin = GPIO_Pin_15,
1393 .GPIO_Speed = GPIO_Speed_2MHz,
1394 .GPIO_Mode = GPIO_Mode_AF,
1395 .GPIO_OType = GPIO_OType_PP,
1396 .GPIO_PuPd = GPIO_PuPd_UP
1398 .pin_source = GPIO_PinSource15,
1403 .timer_chan = TIM_Channel_1,
1404 .remap = GPIO_AF_TIM10,
1408 .GPIO_Pin = GPIO_Pin_8,
1409 .GPIO_Speed = GPIO_Speed_2MHz,
1410 .GPIO_Mode = GPIO_Mode_AF,
1411 .GPIO_OType = GPIO_OType_PP,
1412 .GPIO_PuPd = GPIO_PuPd_UP
1414 .pin_source = GPIO_PinSource8,
1419 .timer_chan = TIM_Channel_1,
1420 .remap = GPIO_AF_TIM11,
1424 .GPIO_Pin = GPIO_Pin_9,
1425 .GPIO_Speed = GPIO_Speed_2MHz,
1426 .GPIO_Mode = GPIO_Mode_AF,
1427 .GPIO_OType = GPIO_OType_PP,
1428 .GPIO_PuPd = GPIO_PuPd_UP
1430 .pin_source = GPIO_PinSource9,
1435 .timer_chan = TIM_Channel_1,
1436 .remap = GPIO_AF_TIM8,
1440 .GPIO_Pin = GPIO_Pin_6,
1441 .GPIO_Speed = GPIO_Speed_2MHz,
1442 .GPIO_Mode = GPIO_Mode_AF,
1443 .GPIO_OType = GPIO_OType_PP,
1444 .GPIO_PuPd = GPIO_PuPd_UP
1446 .pin_source = GPIO_PinSource6,
1451 .timer_chan = TIM_Channel_2,
1452 .remap = GPIO_AF_TIM8,
1456 .GPIO_Pin = GPIO_Pin_7,
1457 .GPIO_Speed = GPIO_Speed_2MHz,
1458 .GPIO_Mode = GPIO_Mode_AF,
1459 .GPIO_OType = GPIO_OType_PP,
1460 .GPIO_PuPd = GPIO_PuPd_UP
1462 .pin_source = GPIO_PinSource7,
1467 .timer_chan = TIM_Channel_3,
1468 .remap = GPIO_AF_TIM8,
1472 .GPIO_Pin = GPIO_Pin_8,
1473 .GPIO_Speed = GPIO_Speed_2MHz,
1474 .GPIO_Mode = GPIO_Mode_AF,
1475 .GPIO_OType = GPIO_OType_PP,
1476 .GPIO_PuPd = GPIO_PuPd_UP
1478 .pin_source = GPIO_PinSource8,
1483 .timer_chan = TIM_Channel_1,
1484 .remap = GPIO_AF_TIM2,
1488 .GPIO_Pin = GPIO_Pin_15,
1489 .GPIO_Speed = GPIO_Speed_2MHz,
1490 .GPIO_Mode = GPIO_Mode_AF,
1491 .GPIO_OType = GPIO_OType_PP,
1492 .GPIO_PuPd = GPIO_PuPd_UP
1494 .pin_source = GPIO_PinSource15,
1499 .timer_chan = TIM_Channel_2,
1500 .remap = GPIO_AF_TIM2,
1504 .GPIO_Pin = GPIO_Pin_3,
1505 .GPIO_Speed = GPIO_Speed_2MHz,
1506 .GPIO_Mode = GPIO_Mode_AF,
1507 .GPIO_OType = GPIO_OType_PP,
1508 .GPIO_PuPd = GPIO_PuPd_UP
1510 .pin_source = GPIO_PinSource3,
1515 .timer_chan = TIM_Channel_1,
1516 .remap = GPIO_AF_TIM5,
1520 .GPIO_Pin = GPIO_Pin_0,
1521 .GPIO_Speed = GPIO_Speed_2MHz,
1522 .GPIO_Mode = GPIO_Mode_AF,
1523 .GPIO_OType = GPIO_OType_PP,
1524 .GPIO_PuPd = GPIO_PuPd_UP
1526 .pin_source = GPIO_PinSource0,
1531 .timer_chan = TIM_Channel_2,
1532 .remap = GPIO_AF_TIM5,
1536 .GPIO_Pin = GPIO_Pin_1,
1537 .GPIO_Speed = GPIO_Speed_2MHz,
1538 .GPIO_Mode = GPIO_Mode_AF,
1539 .GPIO_OType = GPIO_OType_PP,
1540 .GPIO_PuPd = GPIO_PuPd_UP
1542 .pin_source = GPIO_PinSource1,
1570 .timer_chan = TIM_Channel_1,
1571 .remap = GPIO_AF_TIM3,
1575 .GPIO_Pin = GPIO_Pin_4,
1576 .GPIO_Speed = GPIO_Speed_2MHz,
1577 .GPIO_Mode = GPIO_Mode_AF,
1578 .GPIO_OType = GPIO_OType_PP,
1579 .GPIO_PuPd = GPIO_PuPd_UP
1581 .pin_source = GPIO_PinSource4,
1586 .timer_chan = TIM_Channel_2,
1587 .remap = GPIO_AF_TIM3,
1591 .GPIO_Pin = GPIO_Pin_5,
1592 .GPIO_Speed = GPIO_Speed_2MHz,
1593 .GPIO_Mode = GPIO_Mode_AF,
1594 .GPIO_OType = GPIO_OType_PP,
1595 .GPIO_PuPd = GPIO_PuPd_UP
1597 .pin_source = GPIO_PinSource5,
1602 .timer_chan = TIM_Channel_3,
1603 .remap = GPIO_AF_TIM3,
1607 .GPIO_Pin = GPIO_Pin_0,
1608 .GPIO_Speed = GPIO_Speed_2MHz,
1609 .GPIO_Mode = GPIO_Mode_AF,
1610 .GPIO_OType = GPIO_OType_PP,
1611 .GPIO_PuPd = GPIO_PuPd_UP
1613 .pin_source = GPIO_PinSource0,
1618 .timer_chan = TIM_Channel_4,
1619 .remap = GPIO_AF_TIM3,
1623 .GPIO_Pin = GPIO_Pin_1,
1624 .GPIO_Speed = GPIO_Speed_2MHz,
1625 .GPIO_Mode = GPIO_Mode_AF,
1626 .GPIO_OType = GPIO_OType_PP,
1627 .GPIO_PuPd = GPIO_PuPd_UP
1629 .pin_source = GPIO_PinSource1,
1634 .timer_chan = TIM_Channel_1,
1635 .remap = GPIO_AF_TIM12,
1639 .GPIO_Pin = GPIO_Pin_14,
1640 .GPIO_Speed = GPIO_Speed_2MHz,
1641 .GPIO_Mode = GPIO_Mode_AF,
1642 .GPIO_OType = GPIO_OType_PP,
1643 .GPIO_PuPd = GPIO_PuPd_UP
1645 .pin_source = GPIO_PinSource14,
1650 .timer_chan = TIM_Channel_2,
1651 .remap = GPIO_AF_TIM12,
1655 .GPIO_Pin = GPIO_Pin_15,
1656 .GPIO_Speed = GPIO_Speed_2MHz,
1657 .GPIO_Mode = GPIO_Mode_AF,
1658 .GPIO_OType = GPIO_OType_PP,
1659 .GPIO_PuPd = GPIO_PuPd_UP
1661 .pin_source = GPIO_PinSource15,
1666 .timer_chan = TIM_Channel_1,
1667 .remap = GPIO_AF_TIM10,
1671 .GPIO_Pin = GPIO_Pin_8,
1672 .GPIO_Speed = GPIO_Speed_2MHz,
1673 .GPIO_Mode = GPIO_Mode_AF,
1674 .GPIO_OType = GPIO_OType_PP,
1675 .GPIO_PuPd = GPIO_PuPd_UP
1677 .pin_source = GPIO_PinSource8,
1682 .timer_chan = TIM_Channel_1,
1683 .remap = GPIO_AF_TIM11,
1687 .GPIO_Pin = GPIO_Pin_9,
1688 .GPIO_Speed = GPIO_Speed_2MHz,
1689 .GPIO_Mode = GPIO_Mode_AF,
1690 .GPIO_OType = GPIO_OType_PP,
1691 .GPIO_PuPd = GPIO_PuPd_UP
1693 .pin_source = GPIO_PinSource9,
1698 .timer_chan = TIM_Channel_3,
1699 .remap = GPIO_AF_TIM1,
1703 .GPIO_Pin = GPIO_Pin_10,
1704 .GPIO_Speed = GPIO_Speed_2MHz,
1705 .GPIO_Mode = GPIO_Mode_AF,
1706 .GPIO_OType = GPIO_OType_PP,
1707 .GPIO_PuPd = GPIO_PuPd_UP
1709 .pin_source = GPIO_PinSource10,
1714 .timer_chan = TIM_Channel_1,
1715 .remap = GPIO_AF_TIM8,
1719 .GPIO_Pin = GPIO_Pin_6,
1720 .GPIO_Speed = GPIO_Speed_2MHz,
1721 .GPIO_Mode = GPIO_Mode_AF,
1722 .GPIO_OType = GPIO_OType_PP,
1723 .GPIO_PuPd = GPIO_PuPd_UP
1725 .pin_source = GPIO_PinSource6,
1730 .timer_chan = TIM_Channel_2,
1731 .remap = GPIO_AF_TIM8,
1735 .GPIO_Pin = GPIO_Pin_7,
1736 .GPIO_Speed = GPIO_Speed_2MHz,
1737 .GPIO_Mode = GPIO_Mode_AF,
1738 .GPIO_OType = GPIO_OType_PP,
1739 .GPIO_PuPd = GPIO_PuPd_UP
1741 .pin_source = GPIO_PinSource7,
1746 .timer_chan = TIM_Channel_3,
1747 .remap = GPIO_AF_TIM8,
1751 .GPIO_Pin = GPIO_Pin_8,
1752 .GPIO_Speed = GPIO_Speed_2MHz,
1753 .GPIO_Mode = GPIO_Mode_AF,
1754 .GPIO_OType = GPIO_OType_PP,
1755 .GPIO_PuPd = GPIO_PuPd_UP
1757 .pin_source = GPIO_PinSource8,
1762 .timer_chan = TIM_Channel_1,
1763 .remap = GPIO_AF_TIM2,
1767 .GPIO_Pin = GPIO_Pin_15,
1768 .GPIO_Speed = GPIO_Speed_2MHz,
1769 .GPIO_Mode = GPIO_Mode_AF,
1770 .GPIO_OType = GPIO_OType_PP,
1771 .GPIO_PuPd = GPIO_PuPd_UP
1773 .pin_source = GPIO_PinSource15,
1778 .timer_chan = TIM_Channel_2,
1779 .remap = GPIO_AF_TIM2,
1783 .GPIO_Pin = GPIO_Pin_3,
1784 .GPIO_Speed = GPIO_Speed_2MHz,
1785 .GPIO_Mode = GPIO_Mode_AF,
1786 .GPIO_OType = GPIO_OType_PP,
1787 .GPIO_PuPd = GPIO_PuPd_UP
1789 .pin_source = GPIO_PinSource3,
1794 .timer_chan = TIM_Channel_1,
1795 .remap = GPIO_AF_TIM5,
1799 .GPIO_Pin = GPIO_Pin_0,
1800 .GPIO_Speed = GPIO_Speed_2MHz,
1801 .GPIO_Mode = GPIO_Mode_AF,
1802 .GPIO_OType = GPIO_OType_PP,
1803 .GPIO_PuPd = GPIO_PuPd_UP
1805 .pin_source = GPIO_PinSource0,
1810 .timer_chan = TIM_Channel_2,
1811 .remap = GPIO_AF_TIM5,
1815 .GPIO_Pin = GPIO_Pin_1,
1816 .GPIO_Speed = GPIO_Speed_2MHz,
1817 .GPIO_Mode = GPIO_Mode_AF,
1818 .GPIO_OType = GPIO_OType_PP,
1819 .GPIO_PuPd = GPIO_PuPd_UP
1821 .pin_source = GPIO_PinSource1,
1826 #if defined(PIOS_INCLUDE_SERVO) && defined(PIOS_INCLUDE_TIM)
1834 .TIM_OCMode = TIM_OCMode_PWM1,
1835 .TIM_OutputState = TIM_OutputState_Enable,
1836 .TIM_OutputNState = TIM_OutputNState_Disable,
1838 .TIM_OCPolarity = TIM_OCPolarity_High,
1839 .TIM_OCNPolarity = TIM_OCPolarity_High,
1840 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1841 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1844 .num_channels =
NELEMENTS(pios_tim_servoport_all_pins),
1847 const struct pios_servo_cfg pios_servo_with_adc_cfg = {
1849 .TIM_OCMode = TIM_OCMode_PWM1,
1850 .TIM_OutputState = TIM_OutputState_Enable,
1851 .TIM_OutputNState = TIM_OutputNState_Disable,
1853 .TIM_OCPolarity = TIM_OCPolarity_High,
1854 .TIM_OCNPolarity = TIM_OCPolarity_High,
1855 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1856 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1860 .num_channels =
NELEMENTS(pios_tim_servoport_all_pins) - 2,
1863 const struct pios_servo_cfg pios_servo_with_rcvr_cfg = {
1865 .TIM_OCMode = TIM_OCMode_PWM1,
1866 .TIM_OutputState = TIM_OutputState_Enable,
1867 .TIM_OutputNState = TIM_OutputNState_Disable,
1869 .TIM_OCPolarity = TIM_OCPolarity_High,
1870 .TIM_OCNPolarity = TIM_OCPolarity_High,
1871 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1872 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1875 .num_channels =
NELEMENTS(pios_tim_servoport_rcvrport_pins),
1878 const struct pios_servo_cfg pios_servo_with_rcvr_ppm_cfg = {
1880 .TIM_OCMode = TIM_OCMode_PWM1,
1881 .TIM_OutputState = TIM_OutputState_Enable,
1882 .TIM_OutputNState = TIM_OutputNState_Disable,
1884 .TIM_OCPolarity = TIM_OCPolarity_High,
1885 .TIM_OCNPolarity = TIM_OCPolarity_High,
1886 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1887 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1890 .num_channels =
NELEMENTS(pios_tim_servoport_rcvrport_PPM_pins),
1893 const struct pios_servo_cfg pios_servo_with_rcvr_with_adc_cfg = {
1895 .TIM_OCMode = TIM_OCMode_PWM1,
1896 .TIM_OutputState = TIM_OutputState_Enable,
1897 .TIM_OutputNState = TIM_OutputNState_Disable,
1899 .TIM_OCPolarity = TIM_OCPolarity_High,
1900 .TIM_OCNPolarity = TIM_OCPolarity_High,
1901 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1902 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1906 .num_channels =
NELEMENTS(pios_tim_servoport_rcvrport_pins) - 2,
1909 const struct pios_servo_cfg pios_servo_with_rcvr_ppm_with_adc_cfg = {
1911 .TIM_OCMode = TIM_OCMode_PWM1,
1912 .TIM_OutputState = TIM_OutputState_Enable,
1913 .TIM_OutputNState = TIM_OutputNState_Disable,
1915 .TIM_OCPolarity = TIM_OCPolarity_High,
1916 .TIM_OCNPolarity = TIM_OCPolarity_High,
1917 .TIM_OCIdleState = TIM_OCIdleState_Reset,
1918 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
1922 .num_channels =
NELEMENTS(pios_tim_servoport_rcvrport_PPM_pins) - 2,
1941 .timer_chan = TIM_Channel_3,
1942 .remap = GPIO_AF_TIM1,
1946 .GPIO_Pin = GPIO_Pin_10,
1947 .GPIO_Speed = GPIO_Speed_2MHz,
1948 .GPIO_Mode = GPIO_Mode_AF,
1949 .GPIO_OType = GPIO_OType_PP,
1950 .GPIO_PuPd = GPIO_PuPd_UP
1952 .pin_source = GPIO_PinSource10,
1957 .timer_chan = TIM_Channel_1,
1958 .remap = GPIO_AF_TIM8,
1962 .GPIO_Pin = GPIO_Pin_6,
1963 .GPIO_Speed = GPIO_Speed_2MHz,
1964 .GPIO_Mode = GPIO_Mode_AF,
1965 .GPIO_OType = GPIO_OType_PP,
1966 .GPIO_PuPd = GPIO_PuPd_UP
1968 .pin_source = GPIO_PinSource6,
1973 .timer_chan = TIM_Channel_2,
1974 .remap = GPIO_AF_TIM8,
1978 .GPIO_Pin = GPIO_Pin_7,
1979 .GPIO_Speed = GPIO_Speed_2MHz,
1980 .GPIO_Mode = GPIO_Mode_AF,
1981 .GPIO_OType = GPIO_OType_PP,
1982 .GPIO_PuPd = GPIO_PuPd_UP
1984 .pin_source = GPIO_PinSource7,
1989 .timer_chan = TIM_Channel_3,
1990 .remap = GPIO_AF_TIM8,
1994 .GPIO_Pin = GPIO_Pin_8,
1995 .GPIO_Speed = GPIO_Speed_2MHz,
1996 .GPIO_Mode = GPIO_Mode_AF,
1997 .GPIO_OType = GPIO_OType_PP,
1998 .GPIO_PuPd = GPIO_PuPd_UP
2000 .pin_source = GPIO_PinSource8,
2005 .timer_chan = TIM_Channel_1,
2006 .remap = GPIO_AF_TIM2,
2010 .GPIO_Pin = GPIO_Pin_15,
2011 .GPIO_Speed = GPIO_Speed_2MHz,
2012 .GPIO_Mode = GPIO_Mode_AF,
2013 .GPIO_OType = GPIO_OType_PP,
2014 .GPIO_PuPd = GPIO_PuPd_UP
2016 .pin_source = GPIO_PinSource15,
2021 .timer_chan = TIM_Channel_2,
2022 .remap = GPIO_AF_TIM2,
2026 .GPIO_Pin = GPIO_Pin_3,
2027 .GPIO_Speed = GPIO_Speed_2MHz,
2028 .GPIO_Mode = GPIO_Mode_AF,
2029 .GPIO_OType = GPIO_OType_PP,
2030 .GPIO_PuPd = GPIO_PuPd_UP
2032 .pin_source = GPIO_PinSource3,
2037 .timer_chan = TIM_Channel_1,
2038 .remap = GPIO_AF_TIM5,
2042 .GPIO_Pin = GPIO_Pin_0,
2043 .GPIO_Speed = GPIO_Speed_2MHz,
2044 .GPIO_Mode = GPIO_Mode_AF,
2045 .GPIO_OType = GPIO_OType_PP,
2046 .GPIO_PuPd = GPIO_PuPd_UP
2048 .pin_source = GPIO_PinSource0,
2053 .timer_chan = TIM_Channel_2,
2054 .remap = GPIO_AF_TIM5,
2058 .GPIO_Pin = GPIO_Pin_1,
2059 .GPIO_Speed = GPIO_Speed_2MHz,
2060 .GPIO_Mode = GPIO_Mode_AF,
2061 .GPIO_OType = GPIO_OType_PP,
2062 .GPIO_PuPd = GPIO_PuPd_UP
2064 .pin_source = GPIO_PinSource1,
2072 #if defined(PIOS_INCLUDE_PWM) || defined(PIOS_INCLUDE_PPM)
2077 .TIM_ICPolarity = TIM_ICPolarity_Rising,
2078 .TIM_ICSelection = TIM_ICSelection_DirectTI,
2079 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
2080 .TIM_ICFilter = 0x0,
2083 .num_channels =
NELEMENTS(pios_tim_rcvrport_all_channels),
2086 const struct pios_pwm_cfg pios_pwm_with_adc_cfg = {
2088 .TIM_ICPolarity = TIM_ICPolarity_Rising,
2089 .TIM_ICSelection = TIM_ICSelection_DirectTI,
2090 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
2091 .TIM_ICFilter = 0x0,
2095 .num_channels =
NELEMENTS(pios_tim_rcvrport_all_channels) - 2,
2098 const struct pios_pwm_cfg pios_pwm_with_ppm_cfg = {
2100 .TIM_ICPolarity = TIM_ICPolarity_Rising,
2101 .TIM_ICSelection = TIM_ICSelection_DirectTI,
2102 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
2103 .TIM_ICFilter = 0x0,
2106 .channels = &pios_tim_rcvrport_all_channels[1],
2107 .num_channels =
NELEMENTS(pios_tim_rcvrport_all_channels) - 1,
2110 const struct pios_pwm_cfg pios_pwm_with_ppm_with_adc_cfg = {
2112 .TIM_ICPolarity = TIM_ICPolarity_Rising,
2113 .TIM_ICSelection = TIM_ICSelection_DirectTI,
2114 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
2115 .TIM_ICFilter = 0x0,
2118 .channels = &pios_tim_rcvrport_all_channels[1],
2119 .num_channels =
NELEMENTS(pios_tim_rcvrport_all_channels) - 1 - 2,
2127 #if defined(PIOS_INCLUDE_PPM)
2132 .TIM_ICPolarity = TIM_ICPolarity_Rising,
2133 .TIM_ICSelection = TIM_ICSelection_DirectTI,
2134 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
2135 .TIM_ICFilter = 0x0,
2136 .TIM_Channel = TIM_Channel_3,
2139 .channels = &pios_tim_rcvrport_all_channels[0],
2143 static const struct pios_ppm_cfg pios_ppm_in4_cfg = {
2145 .TIM_ICPolarity = TIM_ICPolarity_Rising,
2146 .TIM_ICSelection = TIM_ICSelection_DirectTI,
2147 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
2148 .TIM_ICFilter = 0x0,
2149 .TIM_Channel = TIM_Channel_3,
2152 .channels = &pios_tim_rcvrport_all_channels[3],
2158 #if defined(PIOS_INCLUDE_RCVR)
2162 #if defined(PIOS_INCLUDE_USB)
2168 .NVIC_IRQChannel = OTG_FS_IRQn,
2170 .NVIC_IRQChannelSubPriority = 0,
2171 .NVIC_IRQChannelCmd = ENABLE,
2177 .GPIO_Pin = GPIO_Pin_9,
2178 .GPIO_Speed = GPIO_Speed_25MHz,
2179 .GPIO_Mode = GPIO_Mode_IN,
2180 .GPIO_OType = GPIO_OType_OD,
2181 .GPIO_PuPd = GPIO_PuPd_UP,
2188 return &pios_usb_main_cfg;
2198 #if defined(PIOS_INCLUDE_COM_MSG)
2204 #if defined(PIOS_INCLUDE_USB_HID) && !defined(PIOS_INCLUDE_USB_CDC)
2214 #if defined(PIOS_INCLUDE_USB_HID) && defined(PIOS_INCLUDE_USB_CDC)
2228 const struct pios_usb_hid_cfg pios_usb_hid_cfg = {
2235 #if defined(PIOS_INCLUDE_ADC)
2239 void PIOS_ADC_DMA_irq_handler(
void);
2245 .flags = (DMA_FLAG_TCIF0 | DMA_FLAG_TEIF0 | DMA_FLAG_HTIF0),
2247 .NVIC_IRQChannel = DMA2_Stream0_IRQn,
2249 .NVIC_IRQChannelSubPriority = 0,
2250 .NVIC_IRQChannelCmd = ENABLE,
2254 .channel = DMA2_Stream0,
2256 .DMA_Channel = DMA_Channel_0,
2257 .DMA_PeripheralBaseAddr = (uint32_t)&ADC1->DR
2261 .half_flag = DMA_IT_HTIF0,
2262 .full_flag = DMA_IT_TCIF0,
2264 { GPIOA, GPIO_Pin_0, ADC_Channel_0 }, \
2265 { GPIOA, GPIO_Pin_1, ADC_Channel_1 }, \
2266 { NULL, 0, ADC_Channel_Vrefint }, \
2267 { NULL, 0, ADC_Channel_TempSensor }, \
2272 void PIOS_ADC_DMA_irq_handler(
void)
2284 #if defined(PIOS_INCLUDE_WS2811)
2296 .TIM_Prescaler = (PIOS_PERIPHERAL_APB2_COUNTER_CLOCK / 12000000) - 1,
2297 .TIM_ClockDivision = TIM_CKD_DIV1,
2298 .TIM_CounterMode = TIM_CounterMode_Up,
2302 .NVIC_IRQChannel = DMA2_Stream6_IRQn,
2304 .NVIC_IRQChannelSubPriority = 0,
2305 .NVIC_IRQChannelCmd = ENABLE,
2307 .bit_clear_dma_tcif = DMA_IT_TCIF6,
2311 .gpio_pin = GPIO_Pin_10,
2312 .bit_set_dma_stream = DMA2_Stream4,
2313 .bit_set_dma_channel = DMA_Channel_6,
2314 .bit_clear_dma_stream = DMA2_Stream6,
2315 .bit_clear_dma_channel = DMA_Channel_0,
2322 #if defined(PIOS_INCLUDE_MPU)
2330 .GPIO_Pin = GPIO_Pin_0,
2331 .GPIO_Speed = GPIO_Speed_100MHz,
2332 .GPIO_Mode = GPIO_Mode_IN,
2333 .GPIO_OType = GPIO_OType_OD,
2334 .GPIO_PuPd = GPIO_PuPd_NOPULL,
2339 .NVIC_IRQChannel = EXTI0_IRQn,
2341 .NVIC_IRQChannelSubPriority = 0,
2342 .NVIC_IRQChannelCmd = ENABLE,
2347 .EXTI_Line = EXTI_Line0,
2348 .EXTI_Mode = EXTI_Mode_Interrupt,
2349 .EXTI_Trigger = EXTI_Trigger_Rising,
2350 .EXTI_LineCmd = ENABLE,
2357 .default_samplerate = 1000,
2366 #if defined(PIOS_INCLUDE_HMC5883)
2368 static const struct pios_exti_cfg pios_exti_hmc5883_internal_cfg __exti_config = {
2374 .GPIO_Pin = GPIO_Pin_1,
2375 .GPIO_Speed = GPIO_Speed_100MHz,
2376 .GPIO_Mode = GPIO_Mode_IN,
2377 .GPIO_OType = GPIO_OType_OD,
2378 .GPIO_PuPd = GPIO_PuPd_NOPULL,
2383 .NVIC_IRQChannel = EXTI1_IRQn,
2385 .NVIC_IRQChannelSubPriority = 0,
2386 .NVIC_IRQChannelCmd = ENABLE,
2391 .EXTI_Line = EXTI_Line1,
2392 .EXTI_Mode = EXTI_Mode_Interrupt,
2393 .EXTI_Trigger = EXTI_Trigger_Rising,
2394 .EXTI_LineCmd = ENABLE,
2400 .
exti_cfg = &pios_exti_hmc5883_internal_cfg,
2412 #if defined(PIOS_INCLUDE_MS5611)
2416 .temperature_interleaving = 1,
uint8_t expect_manufacturer
const struct pios_exti_cfg * exti_cfg
#define I2C3_ER_IRQHandler
static const struct pios_tim_channel pios_tim_servoport_rcvrport_pins[]
static const TIM_TimeBaseInitTypeDef tim_10_11_time_base
#define PIOS_HMC5883_ODR_75
static const struct pios_tim_channel pios_tim_servoport_rcvrport_PPM_pins[]
const struct pios_flash_driver pios_jedec_flash_driver
#define I2C2_EV_IRQHandler
COM MSG private definitions.
APIs for PIOS_USBHOOK layer.
TIM_ICInitTypeDef tim_ic_init
static const struct pios_tim_clock_cfg tim_5_cfg
static const TIM_TimeBaseInitTypeDef tim_1_8_time_base
#define PIOS_HMC5883_MODE_CONTINUOUS
bool PIOS_HMC5883_IRQHandler()
#define PIOS_IRQ_PRIO_HIGHEST
#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
static const struct pios_tim_channel pios_tim_servoport_all_pins[]
#define PIOS_IRQ_PRIO_MID
Configuration structure for the MS5611 driver.
USART private definitions.
#define DMA2_Stream0_IRQHandler
Spektrum/JR DSMx satellite receiver private structures.
enum pios_ms5611_osr oversampling
#define I2C2_ER_IRQHandler
static const struct pios_tim_clock_cfg tim_1_cfg
#define FLASH_SECTOR_64KB
const struct pios_exti_cfg * exti_cfg
Driver for talking to most JEDEC flash chips.
#define PIOS_SERVO_UPDATE_HZ
struct pios_i2c_adapter * pios_i2c_t
const struct pios_annunc * annunciators
void PIOS_I2C_EV_IRQ_Handler(pios_i2c_t i2c_id)
#define PIOS_HMC5883_GAIN_1_9
ADC_TypeDef * adc_dev_master
#define I2C1_ER_IRQHandler
static const TIM_TimeBaseInitTypeDef tim_3_12_time_base
TIM_OCInitTypeDef tim_oc_init
USB COM HID private definitions.
#define I2C1_EV_IRQHandler
Servo private structures.
#define FLASH_SECTOR_16KB
static const TIM_TimeBaseInitTypeDef tim_2_5_time_base
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.
NVIC_InitTypeDef interrupt
static const struct pios_tim_clock_cfg tim_3_cfg
static const struct pios_tim_channel pios_tim_rcvrport_all_channels[]
#define PIOS_HMC5883_MEASCONF_NORMAL
void PIOS_RTC_irq_handler(void)
Futaba S.Bus Private structures.
void PIOS_WS2811_dma_interrupt_handler(ws2811_dev_t dev)
Handles a DMA completion interrupt on bit_clear_dma_stream.
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_clock_cfg tim_2_cfg
#define I2C3_EV_IRQHandler
#define PIOS_IRQ_PRIO_HIGH
USB COM CDC private definitions.
#define JEDEC_MANUFACTURER_MACRONIX
enum pios_flash_partition_labels label
static const struct pios_tim_clock_cfg tim_8_cfg
static const struct pios_tim_clock_cfg tim_10_cfg
#define PIOS_IRQ_PRIO_LOW
#define PIOS_Assert(test)
static const struct pios_tim_clock_cfg tim_12_cfg
static const struct pios_tim_clock_cfg tim_11_cfg
#define PIOS_ANNUNCIATOR_BUZZER
#define FLASH_SECTOR_128KB
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.