STM8L15x Standard Peripherals Drivers: Synchronization management functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Synchronization management functions

Synchronization management functions. More...

Functions

void TIM3_ETRConfig (TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler, TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM3 External Trigger.
void TIM3_SelectInputTrigger (TIM3_TRGSelection_TypeDef TIM3_InputTriggerSource)
 Selects the TIM3 Input Trigger source.
void TIM3_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM3 Master/Slave Mode.
void TIM3_SelectOutputTrigger (TIM3_TRGOSource_TypeDef TIM3_TRGOSource)
 Selects the TIM3 Trigger Output Mode.
void TIM3_SelectSlaveMode (TIM3_SlaveMode_TypeDef TIM3_SlaveMode)
 Selects the TIM3 Slave Mode.

Detailed Description

Synchronization management functions.

 ===============================================================================
                       Synchronization management functions
 ===============================================================================  
                   
       ===================================================================      
              TIM3 Driver: how to use it in synchronization Mode
       =================================================================== 
       Case of two/several Timers
       **************************
       1. If TIM3 is used as master to other timers use the following functions:
          - TIM3_SelectOutputTrigger()
          - TIM3_SelectMasterSlaveMode()
       2. If TIM3 is used as slave to other timers use the following functions:
          - TIM3_SelectInputTrigger()
          - TIM3_SelectSlaveMode()
          
       Case of Timers and external trigger (TRIG pin)
       ********************************************       
       1. Configure the External trigger using TIM3_ETRConfig()
       2. Configure the Slave Timer using the following functions:
          - TIM3_SelectInputTrigger()
          - TIM3_SelectSlaveMode()


Function Documentation

void TIM3_ETRConfig ( TIM3_ExtTRGPSC_TypeDef  TIM3_ExtTRGPrescaler,
TIM3_ExtTRGPolarity_TypeDef  TIM3_ExtTRGPolarity,
uint8_t  ExtTRGFilter 
)

Configures the TIM3 External Trigger.

Parameters:
TIM3_ExtTRGPrescaler,:Specifies the external Trigger Prescaler. This parameter can be one of the following values:
  • TIM3_ExtTRGPSC_OFF: No External Trigger prescaler
  • TIM3_ExtTRGPSC_DIV2: External Trigger prescaler = 2 (ETRP frequency divided by 2)
  • TIM3_ExtTRGPSC_DIV4: External Trigger prescaler = 4 (ETRP frequency divided by 4)
  • TIM3_ExtTRGPSC_DIV8: External Trigger prescaler = 8 (ETRP frequency divided by 8)
TIM3_ExtTRGPolarity,:Specifies the external Trigger Polarity. This parameter can be one of the following values:
  • TIM3_ExtTRGPolarity_Inverted: External Trigger Polarity = inverted
  • TIM3_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 1905 of file stm8l15x_tim3.c.

References IS_TIM3_EXT_FILTER, IS_TIM3_EXT_POLARITY, IS_TIM3_EXT_PRESCALER, and TIM3.

Referenced by TIM3_ETRClockMode1Config(), and TIM3_ETRClockMode2Config().

void TIM3_SelectInputTrigger ( TIM3_TRGSelection_TypeDef  TIM3_InputTriggerSource)

Selects the TIM3 Input Trigger source.

Parameters:
TIM3_InputTriggerSource,:Specifies Input Trigger source. This parameter can be one of the following values:
  • TIM3_TRGSelection_TIM4: TRIG Input source = TIM TRIG Output
  • TIM3_TRGSelection_TIM1: TRIG Input source = TIM TRIG Output
  • TIM3_TRGSelection_TIM3: TRIG Input source = TIM TRIG Output
  • TIM3_TRGSelection_TIM2: TRIG Input source = TIM TRIG Output
  • TIM3_TRGSelection_TI1F_ED: TRIG Input source = TI1F_ED (TI1 Edge Detector)
  • TIM3_TRGSelection_TI1FP1: TRIG Input source = TI1FP1 (Filtred Timer Input 1)
  • TIM3_TRGSelection_TI2FP2: TRIG Input source = TI2FP2 (Filtred Timer Input 2)
  • TIM3_TRGSelection_ETRF: TRIG Input source = ETRF (External Trigger Input )
Return values:
None

Definition at line 1793 of file stm8l15x_tim3.c.

References IS_TIM3_TRIGGER_SELECTION, TIM3, and TIM_SMCR_TS.

Referenced by TIM3_TIxExternalClockConfig().

void TIM3_SelectMasterSlaveMode ( FunctionalState  NewState)

Sets or Resets the TIM3 Master/Slave Mode.

Parameters:
NewState,:The new state of the synchronization between TIM3 and its slaves (through TRGO). This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 1873 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_SMCR_MSM.

void TIM3_SelectOutputTrigger ( TIM3_TRGOSource_TypeDef  TIM3_TRGOSource)

Selects the TIM3 Trigger Output Mode.

Parameters:
TIM3_TRGOSource,:Specifies the Trigger Output source. This parameter can be one of the following values:
  • TIM3_TRGOSource_Reset: Trigger Output source = Reset
  • TIM3_TRGOSource_Enable: Trigger Output source = TIM3 is enabled
  • TIM3_TRGOSource_Update: Trigger Output source = Update event
  • TIM3_TRGOSource_OC1: Trigger Output source = output compare channel1
  • TIM3_TRGOSource_OC1REF: Trigger Output source = output compare channel 1 reference
  • TIM3_TRGOSource_OC2REF: Trigger Output source = output compare channel 2 reference
Return values:
None

Definition at line 1821 of file stm8l15x_tim3.c.

References IS_TIM3_TRGO_SOURCE, TIM3, and TIM_CR2_MMS.

void TIM3_SelectSlaveMode ( TIM3_SlaveMode_TypeDef  TIM3_SlaveMode)

Selects the TIM3 Slave Mode.

Parameters:
TIM3_SlaveMode,:Specifies the TIM3 Slave Mode. This parameter can be one of the following values:
  • TIM3_SlaveMode_Reset: Slave Mode Selection = Reset
  • TIM3_SlaveMode_Gated: Slave Mode Selection = Gated
  • TIM3_SlaveMode_Trigger: Slave Mode Selection = Trigger
  • TIM3_SlaveMode_External1: Slave Mode Selection = External 1
Return values:
None

Definition at line 1849 of file stm8l15x_tim3.c.

References IS_TIM3_SLAVE_MODE, TIM3, and TIM_SMCR_SMS.

STM8S Firmware Library: Overview

 

 

 

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