48 #define SMCR_ETR_Mask ((uint16_t)0x00FF) 49 #define CCMR_Offset ((uint16_t)0x0018) 50 #define CCER_CCE_Set ((uint16_t)0x0001) 51 #define CCER_CCNE_Set ((uint16_t)0x0004) 78 uint16_t TIM_ICFilter);
80 uint16_t TIM_ICFilter);
82 uint16_t TIM_ICFilter);
84 uint16_t TIM_ICFilter);
132 else if (TIMx ==
TIM2)
137 else if (TIMx ==
TIM3)
142 else if (TIMx ==
TIM4)
147 else if (TIMx ==
TIM5)
152 else if (TIMx ==
TIM6)
157 else if (TIMx ==
TIM7)
162 else if (TIMx ==
TIM8)
167 else if (TIMx ==
TIM9)
172 else if (TIMx ==
TIM10)
177 else if (TIMx ==
TIM11)
182 else if (TIMx ==
TIM12)
187 else if (TIMx ==
TIM13)
192 else if (TIMx ==
TIM14)
197 else if (TIMx ==
TIM15)
202 else if (TIMx ==
TIM16)
245 if((TIMx !=
TIM6) && (TIMx !=
TIM7))
281 uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
291 tmpccer = TIMx->
CCER;
296 tmpccmrx = TIMx->
CCMR1;
344 TIMx->
CCMR1 = tmpccmrx;
350 TIMx->
CCER = tmpccer;
364 uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
375 tmpccer = TIMx->
CCER;
380 tmpccmrx = TIMx->
CCMR1;
387 tmpccmrx |= (uint16_t)(TIM_OCInitStruct->
TIM_OCMode << 8);
397 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
427 TIMx->
CCMR1 = tmpccmrx;
433 TIMx->
CCER = tmpccer;
446 uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
457 tmpccer = TIMx->
CCER;
462 tmpccmrx = TIMx->
CCMR2;
478 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
506 TIMx->
CCMR2 = tmpccmrx;
512 TIMx->
CCER = tmpccer;
525 uint16_t tmpccmrx = 0, tmpccer = 0, tmpcr2 = 0;
536 tmpccer = TIMx->
CCER;
541 tmpccmrx = TIMx->
CCMR2;
548 tmpccmrx |= (uint16_t)(TIM_OCInitStruct->
TIM_OCMode << 8);
558 if((TIMx ==
TIM1) || (TIMx ==
TIM8))
570 TIMx->
CCMR2 = tmpccmrx;
576 TIMx->
CCER = tmpccer;
882 TIMx->
DIER |= TIM_IT;
887 TIMx->
DIER &= (uint16_t)~TIM_IT;
916 TIMx->
EGR = TIM_EventSource;
944 TIMx->
DCR = TIM_DMABase | TIM_DMABurstLength;
974 TIMx->
DIER |= TIM_DMASource;
979 TIMx->
DIER &= (uint16_t)~TIM_DMASource;
1036 uint16_t TIM_ICPolarity, uint16_t ICFilter)
1076 uint16_t ExtTRGFilter)
1078 uint16_t tmpsmcr = 0;
1085 TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter);
1088 tmpsmcr = TIMx->
SMCR;
1097 TIMx->
SMCR = tmpsmcr;
1118 uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
1126 TIM_ETRConfig(TIMx, TIM_ExtTRGPrescaler, TIM_ExtTRGPolarity, ExtTRGFilter);
1149 uint16_t ExtTRGFilter)
1151 uint16_t tmpsmcr = 0;
1157 tmpsmcr = TIMx->
SMCR;
1161 tmpsmcr |= (uint16_t)(TIM_ExtTRGPrescaler | (uint16_t)(TIM_ExtTRGPolarity | (uint16_t)(ExtTRGFilter << (uint16_t)8)));
1163 TIMx->
SMCR = tmpsmcr;
1182 TIMx->
PSC = Prescaler;
1184 TIMx->
EGR = TIM_PSCReloadMode;
1201 uint16_t tmpcr1 = 0;
1209 tmpcr1 |= TIM_CounterMode;
1231 uint16_t tmpsmcr = 0;
1236 tmpsmcr = TIMx->
SMCR;
1240 tmpsmcr |= TIM_InputTriggerSource;
1242 TIMx->
SMCR = tmpsmcr;
1265 uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity)
1267 uint16_t tmpsmcr = 0;
1268 uint16_t tmpccmr1 = 0;
1269 uint16_t tmpccer = 0;
1278 tmpsmcr = TIMx->
SMCR;
1281 tmpccmr1 = TIMx->
CCMR1;
1284 tmpccer = TIMx->
CCER;
1288 tmpsmcr |= TIM_EncoderMode;
1296 tmpccer |= (uint16_t)(TIM_IC1Polarity | (uint16_t)(TIM_IC2Polarity << (uint16_t)4));
1299 TIMx->
SMCR = tmpsmcr;
1301 TIMx->
CCMR1 = tmpccmr1;
1303 TIMx->
CCER = tmpccer;
1317 uint16_t tmpccmr1 = 0;
1321 tmpccmr1 = TIMx->
CCMR1;
1325 tmpccmr1 |= TIM_ForcedAction;
1327 TIMx->
CCMR1 = tmpccmr1;
1341 uint16_t tmpccmr1 = 0;
1345 tmpccmr1 = TIMx->
CCMR1;
1349 tmpccmr1 |= (uint16_t)(TIM_ForcedAction << 8);
1351 TIMx->
CCMR1 = tmpccmr1;
1365 uint16_t tmpccmr2 = 0;
1369 tmpccmr2 = TIMx->
CCMR2;
1373 tmpccmr2 |= TIM_ForcedAction;
1375 TIMx->
CCMR2 = tmpccmr2;
1389 uint16_t tmpccmr2 = 0;
1393 tmpccmr2 = TIMx->
CCMR2;
1397 tmpccmr2 |= (uint16_t)(TIM_ForcedAction << 8);
1399 TIMx->
CCMR2 = tmpccmr2;
1511 uint16_t tmpccmr1 = 0;
1515 tmpccmr1 = TIMx->
CCMR1;
1519 tmpccmr1 |= TIM_OCPreload;
1521 TIMx->
CCMR1 = tmpccmr1;
1536 uint16_t tmpccmr1 = 0;
1540 tmpccmr1 = TIMx->
CCMR1;
1544 tmpccmr1 |= (uint16_t)(TIM_OCPreload << 8);
1546 TIMx->
CCMR1 = tmpccmr1;
1560 uint16_t tmpccmr2 = 0;
1564 tmpccmr2 = TIMx->
CCMR2;
1568 tmpccmr2 |= TIM_OCPreload;
1570 TIMx->
CCMR2 = tmpccmr2;
1584 uint16_t tmpccmr2 = 0;
1588 tmpccmr2 = TIMx->
CCMR2;
1592 tmpccmr2 |= (uint16_t)(TIM_OCPreload << 8);
1594 TIMx->
CCMR2 = tmpccmr2;
1608 uint16_t tmpccmr1 = 0;
1613 tmpccmr1 = TIMx->
CCMR1;
1617 tmpccmr1 |= TIM_OCFast;
1619 TIMx->
CCMR1 = tmpccmr1;
1634 uint16_t tmpccmr1 = 0;
1639 tmpccmr1 = TIMx->
CCMR1;
1643 tmpccmr1 |= (uint16_t)(TIM_OCFast << 8);
1645 TIMx->
CCMR1 = tmpccmr1;
1659 uint16_t tmpccmr2 = 0;
1664 tmpccmr2 = TIMx->
CCMR2;
1668 tmpccmr2 |= TIM_OCFast;
1670 TIMx->
CCMR2 = tmpccmr2;
1684 uint16_t tmpccmr2 = 0;
1689 tmpccmr2 = TIMx->
CCMR2;
1693 tmpccmr2 |= (uint16_t)(TIM_OCFast << 8);
1695 TIMx->
CCMR2 = tmpccmr2;
1709 uint16_t tmpccmr1 = 0;
1714 tmpccmr1 = TIMx->
CCMR1;
1719 tmpccmr1 |= TIM_OCClear;
1721 TIMx->
CCMR1 = tmpccmr1;
1735 uint16_t tmpccmr1 = 0;
1739 tmpccmr1 = TIMx->
CCMR1;
1743 tmpccmr1 |= (uint16_t)(TIM_OCClear << 8);
1745 TIMx->
CCMR1 = tmpccmr1;
1759 uint16_t tmpccmr2 = 0;
1763 tmpccmr2 = TIMx->
CCMR2;
1767 tmpccmr2 |= TIM_OCClear;
1769 TIMx->
CCMR2 = tmpccmr2;
1783 uint16_t tmpccmr2 = 0;
1787 tmpccmr2 = TIMx->
CCMR2;
1791 tmpccmr2 |= (uint16_t)(TIM_OCClear << 8);
1793 TIMx->
CCMR2 = tmpccmr2;
1807 uint16_t tmpccer = 0;
1811 tmpccer = TIMx->
CCER;
1814 tmpccer |= TIM_OCPolarity;
1816 TIMx->
CCER = tmpccer;
1830 uint16_t tmpccer = 0;
1835 tmpccer = TIMx->
CCER;
1838 tmpccer |= TIM_OCNPolarity;
1840 TIMx->
CCER = tmpccer;
1854 uint16_t tmpccer = 0;
1858 tmpccer = TIMx->
CCER;
1861 tmpccer |= (uint16_t)(TIM_OCPolarity << 4);
1863 TIMx->
CCER = tmpccer;
1877 uint16_t tmpccer = 0;
1882 tmpccer = TIMx->
CCER;
1885 tmpccer |= (uint16_t)(TIM_OCNPolarity << 4);
1887 TIMx->
CCER = tmpccer;
1901 uint16_t tmpccer = 0;
1905 tmpccer = TIMx->
CCER;
1908 tmpccer |= (uint16_t)(TIM_OCPolarity << 8);
1910 TIMx->
CCER = tmpccer;
1924 uint16_t tmpccer = 0;
1930 tmpccer = TIMx->
CCER;
1933 tmpccer |= (uint16_t)(TIM_OCNPolarity << 8);
1935 TIMx->
CCER = tmpccer;
1949 uint16_t tmpccer = 0;
1953 tmpccer = TIMx->
CCER;
1956 tmpccer |= (uint16_t)(TIM_OCPolarity << 12);
1958 TIMx->
CCER = tmpccer;
1986 TIMx->
CCER &= (uint16_t)~ tmp;
1989 TIMx->
CCER |= (uint16_t)(TIM_CCx << TIM_Channel);
2016 TIMx->
CCER &= (uint16_t) ~tmp;
2019 TIMx->
CCER |= (uint16_t)(TIM_CCxN << TIM_Channel);
2055 tmp = (uint32_t) TIMx;
2061 TIMx->
CCER &= (uint16_t) ~tmp1;
2065 tmp += (TIM_Channel>>1);
2071 *(
__IO uint32_t *) tmp |= TIM_OCMode;
2075 tmp += (uint16_t)(TIM_Channel - (uint16_t)4)>> (uint16_t)1;
2081 *(
__IO uint32_t *) tmp |= (uint16_t)(TIM_OCMode << 8);
2178 TIMx->
CR1 |= TIM_OPMode;
2210 TIMx->
CR2 |= TIM_TRGOSource;
2233 TIMx->
SMCR |= TIM_SlaveMode;
2255 TIMx->
SMCR |= TIM_MasterSlaveMode;
2269 TIMx->
CNT = Counter;
2283 TIMx->
ARR = Autoreload;
2297 TIMx->
CCR1 = Compare1;
2311 TIMx->
CCR2 = Compare2;
2325 TIMx->
CCR3 = Compare3;
2339 TIMx->
CCR4 = Compare4;
2361 TIMx->
CCMR1 |= TIM_ICPSC;
2383 TIMx->
CCMR1 |= (uint16_t)(TIM_ICPSC << 8);
2405 TIMx->
CCMR2 |= TIM_ICPSC;
2427 TIMx->
CCMR2 |= (uint16_t)(TIM_ICPSC << 8);
2449 TIMx->
CR1 |= TIM_CKD;
2563 if ((TIMx->
SR & TIM_FLAG) != (uint16_t)
RESET)
2607 TIMx->
SR = (uint16_t)~TIM_FLAG;
2635 uint16_t itstatus = 0x0, itenable = 0x0;
2640 itstatus = TIMx->
SR & TIM_IT;
2642 itenable = TIMx->
DIER & TIM_IT;
2643 if ((itstatus != (uint16_t)
RESET) && (itenable != (uint16_t)RESET))
2682 TIMx->
SR = (uint16_t)~TIM_IT;
2702 uint16_t TIM_ICFilter)
2704 uint16_t tmpccmr1 = 0, tmpccer = 0;
2707 tmpccmr1 = TIMx->
CCMR1;
2708 tmpccer = TIMx->
CCER;
2711 tmpccmr1 |= (uint16_t)(TIM_ICSelection | (uint16_t)(TIM_ICFilter << (uint16_t)4));
2718 tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)
TIM_CCER_CC1E);
2724 tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)
TIM_CCER_CC1E);
2728 TIMx->
CCMR1 = tmpccmr1;
2729 TIMx->
CCER = tmpccer;
2749 uint16_t TIM_ICFilter)
2751 uint16_t tmpccmr1 = 0, tmpccer = 0, tmp = 0;
2754 tmpccmr1 = TIMx->
CCMR1;
2755 tmpccer = TIMx->
CCER;
2756 tmp = (uint16_t)(TIM_ICPolarity << 4);
2759 tmpccmr1 |= (uint16_t)(TIM_ICFilter << 12);
2760 tmpccmr1 |= (uint16_t)(TIM_ICSelection << 8);
2773 tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)
TIM_CCER_CC2E);
2777 TIMx->
CCMR1 = tmpccmr1 ;
2778 TIMx->
CCER = tmpccer;
2798 uint16_t TIM_ICFilter)
2800 uint16_t tmpccmr2 = 0, tmpccer = 0, tmp = 0;
2803 tmpccmr2 = TIMx->
CCMR2;
2804 tmpccer = TIMx->
CCER;
2805 tmp = (uint16_t)(TIM_ICPolarity << 8);
2808 tmpccmr2 |= (uint16_t)(TIM_ICSelection | (uint16_t)(TIM_ICFilter << (uint16_t)4));
2821 tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)
TIM_CCER_CC3E);
2825 TIMx->
CCMR2 = tmpccmr2;
2826 TIMx->
CCER = tmpccer;
2846 uint16_t TIM_ICFilter)
2848 uint16_t tmpccmr2 = 0, tmpccer = 0, tmp = 0;
2852 tmpccmr2 = TIMx->
CCMR2;
2853 tmpccer = TIMx->
CCER;
2854 tmp = (uint16_t)(TIM_ICPolarity << 12);
2857 tmpccmr2 |= (uint16_t)(TIM_ICSelection << 8);
2858 tmpccmr2 |= (uint16_t)(TIM_ICFilter << 12);
2871 tmpccer |= (uint16_t)(TIM_ICPolarity | (uint16_t)
TIM_CCER_CC4E);
2874 TIMx->
CCMR2 = tmpccmr2;
2875 TIMx->
CCER = tmpccer;
void TIM_EncoderInterfaceConfig(TIM_TypeDef *TIMx, uint16_t TIM_EncoderMode, uint16_t TIM_IC1Polarity, uint16_t TIM_IC2Polarity)
Configures the TIMx Encoder Interface.
#define IS_TIM_COUNTER_MODE(MODE)
#define IS_TIM_CKD_DIV(DIV)
void TIM_OCStructInit(TIM_OCInitTypeDef *TIM_OCInitStruct)
Fills each TIM_OCInitStruct member with its default value.
void TIM_TimeBaseInit(TIM_TypeDef *TIMx, TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
Initializes the TIMx Time Base Unit peripheral according to the specified parameters in the TIM_TimeB...
#define TIM_PSCReloadMode_Immediate
#define IS_TIM_OC_MODE(MODE)
#define RCC_APB2Periph_TIM17
void TIM_CounterModeConfig(TIM_TypeDef *TIMx, uint16_t TIM_CounterMode)
Specifies the TIMx Counter Mode to be used.
uint16_t TIM_OutputNState
#define IS_TIM_EVENT_SOURCE(SOURCE)
void TIM_OC2FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 2 Fast feature.
#define IS_TIM_SLAVE_MODE(MODE)
#define RCC_APB1Periph_TIM7
uint16_t TIM_GetPrescaler(TIM_TypeDef *TIMx)
Gets the TIMx Prescaler value.
#define IS_TIM_LIST3_PERIPH(PERIPH)
#define IS_TIM_TIXCLK_SOURCE(SOURCE)
#define TIM_OSSIState_Disable
#define TIM_AutomaticOutput_Disable
#define TIM_LOCKLevel_OFF
void TIM_OC1NPolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
Configures the TIMx Channel 1N polarity.
void TIM_OC1FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 1 Fast feature.
#define IS_TIM_TRGO_SOURCE(SOURCE)
#define IS_TIM_EXT_POLARITY(POLARITY)
void TIM_TimeBaseStructInit(TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
Fills each TIM_TimeBaseInitStruct member with its default value.
#define RCC_APB1Periph_TIM5
#define RCC_APB1Periph_TIM13
void TIM_SetAutoreload(TIM_TypeDef *TIMx, uint16_t Autoreload)
Sets the TIMx Autoreload Register value.
#define RCC_APB2Periph_TIM9
void TIM_OC4PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 4 polarity.
void TIM_ETRConfig(TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
Configures the TIMx External Trigger (ETR).
ITStatus TIM_GetITStatus(TIM_TypeDef *TIMx, uint16_t TIM_IT)
Checks whether the TIM interrupt has occurred or not.
#define IS_TIM_OUTPUTN_STATE(STATE)
void TIM_SetIC1Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 1 prescaler.
#define TIM_OCNIdleState_Reset
void TIM_OC1PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR1.
#define TIM_OutputNState_Disable
void TIM_SetCounter(TIM_TypeDef *TIMx, uint16_t Counter)
Sets the TIMx Counter Register value.
void TIM_InternalClockConfig(TIM_TypeDef *TIMx)
Configures the TIMx internal Clock.
#define IS_TIM_PRESCALER_RELOAD(RELOAD)
void TIM_ForcedOC3Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 3 waveform to active or inactive level.
uint16_t TIM_AutomaticOutput
void TIM_SetIC3Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 3 prescaler.
#define IS_TIM_GET_IT(IT)
void TIM_SetCompare2(TIM_TypeDef *TIMx, uint16_t Compare2)
Sets the TIMx Capture Compare2 Register value.
void TIM_SetCompare1(TIM_TypeDef *TIMx, uint16_t Compare1)
Sets the TIMx Capture Compare1 Register value.
void TIM_Cmd(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the specified TIM peripheral.
#define IS_TIM_UPDATE_SOURCE(SOURCE)
#define TIM_SlaveMode_External1
#define IS_TIM_LIST5_PERIPH(PERIPH)
#define IS_TIM_AUTOMATIC_OUTPUT_STATE(STATE)
void TIM_PrescalerConfig(TIM_TypeDef *TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode)
Configures the TIMx Prescaler.
#define RCC_APB1Periph_TIM12
void TIM_ITRxExternalClockConfig(TIM_TypeDef *TIMx, uint16_t TIM_InputTriggerSource)
Configures the TIMx Internal Trigger as External Clock.
#define IS_TIM_ENCODER_MODE(MODE)
void assert_param(int val)
#define IS_TIM_OCFAST_STATE(STATE)
void TIM_ClearOC3Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF3 signal on an external event.
#define IS_TIM_GET_FLAG(FLAG)
This file contains all the functions prototypes for the TIM firmware library.
#define IS_FUNCTIONAL_STATE(STATE)
#define RCC_APB2Periph_TIM16
void TIM_DMACmd(TIM_TypeDef *TIMx, uint16_t TIM_DMASource, FunctionalState NewState)
Enables or disables the TIMx's DMA Requests.
void TIM_ClearOC4Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF4 signal on an external event.
#define RCC_APB1Periph_TIM2
void TIM_SetIC2Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 2 prescaler.
void TIM_UpdateDisableConfig(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or Disables the TIMx Update event.
#define IS_TIM_BREAK_POLARITY(POLARITY)
#define RCC_APB2Periph_TIM15
void TIM_OC4PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR4.
uint16_t TIM_GetCapture4(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 4 value.
#define IS_TIM_OSSI_STATE(STATE)
#define RCC_APB2Periph_TIM1
#define IS_TIM_COMPLEMENTARY_CHANNEL(CHANNEL)
#define TIM_OSSRState_Disable
#define IS_TIM_LIST1_PERIPH(PERIPH)
#define IS_TIM_LOCK_LEVEL(LEVEL)
void TIM_SelectInputTrigger(TIM_TypeDef *TIMx, uint16_t TIM_InputTriggerSource)
Selects the Input Trigger source.
void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
Forces or releases Low Speed APB (APB1) peripheral reset.
void TIM_ClearOC1Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF1 signal on an external event.
#define IS_TIM_CLEAR_FLAG(TIM_FLAG)
#define TIM_TIxExternalCLK1Source_TI2
#define RCC_APB1Periph_TIM3
void TIM_BDTRStructInit(TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
Fills each TIM_BDTRInitStruct member with its default value.
void TIM_ICInit(TIM_TypeDef *TIMx, TIM_ICInitTypeDef *TIM_ICInitStruct)
Initializes the TIM peripheral according to the specified parameters in the TIM_ICInitStruct.
#define IS_TIM_OSSR_STATE(STATE)
void TIM_OC2PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 2 polarity.
#define RCC_APB1Periph_TIM14
#define RCC_APB2Periph_TIM11
void TIM_SelectHallSensor(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the TIMx's Hall sensor interface.
void TIM_SetIC4Prescaler(TIM_TypeDef *TIMx, uint16_t TIM_ICPSC)
Sets the TIMx Input Capture 4 prescaler.
static void TI2_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI2 as Input.
#define IS_TIM_LIST2_PERIPH(PERIPH)
#define IS_TIM_CHANNEL(CHANNEL)
#define RCC_APB1Periph_TIM4
#define IS_TIM_EXT_FILTER(EXTFILTER)
void TIM_CtrlPWMOutputs(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables the TIM peripheral Main Outputs.
uint16_t TIM_GetCapture3(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 3 value.
void TIM_SelectOutputTrigger(TIM_TypeDef *TIMx, uint16_t TIM_TRGOSource)
Selects the TIMx Trigger Output Mode.
#define IS_TIM_OCCLEAR_STATE(STATE)
uint16_t TIM_ClockDivision
#define IS_TIM_CCXN(CCXN)
#define IS_TIM_DMA_SOURCE(SOURCE)
uint8_t TIM_RepetitionCounter
uint16_t TIM_GetCapture1(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 1 value.
#define IS_TIM_DMA_LENGTH(LENGTH)
void TIM_OC2PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR2.
void TIM_OC3Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel3 according to the specified parameters in the TIM_OCInitStruct.
void TIM_UpdateRequestConfig(TIM_TypeDef *TIMx, uint16_t TIM_UpdateSource)
Configures the TIMx Update Request Interrupt source.
#define IS_TIM_ALL_PERIPH(PERIPH)
void TIM_SelectMasterSlaveMode(TIM_TypeDef *TIMx, uint16_t TIM_MasterSlaveMode)
Sets or Resets the TIMx Master/Slave Mode.
#define IS_TIM_LIST9_PERIPH(PERIPH)
TIM Time Base Init structure definition.
void TIM_BDTRConfig(TIM_TypeDef *TIMx, TIM_BDTRInitTypeDef *TIM_BDTRInitStruct)
Configures the: Break feature, dead time, Lock level, the OSSI, the OSSR State and the AOE(automatic ...
#define TIM_OutputState_Disable
This file contains all the functions prototypes for the RCC firmware library.
void TIM_SelectSlaveMode(TIM_TypeDef *TIMx, uint16_t TIM_SlaveMode)
Selects the TIMx Slave Mode.
#define TIM_OCMode_Timing
void TIM_OC4Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel4 according to the specified parameters in the TIM_OCInitStruct.
void TIM_OC2Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel2 according to the specified parameters in the TIM_OCInitStruct.
void TIM_ClearOC2Ref(TIM_TypeDef *TIMx, uint16_t TIM_OCClear)
Clears or safeguards the OCREF2 signal on an external event.
static void TI4_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI4 as Input.
#define IS_TIM_LIST7_PERIPH(PERIPH)
void TIM_ForcedOC1Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 1 waveform to active or inactive level.
TIM Input Capture Init structure definition.
uint16_t TIM_BreakPolarity
void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState)
Forces or releases High Speed APB (APB2) peripheral reset.
void TIM_ICStructInit(TIM_ICInitTypeDef *TIM_ICInitStruct)
Fills each TIM_ICInitStruct member with its default value.
void TIM_SelectOnePulseMode(TIM_TypeDef *TIMx, uint16_t TIM_OPMode)
Selects the TIMx's One Pulse Mode.
static void TI3_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI3 as Input.
void TIM_ClearFlag(TIM_TypeDef *TIMx, uint16_t TIM_FLAG)
Clears the TIMx's pending flags.
#define IS_TIM_OCNIDLE_STATE(STATE)
uint16_t TIM_OCNIdleState
#define IS_TIM_TRIGGER_SELECTION(SELECTION)
void TIM_PWMIConfig(TIM_TypeDef *TIMx, TIM_ICInitTypeDef *TIM_ICInitStruct)
Configures the TIM peripheral according to the specified parameters in the TIM_ICInitStruct to measur...
void TIM_OC3PreloadConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPreload)
Enables or disables the TIMx peripheral Preload register on CCR3.
#define TIM_OCPolarity_High
void TIM_SetClockDivision(TIM_TypeDef *TIMx, uint16_t TIM_CKD)
Sets the TIMx Clock Division value.
void TIM_ClearITPendingBit(TIM_TypeDef *TIMx, uint16_t TIM_IT)
Clears the TIMx's interrupt pending bits.
#define RCC_APB1Periph_TIM6
#define TIM_BreakPolarity_Low
#define RCC_APB2Periph_TIM10
void TIM_CCxCmd(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCx)
Enables or disables the TIM Capture Compare Channel x.
uint16_t TIM_GetCapture2(TIM_TypeDef *TIMx)
Gets the TIMx Input Capture 2 value.
#define IS_TIM_LIST4_PERIPH(PERIPH)
void TIM_SetCompare4(TIM_TypeDef *TIMx, uint16_t Compare4)
Sets the TIMx Capture Compare4 Register value.
void TIM_CCxNCmd(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN)
Enables or disables the TIM Capture Compare Channel xN.
void TIM_SelectCCDMA(TIM_TypeDef *TIMx, FunctionalState NewState)
Selects the TIMx peripheral Capture Compare DMA source.
void TIM_TIxExternalClockConfig(TIM_TypeDef *TIMx, uint16_t TIM_TIxExternalCLKSource, uint16_t TIM_ICPolarity, uint16_t ICFilter)
Configures the TIMx Trigger as External Clock.
void TIM_ETRClockMode1Config(TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
Configures the External clock Mode1.
uint16_t TIM_GetCounter(TIM_TypeDef *TIMx)
Gets the TIMx Counter value.
#define TIM_OCIdleState_Reset
#define TIM_UpdateSource_Global
#define IS_TIM_LIST6_PERIPH(TIMx)
#define IS_TIM_OC_POLARITY(POLARITY)
#define IS_TIM_OUTPUT_STATE(STATE)
void TIM_OC3NPolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
Configures the TIMx Channel 3N polarity.
#define IS_TIM_DMA_BASE(BASE)
void TIM_OC3FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 3 Fast feature.
FlagStatus TIM_GetFlagStatus(TIM_TypeDef *TIMx, uint16_t TIM_FLAG)
Checks whether the specified TIM flag is set or not.
void TIM_ITConfig(TIM_TypeDef *TIMx, uint16_t TIM_IT, FunctionalState NewState)
Enables or disables the specified TIM interrupts.
void TIM_SelectOCxM(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_OCMode)
Selects the TIM Output Compare Mode.
TIM Output Compare Init structure definition.
void TIM_OC1PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 1 polarity.
#define IS_TIM_MSM_STATE(STATE)
void TIM_ETRClockMode2Config(TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
Configures the External clock Mode2.
void TIM_OC1Init(TIM_TypeDef *TIMx, TIM_OCInitTypeDef *TIM_OCInitStruct)
Initializes the TIMx Channel1 according to the specified parameters in the TIM_OCInitStruct.
void TIM_SelectCOM(TIM_TypeDef *TIMx, FunctionalState NewState)
Selects the TIM peripheral Commutation event.
void TIM_OC2NPolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCNPolarity)
Configures the TIMx Channel 2N polarity.
BDTR structure definition.
void TIM_ForcedOC2Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 2 waveform to active or inactive level.
#define IS_TIM_OCIDLE_STATE(STATE)
#define IS_TIM_INTERNAL_TRIGGER_SELECTION(SELECTION)
void TIM_OC4FastConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCFast)
Configures the TIMx Output Compare 4 Fast feature.
#define TIM_CounterMode_Up
void TIM_GenerateEvent(TIM_TypeDef *TIMx, uint16_t TIM_EventSource)
Configures the TIMx event to be generate by software.
#define IS_TIM_OPM_MODE(MODE)
#define RCC_APB2Periph_TIM8
#define IS_TIM_OCPRELOAD_STATE(STATE)
#define IS_TIM_OCN_POLARITY(POLARITY)
void TIM_ARRPreloadConfig(TIM_TypeDef *TIMx, FunctionalState NewState)
Enables or disables TIMx peripheral Preload register on ARR.
#define IS_TIM_FORCED_ACTION(ACTION)
static void TI1_Config(TIM_TypeDef *TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter)
Configure the TI1 as Input.
#define IS_TIM_EXT_PRESCALER(PRESCALER)
void TIM_SetCompare3(TIM_TypeDef *TIMx, uint16_t Compare3)
Sets the TIMx Capture Compare3 Register value.
void TIM_OC3PolarityConfig(TIM_TypeDef *TIMx, uint16_t TIM_OCPolarity)
Configures the TIMx channel 3 polarity.
void TIM_DMAConfig(TIM_TypeDef *TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength)
Configures the TIMx's DMA interface.
#define IS_TIM_LIST8_PERIPH(PERIPH)
void TIM_CCPreloadControl(TIM_TypeDef *TIMx, FunctionalState NewState)
Sets or Resets the TIM peripheral Capture Compare Preload Control bit.
void TIM_ForcedOC4Config(TIM_TypeDef *TIMx, uint16_t TIM_ForcedAction)
Forces the TIMx output 4 waveform to active or inactive level.
void TIM_DeInit(TIM_TypeDef *TIMx)
Deinitializes the TIMx peripheral registers to their default reset values.