STM8S/A Standard Peripherals Drivers
|
Functions | |
void | TIM2_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM2 peripheral Preload register on ARR. | |
void | TIM2_CCPreloadControl (FunctionalState NewState) |
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_InternalClockConfig (void) |
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
void TIM2_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM2 peripheral Preload register on ARR.
Definition at line 561 of file stm8s_tim2.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CR1_ARPE.
void TIM2_CCPreloadControl | ( | FunctionalState | NewState | ) |
void TIM2_CCxCmd | ( | TIM2_Channel_TypeDef | TIM2_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM2 Capture Compare Channel x.
Definition at line 745 of file stm8s_tim2.c.
References 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.
Definition at line 1103 of file stm8s_tim2.c.
References IS_TIM2_CLEAR_FLAG_OK.
void TIM2_ClearITPendingBit | ( | TIM2_IT_TypeDef | TIM2_IT | ) |
Clears the TIM2's interrupt pending bits.
Definition at line 1156 of file stm8s_tim2.c.
References IS_TIM2_IT_OK.
void TIM2_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM2 peripheral.
Definition at line 339 of file stm8s_tim2.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CR1_CEN.
void TIM2_DeInit | ( | void | ) |
Deinitializes the TIM2 peripheral registers to their default reset values.
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.
Definition at line 507 of file stm8s_tim2.c.
References 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.
Definition at line 526 of file stm8s_tim2.c.
References 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.
Definition at line 545 of file stm8s_tim2.c.
References 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.
Definition at line 653 of file stm8s_tim2.c.
References IS_TIM2_EVENT_SOURCE_OK.
uint16_t TIM2_GetCapture1 | ( | void | ) |
Gets the TIM2 Input Capture 1 value.
Definition at line 975 of file stm8s_tim2.c.
uint16_t TIM2_GetCapture2 | ( | void | ) |
Gets the TIM2 Input Capture 2 value.
Definition at line 995 of file stm8s_tim2.c.
uint16_t TIM2_GetCapture3 | ( | void | ) |
Gets the TIM2 Input Capture 3 value.
Definition at line 1015 of file stm8s_tim2.c.
uint16_t TIM2_GetCounter | ( | void | ) |
Gets the TIM2 Counter 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.
Definition at line 1068 of file stm8s_tim2.c.
References 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.
Definition at line 1123 of file stm8s_tim2.c.
References IS_TIM2_GET_IT_OK, RESET, and SET.
TIM2_Prescaler_TypeDef TIM2_GetPrescaler | ( | void | ) |
Gets the TIM2 Prescaler value.
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.
Definition at line 212 of file stm8s_tim2.c.
References 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_InternalClockConfig | ( | void | ) |
void TIM2_ITConfig | ( | TIM2_IT_TypeDef | TIM2_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified TIM2 interrupts.
Definition at line 368 of file stm8s_tim2.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and IS_TIM2_IT_OK.
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.
Definition at line 108 of file stm8s_tim2.c.
References 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.
void TIM2_OC1PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 1 polarity.
Definition at line 670 of file stm8s_tim2.c.
References 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.
Definition at line 583 of file stm8s_tim2.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CCMR_OCxPE.
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.
Definition at line 142 of file stm8s_tim2.c.
References 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.
void TIM2_OC2PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 2 polarity.
Definition at line 694 of file stm8s_tim2.c.
References 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.
Definition at line 605 of file stm8s_tim2.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CCMR_OCxPE.
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.
Definition at line 179 of file stm8s_tim2.c.
References 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.
void TIM2_OC3PolarityConfig | ( | TIM2_OCPolarity_TypeDef | TIM2_OCPolarity | ) |
Configures the TIM2 Channel 3 polarity.
Definition at line 718 of file stm8s_tim2.c.
References 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.
Definition at line 627 of file stm8s_tim2.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CCMR_OCxPE.
void TIM2_PrescalerConfig | ( | TIM2_Prescaler_TypeDef | Prescaler, |
TIM2_PSCReloadMode_TypeDef | TIM2_PSCReloadMode | ||
) |
Configures the TIM2 Prescaler.
Definition at line 484 of file stm8s_tim2.c.
References IS_TIM2_PRESCALER_OK, and IS_TIM2_PRESCALER_RELOAD_OK.
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 266 of file stm8s_tim2.c.
References 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.
Definition at line 810 of file stm8s_tim2.c.
References 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.
Definition at line 440 of file stm8s_tim2.c.
References IS_TIM2_OPM_MODE_OK, TIM2_CR1_OPM, and TIM2_OPMODE_REPETITIVE.
void TIM2_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM2 Autoreload Register value.
Definition at line 864 of file stm8s_tim2.c.
void TIM2_SetCompare1 | ( | uint16_t | Compare1 | ) |
Sets the TIM2 Capture Compare1 Register value.
Definition at line 877 of file stm8s_tim2.c.
void TIM2_SetCompare2 | ( | uint16_t | Compare2 | ) |
Sets the TIM2 Capture Compare2 Register value.
Definition at line 890 of file stm8s_tim2.c.
void TIM2_SetCompare3 | ( | uint16_t | Compare3 | ) |
Sets the TIM2 Capture Compare3 Register value.
Definition at line 903 of file stm8s_tim2.c.
void TIM2_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM2 Counter Register value.
Definition at line 851 of file stm8s_tim2.c.
void TIM2_SetIC1Prescaler | ( | TIM2_ICPSC_TypeDef | TIM2_IC1Prescaler | ) |
Sets the TIM2 Input Capture 1 Prescaler.
Definition at line 920 of file stm8s_tim2.c.
References 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.
Definition at line 940 of file stm8s_tim2.c.
References 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.
Definition at line 960 of file stm8s_tim2.c.
References 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.
Definition at line 89 of file stm8s_tim2.c.
void TIM2_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM2 Update event.
Definition at line 392 of file stm8s_tim2.c.
References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM2_CR1_UDIS.
void TIM2_UpdateRequestConfig | ( | TIM2_UpdateSource_TypeDef | TIM2_UpdateSource | ) |
Selects the TIM2 Update Request Interrupt source.
Definition at line 416 of file stm8s_tim2.c.
References IS_TIM2_UPDATE_SOURCE_OK, TIM2_CR1_URS, and TIM2_UPDATESOURCE_GLOBAL.