STM8L15x Standard Peripherals Drivers
|
TimeBase management functions. More...
Functions | |
void | TIM4_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM4 peripheral Preload register on ARR. | |
void | TIM4_Cmd (FunctionalState NewState) |
Enables or disables the TIM4 peripheral. | |
void | TIM4_DeInit (void) |
Deinitializes the TIM4 peripheral registers to their default reset values. | |
uint8_t | TIM4_GetCounter (void) |
Gets the TIM4 Counter value. | |
TIM4_Prescaler_TypeDef | TIM4_GetPrescaler (void) |
Gets the TIM4 Prescaler value. | |
void | TIM4_PrescalerConfig (TIM4_Prescaler_TypeDef Prescaler, TIM4_PSCReloadMode_TypeDef TIM4_PSCReloadMode) |
Configures the TIM4 Prescaler. | |
void | TIM4_SelectOnePulseMode (TIM4_OPMode_TypeDef TIM4_OPMode) |
Selects the TIM4�s One Pulse Mode. | |
void | TIM4_SetAutoreload (uint8_t Autoreload) |
Sets the TIM4 Autoreload Register value. | |
void | TIM4_SetCounter (uint8_t Counter) |
Sets the TIM4 Counter Register value. | |
void | TIM4_TimeBaseInit (TIM4_Prescaler_TypeDef TIM4_Prescaler, uint8_t TIM4_Period) |
Initializes the TIM4 Time Base Unit according to the specified parameters. | |
void | TIM4_UpdateDisableConfig (FunctionalState NewState) |
Enables or Disables the TIM4 Update event. | |
void | TIM4_UpdateRequestConfig (TIM4_UpdateSource_TypeDef TIM4_UpdateSource) |
Selects the TIM4 Update Request Interrupt source. |
Detailed Description
TimeBase management functions.
=============================================================================== TimeBase management functions =============================================================================== =================================================================== TIM4 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 TIM4 clock using CLK_PeripheralClockConfig(CLK_Peripheral_TIM4, ENABLE) function. 2. Call TIM4_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 TIM4_ITConfig(TIM4_IT_Update) 5. Call the TIM4_Cmd(ENABLE) function to enable the TIM4 counter. Note1: All other functions can be used separately to modify, if needed, a specific feature of the Timer.
Function Documentation
void TIM4_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM4 peripheral Preload register on ARR.
Definition at line 336 of file stm8l15x_tim4.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM4, and TIM4_CR1_ARPE.
void TIM4_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM4 peripheral.
Definition at line 382 of file stm8l15x_tim4.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM4, and TIM4_CR1_CEN.
void TIM4_DeInit | ( | void | ) |
Deinitializes the TIM4 peripheral registers to their default reset values.
Definition at line 124 of file stm8l15x_tim4.c.
References TIM4, TIM4_ARR_RESET_VALUE, TIM4_CNTR_RESET_VALUE, TIM4_CR1_RESET_VALUE, TIM4_CR2_RESET_VALUE, TIM4_IER_RESET_VALUE, TIM4_PSCR_RESET_VALUE, TIM4_SMCR_RESET_VALUE, and TIM4_SR1_RESET_VALUE.
uint8_t TIM4_GetCounter | ( | void | ) |
TIM4_Prescaler_TypeDef TIM4_GetPrescaler | ( | void | ) |
void TIM4_PrescalerConfig | ( | TIM4_Prescaler_TypeDef | Prescaler, |
TIM4_PSCReloadMode_TypeDef | TIM4_PSCReloadMode | ||
) |
Configures the TIM4 Prescaler.
Definition at line 199 of file stm8l15x_tim4.c.
References IS_TIM4_Prescaler, IS_TIM4_Prescaler_RELOAD, TIM4, TIM4_EGR_UG, and TIM4_PSCReloadMode_Immediate.
void TIM4_SelectOnePulseMode | ( | TIM4_OPMode_TypeDef | TIM4_OPMode | ) |
Selects the TIM4�s One Pulse Mode.
Definition at line 360 of file stm8l15x_tim4.c.
References IS_TIM4_OPM_MODE, TIM4, TIM4_CR1_OPM, and TIM4_OPMode_Single.
void TIM4_SetAutoreload | ( | uint8_t | Autoreload | ) |
Sets the TIM4 Autoreload Register value.
Definition at line 238 of file stm8l15x_tim4.c.
References TIM4.
void TIM4_SetCounter | ( | uint8_t | Counter | ) |
Sets the TIM4 Counter Register value.
Definition at line 226 of file stm8l15x_tim4.c.
References TIM4.
void TIM4_TimeBaseInit | ( | TIM4_Prescaler_TypeDef | TIM4_Prescaler, |
uint8_t | TIM4_Period | ||
) |
Initializes the TIM4 Time Base Unit according to the specified parameters.
Definition at line 159 of file stm8l15x_tim4.c.
References IS_TIM4_Prescaler, TIM4, and TIM4_EventSource_Update.
void TIM4_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM4 Update event.
Definition at line 290 of file stm8l15x_tim4.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM4, and TIM4_CR1_UDIS.
void TIM4_UpdateRequestConfig | ( | TIM4_UpdateSource_TypeDef | TIM4_UpdateSource | ) |
Selects the TIM4 Update Request Interrupt source.
Definition at line 314 of file stm8l15x_tim4.c.
References IS_TIM4_UPDATE_SOURCE, TIM4, TIM4_CR1_URS, and TIM4_UpdateSource_Regular.