136 #define SMCR_ETR_MASK ((uint16_t)0x00FF) 137 #define CCMR_OFFSET ((uint16_t)0x0018) 138 #define CCER_CCE_SET ((uint16_t)0x0001) 139 #define CCER_CCNE_SET ((uint16_t)0x0004) 140 #define CCMR_OC13M_MASK ((uint32_t)0xFFFEFF8F) 141 #define CCMR_OC24M_MASK ((uint32_t)0xFEFF8FFF) 147 uint16_t TIM_ICFilter);
149 uint16_t TIM_ICFilter);
151 uint16_t TIM_ICFilter);
153 uint16_t TIM_ICFilter);
209 else if (TIMx ==
TIM2)
214 else if (TIMx ==
TIM3)
219 else if (TIMx ==
TIM4)
224 else if (TIMx ==
TIM6)
229 else if (TIMx ==
TIM7)
234 else if (TIMx ==
TIM8)
239 else if (TIMx ==
TIM15)
244 else if (TIMx ==
TIM16)
286 if((TIMx !=
TIM6) && (TIMx !=
TIM7))
322 TIM_TimeBaseInitStruct->
TIM_Period = 0xFFFFFFFF;
345 TIMx->
PSC = Prescaler;
347 TIMx->
EGR = TIM_PSCReloadMode;
376 tmpcr1 |= TIM_CounterMode;
409 TIMx->
ARR = Autoreload;
511 TIMx->
CR1 |= TIM_CR1_UIFREMAP;
516 TIMx->
CR1 &= (uint16_t)~TIM_CR1_UIFREMAP;
564 TIMx->
CR1 |= TIM_OPMode;
587 TIMx->
CR1 |= TIM_CKD;
678 uint32_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
690 tmpccer = TIMx->
CCER;
695 tmpccmrx = TIMx->
CCMR1;
739 TIMx->
CCMR1 = tmpccmrx;
745 TIMx->
CCER = tmpccer;
758 uint32_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
770 tmpccer = TIMx->
CCER;
775 tmpccmrx = TIMx->
CCMR1;
782 tmpccmrx |= (uint32_t)(TIM_OCInitStruct->
TIM_OCMode << 8);
787 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCPolarity << 4);
790 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OutputState << 4);
792 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
802 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCNPolarity << 4);
812 tmpcr2 |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCIdleState << 2);
820 TIMx->
CCMR1 = tmpccmrx;
826 TIMx->
CCER = tmpccer;
839 uint32_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
851 tmpccer = TIMx->
CCER;
856 tmpccmrx = TIMx->
CCMR2;
867 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCPolarity << 8);
870 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OutputState << 8);
872 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
882 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCNPolarity << 8);
892 tmpcr2 |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCIdleState << 4);
900 TIMx->
CCMR2 = tmpccmrx;
906 TIMx->
CCER = tmpccer;
919 uint32_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
931 tmpccer = TIMx->
CCER;
936 tmpccmrx = TIMx->
CCMR2;
943 tmpccmrx |= (uint32_t)(TIM_OCInitStruct->
TIM_OCMode << 8);
948 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCPolarity << 12);
951 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OutputState << 12);
953 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
959 tmpcr2 |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCIdleState << 6);
965 TIMx->
CCMR2 = tmpccmrx;
971 TIMx->
CCER = tmpccer;
984 uint32_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
993 TIMx->
CCER &= (uint32_t)~TIM_CCER_CC5E;
996 tmpccer = TIMx->
CCER;
1001 tmpccmrx = TIMx->CCMR3;
1004 tmpccmrx &= (uint32_t)~TIM_CCMR3_OC5M;
1007 tmpccmrx |= (uint32_t)(TIM_OCInitStruct->
TIM_OCMode);
1010 tmpccer &= (uint32_t)~TIM_CCER_CC5P;
1012 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCPolarity << 16);
1015 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OutputState << 16);
1017 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
1021 tmpcr2 &=(uint32_t) ~TIM_CR2_OIS5;
1023 tmpcr2 |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCIdleState << 16);
1029 TIMx->CCMR3 = tmpccmrx;
1032 TIMx->CCR5 = TIM_OCInitStruct->
TIM_Pulse;
1035 TIMx->
CCER = tmpccer;
1048 uint32_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
1057 TIMx->
CCER &= (uint32_t)~TIM_CCER_CC6E;
1060 tmpccer = TIMx->
CCER;
1065 tmpccmrx = TIMx->CCMR3;
1068 tmpccmrx &= (uint32_t)~TIM_CCMR3_OC6M;
1071 tmpccmrx |= (uint32_t)(TIM_OCInitStruct->
TIM_OCMode << 8);
1074 tmpccer &= (uint32_t)~TIM_CCER_CC6P;
1076 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OCPolarity << 20);
1079 tmpccer |= (uint32_t)((uint32_t)TIM_OCInitStruct->
TIM_OutputState << 20);
1081 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
1085 tmpcr2 &=(uint32_t) ~TIM_CR2_OIS6;
1093 TIMx->CCMR3 = tmpccmrx;
1096 TIMx->CCR6 = TIM_OCInitStruct->
TIM_Pulse;
1099 TIMx->
CCER = tmpccer;
1119 TIMx->CCR5 |= TIM_CCR5_GC5C1;
1124 TIMx->CCR5 &= (uint32_t)~TIM_CCR5_GC5C1;
1145 TIMx->CCR5 |= TIM_CCR5_GC5C2;
1150 TIMx->CCR5 &= (uint32_t)~TIM_CCR5_GC5C2;
1172 TIMx->CCR5 |= TIM_CCR5_GC5C3;
1177 TIMx->CCR5 &= (uint32_t)~TIM_CCR5_GC5C3;
1193 TIM_OCInitStruct->
TIM_Pulse = 0x00000000;
1239 tmp = (uint32_t) TIMx;
1245 TIMx->
CCER &= (uint16_t) ~tmp1;
1249 tmp += (TIM_Channel>>1);
1255 *(
__IO uint32_t *) tmp |= TIM_OCMode;
1259 tmp += (uint32_t)(TIM_Channel - (uint32_t)4)>> (uint32_t)1;
1265 *(
__IO uint32_t *) tmp |= (uint32_t)(TIM_OCMode << 8);
1281 TIMx->
CCR1 = Compare1;
1297 TIMx->
CCR2 = Compare2;
1312 TIMx->
CCR3 = Compare3;
1327 TIMx->
CCR4 = Compare4;
1342 TIMx->CCR5 = Compare5;
1357 TIMx->CCR6 = Compare6;
1371 uint32_t tmpccmr1 = 0;
1376 tmpccmr1 = TIMx->
CCMR1;
1382 tmpccmr1 |= TIM_ForcedAction;
1385 TIMx->
CCMR1 = tmpccmr1;
1400 uint32_t tmpccmr1 = 0;
1405 tmpccmr1 = TIMx->
CCMR1;
1411 tmpccmr1 |= ((uint32_t)TIM_ForcedAction << 8);
1414 TIMx->
CCMR1 = tmpccmr1;
1428 uint32_t tmpccmr2 = 0;
1434 tmpccmr2 = TIMx->
CCMR2;
1440 tmpccmr2 |= TIM_ForcedAction;
1443 TIMx->
CCMR2 = tmpccmr2;
1457 uint32_t tmpccmr2 = 0;
1462 tmpccmr2 = TIMx->
CCMR2;
1468 tmpccmr2 |= ((uint32_t)TIM_ForcedAction << 8);
1471 TIMx->
CCMR2 = tmpccmr2;
1485 uint32_t tmpccmr3 = 0;
1490 tmpccmr3 = TIMx->CCMR3;
1493 tmpccmr3 &= (uint32_t)~TIM_CCMR3_OC5M;
1496 tmpccmr3 |= (uint32_t)(TIM_ForcedAction);
1499 TIMx->CCMR3 = tmpccmr3;
1513 uint32_t tmpccmr3 = 0;
1518 tmpccmr3 = TIMx->CCMR3;
1521 tmpccmr3 &= (uint32_t)~TIM_CCMR3_OC6M;
1524 tmpccmr3 |= ((uint32_t)TIM_ForcedAction << 8);
1527 TIMx->CCMR3 = tmpccmr3;
1541 uint32_t tmpccmr1 = 0;
1547 tmpccmr1 = TIMx->
CCMR1;
1553 tmpccmr1 |= TIM_OCPreload;
1556 TIMx->
CCMR1 = tmpccmr1;
1571 uint32_t tmpccmr1 = 0;
1577 tmpccmr1 = TIMx->
CCMR1;
1583 tmpccmr1 |= ((uint32_t)TIM_OCPreload << 8);
1586 TIMx->
CCMR1 = tmpccmr1;
1600 uint32_t tmpccmr2 = 0;
1606 tmpccmr2 = TIMx->
CCMR2;
1612 tmpccmr2 |= TIM_OCPreload;
1615 TIMx->
CCMR2 = tmpccmr2;
1629 uint32_t tmpccmr2 = 0;
1635 tmpccmr2 = TIMx->
CCMR2;
1641 tmpccmr2 |= ((uint32_t)TIM_OCPreload << 8);
1644 TIMx->
CCMR2 = tmpccmr2;
1658 uint32_t tmpccmr3 = 0;
1664 tmpccmr3 = TIMx->CCMR3;
1667 tmpccmr3 &= (uint32_t)(~TIM_CCMR3_OC5PE);
1670 tmpccmr3 |= (uint32_t)(TIM_OCPreload);
1673 TIMx->CCMR3 = tmpccmr3;
1687 uint32_t tmpccmr3 = 0;
1693 tmpccmr3 = TIMx->CCMR3;
1696 tmpccmr3 &= (uint32_t)(~TIM_CCMR3_OC6PE);
1699 tmpccmr3 |= ((uint32_t)TIM_OCPreload << 8);
1702 TIMx->CCMR3 = tmpccmr3;
1716 uint32_t tmpccmr1 = 0;
1723 tmpccmr1 = TIMx->
CCMR1;
1729 tmpccmr1 |= TIM_OCFast;
1732 TIMx->
CCMR1 = tmpccmr1;
1747 uint32_t tmpccmr1 = 0;
1754 tmpccmr1 = TIMx->
CCMR1;
1760 tmpccmr1 |= ((uint32_t)TIM_OCFast << 8);
1763 TIMx->
CCMR1 = tmpccmr1;
1777 uint32_t tmpccmr2 = 0;
1784 tmpccmr2 = TIMx->
CCMR2;
1790 tmpccmr2 |= TIM_OCFast;
1793 TIMx->
CCMR2 = tmpccmr2;
1807 uint32_t tmpccmr2 = 0;
1814 tmpccmr2 = TIMx->
CCMR2;
1820 tmpccmr2 |= ((uint32_t)TIM_OCFast << 8);
1823 TIMx->
CCMR2 = tmpccmr2;
1837 uint32_t tmpccmr1 = 0;
1843 tmpccmr1 = TIMx->
CCMR1;
1849 tmpccmr1 |= TIM_OCClear;
1852 TIMx->
CCMR1 = tmpccmr1;
1867 uint32_t tmpccmr1 = 0;
1873 tmpccmr1 = TIMx->
CCMR1;
1879 tmpccmr1 |= ((uint32_t)TIM_OCClear << 8);
1882 TIMx->
CCMR1 = tmpccmr1;
1896 uint32_t tmpccmr2 = 0;
1902 tmpccmr2 = TIMx->
CCMR2;
1908 tmpccmr2 |= TIM_OCClear;
1911 TIMx->
CCMR2 = tmpccmr2;
1925 uint32_t tmpccmr2 = 0;
1931 tmpccmr2 = TIMx->
CCMR2;
1937 tmpccmr2 |= ((uint32_t)TIM_OCClear << 8);
1940 TIMx->
CCMR2 = tmpccmr2;
1954 uint32_t tmpccmr3 = 0;
1960 tmpccmr3 = TIMx->CCMR3;
1963 tmpccmr3 &= (uint32_t)~TIM_CCMR3_OC5CE;
1966 tmpccmr3 |= (uint32_t)(TIM_OCClear);
1969 TIMx->CCMR3 = tmpccmr3;
1983 uint32_t tmpccmr3 = 0;
1989 tmpccmr3 = TIMx->CCMR3;
1992 tmpccmr3 &= (uint32_t)~TIM_CCMR3_OC6CE;
1995 tmpccmr3 |= ((uint32_t)TIM_OCClear << 8);
1998 TIMx->CCMR3 = tmpccmr3;
2017 TIMx->
SMCR &= (uint16_t)~((uint16_t)TIM_SMCR_OCCS);
2018 TIMx->
SMCR |= TIM_OCReferenceClear;
2032 uint32_t tmpccer = 0;
2038 tmpccer = TIMx->
CCER;
2042 tmpccer |= TIM_OCPolarity;
2045 TIMx->
CCER = tmpccer;
2059 uint32_t tmpccer = 0;
2064 tmpccer = TIMx->
CCER;
2068 tmpccer |= TIM_OCNPolarity;
2071 TIMx->
CCER = tmpccer;
2086 uint32_t tmpccer = 0;
2092 tmpccer = TIMx->
CCER;
2096 tmpccer |= ((uint32_t)TIM_OCPolarity << 4);
2099 TIMx->
CCER = tmpccer;
2113 uint32_t tmpccer = 0;
2119 tmpccer = TIMx->
CCER;
2123 tmpccer |= ((uint32_t)TIM_OCNPolarity << 4);
2126 TIMx->
CCER = tmpccer;
2140 uint32_t tmpccer = 0;
2146 tmpccer = TIMx->
CCER;
2150 tmpccer |= ((uint32_t)TIM_OCPolarity << 8);
2153 TIMx->
CCER = tmpccer;
2167 uint32_t tmpccer = 0;
2173 tmpccer = TIMx->
CCER;
2177 tmpccer |= ((uint32_t)TIM_OCNPolarity << 8);
2180 TIMx->
CCER = tmpccer;
2194 uint32_t tmpccer = 0;
2200 tmpccer = TIMx->
CCER;
2204 tmpccer |= ((uint32_t)TIM_OCPolarity << 12);
2207 TIMx->
CCER = tmpccer;
2221 uint32_t tmpccer = 0;
2227 tmpccer = TIMx->
CCER;
2230 tmpccer &= (uint32_t)~TIM_CCER_CC5P;
2231 tmpccer |= ((uint32_t)TIM_OCPolarity << 16);
2234 TIMx->
CCER = tmpccer;
2248 uint32_t tmpccer = 0;
2254 tmpccer = TIMx->
CCER;
2257 tmpccer &= (uint32_t)~TIM_CCER_CC6P;
2258 tmpccer |= ((uint32_t)TIM_OCPolarity << 20);
2261 TIMx->
CCER = tmpccer;
2291 TIMx->
CCER &= (uint32_t)(~tmp);
2294 TIMx->
CCER |= ((uint32_t)TIM_CCx << (uint32_t)TIM_Channel);
2321 TIMx->
CCER &= (uint32_t) ~tmp;
2324 TIMx->
CCER |= ((uint32_t)TIM_CCxN << (uint32_t)TIM_Channel);
2593 TIMx->
CCMR1 |= TIM_ICPSC;
2618 TIMx->
CCMR1 |= (uint32_t)((uint32_t)TIM_ICPSC << 8);
2642 TIMx->
CCMR2 |= TIM_ICPSC;
2666 TIMx->
CCMR2 |= (uint16_t)(TIM_ICPSC << 8);
2747 TIMx->
BDTR |= TIM_Break1Polarity |((uint32_t)TIM_Break1Filter << 16);
2768 TIMx->
BDTR &= (uint32_t)~ (TIM_BDTR_BK2P | TIM_BDTR_BK2F);
2771 TIMx->
BDTR |= TIM_Break2Polarity |((uint32_t)TIM_Break2Filter << 20);
2815 TIMx->
BDTR |= TIM_BDTR_BK2E;
2820 TIMx->
BDTR &= (uint32_t)~TIM_BDTR_BK2E;
2966 TIMx->
DIER |= TIM_IT;
2971 TIMx->
DIER &= (uint16_t)~TIM_IT;
3001 TIMx->
EGR = TIM_EventSource;
3037 if ((TIMx->
SR & TIM_FLAG) !=
RESET)
3079 TIMx->
SR = (uint16_t)~TIM_FLAG;
3104 uint16_t itstatus = 0x0, itenable = 0x0;
3109 itstatus = TIMx->
SR & TIM_IT;
3111 itenable = TIMx->
DIER & TIM_IT;
3112 if ((itstatus != (uint16_t)
RESET) && (itenable != (uint16_t)RESET))
3148 TIMx->
SR = (uint16_t)~TIM_IT;
3187 TIMx->
DCR = TIM_DMABase | TIM_DMABurstLength;
3216 TIMx->
DIER |= TIM_DMASource;
3221 TIMx->
DIER &= (uint16_t)~TIM_DMASource;
3323 uint16_t TIM_ICPolarity, uint16_t ICFilter)
3363 uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
3365 uint16_t tmpsmcr = 0;
3373 TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter);
3376 tmpsmcr = TIMx->
SMCR;
3389 TIMx->
SMCR = tmpsmcr;
3410 uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
3419 TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter);
3478 uint16_t tmpsmcr = 0;
3485 tmpsmcr = TIMx->
SMCR;
3491 tmpsmcr |= TIM_InputTriggerSource;
3494 TIMx->
SMCR = tmpsmcr;
3528 TIMx->
CR2 |= TIM_TRGOSource;
3564 TIMx->
CR2 &= (uint32_t)~TIM_CR2_MMS2;
3566 TIMx->
CR2 |= TIM_TRGO2Source;
3594 TIMx->
SMCR |= (uint32_t)TIM_SlaveMode;
3617 TIMx->
SMCR |= TIM_MasterSlaveMode;
3638 uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
3640 uint16_t tmpsmcr = 0;
3648 tmpsmcr = TIMx->
SMCR;
3654 tmpsmcr |= (uint16_t)(TIM_ExtTRGPrescaler | (uint16_t)(TIM_ExtTRGPolarity | (uint16_t)(ExtTRGFilter << (uint16_t)8)));
3657 TIMx->
SMCR = tmpsmcr;
3696 uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity)
3698 uint16_t tmpsmcr = 0;
3699 uint16_t tmpccmr1 = 0;
3700 uint16_t tmpccer = 0;
3709 tmpsmcr = TIMx->
SMCR;
3712 tmpccmr1 = TIMx->
CCMR1;
3715 tmpccer = TIMx->
CCER;
3719 tmpsmcr |= TIM_EncoderMode;
3727 tmpccer |= (uint16_t)(TIM_IC1Polarity | (uint16_t)(TIM_IC2Polarity << (uint16_t)4));
3730 TIMx->
SMCR = tmpsmcr;
3733 TIMx->
CCMR1 = tmpccmr1;
3736 TIMx->
CCER = tmpccer;
3810 TIMx->
OR = TIM_Remap;
3835 uint16_t TIM_ICFilter)
3837 uint32_t tmpccmr1 = 0, tmpccer = 0;
3841 tmpccmr1 = TIMx->
CCMR1;
3842 tmpccer = TIMx->
CCER;
3846 tmpccmr1 |= (uint32_t)(TIM_ICSelection | (uint32_t)((uint32_t)TIM_ICFilter << 4));
3850 tmpccer |= (uint32_t)(TIM_ICPolarity | (uint32_t)
TIM_CCER_CC1E);
3853 TIMx->
CCMR1 = tmpccmr1;
3854 TIMx->
CCER = tmpccer;
3876 uint16_t TIM_ICFilter)
3878 uint32_t tmpccmr1 = 0, tmpccer = 0, tmp = 0;
3882 tmpccmr1 = TIMx->
CCMR1;
3883 tmpccer = TIMx->
CCER;
3884 tmp = (uint16_t)(TIM_ICPolarity << 4);
3888 tmpccmr1 |= (uint32_t)((uint32_t)TIM_ICFilter << 12);
3889 tmpccmr1 |= (uint32_t)((uint32_t)TIM_ICSelection << 8);
3896 TIMx->
CCMR1 = tmpccmr1 ;
3897 TIMx->
CCER = tmpccer;
3918 uint16_t TIM_ICFilter)
3920 uint16_t tmpccmr2 = 0, tmpccer = 0, tmp = 0;
3924 tmpccmr2 = TIMx->
CCMR2;
3925 tmpccer = TIMx->
CCER;
3926 tmp = (uint16_t)(TIM_ICPolarity << 8);
3930 tmpccmr2 |= (uint16_t)(TIM_ICSelection | (uint16_t)(TIM_ICFilter << (uint16_t)4));
3937 TIMx->
CCMR2 = tmpccmr2;
3938 TIMx->
CCER = tmpccer;
3959 uint16_t TIM_ICFilter)
3961 uint16_t tmpccmr2 = 0, tmpccer = 0, tmp = 0;
3965 tmpccmr2 = TIMx->
CCMR2;
3966 tmpccer = TIMx->
CCER;
3967 tmp = (uint16_t)(TIM_ICPolarity << 12);
3971 tmpccmr2 |= (uint16_t)(TIM_ICSelection << 8);
3972 tmpccmr2 |= (uint16_t)(TIM_ICFilter << 12);
3979 TIMx->
CCMR2 = tmpccmr2;
3980 TIMx->
CCER = tmpccer ;
#define TIM_OCREFERENCECECLEAR_SOURCE(SOURCE)
void TIM_SelectGC5C3(TIM_TypeDef *TIMx, FunctionalState NewState)
Selects the TIM Group Channel 5 and Channel 3, OC3REFC is the logical AND of OC3REFC and OC5REF...
#define IS_TIM_COUNTER_MODE(MODE)
void TIM_SelectHallSensor(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the TIMx's Hall sensor interface.
void TIM_Break1Cmd(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the TIM Break1 input.
void TIM_SelectOutputTrigger2(TIM_TypeDef *TIMx, uint32_t TIM_TRGO2Source)
Selects the TIMx Trigger Output Mode2 (TRGO2).
#define IS_TIM_CKD_DIV(DIV)
#define TIM_PSCReloadMode_Immediate
#define IS_TIM_OC_MODE(MODE)
#define RCC_APB2Periph_TIM17
uint16_t TIM_OutputNState
uint32_t TIM_GetCapture3(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 3 value.
#define IS_TIM_EVENT_SOURCE(SOURCE)
#define IS_TIM_SLAVE_MODE(MODE)
#define RCC_APB1Periph_TIM7
void TIM_SetIC3Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 3 prescaler.
#define IS_TIM_LIST3_PERIPH(PERIPH)
#define TIM_OSSIState_Disable
#define TIM_AutomaticOutput_Disable
void TIM_OC4Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel4 according to the specified parameters in the TIM_OCInitStruct.
void TIM_SetCompare5(TIM_TypeDef *TIMx, uint32_t Compare5)
Sets the TIMx Capture Compare5 Register value.
#define IS_TIM_BREAK1_FILTER(FILTER)
#define TIM_LOCKLevel_OFF
static void TI1_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI1 as Input.
void TIM_ICInit(TIM_TypeDef *TIMx, TIM_ICInitTypeDef *TIM_ICInitStruct)
Initializes the TIM peripheral according to the specified parameters in the TIM_ICInitStruct.
#define IS_TIM_TRGO_SOURCE(SOURCE)
void TIM_ForcedOC1Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 1 waveform to active or inactive level.
void TIM_ClearOC4Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF4 signal on an external event.
#define IS_TIM_EXT_POLARITY(POLARITY)
uint32_t TIM_GetCapture1(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 1 value.
void TIM_ITRxExternalClockConfig(TIM_TypeDef *TIMx, uint16_t TIM_InputTriggerSource)
Configures the TIMx Internal Trigger as External Clock.
void TIM_TimeBaseInit(TIM_TypeDef *TIMx, TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
Initializes the TIMx Time Base Unit peripheral according to the specified parameters in the TIM_TimeB...
void TIM_OC4PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR4.
void TIM_SetCompare1(TIM_TypeDef *TIMx, uint32_t Compare1)
Sets the TIMx Capture Compare1 Register value.
void TIM_CCxCmd(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx)
Enables or disables the TIM Capture Compare Channel x.
void TIM_OC6PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 6 polarity.
void TIM_SetCounter(TIM_TypeDef *TIMx, uint32_t Counter)
Sets the TIMx Counter Register value.
void TIM_DMAConfig(TIM_TypeDef *TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength)
Configures the TIMx's DMA interface.
void TIM_ForcedOC2Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 2 waveform to active or inactive level.
void TIM_SelectMasterSlaveMode(TIM_TypeDef *TIMx, uint16_t TIM_MasterSlaveMode)
Sets or Resets the TIMx Master/Slave Mode.
void TIM_SelectInputTrigger(TIM_TypeDef *TIMx, uint16_t TIM_InputTriggerSource)
Selects the Input Trigger source.
#define IS_TIM_OUTPUTN_STATE(STATE)
void TIM_CCPreloadControl(TIM_TypeDef *TIMx, FunctionalState NewState)
Sets or Resets the TIM peripheral Capture Compare Preload Control bit.
void TIM_Break2Config(TIM_TypeDef *TIMx, uint32_t TIM_Break2Polarity, uint8_t TIM_Break2Filter)
Configures the Break2 feature.
#define TIM_OCNIdleState_Reset
void TIM_RemapConfig(TIM_TypeDef *TIMx, uint16_t TIM_Remap)
Configures the TIM16 Remapping input Capabilities.
#define TIM_OutputNState_Disable
#define IS_TIM_PRESCALER_RELOAD(RELOAD)
uint16_t TIM_AutomaticOutput
void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
Fills each TIM_TimeBaseInitStruct member with its default value.
#define IS_TIM_GET_IT(IT)
#define IS_TIM_BREAK2_FILTER(FILTER)
void TIM_DeInit(TIM_TypeDef *TIMx)
Deinitializes the TIMx peripheral registers to their default reset values.
#define IS_TIM_UPDATE_SOURCE(SOURCE)
#define TIM_SlaveMode_External1
ITStatus TIM_GetITStatus(TIM_TypeDef *TIMx, uint16_t TIM_IT)
Checks whether the TIM interrupt has occurred or not.
void TIM_ETRClockMode1Config(TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
Configures the External clock Mode1.
#define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE)
void TIM_SetClockDivision(TIM_TypeDef *TIMx, uint16_t TIM_CKD)
Sets the TIMx Clock Division value.
#define IS_TIM_ENCODER_MODE(MODE)
void assert_param(int val)
#define IS_TIM_OCFAST_STATE(STATE)
void TIM_OC4FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 4 Fast feature.
void TIM_SelectOutputTrigger(TIM_TypeDef *TIMx, uint16_t TIM_TRGOSource)
Selects the TIMx Trigger Output Mode.
FlagStatus TIM_GetFlagStatus(TIM_TypeDef *TIMx, uint32_t TIM_FLAG)
Checks whether the specified TIM flag is set or not.
#define IS_TIM_GET_FLAG(FLAG)
#define IS_FUNCTIONAL_STATE(STATE)
#define RCC_APB2Periph_TIM16
void TIM_SelectOCREFClear(TIM_TypeDef *TIMx, uint16_t TIM_OCReferenceClear)
Selects the OCReference Clear source.
#define RCC_APB1Periph_TIM2
void TIM_BDTRStructInit(TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
Fills each TIM_BDTRInitStruct member with its default value.
#define IS_TIM_BREAK_POLARITY(POLARITY)
uint32_t TIM_GetCapture2(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 2 value.
#define RCC_APB2Periph_TIM15
void TIM_OC1NPolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
Configures the TIMx Channel 1N polarity.
#define IS_TIM_OSSI_STATE(STATE)
#define RCC_APB2Periph_TIM1
void TIM_ForcedOC4Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 4 waveform to active or inactive level.
void TIM_GenerateEvent(TIM_TypeDef *TIMx, uint16_t TIM_EventSource)
Configures the TIMx event to be generate by software.
#define IS_TIM_COMPLEMENTARY_CHANNEL(CHANNEL)
void TIM_PWMIConfig(TIM_TypeDef *TIMx, TIM_ICInitTypeDef *TIM_ICInitStruct)
Configures the TIM peripheral according to the specified parameters in the TIM_ICInitStruct to measur...
#define TIM_OSSRState_Disable
#define IS_TIM_TRGO2_SOURCE(SOURCE)
void TIM_OC2PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 2 polarity.
#define IS_TIM_LIST1_PERIPH(PERIPH)
void TIM_ClearOC2Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF2 signal on an external event.
void TIM_CounterModeConfig(TIM_TypeDef *TIMx, uint16_t TIM_CounterMode)
Specifies the TIMx Counter Mode to be used.
#define IS_TIM_LOCK_LEVEL(LEVEL)
void TIM_SetCompare6(TIM_TypeDef *TIMx, uint32_t Compare6)
Sets the TIMx Capture Compare6 Register value.
void TIM_Cmd(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the specified TIM peripheral.
void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
Forces or releases Low Speed APB (APB1) peripheral reset.
void TIM_SetCompare3(TIM_TypeDef *TIMx, uint32_t Compare3)
Sets the TIMx Capture Compare3 Register value.
void TIM_OC6Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel6 according to the specified parameters in the TIM_OCInitStruct.
This file contains all the functions prototypes for the RCC firmware library.
#define TIM_TIxExternalCLK1Source_TI2
uint16_t TIM_GetPrescaler(TIM_TypeDef *TIMx)
Gets the TIMx Prescaler value.
void TIM_SetCompare4(TIM_TypeDef *TIMx, uint32_t Compare4)
Sets the TIMx Capture Compare4 Register value.
#define RCC_APB1Periph_TIM3
#define IS_TIM_REMAP(TIM_REMAP)
static void TI2_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI2 as Input.
#define IS_TIM_OSSR_STATE(STATE)
void TIM_ClearOC1Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF1 signal on an external event.
void TIM_SetIC4Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 4 prescaler.
void TIM_OC1FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 1 Fast feature.
#define IS_TIM_LIST2_PERIPH(PERIPH)
void TIM_UIFRemap(TIM_TypeDef *TIMx, FunctionalState NewState)
Sets or resets the update interrupt flag (UIF)status bit Remapping. when sets, reading TIMx_CNT regis...
This file contains all the functions prototypes for the TIM firmware library.
#define IS_TIM_CHANNEL(CHANNEL)
void TIM_ARRPreloadConfig(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables TIMx peripheral Preload register on ARR.
void TIM_OC3NPolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
Configures the TIMx Channel 3N polarity.
uint32_t TIM_GetCapture4(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 4 value.
#define RCC_APB1Periph_TIM4
void TIM_CtrlPWMOutputs(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the TIM peripheral Main Outputs.
#define IS_TIM_EXT_FILTER(EXTFILTER)
void TIM_SelectCOM(TIM_TypeDef *TIMx, FunctionalState NewState)
Selects the TIM peripheral Commutation event.
static void TI3_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI3 as Input.
void TIM_Break2Cmd(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the TIM Break2 input.
#define IS_TIM_OCCLEAR_STATE(STATE)
void TIM_ICStructInit(TIM_ICInitTypeDef *TIM_ICInitStruct)
Fills each TIM_ICInitStruct member with its default value.
void TIM_SelectGC5C2(TIM_TypeDef *TIMx, FunctionalState NewState)
Selects the TIM Group Channel 5 and Channel 2, OC2REFC is the logical AND of OC2REFC and OC5REF...
uint16_t TIM_ClockDivision
void TIM_ClearOC3Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF3 signal on an external event.
#define IS_TIM_CCXN(CCXN)
#define IS_TIM_DMA_SOURCE(SOURCE)
uint8_t TIM_RepetitionCounter
void TIM_ETRClockMode2Config(TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
Configures the External clock Mode2.
void TIM_Break1Config(TIM_TypeDef *TIMx, uint32_t TIM_Break1Polarity, uint8_t TIM_Break1Filter)
Configures the Break1 feature.
void TIM_ClearOC5Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF5 signal on an external event.
void TIM_OC1PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR1.
#define IS_TIM_DMA_LENGTH(LENGTH)
void TIM_UpdateRequestConfig(TIM_TypeDef *TIMx, uint16_t TIM_UpdateSource)
Configures the TIMx Update Request Interrupt source.
#define IS_TIM_ALL_PERIPH(PERIPH)
TIM Time Base Init structure definition.
void TIM_SelectCCDMA(TIM_TypeDef *TIMx, FunctionalState NewState)
Selects the TIMx peripheral Capture Compare DMA source.
#define TIM_OutputState_Disable
void TIM_UpdateDisableConfig(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or Disables the TIMx Update event.
#define TIM_OCMode_Timing
void TIM_ITConfig(TIM_TypeDef *TIMx, uint16_t TIM_IT, FunctionalState NewState)
Enables or disables the specified TIM interrupts.
void TIM_SetIC1Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 1 prescaler.
void TIM_SetCompare2(TIM_TypeDef *TIMx, uint32_t Compare2)
Sets the TIMx Capture Compare2 Register value.
void TIM_PrescalerConfig(TIM_TypeDef *TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode)
Configures the TIMx Prescaler.
void TIM_EncoderInterfaceConfig(TIM_TypeDef *TIMx, uint16_t TIM_EncoderMode, uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity)
Configures the TIMx Encoder Interface.
#define IS_TIM_LIST7_PERIPH(PERIPH)
void TIM_OC3FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 3 Fast feature.
TIM Input Capture Init structure definition.
void TIM_OC6PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR6.
void TIM_OC2Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel2 according to the specified parameters in the TIM_OCInitStruct.
uint16_t TIM_BreakPolarity
void TIM_OC2PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR2.
void TIM_SelectOCxM(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint32_t TIM_OCMode)
Selects the TIM Output Compare Mode.
void TIM_OC5PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR5.
void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
Forces or releases High Speed APB (APB2) peripheral reset.
void TIM_OC1Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel1 according to the specified parameters in the TIM_OCInitStruct.
void TIM_TIxExternalClockConfig(TIM_TypeDef *TIMx, uint16_t TIM_TIxExternalCLKSource, uint16_t TIM_ICPolarity, uint16_t ICFilter)
Configures the TIMx Trigger as External Clock.
void TIM_OC3Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel3 according to the specified parameters in the TIM_OCInitStruct.
void TIM_OC3PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 3 polarity.
void TIM_ForcedOC6Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 6 waveform to active or inactive level.
void TIM_ClearFlag(TIM_TypeDef *TIMx, uint16_t TIM_FLAG)
Clears the TIMx's pending flags.
#define IS_TIM_OCNIDLE_STATE(STATE)
uint16_t TIM_OCNIdleState
#define IS_TIM_TRIGGER_SELECTION(SELECTION)
void TIM_OC2NPolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
Configures the TIMx Channel 2N polarity.
#define TIM_OCPolarity_High
void TIM_CCxNCmd(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN)
Enables or disables the TIM Capture Compare Channel xN.
#define RCC_APB1Periph_TIM6
void TIM_ForcedOC5Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 5 waveform to active or inactive level.
#define TIM_BreakPolarity_Low
void TIM_OC4PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 4 polarity.
void TIM_ETRConfig(TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
Configures the TIMx External Trigger (ETR).
void TIM_OC3PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR3.
#define IS_TIM_LIST4_PERIPH(PERIPH)
void TIM_OC5Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel5 according to the specified parameters in the TIM_OCInitStruct.
void TIM_SelectSlaveMode(TIM_TypeDef *TIMx, uint32_t TIM_SlaveMode)
Selects the TIMx Slave Mode.
void TIM_SetAutoreload(TIM_TypeDef *TIMx, uint32_t Autoreload)
Sets the TIMx Autoreload Register value.
#define TIM_OCIdleState_Reset
#define TIM_UpdateSource_Global
#define IS_TIM_LIST6_PERIPH(TIMx)
void TIM_OC1PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 1 polarity.
#define IS_TIM_OC_POLARITY(POLARITY)
#define IS_TIM_OUTPUT_STATE(STATE)
#define IS_TIM_DMA_BASE(BASE)
void TIM_ClearOC6Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF6 signal on an external event.
void TIM_InternalClockConfig(TIM_TypeDef *TIMx)
Configures the TIMx internal Clock.
void TIM_OC5PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 5 polarity.
void TIM_ForcedOC3Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 3 waveform to active or inactive level.
TIM Output Compare Init structure definition.
void TIM_OCStructInit(TIM_OCInitTypeDef *TIM_OCInitStruct)
Fills each TIM_OCInitStruct member with its default value.
void TIM_OC2FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 2 Fast feature.
#define IS_TIM_MSM_STATE(STATE)
BDTR structure definition.
void TIM_SelectGC5C1(TIM_TypeDef *TIMx, FunctionalState NewState)
Selects the TIM Group Channel 5 and Channel 1, OC1REFC is the logical AND of OC1REFC and OC5REF...
#define IS_TIM_OCIDLE_STATE(STATE)
#define IS_TIM_INTERNAL_TRIGGER_SELECTION(SELECTION)
#define TIM_CounterMode_Up
#define IS_TIM_OPM_MODE(MODE)
void TIM_BDTRConfig(TIM_TypeDef *TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
Configures the Break feature, dead time, Lock level, OSSI/OSSR State and the AOE(automatic output ena...
#define RCC_APB2Periph_TIM8
void TIM_ClearITPendingBit(TIM_TypeDef *TIMx, uint16_t TIM_IT)
Clears the TIMx's interrupt pending bits.
static void TI4_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI4 as Input.
#define IS_TIM_OCPRELOAD_STATE(STATE)
uint32_t TIM_GetCounter(TIM_TypeDef *TIMx)
Gets the TIMx Counter value.
#define IS_TIM_OCN_POLARITY(POLARITY)
#define IS_TIM_FORCED_ACTION(ACTION)
#define IS_TIM_EXT_PRESCALER(PRESCALER)
void TIM_SetIC2Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 2 prescaler.
#define IS_TIM_LIST8_PERIPH(PERIPH)
void TIM_SelectOnePulseMode(TIM_TypeDef *TIMx, uint16_t TIM_OPMode)
Selects the TIMx's One Pulse Mode.
void TIM_DMACmd(TIM_TypeDef *TIMx, uint16_t TIM_DMASource, FunctionalState NewState)
Enables or disables the TIMx's DMA Requests.