STM8L15x Standard Peripherals Drivers
|
TimeBase management functions. More...
Functions | |
void | TIM3_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM3 peripheral Preload register on ARR. | |
void | TIM3_Cmd (FunctionalState NewState) |
Enables or disables the TIM3 peripheral. | |
void | TIM3_CounterModeConfig (TIM3_CounterMode_TypeDef TIM3_CounterMode) |
Specifies the TIM3 Counter Mode to be used. | |
void | TIM3_DeInit (void) |
Deinitialize the TIM3 peripheral registers to their default reset values. | |
uint16_t | TIM3_GetCounter (void) |
Gets the TIM3 Counter value. | |
TIM3_Prescaler_TypeDef | TIM3_GetPrescaler (void) |
Gets the TIM3 Prescaler value. | |
void | TIM3_PrescalerConfig (TIM3_Prescaler_TypeDef Prescaler, TIM3_PSCReloadMode_TypeDef TIM3_PSCReloadMode) |
Configures the TIM3 Prescaler. | |
void | TIM3_SelectOnePulseMode (TIM3_OPMode_TypeDef TIM3_OPMode) |
Selects the TIM�s One Pulse Mode. | |
void | TIM3_SetAutoreload (uint16_t Autoreload) |
Sets the TIM3 Autoreload Register value. | |
void | TIM3_SetCounter (uint16_t Counter) |
Sets the TIM3 Counter Register value. | |
void | TIM3_TimeBaseInit (TIM3_Prescaler_TypeDef TIM3_Prescaler, TIM3_CounterMode_TypeDef TIM3_CounterMode, uint16_t TIM3_Period) |
Initializes the TIM3 Time Base Unit according to the specified parameters. | |
void | TIM3_UpdateDisableConfig (FunctionalState NewState) |
Enables or Disables the TIM3 Update event. | |
void | TIM3_UpdateRequestConfig (TIM3_UpdateSource_TypeDef TIM3_UpdateSource) |
Selects the TIM3 Update Request Interrupt source. |
Detailed Description
TimeBase management functions.
=============================================================================== TimeBase management functions =============================================================================== =================================================================== TIM3 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 TIM3 clock using CLK_PeripheralClockConfig(CLK_Peripheral_TIM3, ENABLE) function. 2. Call TIM3_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 TIM3_ITConfig(TIM3_IT_Update) 5. Call the TIM3_Cmd(ENABLE) function to enable the TIM3 counter. Note1: All other functions can be used separately to modify, if needed, a specific feature of the Timer.
Function Documentation
void TIM3_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM3 peripheral Preload register on ARR.
Definition at line 436 of file stm8l15x_tim3.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR1_ARPE.
void TIM3_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM3 peripheral.
Definition at line 482 of file stm8l15x_tim3.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR1_CEN.
void TIM3_CounterModeConfig | ( | TIM3_CounterMode_TypeDef | TIM3_CounterMode | ) |
Specifies the TIM3 Counter Mode to be used.
Definition at line 300 of file stm8l15x_tim3.c.
References IS_TIM3_COUNTER_MODE, TIM3, TIM_CR1_CMS, and TIM_CR1_DIR.
void TIM3_DeInit | ( | void | ) |
Deinitialize the TIM3 peripheral registers to their default reset values.
Definition at line 162 of file stm8l15x_tim3.c.
References TIM3, 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 TIM3_GetCounter | ( | void | ) |
TIM3_Prescaler_TypeDef TIM3_GetPrescaler | ( | void | ) |
void TIM3_PrescalerConfig | ( | TIM3_Prescaler_TypeDef | Prescaler, |
TIM3_PSCReloadMode_TypeDef | TIM3_PSCReloadMode | ||
) |
Configures the TIM3 Prescaler.
Definition at line 268 of file stm8l15x_tim3.c.
References IS_TIM3_PRESCALER, IS_TIM3_PRESCALER_RELOAD, TIM3, TIM3_PSCReloadMode_Immediate, and TIM_EGR_UG.
void TIM3_SelectOnePulseMode | ( | TIM3_OPMode_TypeDef | TIM3_OPMode | ) |
Selects the TIM�s One Pulse Mode.
Definition at line 460 of file stm8l15x_tim3.c.
References IS_TIM3_OPM_MODE, TIM3, TIM3_OPMode_Single, and TIM_CR1_OPM.
void TIM3_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM3 Autoreload Register value.
Definition at line 338 of file stm8l15x_tim3.c.
References TIM3.
void TIM3_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM3 Counter Register value.
Definition at line 324 of file stm8l15x_tim3.c.
References TIM3.
void TIM3_TimeBaseInit | ( | TIM3_Prescaler_TypeDef | TIM3_Prescaler, |
TIM3_CounterMode_TypeDef | TIM3_CounterMode, | ||
uint16_t | TIM3_Period | ||
) |
Initializes the TIM3 Time Base Unit according to the specified parameters.
Definition at line 225 of file stm8l15x_tim3.c.
References IS_TIM3_COUNTER_MODE, IS_TIM3_PRESCALER, TIM3, TIM3_EventSource_Update, TIM_CR1_CMS, and TIM_CR1_DIR.
void TIM3_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM3 Update event.
Definition at line 390 of file stm8l15x_tim3.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR1_UDIS.
void TIM3_UpdateRequestConfig | ( | TIM3_UpdateSource_TypeDef | TIM3_UpdateSource | ) |
Selects the TIM3 Update Request Interrupt source.
Definition at line 414 of file stm8l15x_tim3.c.
References IS_TIM3_UPDATE_SOURCE, TIM3, TIM3_UpdateSource_Regular, and TIM_CR1_URS.