187 #include "stm32h7xx_hal.h"
198 #ifdef HAL_TIM_MODULE_ENABLED
213 static void TIM_TI1_ConfigInputStage(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter);
214 static void TIM_TI2_SetConfig(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection,
215 uint32_t TIM_ICFilter);
216 static void TIM_TI2_ConfigInputStage(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter);
217 static void TIM_TI3_SetConfig(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection,
218 uint32_t TIM_ICFilter);
219 static void TIM_TI4_SetConfig(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection,
220 uint32_t TIM_ICFilter);
221 static void TIM_ITRx_SetConfig(
TIM_TypeDef *TIMx, uint32_t InputTriggerSource);
288 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
290 TIM_ResetCallback(htim);
292 if (htim->Base_MspInitCallback ==
NULL)
297 htim->Base_MspInitCallback(htim);
338 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
339 if (htim->Base_MspDeInitCallback ==
NULL)
344 htim->Base_MspDeInitCallback(htim);
542 if ((pData ==
NULL) && (Length > 0U))
670 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
672 TIM_ResetCallback(htim);
674 if (htim->OC_MspInitCallback ==
NULL)
679 htim->OC_MspInitCallback(htim);
720 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
721 if (htim->OC_MspDeInitCallback ==
NULL)
726 htim->OC_MspDeInitCallback(htim);
1055 if ((pData ==
NULL) && (Length > 0U))
1311 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
1313 TIM_ResetCallback(htim);
1315 if (htim->PWM_MspInitCallback ==
NULL)
1320 htim->PWM_MspInitCallback(htim);
1361 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
1362 if (htim->PWM_MspDeInitCallback ==
NULL)
1367 htim->PWM_MspDeInitCallback(htim);
1695 if ((pData ==
NULL) && (Length > 0U))
1950 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
1952 TIM_ResetCallback(htim);
1954 if (htim->IC_MspInitCallback ==
NULL)
1959 htim->IC_MspInitCallback(htim);
2000 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2001 if (htim->IC_MspDeInitCallback ==
NULL)
2006 htim->IC_MspDeInitCallback(htim);
2321 if ((pData ==
NULL) && (Length > 0U))
2573 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2575 TIM_ResetCallback(htim);
2577 if (htim->OnePulse_MspInitCallback ==
NULL)
2582 htim->OnePulse_MspInitCallback(htim);
2631 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2632 if (htim->OnePulse_MspDeInitCallback ==
NULL)
2637 htim->OnePulse_MspDeInitCallback(htim);
2975 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2977 TIM_ResetCallback(htim);
2979 if (htim->Encoder_MspInitCallback ==
NULL)
2984 htim->Encoder_MspInitCallback(htim);
3067 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3068 if (htim->Encoder_MspDeInitCallback ==
NULL)
3073 htim->Encoder_MspDeInitCallback(htim);
3457 uint32_t *pData2, uint16_t Length)
3478 if ((pData1 ==
NULL) && (Length > 0U))
3503 if ((pData2 ==
NULL) && (Length > 0U))
3532 if ((((pData1 ==
NULL) || (pData2 ==
NULL))) && (Length > 0U))
3755 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3756 htim->IC_CaptureCallback(htim);
3764 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3765 htim->OC_DelayElapsedCallback(htim);
3766 htim->PWM_PulseFinishedCallback(htim);
3786 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3787 htim->IC_CaptureCallback(htim);
3795 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3796 htim->OC_DelayElapsedCallback(htim);
3797 htim->PWM_PulseFinishedCallback(htim);
3816 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3817 htim->IC_CaptureCallback(htim);
3825 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3826 htim->OC_DelayElapsedCallback(htim);
3827 htim->PWM_PulseFinishedCallback(htim);
3846 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3847 htim->IC_CaptureCallback(htim);
3855 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3856 htim->OC_DelayElapsedCallback(htim);
3857 htim->PWM_PulseFinishedCallback(htim);
3872 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3873 htim->PeriodElapsedCallback(htim);
3885 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3886 htim->BreakCallback(htim);
3898 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3899 htim->Break2Callback(htim);
3911 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3912 htim->TriggerCallback(htim);
3924 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
3925 htim->CommutationCallback(htim);
3991 TIM_OC1_SetConfig(htim->
Instance, sConfig);
4011 TIM_OC3_SetConfig(htim->
Instance, sConfig);
4021 TIM_OC4_SetConfig(htim->
Instance, sConfig);
4031 TIM_OC5_SetConfig(htim->
Instance, sConfig);
4041 TIM_OC6_SetConfig(htim->
Instance, sConfig);
4183 TIM_OC1_SetConfig(htim->
Instance, sConfig);
4217 TIM_OC3_SetConfig(htim->
Instance, sConfig);
4234 TIM_OC4_SetConfig(htim->
Instance, sConfig);
4251 TIM_OC5_SetConfig(htim->
Instance, sConfig);
4268 TIM_OC6_SetConfig(htim->
Instance, sConfig);
4308 uint32_t OutputChannel, uint32_t InputChannel)
4316 if (OutputChannel != InputChannel)
4331 switch (OutputChannel)
4337 TIM_OC1_SetConfig(htim->
Instance, &temp1);
4351 switch (InputChannel)
4454 uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength)
4457 ((BurstLength) >> 8U) + 1U);
4507 uint32_t BurstRequestSrc, uint32_t *BurstBuffer,
4508 uint32_t BurstLength, uint32_t DataLength)
4523 if ((BurstBuffer ==
NULL) && (BurstLength > 0U))
4536 switch (BurstRequestSrc)
4669 htim->
Instance->
DCR = (BurstBaseAddress | BurstLength);
4689 switch (BurstRequestSrc)
4786 uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength)
4789 ((BurstLength) >> 8U) + 1U);
4839 uint32_t BurstRequestSrc, uint32_t *BurstBuffer,
4840 uint32_t BurstLength, uint32_t DataLength)
4855 if ((BurstBuffer ==
NULL) && (BurstLength > 0U))
4868 switch (BurstRequestSrc)
5001 htim->
Instance->
DCR = (BurstBaseAddress | BurstLength);
5022 switch (BurstRequestSrc)
5364 TIM_TI1_ConfigInputStage(htim->
Instance,
5380 TIM_TI2_ConfigInputStage(htim->
Instance,
5396 TIM_TI1_ConfigInputStage(htim->
Instance,
5457 tmpcr2 |= TI1_Selection;
5485 if (TIM_SlaveTimer_SetConfig(htim, sSlaveConfig) !=
HAL_OK)
5526 if (TIM_SlaveTimer_SetConfig(htim, sSlaveConfig) !=
HAL_OK)
5559 uint32_t tmpreg = 0U;
5786 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
5824 pTIM_CallbackTypeDef pCallback)
5828 if (pCallback ==
NULL)
5839 case HAL_TIM_BASE_MSPINIT_CB_ID :
5840 htim->Base_MspInitCallback = pCallback;
5843 case HAL_TIM_BASE_MSPDEINIT_CB_ID :
5844 htim->Base_MspDeInitCallback = pCallback;
5847 case HAL_TIM_IC_MSPINIT_CB_ID :
5848 htim->IC_MspInitCallback = pCallback;
5851 case HAL_TIM_IC_MSPDEINIT_CB_ID :
5852 htim->IC_MspDeInitCallback = pCallback;
5855 case HAL_TIM_OC_MSPINIT_CB_ID :
5856 htim->OC_MspInitCallback = pCallback;
5859 case HAL_TIM_OC_MSPDEINIT_CB_ID :
5860 htim->OC_MspDeInitCallback = pCallback;
5863 case HAL_TIM_PWM_MSPINIT_CB_ID :
5864 htim->PWM_MspInitCallback = pCallback;
5867 case HAL_TIM_PWM_MSPDEINIT_CB_ID :
5868 htim->PWM_MspDeInitCallback = pCallback;
5871 case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID :
5872 htim->OnePulse_MspInitCallback = pCallback;
5875 case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID :
5876 htim->OnePulse_MspDeInitCallback = pCallback;
5879 case HAL_TIM_ENCODER_MSPINIT_CB_ID :
5880 htim->Encoder_MspInitCallback = pCallback;
5883 case HAL_TIM_ENCODER_MSPDEINIT_CB_ID :
5884 htim->Encoder_MspDeInitCallback = pCallback;
5887 case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID :
5888 htim->HallSensor_MspInitCallback = pCallback;
5891 case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID :
5892 htim->HallSensor_MspDeInitCallback = pCallback;
5895 case HAL_TIM_PERIOD_ELAPSED_CB_ID :
5896 htim->PeriodElapsedCallback = pCallback;
5899 case HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID :
5900 htim->PeriodElapsedHalfCpltCallback = pCallback;
5903 case HAL_TIM_TRIGGER_CB_ID :
5904 htim->TriggerCallback = pCallback;
5907 case HAL_TIM_TRIGGER_HALF_CB_ID :
5908 htim->TriggerHalfCpltCallback = pCallback;
5911 case HAL_TIM_IC_CAPTURE_CB_ID :
5912 htim->IC_CaptureCallback = pCallback;
5915 case HAL_TIM_IC_CAPTURE_HALF_CB_ID :
5916 htim->IC_CaptureHalfCpltCallback = pCallback;
5919 case HAL_TIM_OC_DELAY_ELAPSED_CB_ID :
5920 htim->OC_DelayElapsedCallback = pCallback;
5923 case HAL_TIM_PWM_PULSE_FINISHED_CB_ID :
5924 htim->PWM_PulseFinishedCallback = pCallback;
5927 case HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID :
5928 htim->PWM_PulseFinishedHalfCpltCallback = pCallback;
5931 case HAL_TIM_ERROR_CB_ID :
5932 htim->ErrorCallback = pCallback;
5935 case HAL_TIM_COMMUTATION_CB_ID :
5936 htim->CommutationCallback = pCallback;
5939 case HAL_TIM_COMMUTATION_HALF_CB_ID :
5940 htim->CommutationHalfCpltCallback = pCallback;
5943 case HAL_TIM_BREAK_CB_ID :
5944 htim->BreakCallback = pCallback;
5947 case HAL_TIM_BREAK2_CB_ID :
5948 htim->Break2Callback = pCallback;
5961 case HAL_TIM_BASE_MSPINIT_CB_ID :
5962 htim->Base_MspInitCallback = pCallback;
5965 case HAL_TIM_BASE_MSPDEINIT_CB_ID :
5966 htim->Base_MspDeInitCallback = pCallback;
5969 case HAL_TIM_IC_MSPINIT_CB_ID :
5970 htim->IC_MspInitCallback = pCallback;
5973 case HAL_TIM_IC_MSPDEINIT_CB_ID :
5974 htim->IC_MspDeInitCallback = pCallback;
5977 case HAL_TIM_OC_MSPINIT_CB_ID :
5978 htim->OC_MspInitCallback = pCallback;
5981 case HAL_TIM_OC_MSPDEINIT_CB_ID :
5982 htim->OC_MspDeInitCallback = pCallback;
5985 case HAL_TIM_PWM_MSPINIT_CB_ID :
5986 htim->PWM_MspInitCallback = pCallback;
5989 case HAL_TIM_PWM_MSPDEINIT_CB_ID :
5990 htim->PWM_MspDeInitCallback = pCallback;
5993 case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID :
5994 htim->OnePulse_MspInitCallback = pCallback;
5997 case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID :
5998 htim->OnePulse_MspDeInitCallback = pCallback;
6001 case HAL_TIM_ENCODER_MSPINIT_CB_ID :
6002 htim->Encoder_MspInitCallback = pCallback;
6005 case HAL_TIM_ENCODER_MSPDEINIT_CB_ID :
6006 htim->Encoder_MspDeInitCallback = pCallback;
6009 case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID :
6010 htim->HallSensor_MspInitCallback = pCallback;
6013 case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID :
6014 htim->HallSensor_MspDeInitCallback = pCallback;
6082 case HAL_TIM_BASE_MSPINIT_CB_ID :
6086 case HAL_TIM_BASE_MSPDEINIT_CB_ID :
6090 case HAL_TIM_IC_MSPINIT_CB_ID :
6094 case HAL_TIM_IC_MSPDEINIT_CB_ID :
6098 case HAL_TIM_OC_MSPINIT_CB_ID :
6102 case HAL_TIM_OC_MSPDEINIT_CB_ID :
6106 case HAL_TIM_PWM_MSPINIT_CB_ID :
6110 case HAL_TIM_PWM_MSPDEINIT_CB_ID :
6114 case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID :
6118 case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID :
6122 case HAL_TIM_ENCODER_MSPINIT_CB_ID :
6126 case HAL_TIM_ENCODER_MSPDEINIT_CB_ID :
6130 case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID :
6134 case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID :
6138 case HAL_TIM_PERIOD_ELAPSED_CB_ID :
6142 case HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID :
6146 case HAL_TIM_TRIGGER_CB_ID :
6150 case HAL_TIM_TRIGGER_HALF_CB_ID :
6154 case HAL_TIM_IC_CAPTURE_CB_ID :
6158 case HAL_TIM_IC_CAPTURE_HALF_CB_ID :
6162 case HAL_TIM_OC_DELAY_ELAPSED_CB_ID :
6166 case HAL_TIM_PWM_PULSE_FINISHED_CB_ID :
6170 case HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID :
6174 case HAL_TIM_ERROR_CB_ID :
6178 case HAL_TIM_COMMUTATION_CB_ID :
6182 case HAL_TIM_COMMUTATION_HALF_CB_ID :
6186 case HAL_TIM_BREAK_CB_ID :
6190 case HAL_TIM_BREAK2_CB_ID :
6204 case HAL_TIM_BASE_MSPINIT_CB_ID :
6208 case HAL_TIM_BASE_MSPDEINIT_CB_ID :
6212 case HAL_TIM_IC_MSPINIT_CB_ID :
6216 case HAL_TIM_IC_MSPDEINIT_CB_ID :
6220 case HAL_TIM_OC_MSPINIT_CB_ID :
6224 case HAL_TIM_OC_MSPDEINIT_CB_ID :
6228 case HAL_TIM_PWM_MSPINIT_CB_ID :
6232 case HAL_TIM_PWM_MSPDEINIT_CB_ID :
6236 case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID :
6240 case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID :
6244 case HAL_TIM_ENCODER_MSPINIT_CB_ID :
6248 case HAL_TIM_ENCODER_MSPDEINIT_CB_ID :
6252 case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID :
6256 case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID :
6390 return channel_state;
6452 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6453 htim->ErrorCallback(htim);
6511 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6512 htim->PWM_PulseFinishedCallback(htim);
6550 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6551 htim->PWM_PulseFinishedHalfCpltCallback(htim);
6613 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6614 htim->IC_CaptureCallback(htim);
6652 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6653 htim->IC_CaptureHalfCpltCallback(htim);
6675 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6676 htim->PeriodElapsedCallback(htim);
6691 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6692 htim->PeriodElapsedHalfCpltCallback(htim);
6712 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6713 htim->TriggerCallback(htim);
6728 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
6729 htim->TriggerHalfCpltCallback(htim);
6767 TIMx->
ARR = (uint32_t)Structure->
Period ;
6799 tmpccer = TIMx->
CCER;
6804 tmpccmrx = TIMx->
CCMR1;
6810 tmpccmrx |= OC_Config->
OCMode;
6849 TIMx->
CCMR1 = tmpccmrx;
6855 TIMx->
CCER = tmpccer;
6874 tmpccer = TIMx->
CCER;
6879 tmpccmrx = TIMx->
CCMR1;
6886 tmpccmrx |= (OC_Config->
OCMode << 8U);
6925 TIMx->
CCMR1 = tmpccmrx;
6931 TIMx->
CCER = tmpccer;
6950 tmpccer = TIMx->
CCER;
6955 tmpccmrx = TIMx->
CCMR2;
6961 tmpccmrx |= OC_Config->
OCMode;
6999 TIMx->
CCMR2 = tmpccmrx;
7005 TIMx->
CCER = tmpccer;
7024 tmpccer = TIMx->
CCER;
7029 tmpccmrx = TIMx->
CCMR2;
7036 tmpccmrx |= (OC_Config->
OCMode << 8U);
7059 TIMx->
CCMR2 = tmpccmrx;
7065 TIMx->
CCER = tmpccer;
7085 tmpccer = TIMx->
CCER;
7089 tmpccmrx = TIMx->
CCMR3;
7094 tmpccmrx |= OC_Config->
OCMode;
7112 TIMx->
CCMR3 = tmpccmrx;
7118 TIMx->
CCER = tmpccer;
7138 tmpccer = TIMx->
CCER;
7142 tmpccmrx = TIMx->
CCMR3;
7147 tmpccmrx |= (OC_Config->
OCMode << 8U);
7166 TIMx->
CCMR3 = tmpccmrx;
7172 TIMx->
CCER = tmpccer;
7256 TIM_TI1_ConfigInputStage(htim->
Instance,
7270 TIM_TI2_ConfigInputStage(htim->
Instance,
7323 uint32_t TIM_ICFilter)
7330 tmpccmr1 = TIMx->
CCMR1;
7331 tmpccer = TIMx->
CCER;
7337 tmpccmr1 |= TIM_ICSelection;
7353 TIMx->
CCMR1 = tmpccmr1;
7354 TIMx->
CCER = tmpccer;
7369 static void TIM_TI1_ConfigInputStage(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter)
7375 tmpccer = TIMx->
CCER;
7377 tmpccmr1 = TIMx->
CCMR1;
7381 tmpccmr1 |= (TIM_ICFilter << 4U);
7385 tmpccer |= TIM_ICPolarity;
7388 TIMx->
CCMR1 = tmpccmr1;
7389 TIMx->
CCER = tmpccer;
7412 static void TIM_TI2_SetConfig(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection,
7413 uint32_t TIM_ICFilter)
7420 tmpccmr1 = TIMx->
CCMR1;
7421 tmpccer = TIMx->
CCER;
7425 tmpccmr1 |= (TIM_ICSelection << 8U);
7436 TIMx->
CCMR1 = tmpccmr1 ;
7437 TIMx->
CCER = tmpccer;
7452 static void TIM_TI2_ConfigInputStage(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter)
7459 tmpccmr1 = TIMx->
CCMR1;
7460 tmpccer = TIMx->
CCER;
7464 tmpccmr1 |= (TIM_ICFilter << 12U);
7468 tmpccer |= (TIM_ICPolarity << 4U);
7471 TIMx->
CCMR1 = tmpccmr1 ;
7472 TIMx->
CCER = tmpccer;
7495 static void TIM_TI3_SetConfig(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection,
7496 uint32_t TIM_ICFilter)
7503 tmpccmr2 = TIMx->
CCMR2;
7504 tmpccer = TIMx->
CCER;
7508 tmpccmr2 |= TIM_ICSelection;
7519 TIMx->
CCMR2 = tmpccmr2;
7520 TIMx->
CCER = tmpccer;
7543 static void TIM_TI4_SetConfig(
TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection,
7544 uint32_t TIM_ICFilter)
7551 tmpccmr2 = TIMx->
CCMR2;
7552 tmpccer = TIMx->
CCER;
7556 tmpccmr2 |= (TIM_ICSelection << 8U);
7567 TIMx->
CCMR2 = tmpccmr2;
7568 TIMx->
CCER = tmpccer ;
7599 static void TIM_ITRx_SetConfig(
TIM_TypeDef *TIMx, uint32_t InputTriggerSource)
7604 tmpsmcr = TIMx->
SMCR;
7610 TIMx->
SMCR = tmpsmcr;
7630 uint32_t TIM_ExtTRGPolarity, uint32_t ExtTRGFilter)
7634 tmpsmcr = TIMx->
SMCR;
7640 tmpsmcr |= (uint32_t)(TIM_ExtTRGPrescaler | (TIM_ExtTRGPolarity | (ExtTRGFilter << 8U)));
7643 TIMx->
SMCR = tmpsmcr;
7675 TIMx->
CCER |= (uint32_t)(ChannelState << (Channel & 0x1FU));
7678 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)