STM8L15x Standard Peripherals Drivers
|
TIM2 driver modules. More...
Modules | |
TIM2_Exported_Types | |
TIM2_Exported_Macros | |
TIM2_Private_Functions | |
Functions | |
void | TIM2_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM2 peripheral Preload register on ARR. | |
void | TIM2_BKRConfig (TIM2_OSSIState_TypeDef TIM2_OSSIState, TIM2_LockLevel_TypeDef TIM2_LockLevel, TIM2_BreakState_TypeDef TIM2_BreakState, TIM2_BreakPolarity_TypeDef TIM2_BreakPolarity, TIM2_AutomaticOutput_TypeDef TIM2_AutomaticOutput) |
Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable). | |
void | TIM2_CCxCmd (TIM2_Channel_TypeDef TIM2_Channel, FunctionalState NewState) |
Enables or disables the TIM2 Capture Compare Channel x. | |
void | TIM2_ClearFlag (TIM2_FLAG_TypeDef TIM2_FLAG) |
Clears the TIM�s pending flags. | |
void | TIM2_ClearITPendingBit (TIM2_IT_TypeDef TIM2_IT) |
Clears the TIM's interrupt pending bits. | |
void | TIM2_Cmd (FunctionalState NewState) |
Enables or disables the TIM2 peripheral. | |
void | TIM2_CounterModeConfig (TIM2_CounterMode_TypeDef TIM2_CounterMode) |
Specifies the TIM2 Counter Mode to be used. | |
void | TIM2_CtrlPWMOutputs (FunctionalState NewState) |
Enables or disables the TIM2 peripheral Main Outputs. | |
void | TIM2_DeInit (void) |
Deinitialize the TIM2 peripheral registers to their default reset values. | |
void | TIM2_DMACmd (TIM2_DMASource_TypeDef TIM2_DMASource, FunctionalState NewState) |
Enables or disables the TIM2 DMA Requests. | |
void | TIM2_EncoderInterfaceConfig (TIM2_EncoderMode_TypeDef TIM2_EncoderMode, TIM2_ICPolarity_TypeDef TIM2_IC1Polarity, TIM2_ICPolarity_TypeDef TIM2_IC2Polarity) |
Configures the TIM2 Encoder Interface. | |
void | TIM2_ETRClockMode1Config (TIM2_ExtTRGPSC_TypeDef TIM2_ExtTRGPrescaler, TIM2_ExtTRGPolarity_TypeDef TIM2_ExtTRGPolarity, uint8_t ExtTRGFilter) |
Configures the TIM2 External clock Mode1. | |
void | TIM2_ETRClockMode2Config (TIM2_ExtTRGPSC_TypeDef TIM2_ExtTRGPrescaler, TIM2_ExtTRGPolarity_TypeDef TIM2_ExtTRGPolarity, uint8_t ExtTRGFilter) |
Configures the TIM2 External clock Mode2. | |
void | TIM2_ETRConfig (TIM2_ExtTRGPSC_TypeDef TIM2_ExtTRGPrescaler, TIM2_ExtTRGPolarity_TypeDef TIM2_ExtTRGPolarity, uint8_t ExtTRGFilter) |
Configures the TIM2 External Trigger. | |
void | TIM2_ForcedOC1Config (TIM2_ForcedAction_TypeDef TIM2_ForcedAction) |
Forces the TIM2 Channel1 output waveform to active or inactive level. | |
void | TIM2_ForcedOC2Config (TIM2_ForcedAction_TypeDef TIM2_ForcedAction) |
Forces the TIM2 Channel2 output waveform to active or inactive level. | |
void | TIM2_GenerateEvent (TIM2_EventSource_TypeDef TIM2_EventSource) |
Configures the TIM2 event to be generated by software. | |
uint16_t | TIM2_GetCapture1 (void) |
Gets the TIM2 Input Capture 1 value. | |
uint16_t | TIM2_GetCapture2 (void) |
Gets the TIM2 Input Capture 2 value. | |
uint16_t | TIM2_GetCounter (void) |
Gets the TIM2 Counter value. | |
FlagStatus | TIM2_GetFlagStatus (TIM2_FLAG_TypeDef TIM2_FLAG) |
Checks whether the specified TIM2 flag is set or not. | |
ITStatus | TIM2_GetITStatus (TIM2_IT_TypeDef TIM2_IT) |
Checks whether the TIM2 interrupt has occurred or not. | |
TIM2_Prescaler_TypeDef | TIM2_GetPrescaler (void) |
Gets the TIM2 Prescaler value. | |
void | TIM2_ICInit (TIM2_Channel_TypeDef TIM2_Channel, TIM2_ICPolarity_TypeDef TIM2_ICPolarity, TIM2_ICSelection_TypeDef TIM2_ICSelection, TIM2_ICPSC_TypeDef TIM2_ICPrescaler, uint8_t TIM2_ICFilter) |
Initializes the TIM2 peripheral according to the specified parameters. | |
void | TIM2_InternalClockConfig (void) |
Enables the TIM2 internal Clock. | |
void | TIM2_ITConfig (TIM2_IT_TypeDef TIM2_IT, FunctionalState NewState) |
Enables or disables the specified TIM2 interrupts. | |
void | TIM2_OC1FastConfig (FunctionalState NewState) |
Configures the TIM2 Capture Compare 1 Fast feature. | |
void | TIM2_OC1Init (TIM2_OCMode_TypeDef TIM2_OCMode, TIM2_OutputState_TypeDef TIM2_OutputState, uint16_t TIM2_Pulse, TIM2_OCPolarity_TypeDef TIM2_OCPolarity, TIM2_OCIdleState_TypeDef TIM2_OCIdleState) |
Initializes the TIM2 Channel1 according to the specified parameters. | |
void | TIM2_OC1PolarityConfig (TIM2_OCPolarity_TypeDef TIM2_OCPolarity) |
Configures the TIM2 Channel 1 polarity. | |
void | TIM2_OC1PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM2 peripheral Preload Register on CCR1. | |
void | TIM2_OC2FastConfig (FunctionalState NewState) |
Configures the TIM2 Capture Compare 2 Fast feature. | |
void | TIM2_OC2Init (TIM2_OCMode_TypeDef TIM2_OCMode, TIM2_OutputState_TypeDef TIM2_OutputState, uint16_t TIM2_Pulse, TIM2_OCPolarity_TypeDef TIM2_OCPolarity, TIM2_OCIdleState_TypeDef TIM2_OCIdleState) |
Initializes the TIM2 Channel2 according to the specified parameters. | |
void | TIM2_OC2PolarityConfig (TIM2_OCPolarity_TypeDef TIM2_OCPolarity) |
Configures the TIM2 Channel 2 polarity. | |
void | TIM2_OC2PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM2 peripheral Preload Register on CCR2. | |
void | TIM2_PrescalerConfig (TIM2_Prescaler_TypeDef Prescaler, TIM2_PSCReloadMode_TypeDef TIM2_PSCReloadMode) |
Configures the TIM2 Prescaler. | |
void | TIM2_PWMIConfig (TIM2_Channel_TypeDef TIM2_Channel, TIM2_ICPolarity_TypeDef TIM2_ICPolarity, TIM2_ICSelection_TypeDef TIM2_ICSelection, TIM2_ICPSC_TypeDef TIM2_ICPrescaler, uint8_t TIM2_ICFilter) |
Configures the TIM2 peripheral in PWM Input Mode according to the specified parameters. | |
void | TIM2_SelectCCDMA (FunctionalState NewState) |
Selects the TIM2 peripheral Capture Compare DMA source. | |
void | TIM2_SelectHallSensor (FunctionalState NewState) |
Enables or Disables the TIM�s Hall sensor interface. | |
void | TIM2_SelectInputTrigger (TIM2_TRGSelection_TypeDef TIM2_InputTriggerSource) |
Selects the TIM2 Input Trigger source. | |
void | TIM2_SelectMasterSlaveMode (FunctionalState NewState) |
Sets or Resets the TIM2 Master/Slave Mode. | |
void | TIM2_SelectOCxM (TIM2_Channel_TypeDef TIM2_Channel, TIM2_OCMode_TypeDef TIM2_OCMode) |
Selects the TIM2 Output Compare Mode. | |
void | TIM2_SelectOnePulseMode (TIM2_OPMode_TypeDef TIM2_OPMode) |
Selects the TIM�s One Pulse Mode. | |
void | TIM2_SelectOutputTrigger (TIM2_TRGOSource_TypeDef TIM2_TRGOSource) |
Selects the TIM2 Trigger Output Mode. | |
void | TIM2_SelectSlaveMode (TIM2_SlaveMode_TypeDef TIM2_SlaveMode) |
Selects the TIM2 Slave Mode. | |
void | TIM2_SetAutoreload (uint16_t Autoreload) |
Sets the TIM2 Autoreload Register value. | |
void | TIM2_SetCompare1 (uint16_t Compare) |
Sets the TIM2 Capture Compare1 Register value. | |
void | TIM2_SetCompare2 (uint16_t Compare) |
Sets the TIM2 Capture Compare2 Register value. | |
void | TIM2_SetCounter (uint16_t Counter) |
Sets the TIM2 Counter Register value. | |
void | TIM2_SetIC1Prescaler (TIM2_ICPSC_TypeDef TIM2_IC1Prescaler) |
Sets the TIM2 Input Capture 1 prescaler. | |
void | TIM2_SetIC2Prescaler (TIM2_ICPSC_TypeDef TIM2_IC2Prescaler) |
Sets the TIM2 Input Capture 2 prescaler. | |
void | TIM2_TimeBaseInit (TIM2_Prescaler_TypeDef TIM2_Prescaler, TIM2_CounterMode_TypeDef TIM2_CounterMode, uint16_t TIM2_Period) |
Initializes the TIM2 Time Base Unit according to the specified parameters. | |
void | TIM2_TIxExternalClockConfig (TIM2_TIxExternalCLK1Source_TypeDef TIM2_TIxExternalCLKSource, TIM2_ICPolarity_TypeDef TIM2_ICPolarity, uint8_t ICFilter) |
Configures the TIM2 Trigger as External Clock. | |
void | TIM2_UpdateDisableConfig (FunctionalState NewState) |
Enables or Disables the TIM2 Update event. | |
void | TIM2_UpdateRequestConfig (TIM2_UpdateSource_TypeDef TIM2_UpdateSource) |
Selects the TIM2 Update Request Interrupt source. |
Detailed Description
TIM2 driver modules.
Function Documentation
void TIM2_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM2 peripheral Preload register on ARR.
Definition at line 436 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CR1_ARPE.
void TIM2_BKRConfig | ( | TIM2_OSSIState_TypeDef | TIM2_OSSIState, |
TIM2_LockLevel_TypeDef | TIM2_LockLevel, | ||
TIM2_BreakState_TypeDef | TIM2_BreakState, | ||
TIM2_BreakPolarity_TypeDef | TIM2_BreakPolarity, | ||
TIM2_AutomaticOutput_TypeDef | TIM2_AutomaticOutput | ||
) |
Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).
Definition at line 748 of file stm8l15x_tim2.c.
References IS_TIM2_AUTOMATIC_OUTPUT_STATE, IS_TIM2_BREAK_POLARITY, IS_TIM2_BREAK_STATE, IS_TIM2_LOCK_LEVEL, IS_TIM2_OSSI_STATE, and TIM2.
void TIM2_CCxCmd | ( | TIM2_Channel_TypeDef | TIM2_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM2 Capture Compare Channel x.
Definition at line 1068 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM2_CHANNEL, TIM2, TIM2_Channel_1, TIM_CCER1_CC1E, and TIM_CCER1_CC2E.
void TIM2_ClearFlag | ( | TIM2_FLAG_TypeDef | TIM2_FLAG | ) |
Clears the TIM�s pending flags.
Definition at line 1500 of file stm8l15x_tim2.c.
References IS_TIM2_CLEAR_FLAG, and TIM2.
void TIM2_ClearITPendingBit | ( | TIM2_IT_TypeDef | TIM2_IT | ) |
Clears the TIM's interrupt pending bits.
Definition at line 1555 of file stm8l15x_tim2.c.
References IS_TIM2_IT, and TIM2.
void TIM2_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral.
Definition at line 482 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CR1_CEN.
void TIM2_CounterModeConfig | ( | TIM2_CounterMode_TypeDef | TIM2_CounterMode | ) |
Specifies the TIM2 Counter Mode to be used.
Definition at line 300 of file stm8l15x_tim2.c.
References IS_TIM2_COUNTER_MODE, TIM2, TIM_CR1_CMS, and TIM_CR1_DIR.
void TIM2_CtrlPWMOutputs | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral Main Outputs.
Definition at line 777 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_BKR_MOE.
void TIM2_DeInit | ( | void | ) |
Deinitialize the TIM2 peripheral registers to their default reset values.
Definition at line 162 of file stm8l15x_tim2.c.
References TIM2, TIM_ARRH_RESET_VALUE, TIM_ARRL_RESET_VALUE, TIM_BKR_RESET_VALUE, TIM_CCER1_RESET_VALUE, TIM_CCMR1_RESET_VALUE, TIM_CCMR2_RESET_VALUE, TIM_CCR1H_RESET_VALUE, TIM_CCR1L_RESET_VALUE, TIM_CCR2H_RESET_VALUE, TIM_CCR2L_RESET_VALUE, TIM_CNTRH_RESET_VALUE, TIM_CNTRL_RESET_VALUE, TIM_CR1_RESET_VALUE, TIM_CR2_RESET_VALUE, TIM_ETR_RESET_VALUE, TIM_IER_RESET_VALUE, TIM_OISR_RESET_VALUE, TIM_PSCR_RESET_VALUE, TIM_SMCR_RESET_VALUE, TIM_SR1_RESET_VALUE, and TIM_SR2_RESET_VALUE.
void TIM2_DMACmd | ( | TIM2_DMASource_TypeDef | TIM2_DMASource, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM2 DMA Requests.
Definition at line 1575 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM2_DMA_SOURCE, and TIM2.
void TIM2_EncoderInterfaceConfig | ( | TIM2_EncoderMode_TypeDef | TIM2_EncoderMode, |
TIM2_ICPolarity_TypeDef | TIM2_IC1Polarity, | ||
TIM2_ICPolarity_TypeDef | TIM2_IC2Polarity | ||
) |
Configures the TIM2 Encoder Interface.
Definition at line 1952 of file stm8l15x_tim2.c.
References IS_TIM2_ENCODER_MODE, IS_TIM2_IC_POLARITY, TIM2, TIM2_ICPolarity_Falling, TIM_CCER1_CC1P, TIM_CCER1_CC2P, TIM_CCMR_CCxS, TIM_CCMR_TIxDirect_Set, TIM_SMCR_MSM, and TIM_SMCR_TS.
void TIM2_ETRClockMode1Config | ( | TIM2_ExtTRGPSC_TypeDef | TIM2_ExtTRGPrescaler, |
TIM2_ExtTRGPolarity_TypeDef | TIM2_ExtTRGPolarity, | ||
uint8_t | ExtTRGFilter | ||
) |
Configures the TIM2 External clock Mode1.
Definition at line 1701 of file stm8l15x_tim2.c.
References TIM2, TIM2_ETRConfig(), TIM2_SlaveMode_External1, TIM2_TRGSelection_ETRF, TIM_SMCR_SMS, and TIM_SMCR_TS.
void TIM2_ETRClockMode2Config | ( | TIM2_ExtTRGPSC_TypeDef | TIM2_ExtTRGPrescaler, |
TIM2_ExtTRGPolarity_TypeDef | TIM2_ExtTRGPolarity, | ||
uint8_t | ExtTRGFilter | ||
) |
Configures the TIM2 External clock Mode2.
Definition at line 1733 of file stm8l15x_tim2.c.
References TIM2, TIM2_ETRConfig(), and TIM_ETR_ECE.
void TIM2_ETRConfig | ( | TIM2_ExtTRGPSC_TypeDef | TIM2_ExtTRGPrescaler, |
TIM2_ExtTRGPolarity_TypeDef | TIM2_ExtTRGPolarity, | ||
uint8_t | ExtTRGFilter | ||
) |
Configures the TIM2 External Trigger.
Definition at line 1905 of file stm8l15x_tim2.c.
References IS_TIM2_EXT_FILTER, IS_TIM2_EXT_POLARITY, IS_TIM2_EXT_PRESCALER, and TIM2.
Referenced by TIM2_ETRClockMode1Config(), and TIM2_ETRClockMode2Config().
void TIM2_ForcedOC1Config | ( | TIM2_ForcedAction_TypeDef | TIM2_ForcedAction | ) |
Forces the TIM2 Channel1 output waveform to active or inactive level.
Definition at line 877 of file stm8l15x_tim2.c.
References IS_TIM2_FORCED_ACTION, TIM2, and TIM_CCMR_OCM.
void TIM2_ForcedOC2Config | ( | TIM2_ForcedAction_TypeDef | TIM2_ForcedAction | ) |
Forces the TIM2 Channel2 output waveform to active or inactive level.
Definition at line 903 of file stm8l15x_tim2.c.
References IS_TIM2_FORCED_ACTION, TIM2, and TIM_CCMR_OCM.
void TIM2_GenerateEvent | ( | TIM2_EventSource_TypeDef | TIM2_EventSource | ) |
Configures the TIM2 event to be generated by software.
Definition at line 1445 of file stm8l15x_tim2.c.
References IS_TIM2_EVENT_SOURCE, and TIM2.
uint16_t TIM2_GetCapture1 | ( | void | ) |
Gets the TIM2 Input Capture 1 value.
Definition at line 1298 of file stm8l15x_tim2.c.
References TIM2.
uint16_t TIM2_GetCapture2 | ( | void | ) |
Gets the TIM2 Input Capture 2 value.
Definition at line 1317 of file stm8l15x_tim2.c.
References TIM2.
uint16_t TIM2_GetCounter | ( | void | ) |
FlagStatus TIM2_GetFlagStatus | ( | TIM2_FLAG_TypeDef | TIM2_FLAG | ) |
Checks whether the specified TIM2 flag is set or not.
Definition at line 1467 of file stm8l15x_tim2.c.
References IS_TIM2_GET_FLAG, RESET, SET, and TIM2.
ITStatus TIM2_GetITStatus | ( | TIM2_IT_TypeDef | TIM2_IT | ) |
Checks whether the TIM2 interrupt has occurred or not.
Definition at line 1520 of file stm8l15x_tim2.c.
References IS_TIM2_GET_IT, RESET, SET, and TIM2.
TIM2_Prescaler_TypeDef TIM2_GetPrescaler | ( | void | ) |
void TIM2_ICInit | ( | TIM2_Channel_TypeDef | TIM2_Channel, |
TIM2_ICPolarity_TypeDef | TIM2_ICPolarity, | ||
TIM2_ICSelection_TypeDef | TIM2_ICSelection, | ||
TIM2_ICPSC_TypeDef | TIM2_ICPrescaler, | ||
uint8_t | TIM2_ICFilter | ||
) |
Initializes the TIM2 peripheral according to the specified parameters.
Definition at line 1178 of file stm8l15x_tim2.c.
References IS_TIM2_CHANNEL, TI1_Config(), TI2_Config(), TIM2_Channel_1, TIM2_SetIC1Prescaler(), and TIM2_SetIC2Prescaler().
void TIM2_InternalClockConfig | ( | void | ) |
Enables the TIM2 internal Clock.
Definition at line 1638 of file stm8l15x_tim2.c.
References TIM2, and TIM_SMCR_SMS.
void TIM2_ITConfig | ( | TIM2_IT_TypeDef | TIM2_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified TIM2 interrupts.
Definition at line 1416 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM2_IT, and TIM2.
void TIM2_OC1FastConfig | ( | FunctionalState | NewState | ) |
Configures the TIM2 Capture Compare 1 Fast feature.
Definition at line 971 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CCMR_OCxFE.
void TIM2_OC1Init | ( | TIM2_OCMode_TypeDef | TIM2_OCMode, |
TIM2_OutputState_TypeDef | TIM2_OutputState, | ||
uint16_t | TIM2_Pulse, | ||
TIM2_OCPolarity_TypeDef | TIM2_OCPolarity, | ||
TIM2_OCIdleState_TypeDef | TIM2_OCIdleState | ||
) |
Initializes the TIM2 Channel1 according to the specified parameters.
Definition at line 572 of file stm8l15x_tim2.c.
References IS_TIM2_OC_MODE, IS_TIM2_OC_POLARITY, IS_TIM2_OCIDLE_STATE, IS_TIM2_OUTPUT_STATE, TIM2, TIM2_OCIdleState_Set, TIM2_OCPolarity_Low, TIM2_OutputState_Enable, TIM_CCER1_CC1E, TIM_CCER1_CC1P, TIM_CCMR_OCM, and TIM_OISR_OIS1.
void TIM2_OC1PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 1 polarity.
Definition at line 1018 of file stm8l15x_tim2.c.
References IS_TIM2_OC_POLARITY, TIM2, TIM2_OCPolarity_Low, and TIM_CCER1_CC1P.
void TIM2_OC1PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral Preload Register on CCR1.
Definition at line 927 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CCMR_OCxPE.
void TIM2_OC2FastConfig | ( | FunctionalState | NewState | ) |
Configures the TIM2 Capture Compare 2 Fast feature.
Definition at line 994 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CCMR_OCxFE.
void TIM2_OC2Init | ( | TIM2_OCMode_TypeDef | TIM2_OCMode, |
TIM2_OutputState_TypeDef | TIM2_OutputState, | ||
uint16_t | TIM2_Pulse, | ||
TIM2_OCPolarity_TypeDef | TIM2_OCPolarity, | ||
TIM2_OCIdleState_TypeDef | TIM2_OCIdleState | ||
) |
Initializes the TIM2 Channel2 according to the specified parameters.
Definition at line 658 of file stm8l15x_tim2.c.
References IS_TIM2_OC_MODE, IS_TIM2_OC_POLARITY, IS_TIM2_OCIDLE_STATE, IS_TIM2_OUTPUT_STATE, TIM2, TIM2_OCIdleState_Set, TIM2_OCPolarity_Low, TIM2_OutputState_Enable, TIM_CCER1_CC2E, TIM_CCER1_CC2P, TIM_CCMR_OCM, and TIM_OISR_OIS2.
void TIM2_OC2PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 2 polarity.
Definition at line 1042 of file stm8l15x_tim2.c.
References IS_TIM2_OC_POLARITY, TIM2, TIM2_OCPolarity_Low, and TIM_CCER1_CC2P.
void TIM2_OC2PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral Preload Register on CCR2.
Definition at line 949 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CCMR_OCxPE.
void TIM2_PrescalerConfig | ( | TIM2_Prescaler_TypeDef | Prescaler, |
TIM2_PSCReloadMode_TypeDef | TIM2_PSCReloadMode | ||
) |
Configures the TIM2 Prescaler.
Definition at line 268 of file stm8l15x_tim2.c.
References IS_TIM2_PRESCALER, IS_TIM2_PRESCALER_RELOAD, TIM2, TIM2_PSCReloadMode_Immediate, and TIM_EGR_UG.
void TIM2_PWMIConfig | ( | TIM2_Channel_TypeDef | TIM2_Channel, |
TIM2_ICPolarity_TypeDef | TIM2_ICPolarity, | ||
TIM2_ICSelection_TypeDef | TIM2_ICSelection, | ||
TIM2_ICPSC_TypeDef | TIM2_ICPrescaler, | ||
uint8_t | TIM2_ICFilter | ||
) |
Configures the TIM2 peripheral in PWM Input Mode according to the specified parameters.
Definition at line 1229 of file stm8l15x_tim2.c.
References IS_TIM2_CHANNEL, TI1_Config(), TI2_Config(), TIM2_Channel_1, TIM2_ICPolarity_Falling, TIM2_ICPolarity_Rising, TIM2_ICSelection_DirectTI, TIM2_ICSelection_IndirectTI, TIM2_SetIC1Prescaler(), and TIM2_SetIC2Prescaler().
void TIM2_SelectCCDMA | ( | FunctionalState | NewState | ) |
Selects the TIM2 peripheral Capture Compare DMA source.
Definition at line 1599 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CR2_CCDS.
void TIM2_SelectHallSensor | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM�s Hall sensor interface.
Definition at line 2009 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CR2_TI1S.
void TIM2_SelectInputTrigger | ( | TIM2_TRGSelection_TypeDef | TIM2_InputTriggerSource | ) |
Selects the TIM2 Input Trigger source.
Definition at line 1793 of file stm8l15x_tim2.c.
References IS_TIM2_TRIGGER_SELECTION, TIM2, and TIM_SMCR_TS.
Referenced by TIM2_TIxExternalClockConfig().
void TIM2_SelectMasterSlaveMode | ( | FunctionalState | NewState | ) |
Sets or Resets the TIM2 Master/Slave Mode.
Definition at line 1873 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_SMCR_MSM.
void TIM2_SelectOCxM | ( | TIM2_Channel_TypeDef | TIM2_Channel, |
TIM2_OCMode_TypeDef | TIM2_OCMode | ||
) |
Selects the TIM2 Output Compare Mode.
This function disables the selected channel before changing the Output Compare Mode. User has to enable this channel using TIM2_CCxCmd and TIM2_CCxNCmd functions.
Definition at line 812 of file stm8l15x_tim2.c.
References IS_TIM2_CHANNEL, IS_TIM2_OCM, TIM2, TIM2_Channel_1, TIM_CCER1_CC1E, TIM_CCER1_CC2E, and TIM_CCMR_OCM.
void TIM2_SelectOnePulseMode | ( | TIM2_OPMode_TypeDef | TIM2_OPMode | ) |
Selects the TIM�s One Pulse Mode.
Definition at line 460 of file stm8l15x_tim2.c.
References IS_TIM2_OPM_MODE, TIM2, TIM2_OPMode_Single, and TIM_CR1_OPM.
void TIM2_SelectOutputTrigger | ( | TIM2_TRGOSource_TypeDef | TIM2_TRGOSource | ) |
Selects the TIM2 Trigger Output Mode.
Definition at line 1821 of file stm8l15x_tim2.c.
References IS_TIM2_TRGO_SOURCE, TIM2, and TIM_CR2_MMS.
void TIM2_SelectSlaveMode | ( | TIM2_SlaveMode_TypeDef | TIM2_SlaveMode | ) |
Selects the TIM2 Slave Mode.
Definition at line 1849 of file stm8l15x_tim2.c.
References IS_TIM2_SLAVE_MODE, TIM2, and TIM_SMCR_SMS.
void TIM2_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM2 Autoreload Register value.
Definition at line 338 of file stm8l15x_tim2.c.
References TIM2.
void TIM2_SetCompare1 | ( | uint16_t | Compare | ) |
Sets the TIM2 Capture Compare1 Register value.
Definition at line 849 of file stm8l15x_tim2.c.
References TIM2.
void TIM2_SetCompare2 | ( | uint16_t | Compare | ) |
Sets the TIM2 Capture Compare2 Register value.
Definition at line 862 of file stm8l15x_tim2.c.
References TIM2.
void TIM2_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM2 Counter Register value.
Definition at line 324 of file stm8l15x_tim2.c.
References TIM2.
void TIM2_SetIC1Prescaler | ( | TIM2_ICPSC_TypeDef | TIM2_IC1Prescaler | ) |
Sets the TIM2 Input Capture 1 prescaler.
Definition at line 1341 of file stm8l15x_tim2.c.
References IS_TIM2_IC_PRESCALER, TIM2, and TIM_CCMR_ICxPSC.
Referenced by TIM2_ICInit(), and TIM2_PWMIConfig().
void TIM2_SetIC2Prescaler | ( | TIM2_ICPSC_TypeDef | TIM2_IC2Prescaler | ) |
Sets the TIM2 Input Capture 2 prescaler.
Definition at line 1369 of file stm8l15x_tim2.c.
References IS_TIM2_IC_PRESCALER, TIM2, and TIM_CCMR_ICxPSC.
Referenced by TIM2_ICInit(), and TIM2_PWMIConfig().
void TIM2_TimeBaseInit | ( | TIM2_Prescaler_TypeDef | TIM2_Prescaler, |
TIM2_CounterMode_TypeDef | TIM2_CounterMode, | ||
uint16_t | TIM2_Period | ||
) |
Initializes the TIM2 Time Base Unit according to the specified parameters.
Definition at line 225 of file stm8l15x_tim2.c.
References IS_TIM2_COUNTER_MODE, IS_TIM2_PRESCALER, TIM2, TIM2_EventSource_Update, TIM_CR1_CMS, and TIM_CR1_DIR.
void TIM2_TIxExternalClockConfig | ( | TIM2_TIxExternalCLK1Source_TypeDef | TIM2_TIxExternalCLKSource, |
TIM2_ICPolarity_TypeDef | TIM2_ICPolarity, | ||
uint8_t | ICFilter | ||
) |
Configures the TIM2 Trigger as External Clock.
Definition at line 1659 of file stm8l15x_tim2.c.
References IS_TIM2_IC_FILTER, IS_TIM2_IC_POLARITY, IS_TIM2_TIXCLK_SOURCE, TI1_Config(), TI2_Config(), TIM2, TIM2_ICSelection_DirectTI, TIM2_SelectInputTrigger(), TIM2_SlaveMode_External1, and TIM2_TIxExternalCLK1Source_TI2.
void TIM2_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM2 Update event.
Definition at line 390 of file stm8l15x_tim2.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM2, and TIM_CR1_UDIS.
void TIM2_UpdateRequestConfig | ( | TIM2_UpdateSource_TypeDef | TIM2_UpdateSource | ) |
Selects the TIM2 Update Request Interrupt source.
Definition at line 414 of file stm8l15x_tim2.c.
References IS_TIM2_UPDATE_SOURCE, TIM2, TIM2_UpdateSource_Regular, and TIM_CR1_URS.