STM8S/A Standard Peripherals Firmware Library
|
Functions | |
static void | TI1_Config (uint8_t TIM5_ICPolarity, uint8_t TIM5_ICSelection, uint8_t TIM5_ICFilter) |
Configure the TI1 as Input. | |
static void | TI2_Config (uint8_t TIM5_ICPolarity, uint8_t TIM5_ICSelection, uint8_t TIM5_ICFilter) |
Configure the TI2 as Input. | |
static void | TI3_Config (uint8_t TIM5_ICPolarity, uint8_t TIM5_ICSelection, uint8_t TIM5_ICFilter) |
Configure the TI3 as Input. | |
void | TIM5_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM5 peripheral Preload register on ARR. | |
void | TIM5_CCxCmd (TIM5_Channel_TypeDef TIM5_Channel, FunctionalState NewState) |
Enables or disables the TIM5 Capture Compare Channel x. | |
void | TIM5_ClearFlag (TIM5_FLAG_TypeDef TIM5_FLAG) |
Clears the TIM5�s pending flags. | |
void | TIM5_ClearITPendingBit (TIM5_IT_TypeDef TIM5_IT) |
Clears the TIM5's interrupt pending bits. | |
void | TIM5_Cmd (FunctionalState NewState) |
Enables or disables the TIM5 peripheral. | |
void | TIM5_DeInit (void) |
Deinitializes the TIM5 peripheral registers to their default reset values. | |
void | TIM5_EncoderInterfaceConfig (TIM5_EncoderMode_TypeDef TIM5_EncoderMode, TIM5_ICPolarity_TypeDef TIM5_IC1Polarity, TIM5_ICPolarity_TypeDef TIM5_IC2Polarity) |
Configures the TIM5 Encoder Interface. | |
void | TIM5_ForcedOC1Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction) |
Forces the TIM5 Channel1 output waveform to active or inactive level. | |
void | TIM5_ForcedOC2Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction) |
Forces the TIM5 Channel2 output waveform to active or inactive level. | |
void | TIM5_ForcedOC3Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction) |
Forces the TIM5 Channel3 output waveform to active or inactive level. | |
void | TIM5_GenerateEvent (TIM5_EventSource_TypeDef TIM5_EventSource) |
Configures the TIM5 event to be generated by software. | |
uint16_t | TIM5_GetCapture1 (void) |
Gets the TIM5 Input Capture 1 value. | |
uint16_t | TIM5_GetCapture2 (void) |
Gets the TIM5 Input Capture 2 value. | |
uint16_t | TIM5_GetCapture3 (void) |
Gets the TIM5 Input Capture 3 value. | |
uint16_t | TIM5_GetCounter (void) |
Gets the TIM5 Counter value. | |
FlagStatus | TIM5_GetFlagStatus (TIM5_FLAG_TypeDef TIM5_FLAG) |
Checks whether the specified TIM5 flag is set or not. | |
ITStatus | TIM5_GetITStatus (TIM5_IT_TypeDef TIM5_IT) |
Checks whether the TIM5 interrupt has occurred or not. | |
TIM5_Prescaler_TypeDef | TIM5_GetPrescaler (void) |
Gets the TIM5 Prescaler value. | |
void | TIM5_ICInit (TIM5_Channel_TypeDef TIM5_Channel, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, TIM5_ICSelection_TypeDef TIM5_ICSelection, TIM5_ICPSC_TypeDef TIM5_ICPrescaler, uint8_t TIM5_ICFilter) |
Initializes the TIM5 peripheral according to the specified parameters. | |
void | TIM5_InternalClockConfig (void) |
Enables the TIM5 internal Clock. | |
void | TIM5_ITConfig (TIM5_IT_TypeDef TIM5_IT, FunctionalState NewState) |
Enables or disables the specified TIM5 interrupts. | |
void | TIM5_OC1Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Initializes the TIM5 Channel1 according to the specified parameters. | |
void | TIM5_OC1PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Configures the TIM5 Channel 1 polarity. | |
void | TIM5_OC1PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM5 peripheral Preload Register on CCR1. | |
void | TIM5_OC2Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Initializes the TIM5 Channel2 according to the specified parameters. | |
void | TIM5_OC2PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Configures the TIM5 Channel 2 polarity. | |
void | TIM5_OC2PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM5 peripheral Preload Register on CCR2. | |
void | TIM5_OC3Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Initializes the TIM5 Channel3 according to the specified parameters. | |
void | TIM5_OC3PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Configures the TIM5 Channel 3 polarity. | |
void | TIM5_OC3PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM5 peripheral Preload Register on CCR3. | |
void | TIM5_PrescalerConfig (TIM5_Prescaler_TypeDef Prescaler, TIM5_PSCReloadMode_TypeDef TIM5_PSCReloadMode) |
Configures the TIM5 Prescaler. | |
void | TIM5_PWMIConfig (TIM5_Channel_TypeDef TIM5_Channel, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, TIM5_ICSelection_TypeDef TIM5_ICSelection, TIM5_ICPSC_TypeDef TIM5_ICPrescaler, uint8_t TIM5_ICFilter) |
Configures the TIM5 peripheral in PWM Input Mode according to the specified parameters. | |
void | TIM5_SelectInputTrigger (TIM5_TS_TypeDef TIM5_InputTriggerSource) |
Selects the TIM5 Input Trigger source. | |
void | TIM5_SelectOCxM (TIM5_Channel_TypeDef TIM5_Channel, TIM5_OCMode_TypeDef TIM5_OCMode) |
Selects the TIM5 Output Compare Mode. | |
void | TIM5_SelectOnePulseMode (TIM5_OPMode_TypeDef TIM5_OPMode) |
Selects the TIM5�s One Pulse Mode. | |
void | TIM5_SelectOutputTrigger (TIM5_TRGOSource_TypeDef TIM5_TRGOSource) |
Selects the TIM5 Trigger Output Mode. | |
void | TIM5_SelectSlaveMode (TIM5_SlaveMode_TypeDef TIM5_SlaveMode) |
Selects the TIM5 Slave Mode. | |
void | TIM5_SetAutoreload (uint16_t Autoreload) |
Sets the TIM5 Autoreload Register value. | |
void | TIM5_SetCompare1 (uint16_t Compare1) |
Sets the TIM5 Capture Compare1 Register value. | |
void | TIM5_SetCompare2 (uint16_t Compare2) |
Sets the TIM5 Capture Compare2 Register value. | |
void | TIM5_SetCompare3 (uint16_t Compare3) |
Sets the TIM5 Capture Compare3 Register value. | |
void | TIM5_SetCounter (uint16_t Counter) |
Sets the TIM5 Counter Register value. | |
void | TIM5_SetIC1Prescaler (TIM5_ICPSC_TypeDef TIM5_IC1Prescaler) |
Sets the TIM5 Input Capture 1 prescaler. | |
void | TIM5_SetIC2Prescaler (TIM5_ICPSC_TypeDef TIM5_IC2Prescaler) |
Sets the TIM5 Input Capture 2 prescaler. | |
void | TIM5_SetIC3Prescaler (TIM5_ICPSC_TypeDef TIM5_IC3Prescaler) |
Sets the TIM5 Input Capture 3 prescaler. | |
void | TIM5_TimeBaseInit (TIM5_Prescaler_TypeDef TIM5_Prescaler, uint16_t TIM5_Period) |
Initializes the TIM5 Time Base Unit according to the specified parameters. | |
void | TIM5_UpdateDisableConfig (FunctionalState NewState) |
Enables or Disables the TIM5 Update event. | |
void | TIM5_UpdateRequestConfig (TIM5_UpdateSource_TypeDef TIM5_UpdateSource) |
Selects the TIM5 Update Request Interrupt source. |
Function Documentation
static void TI1_Config | ( | uint8_t | TIM5_ICPolarity, |
uint8_t | TIM5_ICSelection, | ||
uint8_t | TIM5_ICFilter | ||
) | [static] |
Configure the TI1 as Input.
- Parameters:
-
TIM5_ICPolarity The Input Polarity. This parameter can be one of the following values: - TIM5_ICPOLARITY_FALLING
- TIM5_ICPOLARITY_RISING
TIM5_ICSelection specifies the input to be used. This parameter can be one of the following values: - TIM5_ICSELECTION_DIRECTTI: TIM5 Input 1 is selected to be connected to IC1.
- TIM5_ICSELECTION_INDIRECTTI: TIM5 Input 1 is selected to be connected to IC2.
TIM5_ICFilter Specifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
- Return values:
-
None
Definition at line 1161 of file stm8s_tim5.c.
References TIM5_CCER1_CC1E, TIM5_CCER1_CC1P, TIM5_CCMR_CCxS, TIM5_CCMR_ICxF, and TIM5_ICPOLARITY_RISING.
Referenced by TIM5_ICInit(), and TIM5_PWMIConfig().
static void TI2_Config | ( | uint8_t | TIM5_ICPolarity, |
uint8_t | TIM5_ICSelection, | ||
uint8_t | TIM5_ICFilter | ||
) | [static] |
Configure the TI2 as Input.
- Parameters:
-
TIM5_ICPolarity The Input Polarity. This parameter can be one of the following values: - TIM5_ICPOLARITY_FALLING
- TIM5_ICPOLARITY_RISING
TIM5_ICSelection specifies the input to be used. This parameter can be one of the following values: - TIM5_ICSELECTION_DIRECTTI: TIM5 Input 2 is selected to be connected to IC2.
- TIM5_ICSELECTION_INDIRECTTI: TIM5 Input 2 is selected to be connected to IC1.
TIM5_ICFilter Specifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
- Return values:
-
None
Definition at line 1201 of file stm8s_tim5.c.
References TIM5_CCER1_CC2E, TIM5_CCER1_CC2P, TIM5_CCMR_CCxS, TIM5_CCMR_ICxF, and TIM5_ICPOLARITY_RISING.
Referenced by TIM5_ICInit(), and TIM5_PWMIConfig().
static void TI3_Config | ( | uint8_t | TIM5_ICPolarity, |
uint8_t | TIM5_ICSelection, | ||
uint8_t | TIM5_ICFilter | ||
) | [static] |
Configure the TI3 as Input.
- Parameters:
-
TIM5_ICPolarity The Input Polarity. This parameter can be one of the following values: - TIM5_ICPOLARITY_FALLING
- TIM5_ICPOLARITY_RISING
TIM5_ICSelection specifies the input to be used. This parameter can be one of the following values: - TIM5_ICSELECTION_DIRECTTI: TIM5 Input 3 is selected to be connected to IC3.
TIM5_ICFilter Specifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
- Return values:
-
None
Definition at line 1241 of file stm8s_tim5.c.
References TIM5_CCER2_CC3E, TIM5_CCER2_CC3P, TIM5_CCMR_CCxS, TIM5_CCMR_ICxF, and TIM5_ICPOLARITY_RISING.
Referenced by TIM5_ICInit().
void TIM5_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM5 peripheral Preload register on ARR.
- Parameters:
-
NewState new state of the TIM5 peripheral Preload register. This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 556 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM5_CR1_ARPE.
void TIM5_CCxCmd | ( | TIM5_Channel_TypeDef | TIM5_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM5 Capture Compare Channel x.
- Parameters:
-
TIM5_Channel specifies the TIM5 Channel. This parameter can be one of the following values: - TIM5_Channel1: TIM5 Channel1
- TIM5_Channel2: TIM5 Channel2
- TIM5_Channel3: TIM5 Channel3
NewState specifies the TIM5 Channel CCxE bit new state. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 741 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, IS_TIM5_CHANNEL_OK, TIM5_CCER1_CC1E, TIM5_CCER1_CC2E, TIM5_CCER2_CC3E, TIM5_CHANNEL_1, and TIM5_CHANNEL_2.
void TIM5_ClearFlag | ( | TIM5_FLAG_TypeDef | TIM5_FLAG | ) |
Clears the TIM5�s pending flags.
- Parameters:
-
TIM5_FLAG specifies the flag to clear. This parameter can be one of the following values: - TIM5_FLAG_UPDATE: TIM5 update Flag
- TIM5_FLAG_CC1: TIM5 Capture Compare 1 Flag
- TIM5_FLAG_CC2: TIM5 Capture Compare 2 Flag
- TIM5_FLAG_CC3: TIM5 Capture Compare 3 Flag
- TIM5_FLAG_CC1OF: TIM5 Capture Compare 1 overcapture Flag
- TIM5_FLAG_CC2OF: TIM5 Capture Compare 2 overcapture Flag
- TIM5_FLAG_CC3OF: TIM5 Capture Compare 3 overcapture Flag
- Return values:
-
None.
Definition at line 1082 of file stm8s_tim5.c.
References assert_param, and IS_TIM5_CLEAR_FLAG_OK.
void TIM5_ClearITPendingBit | ( | TIM5_IT_TypeDef | TIM5_IT | ) |
Clears the TIM5's interrupt pending bits.
- Parameters:
-
TIM5_IT specifies the pending bit to clear. This parameter can be one of the following values: - TIM5_IT_UPDATE: TIM5 update Interrupt source
- TIM5_IT_CC1: TIM5 Capture Compare 1 Interrupt source
- TIM5_IT_CC2: TIM5 Capture Compare 2 Interrupt source
- TIM5_IT_CC3: TIM5 Capture Compare 3 Interrupt source
- Return values:
-
None.
Definition at line 1136 of file stm8s_tim5.c.
References assert_param, and IS_TIM5_IT_OK.
void TIM5_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM5 peripheral.
- Parameters:
-
NewState new state of the TIM5 peripheral.This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 334 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM5_CR1_CEN.
void TIM5_DeInit | ( | void | ) |
Deinitializes the TIM5 peripheral registers to their default reset values.
- Parameters:
-
None
- Return values:
-
None
Definition at line 52 of file stm8s_tim5.c.
References TIM5_ARRH_RESET_VALUE, TIM5_ARRL_RESET_VALUE, TIM5_CCER1_RESET_VALUE, TIM5_CCER2_RESET_VALUE, TIM5_CCMR1_RESET_VALUE, TIM5_CCMR2_RESET_VALUE, TIM5_CCMR3_RESET_VALUE, TIM5_CCR1H_RESET_VALUE, TIM5_CCR1L_RESET_VALUE, TIM5_CCR2H_RESET_VALUE, TIM5_CCR2L_RESET_VALUE, TIM5_CCR3H_RESET_VALUE, TIM5_CCR3L_RESET_VALUE, TIM5_CNTRH_RESET_VALUE, TIM5_CNTRL_RESET_VALUE, TIM5_CR1_RESET_VALUE, TIM5_CR2_RESET_VALUE, TIM5_IER_RESET_VALUE, TIM5_PSCR_RESET_VALUE, TIM5_SMCR_RESET_VALUE, TIM5_SR1_RESET_VALUE, and TIM5_SR2_RESET_VALUE.
Referenced by TIM5_Config().
void TIM5_EncoderInterfaceConfig | ( | TIM5_EncoderMode_TypeDef | TIM5_EncoderMode, |
TIM5_ICPolarity_TypeDef | TIM5_IC1Polarity, | ||
TIM5_ICPolarity_TypeDef | TIM5_IC2Polarity | ||
) |
Configures the TIM5 Encoder Interface.
- Parameters:
-
TIM5_EncoderMode : Specifies the TIM5 Encoder Mode. This parameter can be one of the TIM5_EncoderMode_TypeDef enumeration. TIM5_IC1Polarity : Specifies the IC1 Polarity. This parameter can be one of the TIM5_ICPolarity_TypeDef enumeration. TIM5_IC2Polarity : Specifies the IC2 Polarity. This parameter can be one of the TIM5_ICPolarity_TypeDef enumeration.
- Return values:
-
None
Definition at line 1357 of file stm8s_tim5.c.
References assert_param, IS_TIM5_ENCODER_MODE_OK, IS_TIM5_IC_POLARITY_OK, TIM5_CCER1_CC1P, TIM5_CCER1_CC2P, TIM5_CCMR_CCxS, TIM5_CCMR_TIxDirect_Set, TIM5_ICPOLARITY_FALLING, TIM5_SMCR_MSM, and TIM5_SMCR_TS.
void TIM5_ForcedOC1Config | ( | TIM5_ForcedAction_TypeDef | TIM5_ForcedAction | ) |
Forces the TIM5 Channel1 output waveform to active or inactive level.
- Parameters:
-
TIM5_ForcedAction specifies the forced Action to be set to the output waveform. This parameter can be one of the following values: - TIM5_FORCEDACTION_ACTIVE: Force active level on OC1REF
- TIM5_FORCEDACTION_INACTIVE: Force inactive level on OC1REF.
- Return values:
-
None
Definition at line 502 of file stm8s_tim5.c.
References assert_param, IS_TIM5_FORCED_ACTION_OK, and TIM5_CCMR_OCM.
void TIM5_ForcedOC2Config | ( | TIM5_ForcedAction_TypeDef | TIM5_ForcedAction | ) |
Forces the TIM5 Channel2 output waveform to active or inactive level.
- Parameters:
-
TIM5_ForcedAction specifies the forced Action to be set to the output waveform. This parameter can be one of the following values: - TIM5_FORCEDACTION_ACTIVE: Force active level on OC2REF
- TIM5_FORCEDACTION_INACTIVE: Force inactive level on OC2REF.
- Return values:
-
None
Definition at line 521 of file stm8s_tim5.c.
References assert_param, IS_TIM5_FORCED_ACTION_OK, and TIM5_CCMR_OCM.
void TIM5_ForcedOC3Config | ( | TIM5_ForcedAction_TypeDef | TIM5_ForcedAction | ) |
Forces the TIM5 Channel3 output waveform to active or inactive level.
- Parameters:
-
TIM5_ForcedAction specifies the forced Action to be set to the output waveform. This parameter can be one of the following values: - TIM5_FORCEDACTION_ACTIVE: Force active level on OC3REF
- TIM5_FORCEDACTION_INACTIVE: Force inactive level on OC3REF.
- Return values:
-
None
Definition at line 540 of file stm8s_tim5.c.
References assert_param, IS_TIM5_FORCED_ACTION_OK, and TIM5_CCMR_OCM.
void TIM5_GenerateEvent | ( | TIM5_EventSource_TypeDef | TIM5_EventSource | ) |
Configures the TIM5 event to be generated by software.
- Parameters:
-
TIM5_EventSource specifies the event source. This parameter can be one of the following values: - TIM5_EVENTSOURCE_UPDATE: TIM5 update Event source
- TIM5_EVENTSOURCE_CC1: TIM5 Capture Compare 1 Event source
- TIM5_EVENTSOURCE_CC2: TIM5 Capture Compare 2 Event source
- TIM5_EVENTSOURCE_CC3: TIM5 Capture Compare 3 Event source
- Return values:
-
None
Definition at line 648 of file stm8s_tim5.c.
References assert_param, and IS_TIM5_EVENT_SOURCE_OK.
uint16_t TIM5_GetCapture1 | ( | void | ) |
Gets the TIM5 Input Capture 1 value.
- Parameters:
-
None
- Return values:
-
Capture Compare 1 Register value.
Definition at line 970 of file stm8s_tim5.c.
uint16_t TIM5_GetCapture2 | ( | void | ) |
Gets the TIM5 Input Capture 2 value.
- Parameters:
-
None
- Return values:
-
Capture Compare 2 Register value.
Definition at line 985 of file stm8s_tim5.c.
uint16_t TIM5_GetCapture3 | ( | void | ) |
Gets the TIM5 Input Capture 3 value.
- Parameters:
-
None
- Return values:
-
Capture Compare 3 Register value.
Definition at line 1000 of file stm8s_tim5.c.
uint16_t TIM5_GetCounter | ( | void | ) |
Gets the TIM5 Counter value.
- Parameters:
-
None
- Return values:
-
Counter Register value.
Definition at line 1014 of file stm8s_tim5.c.
FlagStatus TIM5_GetFlagStatus | ( | TIM5_FLAG_TypeDef | TIM5_FLAG | ) |
Checks whether the specified TIM5 flag is set or not.
- Parameters:
-
TIM5_FLAG specifies the flag to check. This parameter can be one of the following values: - TIM5_FLAG_UPDATE: TIM5 update Flag
- TIM5_FLAG_CC1: TIM5 Capture Compare 1 Flag
- TIM5_FLAG_CC2: TIM5 Capture Compare 2 Flag
- TIM5_FLAG_CC3: TIM5 Capture Compare 3 Flag
- TIM5_FLAG_CC1OF: TIM5 Capture Compare 1 overcapture Flag
- TIM5_FLAG_CC2OF: TIM5 Capture Compare 2 overcapture Flag
- TIM5_FLAG_CC3OF: TIM5 Capture Compare 3 overcapture Flag
- Return values:
-
FlagStatus The new state of TIM5_FLAG (SET or RESET).
Definition at line 1047 of file stm8s_tim5.c.
References assert_param, IS_TIM5_GET_FLAG_OK, RESET, and SET.
ITStatus TIM5_GetITStatus | ( | TIM5_IT_TypeDef | TIM5_IT | ) |
Checks whether the TIM5 interrupt has occurred or not.
- Parameters:
-
TIM5_IT specifies the TIM5 interrupt source to check. This parameter can be one of the following values: - TIM5_IT_UPDATE: TIM5 update Interrupt source
- TIM5_IT_CC1: TIM5 Capture Compare 1 Interrupt source
- TIM5_IT_CC2: TIM5 Capture Compare 2 Interrupt source
- TIM5_IT_CC3: TIM5 Capture Compare 3 Interrupt source
- Return values:
-
ITStatus The new state of the TIM5_IT(SET or RESET).
Definition at line 1103 of file stm8s_tim5.c.
References assert_param, IS_TIM5_GET_IT_OK, RESET, and SET.
TIM5_Prescaler_TypeDef TIM5_GetPrescaler | ( | void | ) |
Gets the TIM5 Prescaler value.
- Parameters:
-
None
- Return values:
-
Prescaler Register configuration value TIM5_Prescaler_TypeDef .
Definition at line 1028 of file stm8s_tim5.c.
void TIM5_ICInit | ( | TIM5_Channel_TypeDef | TIM5_Channel, |
TIM5_ICPolarity_TypeDef | TIM5_ICPolarity, | ||
TIM5_ICSelection_TypeDef | TIM5_ICSelection, | ||
TIM5_ICPSC_TypeDef | TIM5_ICPrescaler, | ||
uint8_t | TIM5_ICFilter | ||
) |
Initializes the TIM5 peripheral according to the specified parameters.
- Parameters:
-
TIM5_Channel specifies the Input Capture Channel from TIM5_Channel_TypeDef. TIM5_ICPolarity specifies the Input Capture Polarity from TIM5_ICPolarity_TypeDef. TIM5_ICSelection specifies theInput Capture Selection from TIM5_ICSelection_TypeDef. TIM5_ICPrescaler specifies the Input Capture Prescaler from TIM5_ICPSC_TypeDef. TIM5_ICFilter specifies the Input Capture Filter value (value can be an integer from 0x00 to 0x0F).
- Return values:
-
None
Definition at line 207 of file stm8s_tim5.c.
References assert_param, IS_TIM5_CHANNEL_OK, IS_TIM5_IC_FILTER_OK, IS_TIM5_IC_POLARITY_OK, IS_TIM5_IC_PRESCALER_OK, IS_TIM5_IC_SELECTION_OK, TI1_Config(), TI2_Config(), TI3_Config(), TIM5_CHANNEL_1, TIM5_CHANNEL_2, TIM5_SetIC1Prescaler(), TIM5_SetIC2Prescaler(), and TIM5_SetIC3Prescaler().
void TIM5_InternalClockConfig | ( | void | ) |
Enables the TIM5 internal Clock.
- Parameters:
- None
- Return values:
-
None
Definition at line 1271 of file stm8s_tim5.c.
References TIM5_SMCR_SMS.
void TIM5_ITConfig | ( | TIM5_IT_TypeDef | TIM5_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified TIM5 interrupts.
- Parameters:
-
NewState new state of the TIM5 peripheral. This parameter can be: ENABLE or DISABLE. TIM5_IT specifies the TIM5 interrupts sources to be enabled or disabled. This parameter can be any combination of the following values: - TIM5_IT_UPDATE: TIM5 update Interrupt source
- TIM5_IT_CC1: TIM5 Capture Compare 1 Interrupt source
- TIM5_IT_CC2: TIM5 Capture Compare 2 Interrupt source
- TIM5_IT_CC3: TIM5 Capture Compare 3 Interrupt source
NewState new state of the TIM5 peripheral.
- Return values:
-
None
Definition at line 363 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and IS_TIM5_IT_OK.
void TIM5_OC1Init | ( | TIM5_OCMode_TypeDef | TIM5_OCMode, |
TIM5_OutputState_TypeDef | TIM5_OutputState, | ||
uint16_t | TIM5_Pulse, | ||
TIM5_OCPolarity_TypeDef | TIM5_OCPolarity | ||
) |
Initializes the TIM5 Channel1 according to the specified parameters.
- Parameters:
-
TIM5_OCMode specifies the Output Compare mode from TIM5_OCMode_TypeDef. TIM5_OutputState specifies the Output State from TIM5_OutputState_TypeDef. TIM5_Pulse specifies the Pulse width value. TIM5_OCPolarity specifies the Output Compare Polarity from TIM5_OCPolarity_TypeDef.
- Return values:
-
None
Definition at line 108 of file stm8s_tim5.c.
References assert_param, IS_TIM5_OC_MODE_OK, IS_TIM5_OC_POLARITY_OK, IS_TIM5_OUTPUT_STATE_OK, TIM5_CCER1_CC1E, TIM5_CCER1_CC1P, and TIM5_CCMR_OCM.
void TIM5_OC1PolarityConfig | ( | TIM5_OCPolarity_TypeDef | TIM5_OCPolarity | ) |
Configures the TIM5 Channel 1 polarity.
- Parameters:
-
TIM5_OCPolarity specifies the OC1 Polarity. This parameter can be one of the following values: - TIM5_OCPOLARITY_LOW: Output Compare active low
- TIM5_OCPOLARITY_HIGH: Output Compare active high
- Return values:
-
None
Definition at line 665 of file stm8s_tim5.c.
References assert_param, IS_TIM5_OC_POLARITY_OK, TIM5_CCER1_CC1P, and TIM5_OCPOLARITY_HIGH.
void TIM5_OC1PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM5 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 578 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM5_CCMR_OCxPE.
void TIM5_OC2Init | ( | TIM5_OCMode_TypeDef | TIM5_OCMode, |
TIM5_OutputState_TypeDef | TIM5_OutputState, | ||
uint16_t | TIM5_Pulse, | ||
TIM5_OCPolarity_TypeDef | TIM5_OCPolarity | ||
) |
Initializes the TIM5 Channel2 according to the specified parameters.
- Parameters:
-
TIM5_OCMode specifies the Output Compare mode from TIM5_OCMode_TypeDef. TIM5_OutputState specifies the Output State from TIM5_OutputState_TypeDef. TIM5_Pulse specifies the Pulse width value. TIM5_OCPolarity specifies the Output Compare Polarity from TIM5_OCPolarity_TypeDef.
- Return values:
-
None
Definition at line 141 of file stm8s_tim5.c.
References assert_param, IS_TIM5_OC_MODE_OK, IS_TIM5_OC_POLARITY_OK, IS_TIM5_OUTPUT_STATE_OK, TIM5_CCER1_CC2E, TIM5_CCER1_CC2P, and TIM5_CCMR_OCM.
void TIM5_OC2PolarityConfig | ( | TIM5_OCPolarity_TypeDef | TIM5_OCPolarity | ) |
Configures the TIM5 Channel 2 polarity.
- Parameters:
-
TIM5_OCPolarity specifies the OC2 Polarity. This parameter can be one of the following values: - TIM5_OCPOLARITY_LOW: Output Compare active low
- TIM5_OCPOLARITY_HIGH: Output Compare active high
- Return values:
-
None
Definition at line 690 of file stm8s_tim5.c.
References assert_param, IS_TIM5_OC_POLARITY_OK, TIM5_CCER1_CC2P, and TIM5_OCPOLARITY_HIGH.
void TIM5_OC2PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM5 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 600 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM5_CCMR_OCxPE.
void TIM5_OC3Init | ( | TIM5_OCMode_TypeDef | TIM5_OCMode, |
TIM5_OutputState_TypeDef | TIM5_OutputState, | ||
uint16_t | TIM5_Pulse, | ||
TIM5_OCPolarity_TypeDef | TIM5_OCPolarity | ||
) |
Initializes the TIM5 Channel3 according to the specified parameters.
- Parameters:
-
TIM5_OCMode specifies the Output Compare mode from TIM5_OCMode_TypeDef. TIM5_OutputState specifies the Output State from TIM5_OutputState_TypeDef. TIM5_Pulse specifies the Pulse width value. TIM5_OCPolarity specifies the Output Compare Polarity from TIM5_OCPolarity_TypeDef.
- Return values:
-
None
Definition at line 175 of file stm8s_tim5.c.
References assert_param, IS_TIM5_OC_MODE_OK, IS_TIM5_OC_POLARITY_OK, IS_TIM5_OUTPUT_STATE_OK, TIM5_CCER2_CC3E, TIM5_CCER2_CC3P, and TIM5_CCMR_OCM.
void TIM5_OC3PolarityConfig | ( | TIM5_OCPolarity_TypeDef | TIM5_OCPolarity | ) |
Configures the TIM5 Channel 3 polarity.
- Parameters:
-
TIM5_OCPolarity specifies the OC3 Polarity. This parameter can be one of the following values: - TIM5_OCPOLARITY_LOW: Output Compare active low
- TIM5_OCPOLARITY_HIGH: Output Compare active high
- Return values:
-
None
Definition at line 714 of file stm8s_tim5.c.
References assert_param, IS_TIM5_OC_POLARITY_OK, TIM5_CCER2_CC3P, and TIM5_OCPOLARITY_HIGH.
void TIM5_OC3PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM5 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 622 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM5_CCMR_OCxPE.
void TIM5_PrescalerConfig | ( | TIM5_Prescaler_TypeDef | Prescaler, |
TIM5_PSCReloadMode_TypeDef | TIM5_PSCReloadMode | ||
) |
Configures the TIM5 Prescaler.
- Parameters:
-
Prescaler specifies the Prescaler Register value This parameter can be one of the following values - TIM5_PRESCALER_1
- TIM5_PRESCALER_2
- TIM5_PRESCALER_4
- TIM5_PRESCALER_8
- TIM5_PRESCALER_16
- TIM5_PRESCALER_32
- TIM5_PRESCALER_64
- TIM5_PRESCALER_128
- TIM5_PRESCALER_256
- TIM5_PRESCALER_512
- TIM5_PRESCALER_1024
- TIM5_PRESCALER_2048
- TIM5_PRESCALER_4096
- TIM5_PRESCALER_8192
- TIM5_PRESCALER_16384
- TIM5_PRESCALER_32768
TIM5_PSCReloadMode specifies the TIM5 Prescaler Reload mode. This parameter can be one of the following values - TIM5_PSCRELOADMODE_IMMEDIATE: The Prescaler is loaded immediatly.
- TIM5_PSCRELOADMODE_UPDATE: The Prescaler is loaded at the update event.
- Return values:
-
None
Definition at line 479 of file stm8s_tim5.c.
References assert_param, IS_TIM5_PRESCALER_OK, and IS_TIM5_PRESCALER_RELOAD_OK.
void TIM5_PWMIConfig | ( | TIM5_Channel_TypeDef | TIM5_Channel, |
TIM5_ICPolarity_TypeDef | TIM5_ICPolarity, | ||
TIM5_ICSelection_TypeDef | TIM5_ICSelection, | ||
TIM5_ICPSC_TypeDef | TIM5_ICPrescaler, | ||
uint8_t | TIM5_ICFilter | ||
) |
Configures the TIM5 peripheral in PWM Input Mode according to the specified parameters.
- Parameters:
-
TIM5_Channel specifies the Input Capture Channel from TIM5_Channel_TypeDef. TIM5_ICPolarity specifies the Input Capture Polarity from TIM5_ICPolarity_TypeDef. TIM5_ICSelection specifies theInput Capture Selection from TIM5_ICSelection_TypeDef. TIM5_ICPrescaler specifies the Input Capture Prescaler from TIM5_ICPSC_TypeDef. TIM5_ICFilter specifies the Input Capture Filter value (value can be an integer from 0x00 to 0x0F).
- Return values:
-
None
Definition at line 261 of file stm8s_tim5.c.
References assert_param, IS_TIM5_IC_POLARITY_OK, IS_TIM5_IC_PRESCALER_OK, IS_TIM5_IC_SELECTION_OK, IS_TIM5_PWMI_CHANNEL_OK, TI1_Config(), TI2_Config(), TIM5_CHANNEL_1, TIM5_ICPOLARITY_FALLING, TIM5_ICPOLARITY_RISING, TIM5_ICSELECTION_DIRECTTI, TIM5_ICSELECTION_INDIRECTTI, TIM5_SetIC1Prescaler(), and TIM5_SetIC2Prescaler().
void TIM5_SelectInputTrigger | ( | TIM5_TS_TypeDef | TIM5_InputTriggerSource | ) |
Selects the TIM5 Input Trigger source.
- Parameters:
-
TIM5_InputTriggerSource : Specifies Input Trigger source. This parameter can be one of the TIM5_TS_TypeDef enumeration.
- Return values:
-
None
Definition at line 1331 of file stm8s_tim5.c.
References assert_param, IS_TIM5_TRIGGER_SELECTION_OK, and TIM5_SMCR_TS.
Referenced by TIM5_Config().
void TIM5_SelectOCxM | ( | TIM5_Channel_TypeDef | TIM5_Channel, |
TIM5_OCMode_TypeDef | TIM5_OCMode | ||
) |
Selects the TIM5 Output Compare Mode.
This function disables the selected channel before changing the Output Compare Mode. User has to enable this channel using TIM5_CCxCmd and TIM5_CCxNCmd functions.
- Parameters:
-
TIM5_Channel specifies the TIM5 Channel. This parameter can be one of the following values: - TIM5_Channel1: TIM5 Channel1
- TIM5_Channel2: TIM5 Channel2
- TIM5_Channel3: TIM5 Channel3
TIM5_OCMode specifies the TIM5 Output Compare Mode. This paramter can be one of the following values: - TIM5_OCMODE_TIMING
- TIM5_OCMODE_ACTIVE
- TIM5_OCMODE_TOGGLE
- TIM5_OCMODE_PWM1
- TIM5_OCMODE_PWM2
- TIM5_FORCEDACTION_ACTIVE
- TIM5_FORCEDACTION_INACTIVE
- Return values:
-
None
Definition at line 806 of file stm8s_tim5.c.
References assert_param, IS_TIM5_CHANNEL_OK, IS_TIM5_OCM_OK, TIM5_CCER1_CC1E, TIM5_CCER1_CC2E, TIM5_CCER2_CC3E, TIM5_CCMR_OCM, TIM5_CHANNEL_1, and TIM5_CHANNEL_2.
void TIM5_SelectOnePulseMode | ( | TIM5_OPMode_TypeDef | TIM5_OPMode | ) |
Selects the TIM5�s One Pulse Mode.
- Parameters:
-
TIM5_OPMode specifies the OPM Mode to be used. This parameter can be one of the following values - TIM5_OPMODE_SINGLE
- TIM5_OPMODE_REPETITIVE
- Return values:
-
None
Definition at line 435 of file stm8s_tim5.c.
References assert_param, IS_TIM5_OPM_MODE_OK, TIM5_CR1_OPM, and TIM5_OPMODE_REPETITIVE.
void TIM5_SelectOutputTrigger | ( | TIM5_TRGOSource_TypeDef | TIM5_TRGOSource | ) |
Selects the TIM5 Trigger Output Mode.
- Parameters:
-
TIM5_TRGOSource : Specifies the Trigger Output source. This parameter can be one of the TIM5_TRGOSource_TypeDef enumeration.
- Return values:
-
None
Definition at line 1283 of file stm8s_tim5.c.
References assert_param, IS_TIM5_TRGO_SOURCE_OK, and TIM5_CR2_MMS.
void TIM5_SelectSlaveMode | ( | TIM5_SlaveMode_TypeDef | TIM5_SlaveMode | ) |
Selects the TIM5 Slave Mode.
- Parameters:
-
TIM5_SlaveMode : Specifies the TIM5 Slave Mode. This parameter can be one of the TIM5_SlaveMode_TypeDef enumeration.
- Return values:
-
None
Definition at line 1307 of file stm8s_tim5.c.
References assert_param, IS_TIM5_SLAVE_MODE_OK, and TIM5_SMCR_SMS.
Referenced by TIM5_Config().
void TIM5_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM5 Autoreload Register value.
- Parameters:
-
Autoreload specifies the Autoreload register new value. This parameter is between 0x0000 and 0xFFFF.
- Return values:
-
None
Definition at line 860 of file stm8s_tim5.c.
void TIM5_SetCompare1 | ( | uint16_t | Compare1 | ) |
Sets the TIM5 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 873 of file stm8s_tim5.c.
void TIM5_SetCompare2 | ( | uint16_t | Compare2 | ) |
Sets the TIM5 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 886 of file stm8s_tim5.c.
void TIM5_SetCompare3 | ( | uint16_t | Compare3 | ) |
Sets the TIM5 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 899 of file stm8s_tim5.c.
void TIM5_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM5 Counter Register value.
- Parameters:
-
Counter specifies the Counter register new value. This parameter is between 0x0000 and 0xFFFF.
- Return values:
-
None
Definition at line 847 of file stm8s_tim5.c.
void TIM5_SetIC1Prescaler | ( | TIM5_ICPSC_TypeDef | TIM5_IC1Prescaler | ) |
Sets the TIM5 Input Capture 1 prescaler.
- Parameters:
-
TIM5_IC1Prescaler specifies the Input Capture prescaler new value This parameter can be one of the following values: - TIM5_ICPSC_DIV1: no prescaler
- TIM5_ICPSC_DIV2: capture is done once every 2 events
- TIM5_ICPSC_DIV4: capture is done once every 4 events
- TIM5_ICPSC_DIV8: capture is done once every 8 events
- Return values:
-
None
Definition at line 916 of file stm8s_tim5.c.
References assert_param, IS_TIM5_IC_PRESCALER_OK, and TIM5_CCMR_ICxPSC.
Referenced by TIM5_ICInit(), and TIM5_PWMIConfig().
void TIM5_SetIC2Prescaler | ( | TIM5_ICPSC_TypeDef | TIM5_IC2Prescaler | ) |
Sets the TIM5 Input Capture 2 prescaler.
- Parameters:
-
TIM5_IC2Prescaler specifies the Input Capture prescaler new value This parameter can be one of the following values: - TIM5_ICPSC_DIV1: no prescaler
- TIM5_ICPSC_DIV2: capture is done once every 2 events
- TIM5_ICPSC_DIV4: capture is done once every 4 events
- TIM5_ICPSC_DIV8: capture is done once every 8 events
- Return values:
-
None
Definition at line 936 of file stm8s_tim5.c.
References assert_param, IS_TIM5_IC_PRESCALER_OK, and TIM5_CCMR_ICxPSC.
Referenced by TIM5_ICInit(), and TIM5_PWMIConfig().
void TIM5_SetIC3Prescaler | ( | TIM5_ICPSC_TypeDef | TIM5_IC3Prescaler | ) |
Sets the TIM5 Input Capture 3 prescaler.
- Parameters:
-
TIM5_IC3Prescaler specifies the Input Capture prescaler new value This parameter can be one of the following values: - TIM5_ICPSC_DIV1: no prescaler
- TIM5_ICPSC_DIV2: capture is done once every 2 events
- TIM5_ICPSC_DIV4: capture is done once every 4 events
- TIM5_ICPSC_DIV8: capture is done once every 8 events
- Return values:
-
None
Definition at line 956 of file stm8s_tim5.c.
References assert_param, IS_TIM5_IC_PRESCALER_OK, and TIM5_CCMR_ICxPSC.
Referenced by TIM5_ICInit().
void TIM5_TimeBaseInit | ( | TIM5_Prescaler_TypeDef | TIM5_Prescaler, |
uint16_t | TIM5_Period | ||
) |
Initializes the TIM5 Time Base Unit according to the specified parameters.
- Parameters:
-
TIM5_Prescaler specifies the Prescaler from TIM5_Prescaler_TypeDef. TIM5_Period specifies the Period value.
- Return values:
-
None
Definition at line 90 of file stm8s_tim5.c.
Referenced by TIM5_Config().
void TIM5_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM5 Update event.
- Parameters:
-
NewState new state of the TIM5 peripheral Preload register.This parameter can be ENABLE or DISABLE.
- Return values:
-
None
Definition at line 387 of file stm8s_tim5.c.
References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM5_CR1_UDIS.
void TIM5_UpdateRequestConfig | ( | TIM5_UpdateSource_TypeDef | TIM5_UpdateSource | ) |
Selects the TIM5 Update Request Interrupt source.
- Parameters:
-
TIM5_UpdateSource specifies the Update source. This parameter can be one of the following values - TIM5_UPDATESOURCE_REGULAR
- TIM5_UPDATESOURCE_GLOBAL
- Return values:
-
None
Definition at line 411 of file stm8s_tim5.c.
References assert_param, IS_TIM5_UPDATE_SOURCE_OK, TIM5_CR1_URS, and TIM5_UPDATESOURCE_GLOBAL.