21 #ifndef STM32F7xx_HAL_TIM_H
22 #define STM32F7xx_HAL_TIM_H
59 uint32_t ClockDivision;
62 uint32_t RepetitionCounter;
71 uint32_t AutoReloadPreload;
102 uint32_t OCNIdleState;
121 uint32_t OCNPolarity;
125 uint32_t OCIdleState;
129 uint32_t OCNIdleState;
136 uint32_t ICSelection;
151 uint32_t ICSelection;
154 uint32_t ICPrescaler;
166 uint32_t EncoderMode;
169 uint32_t IC1Polarity;
172 uint32_t IC1Selection;
175 uint32_t IC1Prescaler;
181 uint32_t IC2Polarity;
184 uint32_t IC2Selection;
187 uint32_t IC2Prescaler;
199 uint32_t ClockSource;
201 uint32_t ClockPolarity;
203 uint32_t ClockPrescaler;
205 uint32_t ClockFilter;
214 uint32_t ClearInputState;
216 uint32_t ClearInputSource;
218 uint32_t ClearInputPolarity;
220 uint32_t ClearInputPrescaler;
222 uint32_t ClearInputFilter;
233 uint32_t MasterOutputTrigger;
237 uint32_t MasterSlaveMode;
253 uint32_t InputTrigger;
255 uint32_t TriggerPolarity;
257 uint32_t TriggerPrescaler;
259 uint32_t TriggerFilter;
271 uint32_t OffStateRunMode;
273 uint32_t OffStateIDLEMode;
281 uint32_t BreakPolarity;
283 uint32_t BreakFilter;
291 uint32_t AutomaticOutput;
324 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
325 typedef struct __TIM_HandleTypeDef
338 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
339 void (* Base_MspInitCallback)(
struct __TIM_HandleTypeDef *htim);
340 void (* Base_MspDeInitCallback)(
struct __TIM_HandleTypeDef *htim);
341 void (* IC_MspInitCallback)(
struct __TIM_HandleTypeDef *htim);
342 void (* IC_MspDeInitCallback)(
struct __TIM_HandleTypeDef *htim);
343 void (* OC_MspInitCallback)(
struct __TIM_HandleTypeDef *htim);
344 void (* OC_MspDeInitCallback)(
struct __TIM_HandleTypeDef *htim);
345 void (* PWM_MspInitCallback)(
struct __TIM_HandleTypeDef *htim);
346 void (* PWM_MspDeInitCallback)(
struct __TIM_HandleTypeDef *htim);
347 void (* OnePulse_MspInitCallback)(
struct __TIM_HandleTypeDef *htim);
348 void (* OnePulse_MspDeInitCallback)(
struct __TIM_HandleTypeDef *htim);
349 void (* Encoder_MspInitCallback)(
struct __TIM_HandleTypeDef *htim);
350 void (* Encoder_MspDeInitCallback)(
struct __TIM_HandleTypeDef *htim);
351 void (* HallSensor_MspInitCallback)(
struct __TIM_HandleTypeDef *htim);
352 void (* HallSensor_MspDeInitCallback)(
struct __TIM_HandleTypeDef *htim);
353 void (* PeriodElapsedCallback)(
struct __TIM_HandleTypeDef *htim);
354 void (* PeriodElapsedHalfCpltCallback)(
struct __TIM_HandleTypeDef *htim);
355 void (* TriggerCallback)(
struct __TIM_HandleTypeDef *htim);
356 void (* TriggerHalfCpltCallback)(
struct __TIM_HandleTypeDef *htim);
357 void (* IC_CaptureCallback)(
struct __TIM_HandleTypeDef *htim);
358 void (* IC_CaptureHalfCpltCallback)(
struct __TIM_HandleTypeDef *htim);
359 void (* OC_DelayElapsedCallback)(
struct __TIM_HandleTypeDef *htim);
360 void (* PWM_PulseFinishedCallback)(
struct __TIM_HandleTypeDef *htim);
361 void (* PWM_PulseFinishedHalfCpltCallback)(
struct __TIM_HandleTypeDef *htim);
362 void (* ErrorCallback)(
struct __TIM_HandleTypeDef *htim);
363 void (* CommutationCallback)(
struct __TIM_HandleTypeDef *htim);
364 void (* CommutationHalfCpltCallback)(
struct __TIM_HandleTypeDef *htim);
365 void (* BreakCallback)(
struct __TIM_HandleTypeDef *htim);
366 void (* Break2Callback)(
struct __TIM_HandleTypeDef *htim);
370 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
376 HAL_TIM_BASE_MSPINIT_CB_ID = 0x00U
377 ,HAL_TIM_BASE_MSPDEINIT_CB_ID = 0x01U
378 ,HAL_TIM_IC_MSPINIT_CB_ID = 0x02U
379 ,HAL_TIM_IC_MSPDEINIT_CB_ID = 0x03U
380 ,HAL_TIM_OC_MSPINIT_CB_ID = 0x04U
381 ,HAL_TIM_OC_MSPDEINIT_CB_ID = 0x05U
382 ,HAL_TIM_PWM_MSPINIT_CB_ID = 0x06U
383 ,HAL_TIM_PWM_MSPDEINIT_CB_ID = 0x07U
384 ,HAL_TIM_ONE_PULSE_MSPINIT_CB_ID = 0x08U
385 ,HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID = 0x09U
386 ,HAL_TIM_ENCODER_MSPINIT_CB_ID = 0x0AU
387 ,HAL_TIM_ENCODER_MSPDEINIT_CB_ID = 0x0BU
388 ,HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID = 0x0CU
389 ,HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID = 0x0DU
390 ,HAL_TIM_PERIOD_ELAPSED_CB_ID = 0x0EU
391 ,HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID = 0x0FU
392 ,HAL_TIM_TRIGGER_CB_ID = 0x10U
393 ,HAL_TIM_TRIGGER_HALF_CB_ID = 0x11U
395 ,HAL_TIM_IC_CAPTURE_CB_ID = 0x12U
396 ,HAL_TIM_IC_CAPTURE_HALF_CB_ID = 0x13U
397 ,HAL_TIM_OC_DELAY_ELAPSED_CB_ID = 0x14U
398 ,HAL_TIM_PWM_PULSE_FINISHED_CB_ID = 0x15U
399 ,HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID = 0x16U
400 ,HAL_TIM_ERROR_CB_ID = 0x17U
401 ,HAL_TIM_COMMUTATION_CB_ID = 0x18U
402 ,HAL_TIM_COMMUTATION_HALF_CB_ID = 0x19U
403 ,HAL_TIM_BREAK_CB_ID = 0x1AU
404 ,HAL_TIM_BREAK2_CB_ID = 0x1BU
405 } HAL_TIM_CallbackIDTypeDef;
427 #define TIM_CLEARINPUTSOURCE_NONE 0x00000000U
428 #define TIM_CLEARINPUTSOURCE_ETR 0x00000001U
436 #define TIM_DMABASE_CR1 0x00000000U
437 #define TIM_DMABASE_CR2 0x00000001U
438 #define TIM_DMABASE_SMCR 0x00000002U
439 #define TIM_DMABASE_DIER 0x00000003U
440 #define TIM_DMABASE_SR 0x00000004U
441 #define TIM_DMABASE_EGR 0x00000005U
442 #define TIM_DMABASE_CCMR1 0x00000006U
443 #define TIM_DMABASE_CCMR2 0x00000007U
444 #define TIM_DMABASE_CCER 0x00000008U
445 #define TIM_DMABASE_CNT 0x00000009U
446 #define TIM_DMABASE_PSC 0x0000000AU
447 #define TIM_DMABASE_ARR 0x0000000BU
448 #define TIM_DMABASE_RCR 0x0000000CU
449 #define TIM_DMABASE_CCR1 0x0000000DU
450 #define TIM_DMABASE_CCR2 0x0000000EU
451 #define TIM_DMABASE_CCR3 0x0000000FU
452 #define TIM_DMABASE_CCR4 0x00000010U
453 #define TIM_DMABASE_BDTR 0x00000011U
454 #define TIM_DMABASE_DCR 0x00000012U
455 #define TIM_DMABASE_DMAR 0x00000013U
456 #define TIM_DMABASE_OR 0x00000014U
457 #define TIM_DMABASE_CCMR3 0x00000015U
458 #define TIM_DMABASE_CCR5 0x00000016U
459 #define TIM_DMABASE_CCR6 0x00000017U
460 #if defined(TIM_BREAK_INPUT_SUPPORT)
461 #define TIM_DMABASE_AF1 0x00000018U
462 #define TIM_DMABASE_AF2 0x00000019U
471 #define TIM_EVENTSOURCE_UPDATE TIM_EGR_UG
472 #define TIM_EVENTSOURCE_CC1 TIM_EGR_CC1G
473 #define TIM_EVENTSOURCE_CC2 TIM_EGR_CC2G
474 #define TIM_EVENTSOURCE_CC3 TIM_EGR_CC3G
475 #define TIM_EVENTSOURCE_CC4 TIM_EGR_CC4G
476 #define TIM_EVENTSOURCE_COM TIM_EGR_COMG
477 #define TIM_EVENTSOURCE_TRIGGER TIM_EGR_TG
478 #define TIM_EVENTSOURCE_BREAK TIM_EGR_BG
479 #define TIM_EVENTSOURCE_BREAK2 TIM_EGR_B2G
487 #define TIM_INPUTCHANNELPOLARITY_RISING 0x00000000U
488 #define TIM_INPUTCHANNELPOLARITY_FALLING TIM_CCER_CC1P
489 #define TIM_INPUTCHANNELPOLARITY_BOTHEDGE (TIM_CCER_CC1P | TIM_CCER_CC1NP)
497 #define TIM_ETRPOLARITY_INVERTED TIM_SMCR_ETP
498 #define TIM_ETRPOLARITY_NONINVERTED 0x00000000U
506 #define TIM_ETRPRESCALER_DIV1 0x00000000U
507 #define TIM_ETRPRESCALER_DIV2 TIM_SMCR_ETPS_0
508 #define TIM_ETRPRESCALER_DIV4 TIM_SMCR_ETPS_1
509 #define TIM_ETRPRESCALER_DIV8 TIM_SMCR_ETPS
517 #define TIM_COUNTERMODE_UP 0x00000000U
518 #define TIM_COUNTERMODE_DOWN TIM_CR1_DIR
519 #define TIM_COUNTERMODE_CENTERALIGNED1 TIM_CR1_CMS_0
520 #define TIM_COUNTERMODE_CENTERALIGNED2 TIM_CR1_CMS_1
521 #define TIM_COUNTERMODE_CENTERALIGNED3 TIM_CR1_CMS
529 #define TIM_UIFREMAP_DISABLE 0x00000000U
530 #define TIM_UIFREMAP_ENABLE TIM_CR1_UIFREMAP
538 #define TIM_CLOCKDIVISION_DIV1 0x00000000U
539 #define TIM_CLOCKDIVISION_DIV2 TIM_CR1_CKD_0
540 #define TIM_CLOCKDIVISION_DIV4 TIM_CR1_CKD_1
548 #define TIM_OUTPUTSTATE_DISABLE 0x00000000U
549 #define TIM_OUTPUTSTATE_ENABLE TIM_CCER_CC1E
557 #define TIM_AUTORELOAD_PRELOAD_DISABLE 0x00000000U
558 #define TIM_AUTORELOAD_PRELOAD_ENABLE TIM_CR1_ARPE
567 #define TIM_OCFAST_DISABLE 0x00000000U
568 #define TIM_OCFAST_ENABLE TIM_CCMR1_OC1FE
576 #define TIM_OUTPUTNSTATE_DISABLE 0x00000000U
577 #define TIM_OUTPUTNSTATE_ENABLE TIM_CCER_CC1NE
585 #define TIM_OCPOLARITY_HIGH 0x00000000U
586 #define TIM_OCPOLARITY_LOW TIM_CCER_CC1P
594 #define TIM_OCNPOLARITY_HIGH 0x00000000U
595 #define TIM_OCNPOLARITY_LOW TIM_CCER_CC1NP
603 #define TIM_OCIDLESTATE_SET TIM_CR2_OIS1
604 #define TIM_OCIDLESTATE_RESET 0x00000000U
612 #define TIM_OCNIDLESTATE_SET TIM_CR2_OIS1N
613 #define TIM_OCNIDLESTATE_RESET 0x00000000U
621 #define TIM_ICPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
622 #define TIM_ICPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
623 #define TIM_ICPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE
631 #define TIM_ENCODERINPUTPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
632 #define TIM_ENCODERINPUTPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
640 #define TIM_ICSELECTION_DIRECTTI TIM_CCMR1_CC1S_0
642 #define TIM_ICSELECTION_INDIRECTTI TIM_CCMR1_CC1S_1
644 #define TIM_ICSELECTION_TRC TIM_CCMR1_CC1S
652 #define TIM_ICPSC_DIV1 0x00000000U
653 #define TIM_ICPSC_DIV2 TIM_CCMR1_IC1PSC_0
654 #define TIM_ICPSC_DIV4 TIM_CCMR1_IC1PSC_1
655 #define TIM_ICPSC_DIV8 TIM_CCMR1_IC1PSC
663 #define TIM_OPMODE_SINGLE TIM_CR1_OPM
664 #define TIM_OPMODE_REPETITIVE 0x00000000U
672 #define TIM_ENCODERMODE_TI1 TIM_SMCR_SMS_0
673 #define TIM_ENCODERMODE_TI2 TIM_SMCR_SMS_1
674 #define TIM_ENCODERMODE_TI12 (TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0)
682 #define TIM_IT_UPDATE TIM_DIER_UIE
683 #define TIM_IT_CC1 TIM_DIER_CC1IE
684 #define TIM_IT_CC2 TIM_DIER_CC2IE
685 #define TIM_IT_CC3 TIM_DIER_CC3IE
686 #define TIM_IT_CC4 TIM_DIER_CC4IE
687 #define TIM_IT_COM TIM_DIER_COMIE
688 #define TIM_IT_TRIGGER TIM_DIER_TIE
689 #define TIM_IT_BREAK TIM_DIER_BIE
697 #define TIM_COMMUTATION_TRGI TIM_CR2_CCUS
698 #define TIM_COMMUTATION_SOFTWARE 0x00000000U
706 #define TIM_DMA_UPDATE TIM_DIER_UDE
707 #define TIM_DMA_CC1 TIM_DIER_CC1DE
708 #define TIM_DMA_CC2 TIM_DIER_CC2DE
709 #define TIM_DMA_CC3 TIM_DIER_CC3DE
710 #define TIM_DMA_CC4 TIM_DIER_CC4DE
711 #define TIM_DMA_COM TIM_DIER_COMDE
712 #define TIM_DMA_TRIGGER TIM_DIER_TDE
720 #define TIM_FLAG_UPDATE TIM_SR_UIF
721 #define TIM_FLAG_CC1 TIM_SR_CC1IF
722 #define TIM_FLAG_CC2 TIM_SR_CC2IF
723 #define TIM_FLAG_CC3 TIM_SR_CC3IF
724 #define TIM_FLAG_CC4 TIM_SR_CC4IF
725 #define TIM_FLAG_CC5 TIM_SR_CC5IF
726 #define TIM_FLAG_CC6 TIM_SR_CC6IF
727 #define TIM_FLAG_COM TIM_SR_COMIF
728 #define TIM_FLAG_TRIGGER TIM_SR_TIF
729 #define TIM_FLAG_BREAK TIM_SR_BIF
730 #define TIM_FLAG_BREAK2 TIM_SR_B2IF
731 #define TIM_FLAG_SYSTEM_BREAK TIM_SR_SBIF
732 #define TIM_FLAG_CC1OF TIM_SR_CC1OF
733 #define TIM_FLAG_CC2OF TIM_SR_CC2OF
734 #define TIM_FLAG_CC3OF TIM_SR_CC3OF
735 #define TIM_FLAG_CC4OF TIM_SR_CC4OF
743 #define TIM_CHANNEL_1 0x00000000U
744 #define TIM_CHANNEL_2 0x00000004U
745 #define TIM_CHANNEL_3 0x00000008U
746 #define TIM_CHANNEL_4 0x0000000CU
747 #define TIM_CHANNEL_5 0x00000010U
748 #define TIM_CHANNEL_6 0x00000014U
749 #define TIM_CHANNEL_ALL 0x0000003CU
757 #define TIM_CLOCKSOURCE_ETRMODE2 TIM_SMCR_ETPS_1
758 #define TIM_CLOCKSOURCE_INTERNAL TIM_SMCR_ETPS_0
759 #define TIM_CLOCKSOURCE_ITR0 TIM_TS_ITR0
760 #define TIM_CLOCKSOURCE_ITR1 TIM_TS_ITR1
761 #define TIM_CLOCKSOURCE_ITR2 TIM_TS_ITR2
762 #define TIM_CLOCKSOURCE_ITR3 TIM_TS_ITR3
763 #define TIM_CLOCKSOURCE_TI1ED TIM_TS_TI1F_ED
764 #define TIM_CLOCKSOURCE_TI1 TIM_TS_TI1FP1
765 #define TIM_CLOCKSOURCE_TI2 TIM_TS_TI2FP2
766 #define TIM_CLOCKSOURCE_ETRMODE1 TIM_TS_ETRF
774 #define TIM_CLOCKPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED
775 #define TIM_CLOCKPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED
776 #define TIM_CLOCKPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
777 #define TIM_CLOCKPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
778 #define TIM_CLOCKPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE
786 #define TIM_CLOCKPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1
787 #define TIM_CLOCKPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2
788 #define TIM_CLOCKPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4
789 #define TIM_CLOCKPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8
797 #define TIM_CLEARINPUTPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED
798 #define TIM_CLEARINPUTPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED
806 #define TIM_CLEARINPUTPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1
807 #define TIM_CLEARINPUTPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2
808 #define TIM_CLEARINPUTPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4
809 #define TIM_CLEARINPUTPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8
817 #define TIM_OSSR_ENABLE TIM_BDTR_OSSR
818 #define TIM_OSSR_DISABLE 0x00000000U
826 #define TIM_OSSI_ENABLE TIM_BDTR_OSSI
827 #define TIM_OSSI_DISABLE 0x00000000U
834 #define TIM_LOCKLEVEL_OFF 0x00000000U
835 #define TIM_LOCKLEVEL_1 TIM_BDTR_LOCK_0
836 #define TIM_LOCKLEVEL_2 TIM_BDTR_LOCK_1
837 #define TIM_LOCKLEVEL_3 TIM_BDTR_LOCK
845 #define TIM_BREAK_ENABLE TIM_BDTR_BKE
846 #define TIM_BREAK_DISABLE 0x00000000U
854 #define TIM_BREAKPOLARITY_LOW 0x00000000U
855 #define TIM_BREAKPOLARITY_HIGH TIM_BDTR_BKP
863 #define TIM_BREAK2_DISABLE 0x00000000U
864 #define TIM_BREAK2_ENABLE TIM_BDTR_BK2E
872 #define TIM_BREAK2POLARITY_LOW 0x00000000U
873 #define TIM_BREAK2POLARITY_HIGH TIM_BDTR_BK2P
881 #define TIM_AUTOMATICOUTPUT_DISABLE 0x00000000U
882 #define TIM_AUTOMATICOUTPUT_ENABLE TIM_BDTR_AOE
891 #define TIM_GROUPCH5_NONE 0x00000000U
892 #define TIM_GROUPCH5_OC1REFC TIM_CCR5_GC5C1
893 #define TIM_GROUPCH5_OC2REFC TIM_CCR5_GC5C2
894 #define TIM_GROUPCH5_OC3REFC TIM_CCR5_GC5C3
902 #define TIM_TRGO_RESET 0x00000000U
903 #define TIM_TRGO_ENABLE TIM_CR2_MMS_0
904 #define TIM_TRGO_UPDATE TIM_CR2_MMS_1
905 #define TIM_TRGO_OC1 (TIM_CR2_MMS_1 | TIM_CR2_MMS_0)
906 #define TIM_TRGO_OC1REF TIM_CR2_MMS_2
907 #define TIM_TRGO_OC2REF (TIM_CR2_MMS_2 | TIM_CR2_MMS_0)
908 #define TIM_TRGO_OC3REF (TIM_CR2_MMS_2 | TIM_CR2_MMS_1)
909 #define TIM_TRGO_OC4REF (TIM_CR2_MMS_2 | TIM_CR2_MMS_1 | TIM_CR2_MMS_0)
917 #define TIM_TRGO2_RESET 0x00000000U
918 #define TIM_TRGO2_ENABLE TIM_CR2_MMS2_0
919 #define TIM_TRGO2_UPDATE TIM_CR2_MMS2_1
920 #define TIM_TRGO2_OC1 (TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0)
921 #define TIM_TRGO2_OC1REF TIM_CR2_MMS2_2
922 #define TIM_TRGO2_OC2REF (TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0)
923 #define TIM_TRGO2_OC3REF (TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1)
924 #define TIM_TRGO2_OC4REF (TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0)
925 #define TIM_TRGO2_OC5REF TIM_CR2_MMS2_3
926 #define TIM_TRGO2_OC6REF (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_0)
927 #define TIM_TRGO2_OC4REF_RISINGFALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1)
928 #define TIM_TRGO2_OC6REF_RISINGFALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0)
929 #define TIM_TRGO2_OC4REF_RISING_OC6REF_RISING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2)
930 #define TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0)
931 #define TIM_TRGO2_OC5REF_RISING_OC6REF_RISING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 |TIM_CR2_MMS2_1)
932 #define TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0)
940 #define TIM_MASTERSLAVEMODE_ENABLE TIM_SMCR_MSM
941 #define TIM_MASTERSLAVEMODE_DISABLE 0x00000000U
949 #define TIM_SLAVEMODE_DISABLE 0x00000000U
950 #define TIM_SLAVEMODE_RESET TIM_SMCR_SMS_2
951 #define TIM_SLAVEMODE_GATED (TIM_SMCR_SMS_2 | TIM_SMCR_SMS_0)
952 #define TIM_SLAVEMODE_TRIGGER (TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1)
953 #define TIM_SLAVEMODE_EXTERNAL1 (TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0)
954 #define TIM_SLAVEMODE_COMBINED_RESETTRIGGER TIM_SMCR_SMS_3
962 #define TIM_OCMODE_TIMING 0x00000000U
963 #define TIM_OCMODE_ACTIVE TIM_CCMR1_OC1M_0
964 #define TIM_OCMODE_INACTIVE TIM_CCMR1_OC1M_1
965 #define TIM_OCMODE_TOGGLE (TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0)
966 #define TIM_OCMODE_PWM1 (TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1)
967 #define TIM_OCMODE_PWM2 (TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0)
968 #define TIM_OCMODE_FORCED_ACTIVE (TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_0)
969 #define TIM_OCMODE_FORCED_INACTIVE TIM_CCMR1_OC1M_2
970 #define TIM_OCMODE_RETRIGERRABLE_OPM1 TIM_CCMR1_OC1M_3
971 #define TIM_OCMODE_RETRIGERRABLE_OPM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0)
972 #define TIM_OCMODE_COMBINED_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_2)
973 #define TIM_OCMODE_COMBINED_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2)
974 #define TIM_OCMODE_ASSYMETRIC_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2)
975 #define TIM_OCMODE_ASSYMETRIC_PWM2 TIM_CCMR1_OC1M
983 #define TIM_TS_ITR0 0x00000000U
984 #define TIM_TS_ITR1 TIM_SMCR_TS_0
985 #define TIM_TS_ITR2 TIM_SMCR_TS_1
986 #define TIM_TS_ITR3 (TIM_SMCR_TS_0 | TIM_SMCR_TS_1)
987 #define TIM_TS_TI1F_ED TIM_SMCR_TS_2
988 #define TIM_TS_TI1FP1 (TIM_SMCR_TS_0 | TIM_SMCR_TS_2)
989 #define TIM_TS_TI2FP2 (TIM_SMCR_TS_1 | TIM_SMCR_TS_2)
990 #define TIM_TS_ETRF (TIM_SMCR_TS_0 | TIM_SMCR_TS_1 | TIM_SMCR_TS_2)
991 #define TIM_TS_NONE 0x0000FFFFU
999 #define TIM_TRIGGERPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED
1000 #define TIM_TRIGGERPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED
1001 #define TIM_TRIGGERPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
1002 #define TIM_TRIGGERPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
1003 #define TIM_TRIGGERPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE
1011 #define TIM_TRIGGERPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1
1012 #define TIM_TRIGGERPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2
1013 #define TIM_TRIGGERPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4
1014 #define TIM_TRIGGERPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8
1022 #define TIM_TI1SELECTION_CH1 0x00000000U
1023 #define TIM_TI1SELECTION_XORCOMBINATION TIM_CR2_TI1S
1031 #define TIM_DMABURSTLENGTH_1TRANSFER 0x00000000U
1032 #define TIM_DMABURSTLENGTH_2TRANSFERS 0x00000100U
1033 #define TIM_DMABURSTLENGTH_3TRANSFERS 0x00000200U
1034 #define TIM_DMABURSTLENGTH_4TRANSFERS 0x00000300U
1035 #define TIM_DMABURSTLENGTH_5TRANSFERS 0x00000400U
1036 #define TIM_DMABURSTLENGTH_6TRANSFERS 0x00000500U
1037 #define TIM_DMABURSTLENGTH_7TRANSFERS 0x00000600U
1038 #define TIM_DMABURSTLENGTH_8TRANSFERS 0x00000700U
1039 #define TIM_DMABURSTLENGTH_9TRANSFERS 0x00000800U
1040 #define TIM_DMABURSTLENGTH_10TRANSFERS 0x00000900U
1041 #define TIM_DMABURSTLENGTH_11TRANSFERS 0x00000A00U
1042 #define TIM_DMABURSTLENGTH_12TRANSFERS 0x00000B00U
1043 #define TIM_DMABURSTLENGTH_13TRANSFERS 0x00000C00U
1044 #define TIM_DMABURSTLENGTH_14TRANSFERS 0x00000D00U
1045 #define TIM_DMABURSTLENGTH_15TRANSFERS 0x00000E00U
1046 #define TIM_DMABURSTLENGTH_16TRANSFERS 0x00000F00U
1047 #define TIM_DMABURSTLENGTH_17TRANSFERS 0x00001000U
1048 #define TIM_DMABURSTLENGTH_18TRANSFERS 0x00001100U
1056 #define TIM_DMA_ID_UPDATE ((uint16_t) 0x0000)
1057 #define TIM_DMA_ID_CC1 ((uint16_t) 0x0001)
1058 #define TIM_DMA_ID_CC2 ((uint16_t) 0x0002)
1059 #define TIM_DMA_ID_CC3 ((uint16_t) 0x0003)
1060 #define TIM_DMA_ID_CC4 ((uint16_t) 0x0004)
1061 #define TIM_DMA_ID_COMMUTATION ((uint16_t) 0x0005)
1062 #define TIM_DMA_ID_TRIGGER ((uint16_t) 0x0006)
1070 #define TIM_CCx_ENABLE 0x00000001U
1071 #define TIM_CCx_DISABLE 0x00000000U
1072 #define TIM_CCxN_ENABLE 0x00000004U
1073 #define TIM_CCxN_DISABLE 0x00000000U
1081 #define TIM_BREAK_SYSTEM_ECC SYSCFG_CFGR2_ECCL
1082 #define TIM_BREAK_SYSTEM_PVD SYSCFG_CFGR2_PVDL
1083 #define TIM_BREAK_SYSTEM_SRAM_PARITY_ERROR SYSCFG_CFGR2_SPL
1084 #define TIM_BREAK_SYSTEM_LOCKUP SYSCFG_CFGR2_CLL
1103 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
1104 #define __HAL_TIM_RESET_HANDLE_STATE(__HANDLE__) do { \
1105 (__HANDLE__)->State = HAL_TIM_STATE_RESET; \
1106 (__HANDLE__)->Base_MspInitCallback = NULL; \
1107 (__HANDLE__)->Base_MspDeInitCallback = NULL; \
1108 (__HANDLE__)->IC_MspInitCallback = NULL; \
1109 (__HANDLE__)->IC_MspDeInitCallback = NULL; \
1110 (__HANDLE__)->OC_MspInitCallback = NULL; \
1111 (__HANDLE__)->OC_MspDeInitCallback = NULL; \
1112 (__HANDLE__)->PWM_MspInitCallback = NULL; \
1113 (__HANDLE__)->PWM_MspDeInitCallback = NULL; \
1114 (__HANDLE__)->OnePulse_MspInitCallback = NULL; \
1115 (__HANDLE__)->OnePulse_MspDeInitCallback = NULL; \
1116 (__HANDLE__)->Encoder_MspInitCallback = NULL; \
1117 (__HANDLE__)->Encoder_MspDeInitCallback = NULL; \
1118 (__HANDLE__)->HallSensor_MspInitCallback = NULL; \
1119 (__HANDLE__)->HallSensor_MspDeInitCallback = NULL; \
1122 #define __HAL_TIM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_TIM_STATE_RESET)
1130 #define __HAL_TIM_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1|=(TIM_CR1_CEN))
1137 #define __HAL_TIM_MOE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->BDTR|=(TIM_BDTR_MOE))
1144 #define __HAL_TIM_DISABLE(__HANDLE__) \
1146 if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0UL) \
1148 if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0UL) \
1150 (__HANDLE__)->Instance->CR1 &= ~(TIM_CR1_CEN); \
1161 #define __HAL_TIM_MOE_DISABLE(__HANDLE__) \
1163 if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0UL) \
1165 if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0UL) \
1167 (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE); \
1178 #define __HAL_TIM_MOE_DISABLE_UNCONDITIONALLY(__HANDLE__) (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE)
1194 #define __HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER |= (__INTERRUPT__))
1210 #define __HAL_TIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER &= ~(__INTERRUPT__))
1225 #define __HAL_TIM_ENABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER |= (__DMA__))
1240 #define __HAL_TIM_DISABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER &= ~(__DMA__))
1264 #define __HAL_TIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__))
1288 #define __HAL_TIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
1305 #define __HAL_TIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->DIER & (__INTERRUPT__)) \
1306 == (__INTERRUPT__)) ? SET : RESET)
1322 #define __HAL_TIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->SR = ~(__INTERRUPT__))
1331 #define __HAL_TIM_UIFREMAP_ENABLE(__HANDLE__) (((__HANDLE__)->Instance->CR1 |= TIM_CR1_UIFREMAP))
1339 #define __HAL_TIM_UIFREMAP_DISABLE(__HANDLE__) (((__HANDLE__)->Instance->CR1 &= ~TIM_CR1_UIFREMAP))
1347 #define __HAL_TIM_GET_UIFCPY(__COUNTER__) (((__COUNTER__) & (TIM_CNT_UIFCPY)) == (TIM_CNT_UIFCPY))
1356 #define __HAL_TIM_IS_TIM_COUNTING_DOWN(__HANDLE__) (((__HANDLE__)->Instance->CR1 &(TIM_CR1_DIR)) == (TIM_CR1_DIR))
1364 #define __HAL_TIM_SET_PRESCALER(__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__))
1374 #define __HAL_TIM_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CNT = (__COUNTER__))
1381 #define __HAL_TIM_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNT)
1389 #define __HAL_TIM_SET_AUTORELOAD(__HANDLE__, __AUTORELOAD__) \
1391 (__HANDLE__)->Instance->ARR = (__AUTORELOAD__); \
1392 (__HANDLE__)->Init.Period = (__AUTORELOAD__); \
1400 #define __HAL_TIM_GET_AUTORELOAD(__HANDLE__) ((__HANDLE__)->Instance->ARR)
1412 #define __HAL_TIM_SET_CLOCKDIVISION(__HANDLE__, __CKD__) \
1414 (__HANDLE__)->Instance->CR1 &= (~TIM_CR1_CKD); \
1415 (__HANDLE__)->Instance->CR1 |= (__CKD__); \
1416 (__HANDLE__)->Init.ClockDivision = (__CKD__); \
1427 #define __HAL_TIM_GET_CLOCKDIVISION(__HANDLE__) ((__HANDLE__)->Instance->CR1 & TIM_CR1_CKD)
1446 #define __HAL_TIM_SET_ICPRESCALER(__HANDLE__, __CHANNEL__, __ICPSC__) \
1448 TIM_RESET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__)); \
1449 TIM_SET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__), (__ICPSC__)); \
1467 #define __HAL_TIM_GET_ICPRESCALER(__HANDLE__, __CHANNEL__) \
1468 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC1PSC) :\
1469 ((__CHANNEL__) == TIM_CHANNEL_2) ? (((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC2PSC) >> 8U) :\
1470 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC3PSC) :\
1471 (((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC4PSC)) >> 8U)
1487 #define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \
1488 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1 = (__COMPARE__)) :\
1489 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2 = (__COMPARE__)) :\
1490 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3 = (__COMPARE__)) :\
1491 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4 = (__COMPARE__)) :\
1492 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5 = (__COMPARE__)) :\
1493 ((__HANDLE__)->Instance->CCR6 = (__COMPARE__)))
1508 #define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \
1509 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1) :\
1510 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2) :\
1511 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3) :\
1512 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4) :\
1513 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5) :\
1514 ((__HANDLE__)->Instance->CCR6))
1529 #define __HAL_TIM_ENABLE_OCxPRELOAD(__HANDLE__, __CHANNEL__) \
1530 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC1PE) :\
1531 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC2PE) :\
1532 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC3PE) :\
1533 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC4PE) :\
1534 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC5PE) :\
1535 ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC6PE))
1550 #define __HAL_TIM_DISABLE_OCxPRELOAD(__HANDLE__, __CHANNEL__) \
1551 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1PE) :\
1552 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2PE) :\
1553 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3PE) :\
1554 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4PE) :\
1555 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC5PE) :\
1556 ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC6PE))
1575 #define __HAL_TIM_ENABLE_OCxFAST(__HANDLE__, __CHANNEL__) \
1576 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC1FE) :\
1577 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC2FE) :\
1578 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC3FE) :\
1579 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC4FE) :\
1580 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC5FE) :\
1581 ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC6FE))
1600 #define __HAL_TIM_DISABLE_OCxFAST(__HANDLE__, __CHANNEL__) \
1601 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1FE) :\
1602 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2FE) :\
1603 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3FE) :\
1604 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4FE) :\
1605 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC5FE) :\
1606 ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC6FE))
1616 #define __HAL_TIM_URS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1|= TIM_CR1_URS)
1629 #define __HAL_TIM_URS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1&=~TIM_CR1_URS)
1646 #define __HAL_TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \
1648 TIM_RESET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__)); \
1649 TIM_SET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__), (__POLARITY__)); \
1663 #define TIM_CCER_CCxE_MASK ((uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC3E | TIM_CCER_CC4E))
1664 #define TIM_CCER_CCxNE_MASK ((uint32_t)(TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE))
1674 #define IS_TIM_CLEARINPUT_SOURCE(__MODE__) (((__MODE__) == TIM_CLEARINPUTSOURCE_NONE) || \
1675 ((__MODE__) == TIM_CLEARINPUTSOURCE_ETR))
1677 #if defined(TIM_AF1_BKINE)&&defined(TIM_AF2_BKINE)
1678 #define IS_TIM_DMA_BASE(__BASE__) (((__BASE__) == TIM_DMABASE_CR1) || \
1679 ((__BASE__) == TIM_DMABASE_CR2) || \
1680 ((__BASE__) == TIM_DMABASE_SMCR) || \
1681 ((__BASE__) == TIM_DMABASE_DIER) || \
1682 ((__BASE__) == TIM_DMABASE_SR) || \
1683 ((__BASE__) == TIM_DMABASE_EGR) || \
1684 ((__BASE__) == TIM_DMABASE_CCMR1) || \
1685 ((__BASE__) == TIM_DMABASE_CCMR2) || \
1686 ((__BASE__) == TIM_DMABASE_CCER) || \
1687 ((__BASE__) == TIM_DMABASE_CNT) || \
1688 ((__BASE__) == TIM_DMABASE_PSC) || \
1689 ((__BASE__) == TIM_DMABASE_ARR) || \
1690 ((__BASE__) == TIM_DMABASE_RCR) || \
1691 ((__BASE__) == TIM_DMABASE_CCR1) || \
1692 ((__BASE__) == TIM_DMABASE_CCR2) || \
1693 ((__BASE__) == TIM_DMABASE_CCR3) || \
1694 ((__BASE__) == TIM_DMABASE_CCR4) || \
1695 ((__BASE__) == TIM_DMABASE_BDTR) || \
1696 ((__BASE__) == TIM_DMABASE_OR) || \
1697 ((__BASE__) == TIM_DMABASE_CCMR3) || \
1698 ((__BASE__) == TIM_DMABASE_CCR5) || \
1699 ((__BASE__) == TIM_DMABASE_CCR6) || \
1700 ((__BASE__) == TIM_DMABASE_AF1) || \
1701 ((__BASE__) == TIM_DMABASE_AF2))
1703 #define IS_TIM_DMA_BASE(__BASE__) (((__BASE__) == TIM_DMABASE_CR1) || \
1704 ((__BASE__) == TIM_DMABASE_CR2) || \
1705 ((__BASE__) == TIM_DMABASE_SMCR) || \
1706 ((__BASE__) == TIM_DMABASE_DIER) || \
1707 ((__BASE__) == TIM_DMABASE_SR) || \
1708 ((__BASE__) == TIM_DMABASE_EGR) || \
1709 ((__BASE__) == TIM_DMABASE_CCMR1) || \
1710 ((__BASE__) == TIM_DMABASE_CCMR2) || \
1711 ((__BASE__) == TIM_DMABASE_CCER) || \
1712 ((__BASE__) == TIM_DMABASE_CNT) || \
1713 ((__BASE__) == TIM_DMABASE_PSC) || \
1714 ((__BASE__) == TIM_DMABASE_ARR) || \
1715 ((__BASE__) == TIM_DMABASE_RCR) || \
1716 ((__BASE__) == TIM_DMABASE_CCR1) || \
1717 ((__BASE__) == TIM_DMABASE_CCR2) || \
1718 ((__BASE__) == TIM_DMABASE_CCR3) || \
1719 ((__BASE__) == TIM_DMABASE_CCR4) || \
1720 ((__BASE__) == TIM_DMABASE_BDTR) || \
1721 ((__BASE__) == TIM_DMABASE_OR) || \
1722 ((__BASE__) == TIM_DMABASE_CCMR3) || \
1723 ((__BASE__) == TIM_DMABASE_CCR5) || \
1724 ((__BASE__) == TIM_DMABASE_CCR6))
1727 #define IS_TIM_EVENT_SOURCE(__SOURCE__) ((((__SOURCE__) & 0xFFFFFE00U) == 0x00000000U) && ((__SOURCE__) != 0x00000000U))
1729 #define IS_TIM_COUNTER_MODE(__MODE__) (((__MODE__) == TIM_COUNTERMODE_UP) || \
1730 ((__MODE__) == TIM_COUNTERMODE_DOWN) || \
1731 ((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED1) || \
1732 ((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED2) || \
1733 ((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED3))
1735 #define IS_TIM_UIFREMAP_MODE(__MODE__) (((__MODE__) == TIM_UIFREMAP_DISABLE) || \
1736 ((__MODE__) == TIM_UIFREMAP_ENALE))
1738 #define IS_TIM_CLOCKDIVISION_DIV(__DIV__) (((__DIV__) == TIM_CLOCKDIVISION_DIV1) || \
1739 ((__DIV__) == TIM_CLOCKDIVISION_DIV2) || \
1740 ((__DIV__) == TIM_CLOCKDIVISION_DIV4))
1742 #define IS_TIM_AUTORELOAD_PRELOAD(PRELOAD) (((PRELOAD) == TIM_AUTORELOAD_PRELOAD_DISABLE) || \
1743 ((PRELOAD) == TIM_AUTORELOAD_PRELOAD_ENABLE))
1745 #define IS_TIM_FAST_STATE(__STATE__) (((__STATE__) == TIM_OCFAST_DISABLE) || \
1746 ((__STATE__) == TIM_OCFAST_ENABLE))
1748 #define IS_TIM_OC_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_OCPOLARITY_HIGH) || \
1749 ((__POLARITY__) == TIM_OCPOLARITY_LOW))
1751 #define IS_TIM_OCN_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_OCNPOLARITY_HIGH) || \
1752 ((__POLARITY__) == TIM_OCNPOLARITY_LOW))
1754 #define IS_TIM_OCIDLE_STATE(__STATE__) (((__STATE__) == TIM_OCIDLESTATE_SET) || \
1755 ((__STATE__) == TIM_OCIDLESTATE_RESET))
1757 #define IS_TIM_OCNIDLE_STATE(__STATE__) (((__STATE__) == TIM_OCNIDLESTATE_SET) || \
1758 ((__STATE__) == TIM_OCNIDLESTATE_RESET))
1760 #define IS_TIM_ENCODERINPUT_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_RISING) || \
1761 ((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_FALLING))
1763 #define IS_TIM_IC_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ICPOLARITY_RISING) || \
1764 ((__POLARITY__) == TIM_ICPOLARITY_FALLING) || \
1765 ((__POLARITY__) == TIM_ICPOLARITY_BOTHEDGE))
1767 #define IS_TIM_IC_SELECTION(__SELECTION__) (((__SELECTION__) == TIM_ICSELECTION_DIRECTTI) || \
1768 ((__SELECTION__) == TIM_ICSELECTION_INDIRECTTI) || \
1769 ((__SELECTION__) == TIM_ICSELECTION_TRC))
1771 #define IS_TIM_IC_PRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_ICPSC_DIV1) || \
1772 ((__PRESCALER__) == TIM_ICPSC_DIV2) || \
1773 ((__PRESCALER__) == TIM_ICPSC_DIV4) || \
1774 ((__PRESCALER__) == TIM_ICPSC_DIV8))
1776 #define IS_TIM_OPM_MODE(__MODE__) (((__MODE__) == TIM_OPMODE_SINGLE) || \
1777 ((__MODE__) == TIM_OPMODE_REPETITIVE))
1779 #define IS_TIM_ENCODER_MODE(__MODE__) (((__MODE__) == TIM_ENCODERMODE_TI1) || \
1780 ((__MODE__) == TIM_ENCODERMODE_TI2) || \
1781 ((__MODE__) == TIM_ENCODERMODE_TI12))
1783 #define IS_TIM_DMA_SOURCE(__SOURCE__) ((((__SOURCE__) & 0xFFFF80FFU) == 0x00000000U) && ((__SOURCE__) != 0x00000000U))
1785 #define IS_TIM_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \
1786 ((__CHANNEL__) == TIM_CHANNEL_2) || \
1787 ((__CHANNEL__) == TIM_CHANNEL_3) || \
1788 ((__CHANNEL__) == TIM_CHANNEL_4) || \
1789 ((__CHANNEL__) == TIM_CHANNEL_5) || \
1790 ((__CHANNEL__) == TIM_CHANNEL_6) || \
1791 ((__CHANNEL__) == TIM_CHANNEL_ALL))
1793 #define IS_TIM_OPM_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \
1794 ((__CHANNEL__) == TIM_CHANNEL_2))
1796 #define IS_TIM_COMPLEMENTARY_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \
1797 ((__CHANNEL__) == TIM_CHANNEL_2) || \
1798 ((__CHANNEL__) == TIM_CHANNEL_3))
1800 #define IS_TIM_CLOCKSOURCE(__CLOCK__) (((__CLOCK__) == TIM_CLOCKSOURCE_INTERNAL) || \
1801 ((__CLOCK__) == TIM_CLOCKSOURCE_ETRMODE2) || \
1802 ((__CLOCK__) == TIM_CLOCKSOURCE_ITR0) || \
1803 ((__CLOCK__) == TIM_CLOCKSOURCE_ITR1) || \
1804 ((__CLOCK__) == TIM_CLOCKSOURCE_ITR2) || \
1805 ((__CLOCK__) == TIM_CLOCKSOURCE_ITR3) || \
1806 ((__CLOCK__) == TIM_CLOCKSOURCE_TI1ED) || \
1807 ((__CLOCK__) == TIM_CLOCKSOURCE_TI1) || \
1808 ((__CLOCK__) == TIM_CLOCKSOURCE_TI2) || \
1809 ((__CLOCK__) == TIM_CLOCKSOURCE_ETRMODE1))
1811 #define IS_TIM_CLOCKPOLARITY(__POLARITY__) (((__POLARITY__) == TIM_CLOCKPOLARITY_INVERTED) || \
1812 ((__POLARITY__) == TIM_CLOCKPOLARITY_NONINVERTED) || \
1813 ((__POLARITY__) == TIM_CLOCKPOLARITY_RISING) || \
1814 ((__POLARITY__) == TIM_CLOCKPOLARITY_FALLING) || \
1815 ((__POLARITY__) == TIM_CLOCKPOLARITY_BOTHEDGE))
1817 #define IS_TIM_CLOCKPRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV1) || \
1818 ((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV2) || \
1819 ((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV4) || \
1820 ((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV8))
1822 #define IS_TIM_CLOCKFILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU)
1824 #define IS_TIM_CLEARINPUT_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_CLEARINPUTPOLARITY_INVERTED) || \
1825 ((__POLARITY__) == TIM_CLEARINPUTPOLARITY_NONINVERTED))
1827 #define IS_TIM_CLEARINPUT_PRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV1) || \
1828 ((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV2) || \
1829 ((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV4) || \
1830 ((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV8))
1832 #define IS_TIM_CLEARINPUT_FILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU)
1834 #define IS_TIM_OSSR_STATE(__STATE__) (((__STATE__) == TIM_OSSR_ENABLE) || \
1835 ((__STATE__) == TIM_OSSR_DISABLE))
1837 #define IS_TIM_OSSI_STATE(__STATE__) (((__STATE__) == TIM_OSSI_ENABLE) || \
1838 ((__STATE__) == TIM_OSSI_DISABLE))
1840 #define IS_TIM_LOCK_LEVEL(__LEVEL__) (((__LEVEL__) == TIM_LOCKLEVEL_OFF) || \
1841 ((__LEVEL__) == TIM_LOCKLEVEL_1) || \
1842 ((__LEVEL__) == TIM_LOCKLEVEL_2) || \
1843 ((__LEVEL__) == TIM_LOCKLEVEL_3))
1845 #define IS_TIM_BREAK_FILTER(__BRKFILTER__) ((__BRKFILTER__) <= 0xFUL)
1848 #define IS_TIM_BREAK_STATE(__STATE__) (((__STATE__) == TIM_BREAK_ENABLE) || \
1849 ((__STATE__) == TIM_BREAK_DISABLE))
1851 #define IS_TIM_BREAK_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAKPOLARITY_LOW) || \
1852 ((__POLARITY__) == TIM_BREAKPOLARITY_HIGH))
1854 #define IS_TIM_BREAK2_STATE(__STATE__) (((__STATE__) == TIM_BREAK2_ENABLE) || \
1855 ((__STATE__) == TIM_BREAK2_DISABLE))
1857 #define IS_TIM_BREAK2_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAK2POLARITY_LOW) || \
1858 ((__POLARITY__) == TIM_BREAK2POLARITY_HIGH))
1860 #define IS_TIM_AUTOMATIC_OUTPUT_STATE(__STATE__) (((__STATE__) == TIM_AUTOMATICOUTPUT_ENABLE) || \
1861 ((__STATE__) == TIM_AUTOMATICOUTPUT_DISABLE))
1863 #define IS_TIM_GROUPCH5(__OCREF__) ((((__OCREF__) & 0x1FFFFFFFU) == 0x00000000U))
1865 #define IS_TIM_TRGO_SOURCE(__SOURCE__) (((__SOURCE__) == TIM_TRGO_RESET) || \
1866 ((__SOURCE__) == TIM_TRGO_ENABLE) || \
1867 ((__SOURCE__) == TIM_TRGO_UPDATE) || \
1868 ((__SOURCE__) == TIM_TRGO_OC1) || \
1869 ((__SOURCE__) == TIM_TRGO_OC1REF) || \
1870 ((__SOURCE__) == TIM_TRGO_OC2REF) || \
1871 ((__SOURCE__) == TIM_TRGO_OC3REF) || \
1872 ((__SOURCE__) == TIM_TRGO_OC4REF))
1874 #define IS_TIM_TRGO2_SOURCE(__SOURCE__) (((__SOURCE__) == TIM_TRGO2_RESET) || \
1875 ((__SOURCE__) == TIM_TRGO2_ENABLE) || \
1876 ((__SOURCE__) == TIM_TRGO2_UPDATE) || \
1877 ((__SOURCE__) == TIM_TRGO2_OC1) || \
1878 ((__SOURCE__) == TIM_TRGO2_OC1REF) || \
1879 ((__SOURCE__) == TIM_TRGO2_OC2REF) || \
1880 ((__SOURCE__) == TIM_TRGO2_OC3REF) || \
1881 ((__SOURCE__) == TIM_TRGO2_OC3REF) || \
1882 ((__SOURCE__) == TIM_TRGO2_OC4REF) || \
1883 ((__SOURCE__) == TIM_TRGO2_OC5REF) || \
1884 ((__SOURCE__) == TIM_TRGO2_OC6REF) || \
1885 ((__SOURCE__) == TIM_TRGO2_OC4REF_RISINGFALLING) || \
1886 ((__SOURCE__) == TIM_TRGO2_OC6REF_RISINGFALLING) || \
1887 ((__SOURCE__) == TIM_TRGO2_OC4REF_RISING_OC6REF_RISING) || \
1888 ((__SOURCE__) == TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING) || \
1889 ((__SOURCE__) == TIM_TRGO2_OC5REF_RISING_OC6REF_RISING) || \
1890 ((__SOURCE__) == TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING))
1892 #define IS_TIM_MSM_STATE(__STATE__) (((__STATE__) == TIM_MASTERSLAVEMODE_ENABLE) || \
1893 ((__STATE__) == TIM_MASTERSLAVEMODE_DISABLE))
1895 #define IS_TIM_SLAVE_MODE(__MODE__) (((__MODE__) == TIM_SLAVEMODE_DISABLE) || \
1896 ((__MODE__) == TIM_SLAVEMODE_RESET) || \
1897 ((__MODE__) == TIM_SLAVEMODE_GATED) || \
1898 ((__MODE__) == TIM_SLAVEMODE_TRIGGER) || \
1899 ((__MODE__) == TIM_SLAVEMODE_EXTERNAL1) || \
1900 ((__MODE__) == TIM_SLAVEMODE_COMBINED_RESETTRIGGER))
1902 #define IS_TIM_PWM_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_PWM1) || \
1903 ((__MODE__) == TIM_OCMODE_PWM2) || \
1904 ((__MODE__) == TIM_OCMODE_COMBINED_PWM1) || \
1905 ((__MODE__) == TIM_OCMODE_COMBINED_PWM2) || \
1906 ((__MODE__) == TIM_OCMODE_ASSYMETRIC_PWM1) || \
1907 ((__MODE__) == TIM_OCMODE_ASSYMETRIC_PWM2))
1909 #define IS_TIM_OC_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_TIMING) || \
1910 ((__MODE__) == TIM_OCMODE_ACTIVE) || \
1911 ((__MODE__) == TIM_OCMODE_INACTIVE) || \
1912 ((__MODE__) == TIM_OCMODE_TOGGLE) || \
1913 ((__MODE__) == TIM_OCMODE_FORCED_ACTIVE) || \
1914 ((__MODE__) == TIM_OCMODE_FORCED_INACTIVE) || \
1915 ((__MODE__) == TIM_OCMODE_RETRIGERRABLE_OPM1) || \
1916 ((__MODE__) == TIM_OCMODE_RETRIGERRABLE_OPM2))
1918 #define IS_TIM_TRIGGER_SELECTION(__SELECTION__) (((__SELECTION__) == TIM_TS_ITR0) || \
1919 ((__SELECTION__) == TIM_TS_ITR1) || \
1920 ((__SELECTION__) == TIM_TS_ITR2) || \
1921 ((__SELECTION__) == TIM_TS_ITR3) || \
1922 ((__SELECTION__) == TIM_TS_TI1F_ED) || \
1923 ((__SELECTION__) == TIM_TS_TI1FP1) || \
1924 ((__SELECTION__) == TIM_TS_TI2FP2) || \
1925 ((__SELECTION__) == TIM_TS_ETRF))
1927 #define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(__SELECTION__) (((__SELECTION__) == TIM_TS_ITR0) || \
1928 ((__SELECTION__) == TIM_TS_ITR1) || \
1929 ((__SELECTION__) == TIM_TS_ITR2) || \
1930 ((__SELECTION__) == TIM_TS_ITR3) || \
1931 ((__SELECTION__) == TIM_TS_NONE))
1933 #define IS_TIM_TRIGGERPOLARITY(__POLARITY__) (((__POLARITY__) == TIM_TRIGGERPOLARITY_INVERTED ) || \
1934 ((__POLARITY__) == TIM_TRIGGERPOLARITY_NONINVERTED) || \
1935 ((__POLARITY__) == TIM_TRIGGERPOLARITY_RISING ) || \
1936 ((__POLARITY__) == TIM_TRIGGERPOLARITY_FALLING ) || \
1937 ((__POLARITY__) == TIM_TRIGGERPOLARITY_BOTHEDGE ))
1939 #define IS_TIM_TRIGGERPRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV1) || \
1940 ((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV2) || \
1941 ((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV4) || \
1942 ((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV8))
1944 #define IS_TIM_TRIGGERFILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU)
1946 #define IS_TIM_TI1SELECTION(__TI1SELECTION__) (((__TI1SELECTION__) == TIM_TI1SELECTION_CH1) || \
1947 ((__TI1SELECTION__) == TIM_TI1SELECTION_XORCOMBINATION))
1949 #define IS_TIM_DMA_LENGTH(__LENGTH__) (((__LENGTH__) == TIM_DMABURSTLENGTH_1TRANSFER) || \
1950 ((__LENGTH__) == TIM_DMABURSTLENGTH_2TRANSFERS) || \
1951 ((__LENGTH__) == TIM_DMABURSTLENGTH_3TRANSFERS) || \
1952 ((__LENGTH__) == TIM_DMABURSTLENGTH_4TRANSFERS) || \
1953 ((__LENGTH__) == TIM_DMABURSTLENGTH_5TRANSFERS) || \
1954 ((__LENGTH__) == TIM_DMABURSTLENGTH_6TRANSFERS) || \
1955 ((__LENGTH__) == TIM_DMABURSTLENGTH_7TRANSFERS) || \
1956 ((__LENGTH__) == TIM_DMABURSTLENGTH_8TRANSFERS) || \
1957 ((__LENGTH__) == TIM_DMABURSTLENGTH_9TRANSFERS) || \
1958 ((__LENGTH__) == TIM_DMABURSTLENGTH_10TRANSFERS) || \
1959 ((__LENGTH__) == TIM_DMABURSTLENGTH_11TRANSFERS) || \
1960 ((__LENGTH__) == TIM_DMABURSTLENGTH_12TRANSFERS) || \
1961 ((__LENGTH__) == TIM_DMABURSTLENGTH_13TRANSFERS) || \
1962 ((__LENGTH__) == TIM_DMABURSTLENGTH_14TRANSFERS) || \
1963 ((__LENGTH__) == TIM_DMABURSTLENGTH_15TRANSFERS) || \
1964 ((__LENGTH__) == TIM_DMABURSTLENGTH_16TRANSFERS) || \
1965 ((__LENGTH__) == TIM_DMABURSTLENGTH_17TRANSFERS) || \
1966 ((__LENGTH__) == TIM_DMABURSTLENGTH_18TRANSFERS))
1968 #define IS_TIM_IC_FILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU)
1970 #define IS_TIM_DEADTIME(__DEADTIME__) ((__DEADTIME__) <= 0xFFU)
1972 #define IS_TIM_BREAK_SYSTEM(__CONFIG__) (((__CONFIG__) == TIM_BREAK_SYSTEM_ECC) || \
1973 ((__CONFIG__) == TIM_BREAK_SYSTEM_PVD) || \
1974 ((__CONFIG__) == TIM_BREAK_SYSTEM_SRAM_PARITY_ERROR) || \
1975 ((__CONFIG__) == TIM_BREAK_SYSTEM_LOCKUP))
1977 #define IS_TIM_SLAVEMODE_TRIGGER_ENABLED(__TRIGGER__) (((__TRIGGER__) == TIM_SLAVEMODE_TRIGGER) || \
1978 ((__TRIGGER__) == TIM_SLAVEMODE_COMBINED_RESETTRIGGER))
1980 #define TIM_SET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__, __ICPSC__) \
1981 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= (__ICPSC__)) :\
1982 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= ((__ICPSC__) << 8U)) :\
1983 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= (__ICPSC__)) :\
1984 ((__HANDLE__)->Instance->CCMR2 |= ((__ICPSC__) << 8U)))
1986 #define TIM_RESET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__) \
1987 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC) :\
1988 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_IC2PSC) :\
1989 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_IC3PSC) :\
1990 ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_IC4PSC))
1992 #define TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \
1993 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER |= (__POLARITY__)) :\
1994 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 4U)) :\
1995 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 8U)) :\
1996 ((__HANDLE__)->Instance->CCER |= (((__POLARITY__) << 12U))))
1998 #define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \
1999 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\
2000 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\
2001 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC3P | TIM_CCER_CC3NP)) :\
2002 ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC4P | TIM_CCER_CC4NP)))
2141 uint32_t *pData2, uint16_t Length);
2166 uint32_t OutputChannel, uint32_t InputChannel);
2174 uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength);
2177 uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength);
2202 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)
2204 pTIM_CallbackTypeDef pCallback);
2240 uint32_t TIM_ExtTRGPolarity, uint32_t ExtTRGFilter);
2249 #if (USE_HAL_TIM_REGISTER_CALLBACKS == 1)