19 #if defined(USE_FULL_LL_DRIVER) 25 #ifdef USE_FULL_ASSERT 26 #include "stm32_assert.h" 28 #define assert_param(expr) ((void)0U) 35 #if defined (TIM1) || defined (TIM8) || defined (TIM2) || defined (TIM3) || defined (TIM4) || defined (TIM5) || defined (TIM15) || defined (TIM16) || defined (TIM17) || defined (TIM6) || defined (TIM7) 48 #define IS_LL_TIM_COUNTERMODE(__VALUE__) (((__VALUE__) == LL_TIM_COUNTERMODE_UP) \ 49 || ((__VALUE__) == LL_TIM_COUNTERMODE_DOWN) \ 50 || ((__VALUE__) == LL_TIM_COUNTERMODE_CENTER_UP) \ 51 || ((__VALUE__) == LL_TIM_COUNTERMODE_CENTER_DOWN) \ 52 || ((__VALUE__) == LL_TIM_COUNTERMODE_CENTER_UP_DOWN)) 54 #define IS_LL_TIM_CLOCKDIVISION(__VALUE__) (((__VALUE__) == LL_TIM_CLOCKDIVISION_DIV1) \ 55 || ((__VALUE__) == LL_TIM_CLOCKDIVISION_DIV2) \ 56 || ((__VALUE__) == LL_TIM_CLOCKDIVISION_DIV4)) 58 #define IS_LL_TIM_OCMODE(__VALUE__) (((__VALUE__) == LL_TIM_OCMODE_FROZEN) \ 59 || ((__VALUE__) == LL_TIM_OCMODE_ACTIVE) \ 60 || ((__VALUE__) == LL_TIM_OCMODE_INACTIVE) \ 61 || ((__VALUE__) == LL_TIM_OCMODE_TOGGLE) \ 62 || ((__VALUE__) == LL_TIM_OCMODE_FORCED_INACTIVE) \ 63 || ((__VALUE__) == LL_TIM_OCMODE_FORCED_ACTIVE) \ 64 || ((__VALUE__) == LL_TIM_OCMODE_PWM1) \ 65 || ((__VALUE__) == LL_TIM_OCMODE_PWM2) \ 66 || ((__VALUE__) == LL_TIM_OCMODE_RETRIG_OPM1) \ 67 || ((__VALUE__) == LL_TIM_OCMODE_RETRIG_OPM2) \ 68 || ((__VALUE__) == LL_TIM_OCMODE_COMBINED_PWM1) \ 69 || ((__VALUE__) == LL_TIM_OCMODE_COMBINED_PWM2) \ 70 || ((__VALUE__) == LL_TIM_OCMODE_ASSYMETRIC_PWM1) \ 71 || ((__VALUE__) == LL_TIM_OCMODE_ASSYMETRIC_PWM2)) 73 #define IS_LL_TIM_OCSTATE(__VALUE__) (((__VALUE__) == LL_TIM_OCSTATE_DISABLE) \ 74 || ((__VALUE__) == LL_TIM_OCSTATE_ENABLE)) 76 #define IS_LL_TIM_OCPOLARITY(__VALUE__) (((__VALUE__) == LL_TIM_OCPOLARITY_HIGH) \ 77 || ((__VALUE__) == LL_TIM_OCPOLARITY_LOW)) 79 #define IS_LL_TIM_OCIDLESTATE(__VALUE__) (((__VALUE__) == LL_TIM_OCIDLESTATE_LOW) \ 80 || ((__VALUE__) == LL_TIM_OCIDLESTATE_HIGH)) 82 #define IS_LL_TIM_ACTIVEINPUT(__VALUE__) (((__VALUE__) == LL_TIM_ACTIVEINPUT_DIRECTTI) \ 83 || ((__VALUE__) == LL_TIM_ACTIVEINPUT_INDIRECTTI) \ 84 || ((__VALUE__) == LL_TIM_ACTIVEINPUT_TRC)) 86 #define IS_LL_TIM_ICPSC(__VALUE__) (((__VALUE__) == LL_TIM_ICPSC_DIV1) \ 87 || ((__VALUE__) == LL_TIM_ICPSC_DIV2) \ 88 || ((__VALUE__) == LL_TIM_ICPSC_DIV4) \ 89 || ((__VALUE__) == LL_TIM_ICPSC_DIV8)) 91 #define IS_LL_TIM_IC_FILTER(__VALUE__) (((__VALUE__) == LL_TIM_IC_FILTER_FDIV1) \ 92 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV1_N2) \ 93 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV1_N4) \ 94 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV1_N8) \ 95 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV2_N6) \ 96 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV2_N8) \ 97 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV4_N6) \ 98 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV4_N8) \ 99 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV8_N6) \ 100 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV8_N8) \ 101 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV16_N5) \ 102 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV16_N6) \ 103 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV16_N8) \ 104 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV32_N5) \ 105 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV32_N6) \ 106 || ((__VALUE__) == LL_TIM_IC_FILTER_FDIV32_N8)) 108 #define IS_LL_TIM_IC_POLARITY(__VALUE__) (((__VALUE__) == LL_TIM_IC_POLARITY_RISING) \ 109 || ((__VALUE__) == LL_TIM_IC_POLARITY_FALLING) \ 110 || ((__VALUE__) == LL_TIM_IC_POLARITY_BOTHEDGE)) 112 #define IS_LL_TIM_ENCODERMODE(__VALUE__) (((__VALUE__) == LL_TIM_ENCODERMODE_X2_TI1) \ 113 || ((__VALUE__) == LL_TIM_ENCODERMODE_X2_TI2) \ 114 || ((__VALUE__) == LL_TIM_ENCODERMODE_X4_TI12)) 116 #define IS_LL_TIM_IC_POLARITY_ENCODER(__VALUE__) (((__VALUE__) == LL_TIM_IC_POLARITY_RISING) \ 117 || ((__VALUE__) == LL_TIM_IC_POLARITY_FALLING)) 119 #define IS_LL_TIM_OSSR_STATE(__VALUE__) (((__VALUE__) == LL_TIM_OSSR_DISABLE) \ 120 || ((__VALUE__) == LL_TIM_OSSR_ENABLE)) 122 #define IS_LL_TIM_OSSI_STATE(__VALUE__) (((__VALUE__) == LL_TIM_OSSI_DISABLE) \ 123 || ((__VALUE__) == LL_TIM_OSSI_ENABLE)) 125 #define IS_LL_TIM_LOCK_LEVEL(__VALUE__) (((__VALUE__) == LL_TIM_LOCKLEVEL_OFF) \ 126 || ((__VALUE__) == LL_TIM_LOCKLEVEL_1) \ 127 || ((__VALUE__) == LL_TIM_LOCKLEVEL_2) \ 128 || ((__VALUE__) == LL_TIM_LOCKLEVEL_3)) 130 #define IS_LL_TIM_BREAK_STATE(__VALUE__) (((__VALUE__) == LL_TIM_BREAK_DISABLE) \ 131 || ((__VALUE__) == LL_TIM_BREAK_ENABLE)) 133 #define IS_LL_TIM_BREAK_POLARITY(__VALUE__) (((__VALUE__) == LL_TIM_BREAK_POLARITY_LOW) \ 134 || ((__VALUE__) == LL_TIM_BREAK_POLARITY_HIGH)) 136 #define IS_LL_TIM_BREAK_FILTER(__VALUE__) (((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV1) \ 137 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV1_N2) \ 138 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV1_N4) \ 139 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV1_N8) \ 140 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV2_N6) \ 141 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV2_N8) \ 142 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV4_N6) \ 143 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV4_N8) \ 144 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV8_N6) \ 145 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV8_N8) \ 146 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV16_N5) \ 147 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV16_N6) \ 148 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV16_N8) \ 149 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV32_N5) \ 150 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV32_N6) \ 151 || ((__VALUE__) == LL_TIM_BREAK_FILTER_FDIV32_N8)) 153 #define IS_LL_TIM_BREAK2_STATE(__VALUE__) (((__VALUE__) == LL_TIM_BREAK2_DISABLE) \ 154 || ((__VALUE__) == LL_TIM_BREAK2_ENABLE)) 156 #define IS_LL_TIM_BREAK2_POLARITY(__VALUE__) (((__VALUE__) == LL_TIM_BREAK2_POLARITY_LOW) \ 157 || ((__VALUE__) == LL_TIM_BREAK2_POLARITY_HIGH)) 159 #define IS_LL_TIM_BREAK2_FILTER(__VALUE__) (((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV1) \ 160 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV1_N2) \ 161 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV1_N4) \ 162 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV1_N8) \ 163 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV2_N6) \ 164 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV2_N8) \ 165 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV4_N6) \ 166 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV4_N8) \ 167 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV8_N6) \ 168 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV8_N8) \ 169 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV16_N5) \ 170 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV16_N6) \ 171 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV16_N8) \ 172 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV32_N5) \ 173 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV32_N6) \ 174 || ((__VALUE__) == LL_TIM_BREAK2_FILTER_FDIV32_N8)) 176 #define IS_LL_TIM_AUTOMATIC_OUTPUT_STATE(__VALUE__) (((__VALUE__) == LL_TIM_AUTOMATICOUTPUT_DISABLE) \ 177 || ((__VALUE__) == LL_TIM_AUTOMATICOUTPUT_ENABLE)) 219 ErrorStatus result = SUCCESS;
229 else if (TIMx == TIM2)
235 else if (TIMx == TIM3)
242 else if (TIMx == TIM4)
249 else if (TIMx == TIM5)
255 else if (TIMx == TIM6)
261 else if (TIMx == TIM7)
268 else if (TIMx == TIM8)
274 else if (TIMx == TIM15)
279 else if (TIMx == TIM16)
285 else if (TIMx == TIM17)
308 TIM_InitStruct->
Prescaler = (uint16_t)0x0000;
309 TIM_InitStruct->
CounterMode = LL_TIM_COUNTERMODE_UP;
332 tmpcr1 = LL_TIM_ReadReg(TIMx, CR1);
334 if (IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx))
340 if (IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx))
347 LL_TIM_WriteReg(TIMx, CR1, tmpcr1);
355 if (IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx))
377 TIM_OC_InitStruct->
OCMode = LL_TIM_OCMODE_FROZEN;
378 TIM_OC_InitStruct->
OCState = LL_TIM_OCSTATE_DISABLE;
379 TIM_OC_InitStruct->
OCNState = LL_TIM_OCSTATE_DISABLE;
381 TIM_OC_InitStruct->
OCPolarity = LL_TIM_OCPOLARITY_HIGH;
382 TIM_OC_InitStruct->
OCNPolarity = LL_TIM_OCPOLARITY_HIGH;
383 TIM_OC_InitStruct->
OCIdleState = LL_TIM_OCIDLESTATE_LOW;
384 TIM_OC_InitStruct->
OCNIdleState = LL_TIM_OCIDLESTATE_LOW;
404 ErrorStatus result = ERROR;
408 case LL_TIM_CHANNEL_CH1:
409 result =
OC1Config(TIMx, TIM_OC_InitStruct);
411 case LL_TIM_CHANNEL_CH2:
412 result =
OC2Config(TIMx, TIM_OC_InitStruct);
414 case LL_TIM_CHANNEL_CH3:
415 result =
OC3Config(TIMx, TIM_OC_InitStruct);
417 case LL_TIM_CHANNEL_CH4:
418 result =
OC4Config(TIMx, TIM_OC_InitStruct);
420 case LL_TIM_CHANNEL_CH5:
421 result =
OC5Config(TIMx, TIM_OC_InitStruct);
423 case LL_TIM_CHANNEL_CH6:
424 result =
OC6Config(TIMx, TIM_OC_InitStruct);
442 TIM_ICInitStruct->
ICPolarity = LL_TIM_IC_POLARITY_RISING;
443 TIM_ICInitStruct->
ICActiveInput = LL_TIM_ACTIVEINPUT_DIRECTTI;
445 TIM_ICInitStruct->
ICFilter = LL_TIM_IC_FILTER_FDIV1;
463 ErrorStatus result = ERROR;
467 case LL_TIM_CHANNEL_CH1:
468 result =
IC1Config(TIMx, TIM_IC_InitStruct);
470 case LL_TIM_CHANNEL_CH2:
471 result =
IC2Config(TIMx, TIM_IC_InitStruct);
473 case LL_TIM_CHANNEL_CH3:
474 result =
IC3Config(TIMx, TIM_IC_InitStruct);
476 case LL_TIM_CHANNEL_CH4:
477 result =
IC4Config(TIMx, TIM_IC_InitStruct);
494 TIM_EncoderInitStruct->
EncoderMode = LL_TIM_ENCODERMODE_X2_TI1;
495 TIM_EncoderInitStruct->
IC1Polarity = LL_TIM_IC_POLARITY_RISING;
496 TIM_EncoderInitStruct->
IC1ActiveInput = LL_TIM_ACTIVEINPUT_DIRECTTI;
497 TIM_EncoderInitStruct->
IC1Prescaler = LL_TIM_ICPSC_DIV1;
498 TIM_EncoderInitStruct->
IC1Filter = LL_TIM_IC_FILTER_FDIV1;
499 TIM_EncoderInitStruct->
IC2Polarity = LL_TIM_IC_POLARITY_RISING;
500 TIM_EncoderInitStruct->
IC2ActiveInput = LL_TIM_ACTIVEINPUT_DIRECTTI;
501 TIM_EncoderInitStruct->
IC2Prescaler = LL_TIM_ICPSC_DIV1;
502 TIM_EncoderInitStruct->
IC2Filter = LL_TIM_IC_FILTER_FDIV1;
531 TIMx->CCER &= (uint32_t)~(TIM_CCER_CC1E | TIM_CCER_CC2E);
534 tmpccmr1 = LL_TIM_ReadReg(TIMx, CCMR1);
537 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
540 tmpccmr1 &= (uint32_t)~(TIM_CCMR1_CC1S | TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC);
541 tmpccmr1 |= (uint32_t)(TIM_EncoderInitStruct->
IC1ActiveInput >> 16U);
542 tmpccmr1 |= (uint32_t)(TIM_EncoderInitStruct->
IC1Filter >> 16U);
543 tmpccmr1 |= (uint32_t)(TIM_EncoderInitStruct->
IC1Prescaler >> 16U);
546 tmpccmr1 &= (uint32_t)~(TIM_CCMR1_CC2S | TIM_CCMR1_IC2F | TIM_CCMR1_IC2PSC);
547 tmpccmr1 |= (uint32_t)(TIM_EncoderInitStruct->
IC2ActiveInput >> 8U);
548 tmpccmr1 |= (uint32_t)(TIM_EncoderInitStruct->
IC2Filter >> 8U);
549 tmpccmr1 |= (uint32_t)(TIM_EncoderInitStruct->
IC2Prescaler >> 8U);
552 tmpccer &= (uint32_t)~(TIM_CCER_CC1P | TIM_CCER_CC1NP | TIM_CCER_CC2P | TIM_CCER_CC2NP);
553 tmpccer |= (uint32_t)(TIM_EncoderInitStruct->
IC1Polarity);
554 tmpccer |= (uint32_t)(TIM_EncoderInitStruct->
IC2Polarity << 4U);
555 tmpccer |= (uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E);
561 LL_TIM_WriteReg(TIMx, CCMR1, tmpccmr1);
564 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
578 TIM_HallSensorInitStruct->
IC1Polarity = LL_TIM_IC_POLARITY_RISING;
579 TIM_HallSensorInitStruct->
IC1Prescaler = LL_TIM_ICPSC_DIV1;
580 TIM_HallSensorInitStruct->
IC1Filter = LL_TIM_IC_FILTER_FDIV1;
612 assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(TIMx));
618 TIMx->CCER &= (uint32_t)~(TIM_CCER_CC1E | TIM_CCER_CC2E);
621 tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
624 tmpccmr1 = LL_TIM_ReadReg(TIMx, CCMR1);
627 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
630 tmpsmcr = LL_TIM_ReadReg(TIMx, SMCR);
633 tmpcr2 |= TIM_CR2_TI1S;
636 tmpcr2 |= LL_TIM_TRGO_OC2REF;
639 tmpsmcr &= (uint32_t)~(TIM_SMCR_TS | TIM_SMCR_SMS);
640 tmpsmcr |= LL_TIM_TS_TI1F_ED;
641 tmpsmcr |= LL_TIM_SLAVEMODE_RESET;
644 tmpccmr1 &= (uint32_t)~(TIM_CCMR1_CC1S | TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC);
645 tmpccmr1 |= (uint32_t)(LL_TIM_ACTIVEINPUT_TRC >> 16U);
646 tmpccmr1 |= (uint32_t)(TIM_HallSensorInitStruct->
IC1Filter >> 16U);
647 tmpccmr1 |= (uint32_t)(TIM_HallSensorInitStruct->
IC1Prescaler >> 16U);
650 tmpccmr1 &= (uint32_t)~(TIM_CCMR1_OC2M | TIM_CCMR1_OC2FE | TIM_CCMR1_OC2PE | TIM_CCMR1_OC2CE);
651 tmpccmr1 |= (uint32_t)(LL_TIM_OCMODE_PWM2 << 8U);
654 tmpccer &= (uint32_t)~(TIM_CCER_CC1P | TIM_CCER_CC1NP | TIM_CCER_CC2P | TIM_CCER_CC2NP);
655 tmpccer |= (uint32_t)(TIM_HallSensorInitStruct->
IC1Polarity);
656 tmpccer |= (uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E);
659 LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
662 LL_TIM_WriteReg(TIMx, SMCR, tmpsmcr);
665 LL_TIM_WriteReg(TIMx, CCMR1, tmpccmr1);
668 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
685 TIM_BDTRInitStruct->
OSSRState = LL_TIM_OSSR_DISABLE;
686 TIM_BDTRInitStruct->
OSSIState = LL_TIM_OSSI_DISABLE;
687 TIM_BDTRInitStruct->
LockLevel = LL_TIM_LOCKLEVEL_OFF;
688 TIM_BDTRInitStruct->
DeadTime = (uint8_t)0x00;
689 TIM_BDTRInitStruct->
BreakState = LL_TIM_BREAK_DISABLE;
690 TIM_BDTRInitStruct->
BreakPolarity = LL_TIM_BREAK_POLARITY_LOW;
691 TIM_BDTRInitStruct->
BreakFilter = LL_TIM_BREAK_FILTER_FDIV1;
692 TIM_BDTRInitStruct->
Break2State = LL_TIM_BREAK2_DISABLE;
694 TIM_BDTRInitStruct->
Break2Filter = LL_TIM_BREAK2_FILTER_FDIV1;
716 uint32_t tmpbdtr = 0;
739 if (IS_TIM_ADVANCED_INSTANCE(TIMx))
745 if (IS_TIM_BKIN2_INSTANCE(TIMx))
758 LL_TIM_WriteReg(TIMx, BDTR, tmpbdtr);
800 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
803 tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
806 tmpccmr1 = LL_TIM_ReadReg(TIMx, CCMR1);
820 if (IS_TIM_BREAK_INSTANCE(TIMx))
839 LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
842 LL_TIM_WriteReg(TIMx, CCMR1, tmpccmr1);
848 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
879 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
882 tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
885 tmpccmr1 = LL_TIM_ReadReg(TIMx, CCMR1);
899 if (IS_TIM_BREAK_INSTANCE(TIMx))
918 LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
921 LL_TIM_WriteReg(TIMx, CCMR1, tmpccmr1);
927 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
958 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
961 tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
964 tmpccmr2 = LL_TIM_ReadReg(TIMx, CCMR2);
978 if (IS_TIM_BREAK_INSTANCE(TIMx))
997 LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
1000 LL_TIM_WriteReg(TIMx, CCMR2, tmpccmr2);
1006 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1037 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
1040 tmpcr2 = LL_TIM_ReadReg(TIMx, CR2);
1043 tmpccmr2 = LL_TIM_ReadReg(TIMx, CCMR2);
1057 if (IS_TIM_BREAK_INSTANCE(TIMx))
1067 LL_TIM_WriteReg(TIMx, CR2, tmpcr2);
1070 LL_TIM_WriteReg(TIMx, CCMR2, tmpccmr2);
1076 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1106 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
1109 tmpccmr3 = LL_TIM_ReadReg(TIMx, CCMR3);
1120 if (IS_TIM_BREAK_INSTANCE(TIMx))
1131 LL_TIM_WriteReg(TIMx, CCMR3, tmpccmr3);
1137 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1167 tmpccer = LL_TIM_ReadReg(TIMx, CCER);
1170 tmpccmr3 = LL_TIM_ReadReg(TIMx, CCMR3);
1181 if (IS_TIM_BREAK_INSTANCE(TIMx))
1191 LL_TIM_WriteReg(TIMx, CCMR3, tmpccmr3);
1197 LL_TIM_WriteReg(TIMx, CCER, tmpccer);
1220 TIMx->CCER &= (uint32_t)~TIM_CCER_CC1E;
1224 (TIM_CCMR1_CC1S | TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC),
1229 (TIM_CCER_CC1P | TIM_CCER_CC1NP),
1230 (TIM_ICInitStruct->
ICPolarity | TIM_CCER_CC1E));
1253 TIMx->CCER &= (uint32_t)~TIM_CCER_CC2E;
1257 (TIM_CCMR1_CC2S | TIM_CCMR1_IC2F | TIM_CCMR1_IC2PSC),
1262 (TIM_CCER_CC2P | TIM_CCER_CC2NP),
1263 ((TIM_ICInitStruct->
ICPolarity << 4U) | TIM_CCER_CC2E));
1286 TIMx->CCER &= (uint32_t)~TIM_CCER_CC3E;
1290 (TIM_CCMR2_CC3S | TIM_CCMR2_IC3F | TIM_CCMR2_IC3PSC),
1295 (TIM_CCER_CC3P | TIM_CCER_CC3NP),
1296 ((TIM_ICInitStruct->
ICPolarity << 8U) | TIM_CCER_CC3E));
1319 TIMx->CCER &= (uint32_t)~TIM_CCER_CC4E;
1323 (TIM_CCMR2_CC4S | TIM_CCMR2_IC4F | TIM_CCMR2_IC4PSC),
1328 (TIM_CCER_CC4P | TIM_CCER_CC4NP),
1329 ((TIM_ICInitStruct->
ICPolarity << 12U) | TIM_CCER_CC4E));
static ErrorStatus IC2Config(TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
Configure the TIMx input channel 2.
uint8_t RepetitionCounter
static ErrorStatus OC1Config(TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
Configure the TIMx output channel 1.
__STATIC_INLINE void LL_TIM_GenerateEvent_UPDATE(TIM_TypeDef *TIMx)
Generate an update event. EGR UG LL_TIM_GenerateEvent_UPDATE.
ErrorStatus LL_TIM_ENCODER_Init(TIM_TypeDef *TIMx, LL_TIM_ENCODER_InitTypeDef *TIM_EncoderInitStruct)
Configure the encoder interface of the timer instance.
static ErrorStatus OC5Config(TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
Configure the TIMx output channel 5.
static ErrorStatus OC6Config(TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
Configure the TIMx output channel 6.
ErrorStatus LL_TIM_OC_Init(TIM_TypeDef *TIMx, uint32_t Channel, LL_TIM_OC_InitTypeDef *TIM_OC_InitStruct)
Configure the TIMx output channel.
static ErrorStatus IC4Config(TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
Configure the TIMx input channel 4.
static ErrorStatus OC4Config(TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
Configure the TIMx output channel 4.
__STATIC_INLINE void LL_TIM_OC_SetCompareCH3(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 3 (TIMx_CCR3).
__STATIC_INLINE void LL_APB2_GRP1_ReleaseReset(uint32_t Periphs)
Release APB2 peripherals reset. APB2RSTR SYSCFGRST LL_APB2_GRP1_ReleaseReset APB2RSTR SDMMC1RST LL_...
ErrorStatus LL_TIM_IC_Init(TIM_TypeDef *TIMx, uint32_t Channel, LL_TIM_IC_InitTypeDef *TIM_IC_InitStruct)
Configure the TIMx input channel.
BDTR (Break and Dead Time) structure definition.
TIM Time Base configuration structure definition.
__STATIC_INLINE void LL_TIM_SetEncoderMode(TIM_TypeDef *TIMx, uint32_t EncoderMode)
Set the encoder interface mode.
__STATIC_INLINE void LL_TIM_SetPrescaler(TIM_TypeDef *TIMx, uint32_t Prescaler)
Set the prescaler value.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
__STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs)
Release APB1 peripherals reset. APB1RSTR1 TIM2RST LL_APB1_GRP1_ReleaseReset APB1RSTR1 TIM3RST LL_AP...
static ErrorStatus IC1Config(TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
Configure the TIMx input channel 1.
__STATIC_INLINE void LL_TIM_SetRepetitionCounter(TIM_TypeDef *TIMx, uint32_t RepetitionCounter)
Set the repetition counter value.
void LL_TIM_HALLSENSOR_StructInit(LL_TIM_HALLSENSOR_InitTypeDef *TIM_HallSensorInitStruct)
Set the fields of the TIMx Hall sensor interface configuration data structure to their default values...
void LL_TIM_BDTR_StructInit(LL_TIM_BDTR_InitTypeDef *TIM_BDTRInitStruct)
Set the fields of the Break and Dead Time configuration data structure to their default values...
void LL_TIM_ENCODER_StructInit(LL_TIM_ENCODER_InitTypeDef *TIM_EncoderInitStruct)
Fills each TIM_EncoderInitStruct field with its default value.
__STATIC_INLINE void LL_TIM_SetAutoReload(TIM_TypeDef *TIMx, uint32_t AutoReload)
Set the auto-reload value.
__STATIC_INLINE void LL_APB2_GRP1_ForceReset(uint32_t Periphs)
Force APB2 peripherals reset. APB2RSTR SYSCFGRST LL_APB2_GRP1_ForceReset APB2RSTR SDMMC1RST LL_APB2...
TIM Encoder interface configuration structure definition.
uint32_t CommutationDelay
TIM Output Compare configuration structure definition.
Header file of BUS LL module.
static ErrorStatus IC3Config(TIM_TypeDef *TIMx, LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
Configure the TIMx input channel 3.
__STATIC_INLINE void LL_TIM_OC_SetCompareCH6(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 6 (TIMx_CCR6).
static ErrorStatus OC3Config(TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
Configure the TIMx output channel 3.
__STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs)
Force APB1 peripherals reset. APB1RSTR1 TIM2RST LL_APB1_GRP1_ForceReset APB1RSTR1 TIM3RST LL_APB1_G...
ErrorStatus LL_TIM_DeInit(TIM_TypeDef *TIMx)
Set TIMx registers to their reset values.
void LL_TIM_OC_StructInit(LL_TIM_OC_InitTypeDef *TIM_OC_InitStruct)
Set the fields of the TIMx output channel configuration data structure to their default values...
ErrorStatus LL_TIM_HALLSENSOR_Init(TIM_TypeDef *TIMx, LL_TIM_HALLSENSOR_InitTypeDef *TIM_HallSensorInitStruct)
Configure the Hall sensor interface of the timer instance.
void LL_TIM_IC_StructInit(LL_TIM_IC_InitTypeDef *TIM_ICInitStruct)
Set the fields of the TIMx input channel configuration data structure to their default values...
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
Header file of TIM LL module.
void LL_TIM_StructInit(LL_TIM_InitTypeDef *TIM_InitStruct)
Set the fields of the time base unit configuration data structure to their default values...
ErrorStatus LL_TIM_Init(TIM_TypeDef *TIMx, LL_TIM_InitTypeDef *TIM_InitStruct)
Configure the TIMx time base unit.
__STATIC_INLINE void LL_TIM_OC_SetCompareCH5(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 5 (TIMx_CCR5).
ErrorStatus LL_TIM_BDTR_Init(TIM_TypeDef *TIMx, LL_TIM_BDTR_InitTypeDef *TIM_BDTRInitStruct)
Configure the Break and Dead Time feature of the timer instance.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
TIM Hall sensor interface configuration structure definition.
__STATIC_INLINE void LL_TIM_OC_SetCompareCH2(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 2 (TIMx_CCR2).
static ErrorStatus OC2Config(TIM_TypeDef *TIMx, LL_TIM_OC_InitTypeDef *TIM_OCInitStruct)
Configure the TIMx output channel 2.
TIM Input Capture configuration structure definition.
__STATIC_INLINE void LL_TIM_OC_SetCompareCH4(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 4 (TIMx_CCR4).
__STATIC_INLINE void LL_TIM_OC_SetCompareCH1(TIM_TypeDef *TIMx, uint32_t CompareValue)
Set compare value for output channel 1 (TIMx_CCR1).