STM8S/A Standard Peripherals Drivers: stm8s_tim2.c File Reference

STM8S/A

stm8s_tim2.c File Reference

This file contains all the functions for the TIM2 peripheral. More...

#include "stm8s_tim2.h"

Go to the source code of this file.

Functions

static void TI1_Config (uint8_t TIM1_ICPolarity, uint8_t TIM1_ICSelection, uint8_t TIM1_ICFilter)
 Configure the TI1 as Input.
static void TI1_Config (uint8_t TIM2_ICPolarity, uint8_t TIM2_ICSelection, uint8_t TIM2_ICFilter)
 Configure the TI1 as Input.
static void TI2_Config (uint8_t TIM1_ICPolarity, uint8_t TIM1_ICSelection, uint8_t TIM1_ICFilter)
 Configure the TI2 as Input.
static void TI2_Config (uint8_t TIM2_ICPolarity, uint8_t TIM2_ICSelection, uint8_t TIM2_ICFilter)
 Configure the TI2 as Input.
static void TI3_Config (uint8_t TIM1_ICPolarity, uint8_t TIM1_ICSelection, uint8_t TIM1_ICFilter)
 Configure the TI3 as Input.
static void TI3_Config (uint8_t TIM2_ICPolarity, uint8_t TIM2_ICSelection, uint8_t TIM2_ICFilter)
 Configure the TI3 as Input.
void TIM2_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM2 peripheral Preload register on ARR.
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_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.

Detailed Description

This file contains all the functions for the TIM2 peripheral.

Author:
MCD Application Team
Version:
V2.3.0
Date:
16-June-2017
Attention:

© COPYRIGHT 2014 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm8s_tim2.c.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com