STM8L15x Standard Peripherals Drivers
|
TimeBase management functions. More...
Functions | |
void | TIM5_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM5 peripheral Preload register on ARR. | |
void | TIM5_Cmd (FunctionalState NewState) |
Enables or disables the TIM5 peripheral. | |
void | TIM5_CounterModeConfig (TIM5_CounterMode_TypeDef TIM5_CounterMode) |
Specifies the TIM5 Counter Mode to be used. | |
void | TIM5_DeInit (void) |
Deinitialize the TIM5 peripheral registers to their default reset values. | |
uint16_t | TIM5_GetCounter (void) |
Gets the TIM5 Counter value. | |
TIM5_Prescaler_TypeDef | TIM5_GetPrescaler (void) |
Gets the TIM5 Prescaler value. | |
void | TIM5_PrescalerConfig (TIM5_Prescaler_TypeDef Prescaler, TIM5_PSCReloadMode_TypeDef TIM5_PSCReloadMode) |
Configures the TIM5 Prescaler. | |
void | TIM5_SelectOnePulseMode (TIM5_OPMode_TypeDef TIM5_OPMode) |
Selects the TIM�s One Pulse Mode. | |
void | TIM5_SetAutoreload (uint16_t Autoreload) |
Sets the TIM5 Autoreload Register value. | |
void | TIM5_SetCounter (uint16_t Counter) |
Sets the TIM5 Counter Register value. | |
void | TIM5_TimeBaseInit (TIM5_Prescaler_TypeDef TIM5_Prescaler, TIM5_CounterMode_TypeDef TIM5_CounterMode, 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. |
Detailed Description
TimeBase management functions.
=============================================================================== TimeBase management functions =============================================================================== =================================================================== TIM5 Driver: how to use it in Timing(Time base) Mode =================================================================== To use the Timer in Timing(Time base) mode, the following steps are mandatory: 1. Enable TIM5 clock using CLK_PeripheralClockConfig(CLK_Peripheral_TIM5, ENABLE) function. 2. Call TIM5_TimeBaseInit() to configure the Time Base unit with the corresponding configuration. 3. Enable global interrupts if you need to generate the update interrupt. 4. Enable the corresponding interrupt using the function TIM5_ITConfig(TIM5_IT_Update) 5. Call the TIM5_Cmd(ENABLE) function to enable the TIM5 counter. Note1: All other functions can be used separately to modify, if needed, a specific feature of the Timer.
Function Documentation
void TIM5_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM5 peripheral Preload register on ARR.
Definition at line 436 of file stm8l15x_tim5.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR1_ARPE.
void TIM5_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM5 peripheral.
Definition at line 482 of file stm8l15x_tim5.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR1_CEN.
void TIM5_CounterModeConfig | ( | TIM5_CounterMode_TypeDef | TIM5_CounterMode | ) |
Specifies the TIM5 Counter Mode to be used.
Definition at line 300 of file stm8l15x_tim5.c.
References IS_TIM5_COUNTER_MODE, TIM5, TIM_CR1_CMS, and TIM_CR1_DIR.
void TIM5_DeInit | ( | void | ) |
Deinitialize the TIM5 peripheral registers to their default reset values.
Definition at line 162 of file stm8l15x_tim5.c.
References TIM5, 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.
uint16_t TIM5_GetCounter | ( | void | ) |
TIM5_Prescaler_TypeDef TIM5_GetPrescaler | ( | void | ) |
void TIM5_PrescalerConfig | ( | TIM5_Prescaler_TypeDef | Prescaler, |
TIM5_PSCReloadMode_TypeDef | TIM5_PSCReloadMode | ||
) |
Configures the TIM5 Prescaler.
Definition at line 268 of file stm8l15x_tim5.c.
References IS_TIM5_PRESCALER, IS_TIM5_PRESCALER_RELOAD, TIM5, TIM5_PSCReloadMode_Immediate, and TIM_EGR_UG.
void TIM5_SelectOnePulseMode | ( | TIM5_OPMode_TypeDef | TIM5_OPMode | ) |
Selects the TIM�s One Pulse Mode.
Definition at line 460 of file stm8l15x_tim5.c.
References IS_TIM5_OPM_MODE, TIM5, TIM5_OPMode_Single, and TIM_CR1_OPM.
void TIM5_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM5 Autoreload Register value.
Definition at line 338 of file stm8l15x_tim5.c.
References TIM5.
void TIM5_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM5 Counter Register value.
Definition at line 324 of file stm8l15x_tim5.c.
References TIM5.
void TIM5_TimeBaseInit | ( | TIM5_Prescaler_TypeDef | TIM5_Prescaler, |
TIM5_CounterMode_TypeDef | TIM5_CounterMode, | ||
uint16_t | TIM5_Period | ||
) |
Initializes the TIM5 Time Base Unit according to the specified parameters.
Definition at line 225 of file stm8l15x_tim5.c.
References IS_TIM5_COUNTER_MODE, IS_TIM5_PRESCALER, TIM5, TIM5_EventSource_Update, TIM_CR1_CMS, and TIM_CR1_DIR.
void TIM5_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM5 Update event.
Definition at line 390 of file stm8l15x_tim5.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR1_UDIS.
void TIM5_UpdateRequestConfig | ( | TIM5_UpdateSource_TypeDef | TIM5_UpdateSource | ) |
Selects the TIM5 Update Request Interrupt source.
Definition at line 414 of file stm8l15x_tim5.c.
References IS_TIM5_UPDATE_SOURCE, TIM5, TIM5_UpdateSource_Regular, and TIM_CR1_URS.