STM8L15x Standard Peripherals Drivers: Clocks management functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Clocks management functions

Clocks management functions. More...

Functions

void TIM2_ETRClockMode1Config (TIM2_ExtTRGPSC_TypeDef TIM2_ExtTRGPrescaler, TIM2_ExtTRGPolarity_TypeDef TIM2_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM2 External clock Mode1.
void TIM2_ETRClockMode2Config (TIM2_ExtTRGPSC_TypeDef TIM2_ExtTRGPrescaler, TIM2_ExtTRGPolarity_TypeDef TIM2_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM2 External clock Mode2.
void TIM2_InternalClockConfig (void)
 Enables the TIM2 internal Clock.
void TIM2_TIxExternalClockConfig (TIM2_TIxExternalCLK1Source_TypeDef TIM2_TIxExternalCLKSource, TIM2_ICPolarity_TypeDef TIM2_ICPolarity, uint8_t ICFilter)
 Configures the TIM2 Trigger as External Clock.

Detailed Description

Clocks management functions.

 ===============================================================================
                         Clocks management functions
 ===============================================================================  


Function Documentation

void TIM2_ETRClockMode1Config ( TIM2_ExtTRGPSC_TypeDef  TIM2_ExtTRGPrescaler,
TIM2_ExtTRGPolarity_TypeDef  TIM2_ExtTRGPolarity,
uint8_t  ExtTRGFilter 
)

Configures the TIM2 External clock Mode1.

Parameters:
TIM2_ExtTRGPrescaler,:Specifies the external Trigger Prescaler. This parameter can be one of the following values:
  • TIM2_ExtTRGPSC_OFF: No External Trigger prescaler
  • TIM2_ExtTRGPSC_DIV2: External Trigger prescaler = 2 (ETRP frequency divided by 2)
  • TIM2_ExtTRGPSC_DIV4: External Trigger prescaler = 4 (ETRP frequency divided by 4)
  • TIM2_ExtTRGPSC_DIV8: External Trigger prescaler = 8 (ETRP frequency divided by 8)
TIM2_ExtTRGPolarity,:Specifies the external Trigger Polarity. This parameter can be one of the following values:
  • TIM2_ExtTRGPolarity_Inverted: External Trigger Polarity = inverted
  • TIM2_ExtTRGPolarity_NonInverted: External Trigger Polarity = non inverted
ExtTRGFilter,:Specifies the External Trigger Filter. This parameter must be a value between 0x00 and 0x0F
Return values:
None

Definition at line 1701 of file stm8l15x_tim2.c.

References TIM2, TIM2_ETRConfig(), TIM2_SlaveMode_External1, TIM2_TRGSelection_ETRF, TIM_SMCR_SMS, and TIM_SMCR_TS.

void TIM2_ETRClockMode2Config ( TIM2_ExtTRGPSC_TypeDef  TIM2_ExtTRGPrescaler,
TIM2_ExtTRGPolarity_TypeDef  TIM2_ExtTRGPolarity,
uint8_t  ExtTRGFilter 
)

Configures the TIM2 External clock Mode2.

Parameters:
TIM2_ExtTRGPrescaler,:Specifies the external Trigger Prescaler. This parameter can be one of the following values:
  • TIM2_ExtTRGPSC_OFF: No External Trigger prescaler
  • TIM2_ExtTRGPSC_DIV2: External Trigger prescaler = 2 (ETRP frequency divided by 2)
  • TIM2_ExtTRGPSC_DIV4: External Trigger prescaler = 4 (ETRP frequency divided by 4)
  • TIM2_ExtTRGPSC_DIV8: External Trigger prescaler = 8 (ETRP frequency divided by 8)
TIM2_ExtTRGPolarity,:Specifies the external Trigger Polarity. This parameter can be one of the following values:
  • TIM2_ExtTRGPolarity_Inverted: External Trigger Polarity = inverted
  • TIM2_ExtTRGPolarity_NonInverted: External Trigger Polarity = non inverted
ExtTRGFilter,:Specifies the External Trigger Filter. This parameter must be a value between 0x00 and 0x0F
Return values:
None

Definition at line 1733 of file stm8l15x_tim2.c.

References TIM2, TIM2_ETRConfig(), and TIM_ETR_ECE.

void TIM2_InternalClockConfig ( void  )

Enables the TIM2 internal Clock.

Parameters:
None
Return values:
None

Definition at line 1638 of file stm8l15x_tim2.c.

References TIM2, and TIM_SMCR_SMS.

void TIM2_TIxExternalClockConfig ( TIM2_TIxExternalCLK1Source_TypeDef  TIM2_TIxExternalCLKSource,
TIM2_ICPolarity_TypeDef  TIM2_ICPolarity,
uint8_t  ICFilter 
)

Configures the TIM2 Trigger as External Clock.

Parameters:
TIM2_TIxExternalCLKSource,:Specifies Trigger source. This parameter can be one of the following values:
  • TIM2_TIxExternalCLK1Source_TI1ED: External Clock mode 1 source = TI1ED
  • TIM2_TIxExternalCLK1Source_TI1: External Clock mode 1 source = TI1
  • TIM2_TIxExternalCLK1Source_TI2: External Clock mode 1 source = TI2
TIM2_ICPolarity,:Specifies the TIx Polarity. This parameter can be one of the following values:
  • TIM2_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM2_ICPolarity_Falling: Input Capture on Falling Edge
ICFilter,:Specifies the filter value. This parameter must be a value between 0x00 and 0x0F
Return values:
None

Definition at line 1659 of file stm8l15x_tim2.c.

References IS_TIM2_IC_FILTER, IS_TIM2_IC_POLARITY, IS_TIM2_TIXCLK_SOURCE, TI1_Config(), TI2_Config(), TIM2, TIM2_ICSelection_DirectTI, TIM2_SelectInputTrigger(), TIM2_SlaveMode_External1, and TIM2_TIxExternalCLK1Source_TI2.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com