Prusa MINI Firmware overview
|
Go to the documentation of this file.
37 #ifndef __STM32F4xx_HAL_TIM_H
38 #define __STM32F4xx_HAL_TIM_H
309 #define TIM_INPUTCHANNELPOLARITY_RISING 0x00000000U
310 #define TIM_INPUTCHANNELPOLARITY_FALLING (TIM_CCER_CC1P)
311 #define TIM_INPUTCHANNELPOLARITY_BOTHEDGE (TIM_CCER_CC1P | TIM_CCER_CC1NP)
319 #define TIM_ETRPOLARITY_INVERTED (TIM_SMCR_ETP)
320 #define TIM_ETRPOLARITY_NONINVERTED 0x00000000U
328 #define TIM_ETRPRESCALER_DIV1 0x00000000U
329 #define TIM_ETRPRESCALER_DIV2 (TIM_SMCR_ETPS_0)
330 #define TIM_ETRPRESCALER_DIV4 (TIM_SMCR_ETPS_1)
331 #define TIM_ETRPRESCALER_DIV8 (TIM_SMCR_ETPS)
339 #define TIM_COUNTERMODE_UP 0x00000000U
340 #define TIM_COUNTERMODE_DOWN TIM_CR1_DIR
341 #define TIM_COUNTERMODE_CENTERALIGNED1 TIM_CR1_CMS_0
342 #define TIM_COUNTERMODE_CENTERALIGNED2 TIM_CR1_CMS_1
343 #define TIM_COUNTERMODE_CENTERALIGNED3 TIM_CR1_CMS
351 #define TIM_CLOCKDIVISION_DIV1 0x00000000U
352 #define TIM_CLOCKDIVISION_DIV2 (TIM_CR1_CKD_0)
353 #define TIM_CLOCKDIVISION_DIV4 (TIM_CR1_CKD_1)
361 #define TIM_OCMODE_TIMING 0x00000000U
362 #define TIM_OCMODE_ACTIVE (TIM_CCMR1_OC1M_0)
363 #define TIM_OCMODE_INACTIVE (TIM_CCMR1_OC1M_1)
364 #define TIM_OCMODE_TOGGLE (TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_1)
365 #define TIM_OCMODE_PWM1 (TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2)
366 #define TIM_OCMODE_PWM2 (TIM_CCMR1_OC1M)
367 #define TIM_OCMODE_FORCED_ACTIVE (TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2)
368 #define TIM_OCMODE_FORCED_INACTIVE (TIM_CCMR1_OC1M_2)
377 #define TIM_OCFAST_DISABLE 0x00000000U
378 #define TIM_OCFAST_ENABLE (TIM_CCMR1_OC1FE)
386 #define TIM_OCPOLARITY_HIGH 0x00000000U
387 #define TIM_OCPOLARITY_LOW (TIM_CCER_CC1P)
395 #define TIM_OCNPOLARITY_HIGH 0x00000000U
396 #define TIM_OCNPOLARITY_LOW (TIM_CCER_CC1NP)
404 #define TIM_OCIDLESTATE_SET (TIM_CR2_OIS1)
405 #define TIM_OCIDLESTATE_RESET 0x00000000U
413 #define TIM_OCNIDLESTATE_SET (TIM_CR2_OIS1N)
414 #define TIM_OCNIDLESTATE_RESET 0x00000000U
422 #define TIM_CHANNEL_1 0x00000000U
423 #define TIM_CHANNEL_2 0x00000004U
424 #define TIM_CHANNEL_3 0x00000008U
425 #define TIM_CHANNEL_4 0x0000000CU
426 #define TIM_CHANNEL_ALL 0x00000018U
435 #define TIM_ICPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
436 #define TIM_ICPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
437 #define TIM_ICPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE
445 #define TIM_ICSELECTION_DIRECTTI (TIM_CCMR1_CC1S_0)
447 #define TIM_ICSELECTION_INDIRECTTI (TIM_CCMR1_CC1S_1)
449 #define TIM_ICSELECTION_TRC (TIM_CCMR1_CC1S)
458 #define TIM_ICPSC_DIV1 0x00000000U
459 #define TIM_ICPSC_DIV2 (TIM_CCMR1_IC1PSC_0)
460 #define TIM_ICPSC_DIV4 (TIM_CCMR1_IC1PSC_1)
461 #define TIM_ICPSC_DIV8 (TIM_CCMR1_IC1PSC)
469 #define TIM_OPMODE_SINGLE (TIM_CR1_OPM)
470 #define TIM_OPMODE_REPETITIVE 0x00000000U
478 #define TIM_ENCODERMODE_TI1 (TIM_SMCR_SMS_0)
479 #define TIM_ENCODERMODE_TI2 (TIM_SMCR_SMS_1)
480 #define TIM_ENCODERMODE_TI12 (TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0)
489 #define TIM_IT_UPDATE (TIM_DIER_UIE)
490 #define TIM_IT_CC1 (TIM_DIER_CC1IE)
491 #define TIM_IT_CC2 (TIM_DIER_CC2IE)
492 #define TIM_IT_CC3 (TIM_DIER_CC3IE)
493 #define TIM_IT_CC4 (TIM_DIER_CC4IE)
494 #define TIM_IT_COM (TIM_DIER_COMIE)
495 #define TIM_IT_TRIGGER (TIM_DIER_TIE)
496 #define TIM_IT_BREAK (TIM_DIER_BIE)
504 #define TIM_COMMUTATION_TRGI (TIM_CR2_CCUS)
505 #define TIM_COMMUTATION_SOFTWARE 0x00000000U
513 #define TIM_DMA_UPDATE (TIM_DIER_UDE)
514 #define TIM_DMA_CC1 (TIM_DIER_CC1DE)
515 #define TIM_DMA_CC2 (TIM_DIER_CC2DE)
516 #define TIM_DMA_CC3 (TIM_DIER_CC3DE)
517 #define TIM_DMA_CC4 (TIM_DIER_CC4DE)
518 #define TIM_DMA_COM (TIM_DIER_COMDE)
519 #define TIM_DMA_TRIGGER (TIM_DIER_TDE)
527 #define TIM_EVENTSOURCE_UPDATE TIM_EGR_UG
528 #define TIM_EVENTSOURCE_CC1 TIM_EGR_CC1G
529 #define TIM_EVENTSOURCE_CC2 TIM_EGR_CC2G
530 #define TIM_EVENTSOURCE_CC3 TIM_EGR_CC3G
531 #define TIM_EVENTSOURCE_CC4 TIM_EGR_CC4G
532 #define TIM_EVENTSOURCE_COM TIM_EGR_COMG
533 #define TIM_EVENTSOURCE_TRIGGER TIM_EGR_TG
534 #define TIM_EVENTSOURCE_BREAK TIM_EGR_BG
543 #define TIM_FLAG_UPDATE (TIM_SR_UIF)
544 #define TIM_FLAG_CC1 (TIM_SR_CC1IF)
545 #define TIM_FLAG_CC2 (TIM_SR_CC2IF)
546 #define TIM_FLAG_CC3 (TIM_SR_CC3IF)
547 #define TIM_FLAG_CC4 (TIM_SR_CC4IF)
548 #define TIM_FLAG_COM (TIM_SR_COMIF)
549 #define TIM_FLAG_TRIGGER (TIM_SR_TIF)
550 #define TIM_FLAG_BREAK (TIM_SR_BIF)
551 #define TIM_FLAG_CC1OF (TIM_SR_CC1OF)
552 #define TIM_FLAG_CC2OF (TIM_SR_CC2OF)
553 #define TIM_FLAG_CC3OF (TIM_SR_CC3OF)
554 #define TIM_FLAG_CC4OF (TIM_SR_CC4OF)
562 #define TIM_CLOCKSOURCE_ETRMODE2 (TIM_SMCR_ETPS_1)
563 #define TIM_CLOCKSOURCE_INTERNAL (TIM_SMCR_ETPS_0)
564 #define TIM_CLOCKSOURCE_ITR0 0x00000000U
565 #define TIM_CLOCKSOURCE_ITR1 (TIM_SMCR_TS_0)
566 #define TIM_CLOCKSOURCE_ITR2 (TIM_SMCR_TS_1)
567 #define TIM_CLOCKSOURCE_ITR3 (TIM_SMCR_TS_0 | TIM_SMCR_TS_1)
568 #define TIM_CLOCKSOURCE_TI1ED (TIM_SMCR_TS_2)
569 #define TIM_CLOCKSOURCE_TI1 (TIM_SMCR_TS_0 | TIM_SMCR_TS_2)
570 #define TIM_CLOCKSOURCE_TI2 (TIM_SMCR_TS_1 | TIM_SMCR_TS_2)
571 #define TIM_CLOCKSOURCE_ETRMODE1 (TIM_SMCR_TS)
579 #define TIM_CLOCKPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED
580 #define TIM_CLOCKPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED
581 #define TIM_CLOCKPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
582 #define TIM_CLOCKPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
583 #define TIM_CLOCKPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE
591 #define TIM_CLOCKPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1
592 #define TIM_CLOCKPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2
593 #define TIM_CLOCKPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4
594 #define TIM_CLOCKPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8
602 #define TIM_CLEARINPUTSOURCE_ETR 0x00000001U
603 #define TIM_CLEARINPUTSOURCE_NONE 0x00000000U
611 #define TIM_CLEARINPUTPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED
612 #define TIM_CLEARINPUTPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED
620 #define TIM_CLEARINPUTPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1
621 #define TIM_CLEARINPUTPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2
622 #define TIM_CLEARINPUTPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4
623 #define TIM_CLEARINPUTPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8
631 #define TIM_OSSR_ENABLE (TIM_BDTR_OSSR)
632 #define TIM_OSSR_DISABLE 0x00000000U
640 #define TIM_OSSI_ENABLE (TIM_BDTR_OSSI)
641 #define TIM_OSSI_DISABLE 0x00000000U
649 #define TIM_LOCKLEVEL_OFF 0x00000000U
650 #define TIM_LOCKLEVEL_1 (TIM_BDTR_LOCK_0)
651 #define TIM_LOCKLEVEL_2 (TIM_BDTR_LOCK_1)
652 #define TIM_LOCKLEVEL_3 (TIM_BDTR_LOCK)
659 #define TIM_BREAK_ENABLE (TIM_BDTR_BKE)
660 #define TIM_BREAK_DISABLE 0x00000000U
668 #define TIM_BREAKPOLARITY_LOW 0x00000000U
669 #define TIM_BREAKPOLARITY_HIGH (TIM_BDTR_BKP)
677 #define TIM_AUTOMATICOUTPUT_ENABLE (TIM_BDTR_AOE)
678 #define TIM_AUTOMATICOUTPUT_DISABLE 0x00000000U
686 #define TIM_TRGO_RESET 0x00000000U
687 #define TIM_TRGO_ENABLE (TIM_CR2_MMS_0)
688 #define TIM_TRGO_UPDATE (TIM_CR2_MMS_1)
689 #define TIM_TRGO_OC1 ((TIM_CR2_MMS_1 | TIM_CR2_MMS_0))
690 #define TIM_TRGO_OC1REF (TIM_CR2_MMS_2)
691 #define TIM_TRGO_OC2REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_0))
692 #define TIM_TRGO_OC3REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_1))
693 #define TIM_TRGO_OC4REF ((TIM_CR2_MMS_2 | TIM_CR2_MMS_1 | TIM_CR2_MMS_0))
701 #define TIM_SLAVEMODE_DISABLE 0x00000000U
702 #define TIM_SLAVEMODE_RESET 0x00000004U
703 #define TIM_SLAVEMODE_GATED 0x00000005U
704 #define TIM_SLAVEMODE_TRIGGER 0x00000006U
705 #define TIM_SLAVEMODE_EXTERNAL1 0x00000007U
713 #define TIM_MASTERSLAVEMODE_ENABLE 0x00000080U
714 #define TIM_MASTERSLAVEMODE_DISABLE 0x00000000U
722 #define TIM_TS_ITR0 0x00000000U
723 #define TIM_TS_ITR1 0x00000010U
724 #define TIM_TS_ITR2 0x00000020U
725 #define TIM_TS_ITR3 0x00000030U
726 #define TIM_TS_TI1F_ED 0x00000040U
727 #define TIM_TS_TI1FP1 0x00000050U
728 #define TIM_TS_TI2FP2 0x00000060U
729 #define TIM_TS_ETRF 0x00000070U
730 #define TIM_TS_NONE 0x0000FFFFU
738 #define TIM_TRIGGERPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED
739 #define TIM_TRIGGERPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED
740 #define TIM_TRIGGERPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
741 #define TIM_TRIGGERPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
742 #define TIM_TRIGGERPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE
750 #define TIM_TRIGGERPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1
751 #define TIM_TRIGGERPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2
752 #define TIM_TRIGGERPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4
753 #define TIM_TRIGGERPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8
762 #define TIM_TI1SELECTION_CH1 0x00000000U
763 #define TIM_TI1SELECTION_XORCOMBINATION (TIM_CR2_TI1S)
771 #define TIM_DMABASE_CR1 0x00000000U
772 #define TIM_DMABASE_CR2 0x00000001U
773 #define TIM_DMABASE_SMCR 0x00000002U
774 #define TIM_DMABASE_DIER 0x00000003U
775 #define TIM_DMABASE_SR 0x00000004U
776 #define TIM_DMABASE_EGR 0x00000005U
777 #define TIM_DMABASE_CCMR1 0x00000006U
778 #define TIM_DMABASE_CCMR2 0x00000007U
779 #define TIM_DMABASE_CCER 0x00000008U
780 #define TIM_DMABASE_CNT 0x00000009U
781 #define TIM_DMABASE_PSC 0x0000000AU
782 #define TIM_DMABASE_ARR 0x0000000BU
783 #define TIM_DMABASE_RCR 0x0000000CU
784 #define TIM_DMABASE_CCR1 0x0000000DU
785 #define TIM_DMABASE_CCR2 0x0000000EU
786 #define TIM_DMABASE_CCR3 0x0000000FU
787 #define TIM_DMABASE_CCR4 0x00000010U
788 #define TIM_DMABASE_BDTR 0x00000011U
789 #define TIM_DMABASE_DCR 0x00000012U
790 #define TIM_DMABASE_OR 0x00000013U
798 #define TIM_DMABURSTLENGTH_1TRANSFER 0x00000000U
799 #define TIM_DMABURSTLENGTH_2TRANSFERS 0x00000100U
800 #define TIM_DMABURSTLENGTH_3TRANSFERS 0x00000200U
801 #define TIM_DMABURSTLENGTH_4TRANSFERS 0x00000300U
802 #define TIM_DMABURSTLENGTH_5TRANSFERS 0x00000400U
803 #define TIM_DMABURSTLENGTH_6TRANSFERS 0x00000500U
804 #define TIM_DMABURSTLENGTH_7TRANSFERS 0x00000600U
805 #define TIM_DMABURSTLENGTH_8TRANSFERS 0x00000700U
806 #define TIM_DMABURSTLENGTH_9TRANSFERS 0x00000800U
807 #define TIM_DMABURSTLENGTH_10TRANSFERS 0x00000900U
808 #define TIM_DMABURSTLENGTH_11TRANSFERS 0x00000A00U
809 #define TIM_DMABURSTLENGTH_12TRANSFERS 0x00000B00U
810 #define TIM_DMABURSTLENGTH_13TRANSFERS 0x00000C00U
811 #define TIM_DMABURSTLENGTH_14TRANSFERS 0x00000D00U
812 #define TIM_DMABURSTLENGTH_15TRANSFERS 0x00000E00U
813 #define TIM_DMABURSTLENGTH_16TRANSFERS 0x00000F00U
814 #define TIM_DMABURSTLENGTH_17TRANSFERS 0x00001000U
815 #define TIM_DMABURSTLENGTH_18TRANSFERS 0x00001100U
823 #define TIM_DMA_ID_UPDATE ((uint16_t)0x0000)
824 #define TIM_DMA_ID_CC1 ((uint16_t)0x0001)
825 #define TIM_DMA_ID_CC2 ((uint16_t)0x0002)
826 #define TIM_DMA_ID_CC3 ((uint16_t)0x0003)
827 #define TIM_DMA_ID_CC4 ((uint16_t)0x0004)
828 #define TIM_DMA_ID_COMMUTATION ((uint16_t)0x0005)
829 #define TIM_DMA_ID_TRIGGER ((uint16_t)0x0006)
837 #define TIM_CCx_ENABLE 0x00000001U
838 #define TIM_CCx_DISABLE 0x00000000U
839 #define TIM_CCxN_ENABLE 0x00000004U
840 #define TIM_CCxN_DISABLE 0x00000000U
857 #define __HAL_TIM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_TIM_STATE_RESET)
864 #define __HAL_TIM_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1|=(TIM_CR1_CEN))
871 #define __HAL_TIM_MOE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->BDTR|=(TIM_BDTR_MOE))
879 #define __HAL_TIM_DISABLE(__HANDLE__) \
881 if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0U) \
883 if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0U) \
885 (__HANDLE__)->Instance->CR1 &= ~(TIM_CR1_CEN); \
897 #define __HAL_TIM_MOE_DISABLE(__HANDLE__) \
899 if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0U) \
901 if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0U) \
903 (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE); \
914 #define __HAL_TIM_MOE_DISABLE_UNCONDITIONALLY(__HANDLE__) (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE)
930 #define __HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER |= (__INTERRUPT__))
947 #define __HAL_TIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER &= ~(__INTERRUPT__))
962 #define __HAL_TIM_ENABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER |= (__DMA__))
977 #define __HAL_TIM_DISABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER &= ~(__DMA__))
1001 #define __HAL_TIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__))
1025 #define __HAL_TIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
1042 #define __HAL_TIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->DIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
1058 #define __HAL_TIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->SR = ~(__INTERRUPT__))
1067 #define __HAL_TIM_IS_TIM_COUNTING_DOWN(__HANDLE__) (((__HANDLE__)->Instance->CR1 &(TIM_CR1_DIR)) == (TIM_CR1_DIR))
1075 #define __HAL_TIM_SET_PRESCALER(__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__))
1077 #define TIM_SET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__, __ICPSC__) \
1078 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= (__ICPSC__)) :\
1079 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= ((__ICPSC__) << 8U)) :\
1080 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= (__ICPSC__)) :\
1081 ((__HANDLE__)->Instance->CCMR2 |= ((__ICPSC__) << 8U)))
1083 #define TIM_RESET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__) \
1084 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC1PSC) :\
1085 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC2PSC) :\
1086 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC3PSC) :\
1087 ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC4PSC))
1089 #define TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \
1090 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER |= (__POLARITY__)) :\
1091 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 4U)) :\
1092 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 8U)) :\
1093 ((__HANDLE__)->Instance->CCER |= (((__POLARITY__) << 12U) & TIM_CCER_CC4P)))
1095 #define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \
1096 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\
1097 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\
1098 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC3P | TIM_CCER_CC3NP)) :\
1099 ((__HANDLE__)->Instance->CCER &= (uint16_t)~TIM_CCER_CC4P))
1114 #define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \
1115 (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2U)) = (__COMPARE__))
1130 #define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \
1131 (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2U)))
1139 #define __HAL_TIM_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CNT = (__COUNTER__))
1146 #define __HAL_TIM_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNT)
1155 #define __HAL_TIM_SET_AUTORELOAD(__HANDLE__, __AUTORELOAD__) \
1157 (__HANDLE__)->Instance->ARR = (__AUTORELOAD__); \
1158 (__HANDLE__)->Init.Period = (__AUTORELOAD__); \
1165 #define __HAL_TIM_GET_AUTORELOAD(__HANDLE__) ((__HANDLE__)->Instance->ARR)
1177 #define __HAL_TIM_SET_CLOCKDIVISION(__HANDLE__, __CKD__) \
1179 (__HANDLE__)->Instance->CR1 &= (uint16_t)(~TIM_CR1_CKD); \
1180 (__HANDLE__)->Instance->CR1 |= (__CKD__); \
1181 (__HANDLE__)->Init.ClockDivision = (__CKD__); \
1191 #define __HAL_TIM_GET_CLOCKDIVISION(__HANDLE__) ((__HANDLE__)->Instance->CR1 & TIM_CR1_CKD)
1211 #define __HAL_TIM_SET_ICPRESCALER(__HANDLE__, __CHANNEL__, __ICPSC__) \
1213 TIM_RESET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__)); \
1214 TIM_SET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__), (__ICPSC__)); \
1232 #define __HAL_TIM_GET_ICPRESCALER(__HANDLE__, __CHANNEL__) \
1233 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC1PSC) :\
1234 ((__CHANNEL__) == TIM_CHANNEL_2) ? (((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC2PSC) >> 8U) :\
1235 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC3PSC) :\
1236 (((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC4PSC)) >> 8U)
1246 #define __HAL_TIM_URS_ENABLE(__HANDLE__) \
1247 ((__HANDLE__)->Instance->CR1|= (TIM_CR1_URS))
1260 #define __HAL_TIM_URS_DISABLE(__HANDLE__) \
1261 ((__HANDLE__)->Instance->CR1&=~(TIM_CR1_URS))
1279 #define __HAL_TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \
1281 TIM_RESET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__)); \
1282 TIM_SET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__), (__POLARITY__)); \
1450 uint32_t *BurstBuffer, uint32_t BurstLength);
1453 uint32_t *BurstBuffer, uint32_t BurstLength);
1504 #define IS_TIM_COUNTER_MODE(MODE) (((MODE) == TIM_COUNTERMODE_UP) || \
1505 ((MODE) == TIM_COUNTERMODE_DOWN) || \
1506 ((MODE) == TIM_COUNTERMODE_CENTERALIGNED1) || \
1507 ((MODE) == TIM_COUNTERMODE_CENTERALIGNED2) || \
1508 ((MODE) == TIM_COUNTERMODE_CENTERALIGNED3))
1510 #define IS_TIM_CLOCKDIVISION_DIV(DIV) (((DIV) == TIM_CLOCKDIVISION_DIV1) || \
1511 ((DIV) == TIM_CLOCKDIVISION_DIV2) || \
1512 ((DIV) == TIM_CLOCKDIVISION_DIV4))
1514 #define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \
1515 ((MODE) == TIM_OCMODE_PWM2))
1517 #define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \
1518 ((MODE) == TIM_OCMODE_ACTIVE) || \
1519 ((MODE) == TIM_OCMODE_INACTIVE) || \
1520 ((MODE) == TIM_OCMODE_TOGGLE) || \
1521 ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \
1522 ((MODE) == TIM_OCMODE_FORCED_INACTIVE))
1524 #define IS_TIM_FAST_STATE(STATE) (((STATE) == TIM_OCFAST_DISABLE) || \
1525 ((STATE) == TIM_OCFAST_ENABLE))
1527 #define IS_TIM_OC_POLARITY(POLARITY) (((POLARITY) == TIM_OCPOLARITY_HIGH) || \
1528 ((POLARITY) == TIM_OCPOLARITY_LOW))
1530 #define IS_TIM_OCN_POLARITY(POLARITY) (((POLARITY) == TIM_OCNPOLARITY_HIGH) || \
1531 ((POLARITY) == TIM_OCNPOLARITY_LOW))
1533 #define IS_TIM_OCIDLE_STATE(STATE) (((STATE) == TIM_OCIDLESTATE_SET) || \
1534 ((STATE) == TIM_OCIDLESTATE_RESET))
1536 #define IS_TIM_OCNIDLE_STATE(STATE) (((STATE) == TIM_OCNIDLESTATE_SET) || \
1537 ((STATE) == TIM_OCNIDLESTATE_RESET))
1539 #define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
1540 ((CHANNEL) == TIM_CHANNEL_2) || \
1541 ((CHANNEL) == TIM_CHANNEL_3) || \
1542 ((CHANNEL) == TIM_CHANNEL_4) || \
1543 ((CHANNEL) == TIM_CHANNEL_ALL))
1545 #define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
1546 ((CHANNEL) == TIM_CHANNEL_2))
1548 #define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
1549 ((CHANNEL) == TIM_CHANNEL_2) || \
1550 ((CHANNEL) == TIM_CHANNEL_3))
1552 #define IS_TIM_IC_POLARITY(POLARITY) (((POLARITY) == TIM_ICPOLARITY_RISING) || \
1553 ((POLARITY) == TIM_ICPOLARITY_FALLING) || \
1554 ((POLARITY) == TIM_ICPOLARITY_BOTHEDGE))
1556 #define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSELECTION_DIRECTTI) || \
1557 ((SELECTION) == TIM_ICSELECTION_INDIRECTTI) || \
1558 ((SELECTION) == TIM_ICSELECTION_TRC))
1560 #define IS_TIM_IC_PRESCALER(PRESCALER) (((PRESCALER) == TIM_ICPSC_DIV1) || \
1561 ((PRESCALER) == TIM_ICPSC_DIV2) || \
1562 ((PRESCALER) == TIM_ICPSC_DIV4) || \
1563 ((PRESCALER) == TIM_ICPSC_DIV8))
1565 #define IS_TIM_OPM_MODE(MODE) (((MODE) == TIM_OPMODE_SINGLE) || \
1566 ((MODE) == TIM_OPMODE_REPETITIVE))
1568 #define IS_TIM_DMA_SOURCE(SOURCE) ((((SOURCE) & 0xFFFF80FFU) == 0x00000000U) && ((SOURCE) != 0x00000000U))
1570 #define IS_TIM_ENCODER_MODE(MODE) (((MODE) == TIM_ENCODERMODE_TI1) || \
1571 ((MODE) == TIM_ENCODERMODE_TI2) || \
1572 ((MODE) == TIM_ENCODERMODE_TI12))
1574 #define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & 0xFFFFFF00U) == 0x00000000U) && ((SOURCE) != 0x00000000U))
1576 #define IS_TIM_CLOCKSOURCE(CLOCK) (((CLOCK) == TIM_CLOCKSOURCE_INTERNAL) || \
1577 ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE2) || \
1578 ((CLOCK) == TIM_CLOCKSOURCE_ITR0) || \
1579 ((CLOCK) == TIM_CLOCKSOURCE_ITR1) || \
1580 ((CLOCK) == TIM_CLOCKSOURCE_ITR2) || \
1581 ((CLOCK) == TIM_CLOCKSOURCE_ITR3) || \
1582 ((CLOCK) == TIM_CLOCKSOURCE_TI1ED) || \
1583 ((CLOCK) == TIM_CLOCKSOURCE_TI1) || \
1584 ((CLOCK) == TIM_CLOCKSOURCE_TI2) || \
1585 ((CLOCK) == TIM_CLOCKSOURCE_ETRMODE1))
1587 #define IS_TIM_CLOCKPOLARITY(POLARITY) (((POLARITY) == TIM_CLOCKPOLARITY_INVERTED) || \
1588 ((POLARITY) == TIM_CLOCKPOLARITY_NONINVERTED) || \
1589 ((POLARITY) == TIM_CLOCKPOLARITY_RISING) || \
1590 ((POLARITY) == TIM_CLOCKPOLARITY_FALLING) || \
1591 ((POLARITY) == TIM_CLOCKPOLARITY_BOTHEDGE))
1593 #define IS_TIM_CLOCKPRESCALER(PRESCALER) (((PRESCALER) == TIM_CLOCKPRESCALER_DIV1) || \
1594 ((PRESCALER) == TIM_CLOCKPRESCALER_DIV2) || \
1595 ((PRESCALER) == TIM_CLOCKPRESCALER_DIV4) || \
1596 ((PRESCALER) == TIM_CLOCKPRESCALER_DIV8))
1598 #define IS_TIM_CLOCKFILTER(ICFILTER) ((ICFILTER) <= 0x0FU)
1600 #define IS_TIM_CLEARINPUT_SOURCE(SOURCE) (((SOURCE) == TIM_CLEARINPUTSOURCE_NONE) || \
1601 ((SOURCE) == TIM_CLEARINPUTSOURCE_ETR))
1603 #define IS_TIM_CLEARINPUT_POLARITY(POLARITY) (((POLARITY) == TIM_CLEARINPUTPOLARITY_INVERTED) || \
1604 ((POLARITY) == TIM_CLEARINPUTPOLARITY_NONINVERTED))
1606 #define IS_TIM_CLEARINPUT_PRESCALER(PRESCALER) (((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV1) || \
1607 ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV2) || \
1608 ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV4) || \
1609 ((PRESCALER) == TIM_CLEARINPUTPRESCALER_DIV8))
1611 #define IS_TIM_CLEARINPUT_FILTER(ICFILTER) ((ICFILTER) <= 0x0FU)
1613 #define IS_TIM_OSSR_STATE(STATE) (((STATE) == TIM_OSSR_ENABLE) || \
1614 ((STATE) == TIM_OSSR_DISABLE))
1616 #define IS_TIM_OSSI_STATE(STATE) (((STATE) == TIM_OSSI_ENABLE) || \
1617 ((STATE) == TIM_OSSI_DISABLE))
1619 #define IS_TIM_LOCK_LEVEL(LEVEL) (((LEVEL) == TIM_LOCKLEVEL_OFF) || \
1620 ((LEVEL) == TIM_LOCKLEVEL_1) || \
1621 ((LEVEL) == TIM_LOCKLEVEL_2) || \
1622 ((LEVEL) == TIM_LOCKLEVEL_3))
1624 #define IS_TIM_BREAK_STATE(STATE) (((STATE) == TIM_BREAK_ENABLE) || \
1625 ((STATE) == TIM_BREAK_DISABLE))
1627 #define IS_TIM_BREAK_POLARITY(POLARITY) (((POLARITY) == TIM_BREAKPOLARITY_LOW) || \
1628 ((POLARITY) == TIM_BREAKPOLARITY_HIGH))
1630 #define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE) (((STATE) == TIM_AUTOMATICOUTPUT_ENABLE) || \
1631 ((STATE) == TIM_AUTOMATICOUTPUT_DISABLE))
1633 #define IS_TIM_TRGO_SOURCE(SOURCE) (((SOURCE) == TIM_TRGO_RESET) || \
1634 ((SOURCE) == TIM_TRGO_ENABLE) || \
1635 ((SOURCE) == TIM_TRGO_UPDATE) || \
1636 ((SOURCE) == TIM_TRGO_OC1) || \
1637 ((SOURCE) == TIM_TRGO_OC1REF) || \
1638 ((SOURCE) == TIM_TRGO_OC2REF) || \
1639 ((SOURCE) == TIM_TRGO_OC3REF) || \
1640 ((SOURCE) == TIM_TRGO_OC4REF))
1642 #define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \
1643 ((MODE) == TIM_SLAVEMODE_GATED) || \
1644 ((MODE) == TIM_SLAVEMODE_RESET) || \
1645 ((MODE) == TIM_SLAVEMODE_TRIGGER) || \
1646 ((MODE) == TIM_SLAVEMODE_EXTERNAL1))
1648 #define IS_TIM_MSM_STATE(STATE) (((STATE) == TIM_MASTERSLAVEMODE_ENABLE) || \
1649 ((STATE) == TIM_MASTERSLAVEMODE_DISABLE))
1651 #define IS_TIM_TRIGGER_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \
1652 ((SELECTION) == TIM_TS_ITR1) || \
1653 ((SELECTION) == TIM_TS_ITR2) || \
1654 ((SELECTION) == TIM_TS_ITR3) || \
1655 ((SELECTION) == TIM_TS_TI1F_ED) || \
1656 ((SELECTION) == TIM_TS_TI1FP1) || \
1657 ((SELECTION) == TIM_TS_TI2FP2) || \
1658 ((SELECTION) == TIM_TS_ETRF))
1660 #define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(SELECTION) (((SELECTION) == TIM_TS_ITR0) || \
1661 ((SELECTION) == TIM_TS_ITR1) || \
1662 ((SELECTION) == TIM_TS_ITR2) || \
1663 ((SELECTION) == TIM_TS_ITR3) || \
1664 ((SELECTION) == TIM_TS_NONE))
1666 #define IS_TIM_TRIGGERPOLARITY(POLARITY) (((POLARITY) == TIM_TRIGGERPOLARITY_INVERTED ) || \
1667 ((POLARITY) == TIM_TRIGGERPOLARITY_NONINVERTED) || \
1668 ((POLARITY) == TIM_TRIGGERPOLARITY_RISING ) || \
1669 ((POLARITY) == TIM_TRIGGERPOLARITY_FALLING ) || \
1670 ((POLARITY) == TIM_TRIGGERPOLARITY_BOTHEDGE ))
1672 #define IS_TIM_TRIGGERPRESCALER(PRESCALER) (((PRESCALER) == TIM_TRIGGERPRESCALER_DIV1) || \
1673 ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV2) || \
1674 ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV4) || \
1675 ((PRESCALER) == TIM_TRIGGERPRESCALER_DIV8))
1677 #define IS_TIM_TRIGGERFILTER(ICFILTER) ((ICFILTER) <= 0x0FU)
1679 #define IS_TIM_TI1SELECTION(TI1SELECTION) (((TI1SELECTION) == TIM_TI1SELECTION_CH1) || \
1680 ((TI1SELECTION) == TIM_TI1SELECTION_XORCOMBINATION))
1682 #define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABASE_CR1) || \
1683 ((BASE) == TIM_DMABASE_CR2) || \
1684 ((BASE) == TIM_DMABASE_SMCR) || \
1685 ((BASE) == TIM_DMABASE_DIER) || \
1686 ((BASE) == TIM_DMABASE_SR) || \
1687 ((BASE) == TIM_DMABASE_EGR) || \
1688 ((BASE) == TIM_DMABASE_CCMR1) || \
1689 ((BASE) == TIM_DMABASE_CCMR2) || \
1690 ((BASE) == TIM_DMABASE_CCER) || \
1691 ((BASE) == TIM_DMABASE_CNT) || \
1692 ((BASE) == TIM_DMABASE_PSC) || \
1693 ((BASE) == TIM_DMABASE_ARR) || \
1694 ((BASE) == TIM_DMABASE_RCR) || \
1695 ((BASE) == TIM_DMABASE_CCR1) || \
1696 ((BASE) == TIM_DMABASE_CCR2) || \
1697 ((BASE) == TIM_DMABASE_CCR3) || \
1698 ((BASE) == TIM_DMABASE_CCR4) || \
1699 ((BASE) == TIM_DMABASE_BDTR) || \
1700 ((BASE) == TIM_DMABASE_DCR) || \
1701 ((BASE) == TIM_DMABASE_OR))
1703 #define IS_TIM_DMA_LENGTH(LENGTH) (((LENGTH) == TIM_DMABURSTLENGTH_1TRANSFER) || \
1704 ((LENGTH) == TIM_DMABURSTLENGTH_2TRANSFERS) || \
1705 ((LENGTH) == TIM_DMABURSTLENGTH_3TRANSFERS) || \
1706 ((LENGTH) == TIM_DMABURSTLENGTH_4TRANSFERS) || \
1707 ((LENGTH) == TIM_DMABURSTLENGTH_5TRANSFERS) || \
1708 ((LENGTH) == TIM_DMABURSTLENGTH_6TRANSFERS) || \
1709 ((LENGTH) == TIM_DMABURSTLENGTH_7TRANSFERS) || \
1710 ((LENGTH) == TIM_DMABURSTLENGTH_8TRANSFERS) || \
1711 ((LENGTH) == TIM_DMABURSTLENGTH_9TRANSFERS) || \
1712 ((LENGTH) == TIM_DMABURSTLENGTH_10TRANSFERS) || \
1713 ((LENGTH) == TIM_DMABURSTLENGTH_11TRANSFERS) || \
1714 ((LENGTH) == TIM_DMABURSTLENGTH_12TRANSFERS) || \
1715 ((LENGTH) == TIM_DMABURSTLENGTH_13TRANSFERS) || \
1716 ((LENGTH) == TIM_DMABURSTLENGTH_14TRANSFERS) || \
1717 ((LENGTH) == TIM_DMABURSTLENGTH_15TRANSFERS) || \
1718 ((LENGTH) == TIM_DMABURSTLENGTH_16TRANSFERS) || \
1719 ((LENGTH) == TIM_DMABURSTLENGTH_17TRANSFERS) || \
1720 ((LENGTH) == TIM_DMABURSTLENGTH_18TRANSFERS))
1722 #define IS_TIM_IC_FILTER(ICFILTER) ((ICFILTER) <= 0x0FU)
1732 #define TIM_CCER_CCxE_MASK ((uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC3E | TIM_CCER_CC4E))
1733 #define TIM_CCER_CCxNE_MASK ((uint32_t)(TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE))
1747 void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter);
1752 void TIM_CCxChannelCmd(TIM_TypeDef* TIMx, uint32_t Channel, uint32_t ChannelState);
HAL_StatusTypeDef HAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
TIM Input Capture Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:162
HAL_StatusTypeDef HAL_TIM_Base_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length)
uint32_t IC1Polarity
Definition: stm32f4xx_hal_tim.h:186
HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA(TIM_HandleTypeDef *htim)
uint32_t IC2Prescaler
Definition: stm32f4xx_hal_tim.h:204
uint32_t Period
Definition: stm32f4xx_hal_tim.h:71
uint32_t IC1Filter
Definition: stm32f4xx_hal_tim.h:195
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_TIM_StateTypeDef HAL_TIM_Encoder_GetState(TIM_HandleTypeDef *htim)
HAL_TIM_StateTypeDef
HAL State structures definition.
Definition: stm32f4xx_hal_tim.h:263
HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim)
void TIM_DMAError(DMA_HandleTypeDef *hdma)
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
Period elapsed callback in non blocking mode.
Definition: main.c:1033
HAL_StatusTypeDef HAL_TIM_OnePulse_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
uint32_t IC2Filter
Definition: stm32f4xx_hal_tim.h:207
HAL_StatusTypeDef HAL_TIM_OC_Init(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfig, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc)
HAL_StatusTypeDef HAL_TIM_OC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_IC_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
TIM One Pulse Mode Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:124
TIM Time base Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:63
uint32_t OCIdleState
Definition: stm32f4xx_hal_tim.h:112
HAL_StatusTypeDef HAL_TIM_OnePulse_Init(TIM_HandleTypeDef *htim, uint32_t OnePulseMode)
Definition: stm32f4xx_hal_tim.h:268
void TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma)
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_Base_Start_IT(TIM_HandleTypeDef *htim)
uint32_t ClockDivision
Definition: stm32f4xx_hal_tim.h:75
uint32_t OCNPolarity
Definition: stm32f4xx_hal_tim.h:103
uint32_t ICSelection
Definition: stm32f4xx_hal_tim.h:150
HAL_StatusTypeDef HAL_TIM_GenerateEvent(TIM_HandleTypeDef *htim, uint32_t EventSource)
HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization_IT(TIM_HandleTypeDef *htim, TIM_SlaveConfigTypeDef *sSlaveConfig)
uint32_t OCPolarity
Definition: stm32f4xx_hal_tim.h:100
HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData1, uint32_t *pData2, uint16_t Length)
HAL_StatusTypeDef HAL_TIM_IC_DeInit(TIM_HandleTypeDef *htim)
uint32_t OCFastMode
Definition: stm32f4xx_hal_tim.h:107
Definition: stm32f4xx_hal_tim.h:265
HAL_StatusTypeDef HAL_TIM_IC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OnePulse_InitTypeDef *sConfig, uint32_t OutputChannel, uint32_t InputChannel)
uint32_t OCNIdleState
Definition: stm32f4xx_hal_tim.h:143
uint32_t CounterMode
Definition: stm32f4xx_hal_tim.h:68
uint32_t EncoderMode
Definition: stm32f4xx_hal_tim.h:183
void HAL_TIM_OC_MspInit(TIM_HandleTypeDef *htim)
uint32_t Pulse
Definition: stm32f4xx_hal_tim.h:129
uint32_t ICFilter
Definition: stm32f4xx_hal_tim.h:153
void HAL_TIM_ErrorCallback(TIM_HandleTypeDef *htim)
HAL_TIM_StateTypeDef HAL_TIM_Base_GetState(TIM_HandleTypeDef *htim)
void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState)
TIM Output Compare Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:92
HAL_StatusTypeDef HAL_TIM_OC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
uint32_t OCPolarity
Definition: stm32f4xx_hal_tim.h:132
void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim)
uint32_t TriggerPrescaler
Definition: stm32f4xx_hal_tim.h:253
HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, TIM_Encoder_InitTypeDef *sConfig)
HAL_TIM_ActiveChannel
HAL Active channel structures definition.
Definition: stm32f4xx_hal_tim.h:275
uint32_t SlaveMode
Definition: stm32f4xx_hal_tim.h:247
HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_Base_DeInit(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:55
void HAL_TIM_OnePulse_MspDeInit(TIM_HandleTypeDef *htim)
void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, TIM_OC_InitTypeDef *OC_Config)
void HAL_TIM_IC_MspDeInit(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_PWM_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_TIM_StateTypeDef HAL_TIM_OnePulse_GetState(TIM_HandleTypeDef *htim)
uint32_t OCMode
Definition: stm32f4xx_hal_tim.h:126
uint32_t ICPrescaler
Definition: stm32f4xx_hal_tim.h:170
uint32_t HAL_TIM_ReadCapturedValue(TIM_HandleTypeDef *htim, uint32_t Channel)
uint32_t RepetitionCounter
Definition: stm32f4xx_hal_tim.h:78
uint32_t IC1Selection
Definition: stm32f4xx_hal_tim.h:189
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim)
TIM_Base MSP Initialization This function configures the hardware resources used in this example.
Definition: stm32f4xx_hal_msp.c:386
uint32_t ICFilter
Definition: stm32f4xx_hal_tim.h:173
Definition: stm32f4xx_hal_tim.h:277
void HAL_TIM_IC_MspInit(TIM_HandleTypeDef *htim)
uint32_t ClockPrescaler
Definition: stm32f4xx_hal_tim.h:220
HAL_StatusTypeDef HAL_TIM_Encoder_DeInit(TIM_HandleTypeDef *htim)
HAL_TIM_StateTypeDef HAL_TIM_OC_GetState(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength)
uint32_t ICPolarity
Definition: stm32f4xx_hal_tim.h:164
HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_OC_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfig, uint32_t Channel)
DMA handle Structure definition.
Definition: stm32f4xx_hal_dma.h:155
uint32_t InputTrigger
Definition: stm32f4xx_hal_tim.h:249
void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma)
uint32_t OCIdleState
Definition: stm32f4xx_hal_tim.h:139
HAL_StatusTypeDef HAL_TIM_Encoder_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_OC_Start(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_OnePulse_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
TIM_TypeDef * Instance
Definition: stm32f4xx_hal_tim.h:289
HAL_StatusTypeDef HAL_TIM_IC_ConfigChannel(TIM_HandleTypeDef *htim, TIM_IC_InitTypeDef *sConfig, uint32_t Channel)
void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef *htim)
HAL_LockTypeDef Lock
Definition: stm32f4xx_hal_tim.h:294
uint32_t IC2Selection
Definition: stm32f4xx_hal_tim.h:201
HAL_StatusTypeDef HAL_TIM_Base_Stop_IT(TIM_HandleTypeDef *htim)
Definition: stm32f4xx_hal_tim.h:279
void TIM_Base_SetConfig(TIM_TypeDef *TIMx, TIM_Base_InitTypeDef *Structure)
void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_OnePulse_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel)
uint32_t ClockPolarity
Definition: stm32f4xx_hal_tim.h:218
Definition: stm32f4xx_hal_tim.h:278
HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength)
void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
uint32_t OCNPolarity
Definition: stm32f4xx_hal_tim.h:135
uint32_t Prescaler
Definition: stm32f4xx_hal_tim.h:65
uint32_t ICPolarity
Definition: stm32f4xx_hal_tim.h:147
HAL_StatusTypeDef HAL_TIM_Encoder_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
uint32_t Pulse
Definition: stm32f4xx_hal_tim.h:97
uint32_t OCNIdleState
Definition: stm32f4xx_hal_tim.h:116
HAL_StatusTypeDef HAL_TIM_Base_Start(TIM_HandleTypeDef *htim)
uint32_t OCMode
Definition: stm32f4xx_hal_tim.h:94
Definition: stm32f4xx_hal_tim.h:281
TIM Encoder Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:181
Definition: stm32f4xx_hal_tim.h:267
TIM Slave configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:246
HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
HAL_TIM_ActiveChannel Channel
Definition: stm32f4xx_hal_tim.h:291
HAL_StatusTypeDef HAL_TIM_PWM_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_OnePulse_DeInit(TIM_HandleTypeDef *htim)
uint32_t TriggerFilter
Definition: stm32f4xx_hal_tim.h:255
HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_Selection)
HAL_TIM_StateTypeDef HAL_TIM_PWM_GetState(TIM_HandleTypeDef *htim)
TIM Time Base Handle Structure definition.
Definition: stm32f4xx_hal_tim.h:287
HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
uint32_t IC2Polarity
Definition: stm32f4xx_hal_tim.h:198
HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, TIM_ClockConfigTypeDef *sClockSourceConfig)
HAL_StatusTypeDef HAL_TIM_OC_DeInit(TIM_HandleTypeDef *htim)
Definition: stm32f4xx_hal_tim.h:269
Definition: stm32f4xx_hal_tim.h:280
Clock Configuration Handle Structure definition.
Definition: stm32f4xx_hal_tim.h:214
void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim)
TIM_Base_InitTypeDef Init
Definition: stm32f4xx_hal_tim.h:290
HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_OC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
uint32_t ICSelection
Definition: stm32f4xx_hal_tim.h:167
uint32_t IC1Prescaler
Definition: stm32f4xx_hal_tim.h:192
HAL_LockTypeDef
HAL Lock structures definition.
Definition: stm32f4xx_hal_def.h:66
Header file of TIM HAL Extension module.
void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter)
HAL_StatusTypeDef HAL_TIM_PWM_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc)
HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchronization(TIM_HandleTypeDef *htim, TIM_SlaveConfigTypeDef *sSlaveConfig)
HAL_StatusTypeDef HAL_TIM_ConfigOCrefClear(TIM_HandleTypeDef *htim, TIM_ClearInputConfigTypeDef *sClearInputConfig, uint32_t Channel)
Definition: stm32f4xx_hal_tim.h:266
HAL_StatusTypeDef HAL_TIM_IC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel)
HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
HAL_StatusTypeDef HAL_TIM_Base_Stop(TIM_HandleTypeDef *htim)
void HAL_TIM_OC_MspDeInit(TIM_HandleTypeDef *htim)
HAL_TIM_StateTypeDef HAL_TIM_IC_GetState(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_IC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel)
uint32_t ClockSource
Definition: stm32f4xx_hal_tim.h:216
void HAL_TIM_OnePulse_MspInit(TIM_HandleTypeDef *htim)
uint32_t ClockFilter
Definition: stm32f4xx_hal_tim.h:222
uint32_t TriggerPolarity
Definition: stm32f4xx_hal_tim.h:251
void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_IC_Init(TIM_HandleTypeDef *htim)
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim)
TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example.
Definition: stm32f4xx_hal_msp.c:500
void HAL_TIM_TriggerCallback(TIM_HandleTypeDef *htim)
HAL_StatusTypeDef HAL_TIM_PWM_DeInit(TIM_HandleTypeDef *htim)
__IO HAL_TIM_StateTypeDef State
Definition: stm32f4xx_hal_tim.h:295