STM8L15x Standard Peripherals Drivers
|
TimeBase management functions. More...
Functions | |
void | TIM1_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM1 peripheral Preload register on ARR. | |
void | TIM1_Cmd (FunctionalState NewState) |
Enables or disables the TIM1 peripheral. | |
void | TIM1_CounterModeConfig (TIM1_CounterMode_TypeDef TIM1_CounterMode) |
Specifies the TIM1 Counter Mode to be used. | |
void | TIM1_DeInit (void) |
Deinitializes the TIM1 peripheral registers to their default reset values. | |
uint16_t | TIM1_GetCounter (void) |
Gets the TIM1 Counter value. | |
uint16_t | TIM1_GetPrescaler (void) |
Gets the TIM1 Prescaler value. | |
void | TIM1_PrescalerConfig (uint16_t Prescaler, TIM1_PSCReloadMode_TypeDef TIM1_PSCReloadMode) |
Configures the TIM1 Prescaler. | |
void | TIM1_SelectOnePulseMode (TIM1_OPMode_TypeDef TIM1_OPMode) |
Selects the TIM1�s One Pulse Mode. | |
void | TIM1_SetAutoreload (uint16_t Autoreload) |
Sets the TIM1 Autoreload Register value. | |
void | TIM1_SetCounter (uint16_t Counter) |
Sets the TIM1 Counter Register value. | |
void | TIM1_TimeBaseInit (uint16_t TIM1_Prescaler, TIM1_CounterMode_TypeDef TIM1_CounterMode, uint16_t TIM1_Period, uint8_t TIM1_RepetitionCounter) |
Initializes the TIM1 Time Base Unit according to the specified parameters. | |
void | TIM1_UpdateDisableConfig (FunctionalState NewState) |
Enables or Disables the TIM1 Update event. | |
void | TIM1_UpdateRequestConfig (TIM1_UpdateSource_TypeDef TIM1_UpdateSource) |
Selects the TIM1 Update Request Interrupt source. |
Detailed Description
TimeBase management functions.
=============================================================================== TimeBase management functions =============================================================================== =================================================================== TIM1 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 TIM1 clock using CLK_PeripheralClockConfig(CLK_Peripheral_TIM1, ENABLE) function. 2. Call TIM1_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 TIM1_ITConfig(TIM1_IT_Update) 5. Call the TIM1_Cmd(ENABLE) function to enable the TIM1 counter. Note1: All other functions can be used separately to modify, if needed, a specific feature of the Timer.
Function Documentation
void TIM1_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM1 peripheral Preload register on ARR.
Definition at line 420 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_ARPE.
void TIM1_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM1 peripheral.
Definition at line 466 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_CEN.
void TIM1_CounterModeConfig | ( | TIM1_CounterMode_TypeDef | TIM1_CounterMode | ) |
Specifies the TIM1 Counter Mode to be used.
Definition at line 297 of file stm8l15x_tim1.c.
References IS_TIM1_COUNTER_MODE, TIM1, TIM1_CR1_CMS, and TIM1_CR1_DIR.
void TIM1_DeInit | ( | void | ) |
Deinitializes the TIM1 peripheral registers to their default reset values.
Definition at line 175 of file stm8l15x_tim1.c.
References TIM1, TIM1_ARRH_RESET_VALUE, TIM1_ARRL_RESET_VALUE, TIM1_BKR_RESET_VALUE, TIM1_CCER1_RESET_VALUE, TIM1_CCER2_RESET_VALUE, TIM1_CCMR1_RESET_VALUE, TIM1_CCMR2_RESET_VALUE, TIM1_CCMR3_RESET_VALUE, TIM1_CCMR4_RESET_VALUE, TIM1_CCR1H_RESET_VALUE, TIM1_CCR1L_RESET_VALUE, TIM1_CCR2H_RESET_VALUE, TIM1_CCR2L_RESET_VALUE, TIM1_CCR3H_RESET_VALUE, TIM1_CCR3L_RESET_VALUE, TIM1_CCR4H_RESET_VALUE, TIM1_CCR4L_RESET_VALUE, TIM1_CNTRH_RESET_VALUE, TIM1_CNTRL_RESET_VALUE, TIM1_CR1_RESET_VALUE, TIM1_CR2_RESET_VALUE, TIM1_DTR_RESET_VALUE, TIM1_ETR_RESET_VALUE, TIM1_IER_RESET_VALUE, TIM1_OISR_RESET_VALUE, TIM1_PSCRH_RESET_VALUE, TIM1_PSCRL_RESET_VALUE, TIM1_RCR_RESET_VALUE, TIM1_SMCR_RESET_VALUE, TIM1_SR1_RESET_VALUE, and TIM1_SR2_RESET_VALUE.
uint16_t TIM1_GetCounter | ( | void | ) |
uint16_t TIM1_GetPrescaler | ( | void | ) |
void TIM1_PrescalerConfig | ( | uint16_t | Prescaler, |
TIM1_PSCReloadMode_TypeDef | TIM1_PSCReloadMode | ||
) |
Configures the TIM1 Prescaler.
Definition at line 273 of file stm8l15x_tim1.c.
References IS_TIM1_PRESCALER_RELOAD, and TIM1.
void TIM1_SelectOnePulseMode | ( | TIM1_OPMode_TypeDef | TIM1_OPMode | ) |
Selects the TIM1�s One Pulse Mode.
Definition at line 444 of file stm8l15x_tim1.c.
References IS_TIM1_OPM_MODE, TIM1, TIM1_CR1_OPM, and TIM1_OPMode_Repetitive.
void TIM1_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM1 Autoreload Register value.
Definition at line 327 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM1 Counter Register value.
Definition at line 314 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_TimeBaseInit | ( | uint16_t | TIM1_Prescaler, |
TIM1_CounterMode_TypeDef | TIM1_CounterMode, | ||
uint16_t | TIM1_Period, | ||
uint8_t | TIM1_RepetitionCounter | ||
) |
Initializes the TIM1 Time Base Unit according to the specified parameters.
Definition at line 235 of file stm8l15x_tim1.c.
References IS_TIM1_COUNTER_MODE, TIM1, TIM1_CR1_CMS, and TIM1_CR1_DIR.
void TIM1_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM1 Update event.
Definition at line 374 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_UDIS.
void TIM1_UpdateRequestConfig | ( | TIM1_UpdateSource_TypeDef | TIM1_UpdateSource | ) |
Selects the TIM1 Update Request Interrupt source.
Definition at line 398 of file stm8l15x_tim1.c.
References IS_TIM1_UPDATE_SOURCE, TIM1, TIM1_CR1_URS, and TIM1_UpdateSource_Global.