STM8S/A Standard Peripherals Firmware Library
|
Functions | |
static void | TI1_Config (uint8_t TIM2_ICPolarity, uint8_t TIM2_ICSelection, uint8_t TIM2_ICFilter) |
Configure the TI1 as Input. | |
static void | TI2_Config (uint8_t TIM2_ICPolarity, uint8_t TIM2_ICSelection, uint8_t TIM2_ICFilter) |
Configure the TI2 as Input. | |
static void | TI3_Config (uint8_t TIM2_ICPolarity, uint8_t TIM2_ICSelection, uint8_t TIM2_ICFilter) |
Configure the TI3 as Input. | |
void | TIM2_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM2 peripheral Preload register on ARR. | |
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 TIM2�s pending flags. | |
void | TIM2_ClearITPendingBit (TIM2_IT_TypeDef TIM2_IT) |
Clears the TIM2's interrupt pending bits. | |
void | TIM2_Cmd (FunctionalState NewState) |
Enables or disables the TIM2 peripheral. | |
void | TIM2_DeInit (void) |
Deinitializes the TIM2 peripheral registers to their default reset values. | |
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_ForcedOC3Config (TIM2_ForcedAction_TypeDef TIM2_ForcedAction) |
Forces the TIM2 Channel3 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_GetCapture3 (void) |
Gets the TIM2 Input Capture 3 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_ITConfig (TIM2_IT_TypeDef TIM2_IT, FunctionalState NewState) |
Enables or disables the specified TIM2 interrupts. | |
void | TIM2_OC1Init (TIM2_OCMode_TypeDef TIM2_OCMode, TIM2_OutputState_TypeDef TIM2_OutputState, uint16_t TIM2_Pulse, TIM2_OCPolarity_TypeDef TIM2_OCPolarity) |
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_OC2Init (TIM2_OCMode_TypeDef TIM2_OCMode, TIM2_OutputState_TypeDef TIM2_OutputState, uint16_t TIM2_Pulse, TIM2_OCPolarity_TypeDef TIM2_OCPolarity) |
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_OC3Init (TIM2_OCMode_TypeDef TIM2_OCMode, TIM2_OutputState_TypeDef TIM2_OutputState, uint16_t TIM2_Pulse, TIM2_OCPolarity_TypeDef TIM2_OCPolarity) |
Initializes the TIM2 Channel3 according to the specified parameters. | |
void | TIM2_OC3PolarityConfig (TIM2_OCPolarity_TypeDef TIM2_OCPolarity) |
Configures the TIM2 Channel 3 polarity. | |
void | TIM2_OC3PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM2 peripheral Preload Register on CCR3. | |
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_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 TIM2�s One Pulse Mode. | |
void | TIM2_SetAutoreload (uint16_t Autoreload) |
Sets the TIM2 Autoreload Register value. | |
void | TIM2_SetCompare1 (uint16_t Compare1) |
Sets the TIM2 Capture Compare1 Register value. | |
void | TIM2_SetCompare2 (uint16_t Compare2) |
Sets the TIM2 Capture Compare2 Register value. | |
void | TIM2_SetCompare3 (uint16_t Compare3) |
Sets the TIM2 Capture Compare3 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_SetIC3Prescaler (TIM2_ICPSC_TypeDef TIM2_IC3Prescaler) |
Sets the TIM2 Input Capture 3 prescaler. | |
void | TIM2_TimeBaseInit (TIM2_Prescaler_TypeDef TIM2_Prescaler, uint16_t TIM2_Period) |
Initializes the TIM2 Time Base Unit according to the specified parameters. | |
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. |
Function Documentation
static void TI1_Config | ( | uint8_t | TIM2_ICPolarity, |
uint8_t | TIM2_ICSelection, | ||
uint8_t | TIM2_ICFilter | ||
) | [static] |
Configure the TI1 as Input.
- Parameters:
-
TIM2_ICPolarity The Input Polarity. This parameter can be one of the following values: - TIM2_ICPOLARITY_FALLING
- TIM2_ICPOLARITY_RISING
TIM2_ICSelection specifies the input to be used. This parameter can be one of the following values: - TIM2_ICSELECTION_DIRECTTI: TIM2 Input 1 is selected to be connected to IC1.
- TIM2_ICSELECTION_INDIRECTTI: TIM2 Input 1 is selected to be connected to IC2.
TIM2_ICFilter Specifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
- Return values:
-
None
Definition at line 1181 of file stm8s_tim2.c.
References TIM2_CCER1_CC1E, TIM2_CCER1_CC1P, TIM2_CCMR_CCxS, TIM2_CCMR_ICxF, and TIM2_ICPOLARITY_RISING.
Referenced by TIM2_ICInit(), and TIM2_PWMIConfig().
static void TI2_Config | ( | uint8_t | TIM2_ICPolarity, |
uint8_t | TIM2_ICSelection, | ||
uint8_t | TIM2_ICFilter | ||
) | [static] |
Configure the TI2 as Input.
- Parameters:
-
TIM2_ICPolarity The Input Polarity. This parameter can be one of the following values: - TIM2_ICPOLARITY_FALLING
- TIM2_ICPOLARITY_RISING
TIM2_ICSelection specifies the input to be used. This parameter can be one of the following values: - TIM2_ICSELECTION_DIRECTTI: TIM2 Input 2 is selected to be connected to IC2.
- TIM2_ICSELECTION_INDIRECTTI: TIM2 Input 2 is selected to be connected to IC1.
TIM2_ICFilter Specifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
- Return values:
-
None
Definition at line 1221 of file stm8s_tim2.c.
References TIM2_CCER1_CC2E, TIM2_CCER1_CC2P, TIM2_CCMR_CCxS, TIM2_CCMR_ICxF, and TIM2_ICPOLARITY_RISING.
Referenced by TIM2_ICInit(), and TIM2_PWMIConfig().
static void TI3_Config | ( | uint8_t | TIM2_ICPolarity, |
uint8_t | TIM2_ICSelection, | ||
uint8_t | TIM2_ICFilter | ||
) | [static] |
Configure the TI3 as Input.
- Parameters:
-
TIM2_ICPolarity The Input Polarity. This parameter can be one of the following values: - TIM2_ICPOLARITY_FALLING
- TIM2_ICPOLARITY_RISING
TIM2_ICSelection specifies the input to be used. This parameter can be one of the following values: - TIM2_ICSELECTION_DIRECTTI: TIM2 Input 3 is selected to be connected to IC3.
TIM2_ICFilter Specifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
- Return values:
-
None
Definition at line 1261 of file stm8s_tim2.c.
References TIM2_CCER2_CC3E, TIM2_CCER2_CC3P, TIM2_CCMR_CCxS, TIM2_CCMR_ICxF, and TIM2_ICPOLARITY_RISING.
Referenced by TIM2_ICInit().
void TIM2_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM2 peripheral Preload register on ARR.
- Parameters:
-
NewState new state of the TIM2 peripheral Preload register. This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 561 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CR1_ARPE.
Referenced by TIM2_Config().
void TIM2_CCxCmd | ( | TIM2_Channel_TypeDef | TIM2_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM2 Capture Compare Channel x.
- Parameters:
-
TIM2_Channel specifies the TIM2 Channel. This parameter can be one of the following values: - TIM2_CHANNEL_1: TIM2 Channel1
- TIM2_CHANNEL_2: TIM2 Channel2
- TIM2_CHANNEL_3: TIM2 Channel3
NewState specifies the TIM2 Channel CCxE bit new state. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 745 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, IS_TIM2_CHANNEL_OK, TIM2_CCER1_CC1E, TIM2_CCER1_CC2E, TIM2_CCER2_CC3E, TIM2_CHANNEL_1, and TIM2_CHANNEL_2.
void TIM2_ClearFlag | ( | TIM2_FLAG_TypeDef | TIM2_FLAG | ) |
Clears the TIM2�s pending flags.
- Parameters:
-
TIM2_FLAG specifies the flag to clear. This parameter can be one of the following values: - TIM2_FLAG_UPDATE: TIM2 update Flag
- TIM2_FLAG_CC1: TIM2 Capture Compare 1 Flag
- TIM2_FLAG_CC2: TIM2 Capture Compare 2 Flag
- TIM2_FLAG_CC3: TIM2 Capture Compare 3 Flag
- TIM2_FLAG_CC1OF: TIM2 Capture Compare 1 over capture Flag
- TIM2_FLAG_CC2OF: TIM2 Capture Compare 2 over capture Flag
- TIM2_FLAG_CC3OF: TIM2 Capture Compare 3 over capture Flag
- Return values:
-
None.
Definition at line 1103 of file stm8s_tim2.c.
References assert_param, and IS_TIM2_CLEAR_FLAG_OK.
void TIM2_ClearITPendingBit | ( | TIM2_IT_TypeDef | TIM2_IT | ) |
Clears the TIM2's interrupt pending bits.
- Parameters:
-
TIM2_IT specifies the pending bit to clear. This parameter can be one of the following values: - TIM2_IT_UPDATE: TIM2 update Interrupt source
- TIM2_IT_CC1: TIM2 Capture Compare 1 Interrupt source
- TIM2_IT_CC2: TIM2 Capture Compare 2 Interrupt source
- TIM2_IT_CC3: TIM2 Capture Compare 3 Interrupt source
- Return values:
-
None.
Definition at line 1156 of file stm8s_tim2.c.
References assert_param, and IS_TIM2_IT_OK.
Referenced by INTERRUPT_HANDLER().
void TIM2_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral.
- Parameters:
-
NewState new state of the TIM2 peripheral. This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 339 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CR1_CEN.
Referenced by TIM2_Config().
void TIM2_DeInit | ( | void | ) |
Deinitializes the TIM2 peripheral registers to their default reset values.
- Parameters:
-
None
- Return values:
-
None
Definition at line 52 of file stm8s_tim2.c.
References TIM2_ARRH_RESET_VALUE, TIM2_ARRL_RESET_VALUE, TIM2_CCER1_RESET_VALUE, TIM2_CCER2_RESET_VALUE, TIM2_CCMR1_RESET_VALUE, TIM2_CCMR2_RESET_VALUE, TIM2_CCMR3_RESET_VALUE, TIM2_CCR1H_RESET_VALUE, TIM2_CCR1L_RESET_VALUE, TIM2_CCR2H_RESET_VALUE, TIM2_CCR2L_RESET_VALUE, TIM2_CCR3H_RESET_VALUE, TIM2_CCR3L_RESET_VALUE, TIM2_CNTRH_RESET_VALUE, TIM2_CNTRL_RESET_VALUE, TIM2_CR1_RESET_VALUE, TIM2_IER_RESET_VALUE, TIM2_PSCR_RESET_VALUE, TIM2_SR1_RESET_VALUE, and TIM2_SR2_RESET_VALUE.
void TIM2_ForcedOC1Config | ( | TIM2_ForcedAction_TypeDef | TIM2_ForcedAction | ) |
Forces the TIM2 Channel1 output waveform to active or inactive level.
- Parameters:
-
TIM2_ForcedAction specifies the forced Action to be set to the output waveform. This parameter can be one of the following values: - TIM2_FORCEDACTION_ACTIVE: Force active level on OC1REF
- TIM2_FORCEDACTION_INACTIVE: Force inactive level on OC1REF.
- Return values:
-
None
Definition at line 507 of file stm8s_tim2.c.
References assert_param, IS_TIM2_FORCED_ACTION_OK, and TIM2_CCMR_OCM.
void TIM2_ForcedOC2Config | ( | TIM2_ForcedAction_TypeDef | TIM2_ForcedAction | ) |
Forces the TIM2 Channel2 output waveform to active or inactive level.
- Parameters:
-
TIM2_ForcedAction specifies the forced Action to be set to the output waveform. This parameter can be one of the following values: - TIM2_FORCEDACTION_ACTIVE: Force active level on OC2REF
- TIM2_FORCEDACTION_INACTIVE: Force inactive level on OC2REF.
- Return values:
-
None
Definition at line 526 of file stm8s_tim2.c.
References assert_param, IS_TIM2_FORCED_ACTION_OK, and TIM2_CCMR_OCM.
void TIM2_ForcedOC3Config | ( | TIM2_ForcedAction_TypeDef | TIM2_ForcedAction | ) |
Forces the TIM2 Channel3 output waveform to active or inactive level.
- Parameters:
-
TIM2_ForcedAction specifies the forced Action to be set to the output waveform. This parameter can be one of the following values: - TIM2_FORCEDACTION_ACTIVE: Force active level on OC3REF
- TIM2_FORCEDACTION_INACTIVE: Force inactive level on OC3REF.
- Return values:
-
None
Definition at line 545 of file stm8s_tim2.c.
References assert_param, IS_TIM2_FORCED_ACTION_OK, and TIM2_CCMR_OCM.
void TIM2_GenerateEvent | ( | TIM2_EventSource_TypeDef | TIM2_EventSource | ) |
Configures the TIM2 event to be generated by software.
- Parameters:
-
TIM2_EventSource specifies the event source. This parameter can be one of the following values: - TIM2_EVENTSOURCE_UPDATE: TIM2 update Event source
- TIM2_EVENTSOURCE_CC1: TIM2 Capture Compare 1 Event source
- TIM2_EVENTSOURCE_CC2: TIM2 Capture Compare 2 Event source
- TIM2_EVENTSOURCE_CC3: TIM2 Capture Compare 3 Event source
- Return values:
-
None
Definition at line 653 of file stm8s_tim2.c.
References assert_param, and IS_TIM2_EVENT_SOURCE_OK.
uint16_t TIM2_GetCapture1 | ( | void | ) |
Gets the TIM2 Input Capture 1 value.
- Parameters:
-
None
- Return values:
-
Capture Compare 1 Register value.
Definition at line 975 of file stm8s_tim2.c.
uint16_t TIM2_GetCapture2 | ( | void | ) |
Gets the TIM2 Input Capture 2 value.
- Parameters:
-
None
- Return values:
-
Capture Compare 2 Register value.
Definition at line 995 of file stm8s_tim2.c.
uint16_t TIM2_GetCapture3 | ( | void | ) |
Gets the TIM2 Input Capture 3 value.
- Parameters:
-
None
- Return values:
-
Capture Compare 3 Register value.
Definition at line 1015 of file stm8s_tim2.c.
uint16_t TIM2_GetCounter | ( | void | ) |
Gets the TIM2 Counter value.
- Parameters:
-
None
- Return values:
-
Counter Register value.
Definition at line 1035 of file stm8s_tim2.c.
FlagStatus TIM2_GetFlagStatus | ( | TIM2_FLAG_TypeDef | TIM2_FLAG | ) |
Checks whether the specified TIM2 flag is set or not.
- Parameters:
-
TIM2_FLAG specifies the flag to check. This parameter can be one of the following values: - TIM2_FLAG_UPDATE: TIM2 update Flag
- TIM2_FLAG_CC1: TIM2 Capture Compare 1 Flag
- TIM2_FLAG_CC2: TIM2 Capture Compare 2 Flag
- TIM2_FLAG_CC3: TIM2 Capture Compare 3 Flag
- TIM2_FLAG_CC1OF: TIM2 Capture Compare 1 over capture Flag
- TIM2_FLAG_CC2OF: TIM2 Capture Compare 2 over capture Flag
- TIM2_FLAG_CC3OF: TIM2 Capture Compare 3 over capture Flag
- Return values:
-
FlagStatus The new state of TIM2_FLAG (SET or RESET).
Definition at line 1068 of file stm8s_tim2.c.
References assert_param, IS_TIM2_GET_FLAG_OK, RESET, and SET.
ITStatus TIM2_GetITStatus | ( | TIM2_IT_TypeDef | TIM2_IT | ) |
Checks whether the TIM2 interrupt has occurred or not.
- Parameters:
-
TIM2_IT specifies the TIM2 interrupt source to check. This parameter can be one of the following values: - TIM2_IT_UPDATE: TIM2 update Interrupt source
- TIM2_IT_CC1: TIM2 Capture Compare 1 Interrupt source
- TIM2_IT_CC2: TIM2 Capture Compare 2 Interrupt source
- TIM2_IT_CC3: TIM2 Capture Compare 3 Interrupt source
- Return values:
-
ITStatus The new state of the TIM2_IT(SET or RESET).
Definition at line 1123 of file stm8s_tim2.c.
References assert_param, IS_TIM2_GET_IT_OK, RESET, and SET.
Referenced by INTERRUPT_HANDLER().
TIM2_Prescaler_TypeDef TIM2_GetPrescaler | ( | void | ) |
Gets the TIM2 Prescaler value.
- Parameters:
-
None
- Return values:
-
Prescaler Register configuration value TIM2_Prescaler_TypeDef.
Definition at line 1049 of file stm8s_tim2.c.
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.
- Parameters:
-
TIM2_Channel specifies the Input Capture Channel from TIM2_Channel_TypeDef. TIM2_ICPolarity specifies the Input Capture Polarity from TIM2_ICPolarity_TypeDef. TIM2_ICSelection specifies the Input Capture Selection from TIM2_ICSelection_TypeDef. TIM2_ICPrescaler specifies the Input Capture Prescaler from TIM2_ICPSC_TypeDef. TIM2_ICFilter specifies the Input Capture Filter value (value can be an integer from 0x00 to 0x0F).
- Return values:
-
None
Definition at line 212 of file stm8s_tim2.c.
References assert_param, IS_TIM2_CHANNEL_OK, IS_TIM2_IC_FILTER_OK, IS_TIM2_IC_POLARITY_OK, IS_TIM2_IC_PRESCALER_OK, IS_TIM2_IC_SELECTION_OK, TI1_Config(), TI2_Config(), TI3_Config(), TIM2_CHANNEL_1, TIM2_CHANNEL_2, TIM2_SetIC1Prescaler(), TIM2_SetIC2Prescaler(), and TIM2_SetIC3Prescaler().
void TIM2_ITConfig | ( | TIM2_IT_TypeDef | TIM2_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified TIM2 interrupts.
- Parameters:
-
NewState new state of the TIM2 peripheral. This parameter can be: ENABLE or DISABLE. TIM2_IT specifies the TIM2 interrupts sources to be enabled or disabled. This parameter can be any combination of the following values: - TIM2_IT_UPDATE: TIM2 update Interrupt source
- TIM2_IT_CC1: TIM2 Capture Compare 1 Interrupt source
- TIM2_IT_CC2: TIM2 Capture Compare 2 Interrupt source
- TIM2_IT_CC3: TIM2 Capture Compare 3 Interrupt source
NewState new state of the TIM2 peripheral.
- Return values:
-
None
Definition at line 368 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and IS_TIM2_IT_OK.
Referenced by TIM2_Config().
void TIM2_OC1Init | ( | TIM2_OCMode_TypeDef | TIM2_OCMode, |
TIM2_OutputState_TypeDef | TIM2_OutputState, | ||
uint16_t | TIM2_Pulse, | ||
TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ||
) |
Initializes the TIM2 Channel1 according to the specified parameters.
- Parameters:
-
TIM2_OCMode specifies the Output Compare mode from TIM2_OCMode_TypeDef. TIM2_OutputState specifies the Output State from TIM2_OutputState_TypeDef. TIM2_Pulse specifies the Pulse width value. TIM2_OCPolarity specifies the Output Compare Polarity from TIM2_OCPolarity_TypeDef.
- Return values:
-
None
Definition at line 108 of file stm8s_tim2.c.
References assert_param, IS_TIM2_OC_MODE_OK, IS_TIM2_OC_POLARITY_OK, IS_TIM2_OUTPUT_STATE_OK, TIM2_CCER1_CC1E, TIM2_CCER1_CC1P, and TIM2_CCMR_OCM.
Referenced by TIM2_Config().
void TIM2_OC1PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 1 polarity.
- Parameters:
-
TIM2_OCPolarity specifies the OC1 Polarity. This parameter can be one of the following values: - TIM2_OCPOLARITY_LOW: Output Compare active low
- TIM2_OCPOLARITY_HIGH: Output Compare active high
- Return values:
-
None
Definition at line 670 of file stm8s_tim2.c.
References assert_param, IS_TIM2_OC_POLARITY_OK, TIM2_CCER1_CC1P, and TIM2_OCPOLARITY_HIGH.
void TIM2_OC1PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral Preload Register on CCR1.
- Parameters:
-
NewState new state of the Capture Compare Preload register. This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 583 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CCMR_OCxPE.
Referenced by TIM2_Config().
void TIM2_OC2Init | ( | TIM2_OCMode_TypeDef | TIM2_OCMode, |
TIM2_OutputState_TypeDef | TIM2_OutputState, | ||
uint16_t | TIM2_Pulse, | ||
TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ||
) |
Initializes the TIM2 Channel2 according to the specified parameters.
- Parameters:
-
TIM2_OCMode specifies the Output Compare mode from TIM2_OCMode_TypeDef. TIM2_OutputState specifies the Output State from TIM2_OutputState_TypeDef. TIM2_Pulse specifies the Pulse width value. TIM2_OCPolarity specifies the Output Compare Polarity from TIM2_OCPolarity_TypeDef.
- Return values:
-
None
Definition at line 142 of file stm8s_tim2.c.
References assert_param, IS_TIM2_OC_MODE_OK, IS_TIM2_OC_POLARITY_OK, IS_TIM2_OUTPUT_STATE_OK, TIM2_CCER1_CC2E, TIM2_CCER1_CC2P, and TIM2_CCMR_OCM.
Referenced by TIM2_Config().
void TIM2_OC2PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 2 polarity.
- Parameters:
-
TIM2_OCPolarity specifies the OC2 Polarity. This parameter can be one of the following values: - TIM2_OCPOLARITY_LOW: Output Compare active low
- TIM2_OCPOLARITY_HIGH: Output Compare active high
- Return values:
-
None
Definition at line 694 of file stm8s_tim2.c.
References assert_param, IS_TIM2_OC_POLARITY_OK, TIM2_CCER1_CC2P, and TIM2_OCPOLARITY_HIGH.
void TIM2_OC2PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral Preload Register on CCR2.
- Parameters:
-
NewState new state of the Capture Compare Preload register. This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 605 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CCMR_OCxPE.
Referenced by TIM2_Config().
void TIM2_OC3Init | ( | TIM2_OCMode_TypeDef | TIM2_OCMode, |
TIM2_OutputState_TypeDef | TIM2_OutputState, | ||
uint16_t | TIM2_Pulse, | ||
TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ||
) |
Initializes the TIM2 Channel3 according to the specified parameters.
- Parameters:
-
TIM2_OCMode specifies the Output Compare mode from TIM2_OCMode_TypeDef. TIM2_OutputState specifies the Output State from TIM2_OutputState_TypeDef. TIM2_Pulse specifies the Pulse width value. TIM2_OCPolarity specifies the Output Compare Polarity from TIM2_OCPolarity_TypeDef.
- Return values:
-
None
Definition at line 179 of file stm8s_tim2.c.
References assert_param, IS_TIM2_OC_MODE_OK, IS_TIM2_OC_POLARITY_OK, IS_TIM2_OUTPUT_STATE_OK, TIM2_CCER2_CC3E, TIM2_CCER2_CC3P, and TIM2_CCMR_OCM.
Referenced by TIM2_Config().
void TIM2_OC3PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 3 polarity.
- Parameters:
-
TIM2_OCPolarity specifies the OC3 Polarity. This parameter can be one of the following values: - TIM2_OCPOLARITY_LOW: Output Compare active low
- TIM2_OCPOLARITY_HIGH: Output Compare active high
- Return values:
-
None
Definition at line 718 of file stm8s_tim2.c.
References assert_param, IS_TIM2_OC_POLARITY_OK, TIM2_CCER2_CC3P, and TIM2_OCPOLARITY_HIGH.
void TIM2_OC3PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral Preload Register on CCR3.
- Parameters:
-
NewState new state of the Capture Compare Preload register. This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 627 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CCMR_OCxPE.
Referenced by TIM2_Config().
void TIM2_PrescalerConfig | ( | TIM2_Prescaler_TypeDef | Prescaler, |
TIM2_PSCReloadMode_TypeDef | TIM2_PSCReloadMode | ||
) |
Configures the TIM2 Prescaler.
- Parameters:
-
Prescaler specifies the Prescaler Register value This parameter can be one of the following values - TIM2_PRESCALER_1
- TIM2_PRESCALER_2
- TIM2_PRESCALER_4
- TIM2_PRESCALER_8
- TIM2_PRESCALER_16
- TIM2_PRESCALER_32
- TIM2_PRESCALER_64
- TIM2_PRESCALER_128
- TIM2_PRESCALER_256
- TIM2_PRESCALER_512
- TIM2_PRESCALER_1024
- TIM2_PRESCALER_2048
- TIM2_PRESCALER_4096
- TIM2_PRESCALER_8192
- TIM2_PRESCALER_16384
- TIM2_PRESCALER_32768
TIM2_PSCReloadMode specifies the TIM2 Prescaler Reload mode. This parameter can be one of the following values - TIM2_PSCRELOADMODE_IMMEDIATE: The Prescaler is loaded immediately.
- TIM2_PSCRELOADMODE_UPDATE: The Prescaler is loaded at the update event.
- Return values:
-
None
Definition at line 484 of file stm8s_tim2.c.
References assert_param, IS_TIM2_PRESCALER_OK, and IS_TIM2_PRESCALER_RELOAD_OK.
Referenced by TIM2_Config().
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.
- Parameters:
-
TIM2_Channel specifies the Input Capture Channel from TIM2_Channel_TypeDef. TIM2_ICPolarity specifies the Input Capture Polarity from TIM2_ICPolarity_TypeDef. TIM2_ICSelection specifies the Input Capture Selection from TIM2_ICSelection_TypeDef. TIM2_ICPrescaler specifies the Input Capture Prescaler from TIM2_ICPSC_TypeDef. TIM2_ICFilter specifies the Input Capture Filter value (value can be an integer from 0x00 to 0x0F).
- Return values:
-
None
Definition at line 266 of file stm8s_tim2.c.
References assert_param, IS_TIM2_IC_POLARITY_OK, IS_TIM2_IC_PRESCALER_OK, IS_TIM2_IC_SELECTION_OK, IS_TIM2_PWMI_CHANNEL_OK, 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_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.
- Parameters:
-
TIM2_Channel specifies the TIM2 Channel. This parameter can be one of the following values: - TIM2_CHANNEL_1: TIM2 Channel1
- TIM2_CHANNEL_2: TIM2 Channel2
- TIM2_CHANNEL_3: TIM2 Channel3
TIM2_OCMode specifies the TIM2 Output Compare Mode. This paramter can be one of the following values: - TIM2_OCMODE_TIMING
- TIM2_OCMODE_ACTIVE
- TIM2_OCMODE_TOGGLE
- TIM2_OCMODE_PWM1
- TIM2_OCMODE_PWM2
- TIM2_FORCEDACTION_ACTIVE
- TIM2_FORCEDACTION_INACTIVE
- Return values:
-
None
Definition at line 810 of file stm8s_tim2.c.
References assert_param, IS_TIM2_CHANNEL_OK, IS_TIM2_OCM_OK, TIM2_CCER1_CC1E, TIM2_CCER1_CC2E, TIM2_CCER2_CC3E, TIM2_CCMR_OCM, TIM2_CHANNEL_1, and TIM2_CHANNEL_2.
void TIM2_SelectOnePulseMode | ( | TIM2_OPMode_TypeDef | TIM2_OPMode | ) |
Selects the TIM2�s One Pulse Mode.
- Parameters:
-
TIM2_OPMode specifies the OPM Mode to be used. This parameter can be one of the following values - TIM2_OPMODE_SINGLE
- TIM2_OPMODE_REPETITIVE
- Return values:
-
None
Definition at line 440 of file stm8s_tim2.c.
References assert_param, IS_TIM2_OPM_MODE_OK, TIM2_CR1_OPM, and TIM2_OPMODE_REPETITIVE.
void TIM2_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM2 Autoreload Register value.
- Parameters:
-
Autoreload specifies the Autoreload register new value. This parameter is between 0x0000 and 0xFFFF.
- Return values:
-
None
Definition at line 864 of file stm8s_tim2.c.
void TIM2_SetCompare1 | ( | uint16_t | Compare1 | ) |
Sets the TIM2 Capture Compare1 Register value.
- Parameters:
-
Compare1 specifies the Capture Compare1 register new value. This parameter is between 0x0000 and 0xFFFF.
- Return values:
-
None
Definition at line 877 of file stm8s_tim2.c.
void TIM2_SetCompare2 | ( | uint16_t | Compare2 | ) |
Sets the TIM2 Capture Compare2 Register value.
- Parameters:
-
Compare2 specifies the Capture Compare2 register new value. This parameter is between 0x0000 and 0xFFFF.
- Return values:
-
None
Definition at line 890 of file stm8s_tim2.c.
void TIM2_SetCompare3 | ( | uint16_t | Compare3 | ) |
Sets the TIM2 Capture Compare3 Register value.
- Parameters:
-
Compare3 specifies the Capture Compare3 register new value. This parameter is between 0x0000 and 0xFFFF.
- Return values:
-
None
Definition at line 903 of file stm8s_tim2.c.
void TIM2_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM2 Counter Register value.
- Parameters:
-
Counter specifies the Counter register new value. This parameter is between 0x0000 and 0xFFFF.
- Return values:
-
None
Definition at line 851 of file stm8s_tim2.c.
void TIM2_SetIC1Prescaler | ( | TIM2_ICPSC_TypeDef | TIM2_IC1Prescaler | ) |
Sets the TIM2 Input Capture 1 Prescaler.
- Parameters:
-
TIM2_IC1Prescaler specifies the Input Capture prescaler new value This parameter can be one of the following values: - TIM2_ICPSC_DIV1: no prescaler
- TIM2_ICPSC_DIV2: capture is done once every 2 events
- TIM2_ICPSC_DIV4: capture is done once every 4 events
- TIM2_ICPSC_DIV8: capture is done once every 8 events
- Return values:
-
None
Definition at line 920 of file stm8s_tim2.c.
References assert_param, IS_TIM2_IC_PRESCALER_OK, and TIM2_CCMR_ICxPSC.
Referenced by TIM2_ICInit(), and TIM2_PWMIConfig().
void TIM2_SetIC2Prescaler | ( | TIM2_ICPSC_TypeDef | TIM2_IC2Prescaler | ) |
Sets the TIM2 Input Capture 2 prescaler.
- Parameters:
-
TIM2_IC2Prescaler specifies the Input Capture prescaler new value This parameter can be one of the following values: - TIM2_ICPSC_DIV1: no prescaler
- TIM2_ICPSC_DIV2: capture is done once every 2 events
- TIM2_ICPSC_DIV4: capture is done once every 4 events
- TIM2_ICPSC_DIV8: capture is done once every 8 events
- Return values:
-
None
Definition at line 940 of file stm8s_tim2.c.
References assert_param, IS_TIM2_IC_PRESCALER_OK, and TIM2_CCMR_ICxPSC.
Referenced by TIM2_ICInit(), and TIM2_PWMIConfig().
void TIM2_SetIC3Prescaler | ( | TIM2_ICPSC_TypeDef | TIM2_IC3Prescaler | ) |
Sets the TIM2 Input Capture 3 prescaler.
- Parameters:
-
TIM2_IC3Prescaler specifies the Input Capture prescaler new value This parameter can be one of the following values: - TIM2_ICPSC_DIV1: no prescaler
- TIM2_ICPSC_DIV2: capture is done once every 2 events
- TIM2_ICPSC_DIV4: capture is done once every 4 events
- TIM2_ICPSC_DIV8: capture is done once every 8 events
- Return values:
-
None
Definition at line 960 of file stm8s_tim2.c.
References assert_param, IS_TIM2_IC_PRESCALER_OK, and TIM2_CCMR_ICxPSC.
Referenced by TIM2_ICInit().
void TIM2_TimeBaseInit | ( | TIM2_Prescaler_TypeDef | TIM2_Prescaler, |
uint16_t | TIM2_Period | ||
) |
Initializes the TIM2 Time Base Unit according to the specified parameters.
- Parameters:
-
TIM2_Prescaler specifies the Prescaler from TIM2_Prescaler_TypeDef. TIM2_Period specifies the Period value.
- Return values:
-
None
Definition at line 89 of file stm8s_tim2.c.
Referenced by TIM2_Config().
void TIM2_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM2 Update event.
- Parameters:
-
NewState new state of the TIM2 peripheral Preload register. This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 392 of file stm8s_tim2.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CR1_UDIS.
void TIM2_UpdateRequestConfig | ( | TIM2_UpdateSource_TypeDef | TIM2_UpdateSource | ) |
Selects the TIM2 Update Request Interrupt source.
- Parameters:
-
TIM2_UpdateSource specifies the Update source. This parameter can be one of the following values - TIM2_UPDATESOURCE_REGULAR
- TIM2_UPDATESOURCE_GLOBAL
- Return values:
-
None
Definition at line 416 of file stm8s_tim2.c.
References assert_param, IS_TIM2_UPDATE_SOURCE_OK, TIM2_CR1_URS, and TIM2_UPDATESOURCE_GLOBAL.