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 TIM5_ETRConfig (TIM5_ExtTRGPSC_TypeDef TIM5_ExtTRGPrescaler, TIM5_ExtTRGPolarity_TypeDef TIM5_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM5 External Trigger.
void TIM5_SelectInputTrigger (TIM5_TRGSelection_TypeDef TIM5_InputTriggerSource)
 Selects the TIM5 Input Trigger source.
void TIM5_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM5 Master/Slave Mode.
void TIM5_SelectOutputTrigger (TIM5_TRGOSource_TypeDef TIM5_TRGOSource)
 Selects the TIM5 Trigger Output Mode.
void TIM5_SelectSlaveMode (TIM5_SlaveMode_TypeDef TIM5_SlaveMode)
 Selects the TIM5 Slave Mode.

Detailed Description

Synchronization management functions.

 ===============================================================================
                       Synchronization management functions
 ===============================================================================  
                   
       ===================================================================      
              TIM5 Driver: how to use it in synchronization Mode
       =================================================================== 
       Case of two/several Timers
       **************************
       1. If TIM5 is used as master to other timers use the following functions:
          - TIM5_SelectOutputTrigger()
          - TIM5_SelectMasterSlaveMode()
       2. If TIM5 is used as slave to other timers use the following functions:
          - TIM5_SelectInputTrigger()
          - TIM5_SelectSlaveMode()
          
       Case of Timers and external trigger (TRIG pin)
       ********************************************       
       1. Configure the External trigger using TIM5_ETRConfig()
       2. Configure the Slave Timer using the following functions:
          - TIM5_SelectInputTrigger()
          - TIM5_SelectSlaveMode()


Function Documentation

void TIM5_ETRConfig ( TIM5_ExtTRGPSC_TypeDef  TIM5_ExtTRGPrescaler,
TIM5_ExtTRGPolarity_TypeDef  TIM5_ExtTRGPolarity,
uint8_t  ExtTRGFilter 
)

Configures the TIM5 External Trigger.

Parameters:
TIM5_ExtTRGPrescaler,:Specifies the external Trigger Prescaler. This parameter can be one of the following values:
  • TIM5_ExtTRGPSC_OFF: No External Trigger prescaler
  • TIM5_ExtTRGPSC_DIV2: External Trigger prescaler = 2 (ETRP frequency divided by 2)
  • TIM5_ExtTRGPSC_DIV4: External Trigger prescaler = 4 (ETRP frequency divided by 4)
  • TIM5_ExtTRGPSC_DIV8: External Trigger prescaler = 8 (ETRP frequency divided by 8)
TIM5_ExtTRGPolarity,:Specifies the external Trigger Polarity. This parameter can be one of the following values:
  • TIM5_ExtTRGPolarity_Inverted: External Trigger Polarity = inverted
  • TIM5_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_tim5.c.

References IS_TIM5_EXT_FILTER, IS_TIM5_EXT_POLARITY, IS_TIM5_EXT_PRESCALER, and TIM5.

Referenced by TIM5_ETRClockMode1Config(), and TIM5_ETRClockMode2Config().

void TIM5_SelectInputTrigger ( TIM5_TRGSelection_TypeDef  TIM5_InputTriggerSource)

Selects the TIM5 Input Trigger source.

Parameters:
TIM5_InputTriggerSource,:Specifies Input Trigger source. This parameter can be one of the following values:
  • TIM5_TRGSelection_TIM4: TRIG Input source = TIM TRIG Output
  • TIM5_TRGSelection_TIM1: TRIG Input source = TIM TRIG Output
  • TIM5_TRGSelection_TIM3: TRIG Input source = TIM TRIG Output
  • TIM5_TRGSelection_TIM2: TRIG Input source = TIM TRIG Output
  • TIM5_TRGSelection_TI1F_ED: TRIG Input source = TI1F_ED (TI1 Edge Detector)
  • TIM5_TRGSelection_TI1FP1: TRIG Input source = TI1FP1 (Filtred Timer Input 1)
  • TIM5_TRGSelection_TI2FP2: TRIG Input source = TI2FP2 (Filtred Timer Input 2)
  • TIM5_TRGSelection_ETRF: TRIG Input source = ETRF (External Trigger Input )
Return values:
None

Definition at line 1793 of file stm8l15x_tim5.c.

References IS_TIM5_TRIGGER_SELECTION, TIM5, and TIM_SMCR_TS.

Referenced by TIM5_TIxExternalClockConfig().

void TIM5_SelectMasterSlaveMode ( FunctionalState  NewState)

Sets or Resets the TIM5 Master/Slave Mode.

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

Definition at line 1873 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_SMCR_MSM.

void TIM5_SelectOutputTrigger ( TIM5_TRGOSource_TypeDef  TIM5_TRGOSource)

Selects the TIM5 Trigger Output Mode.

Parameters:
TIM5_TRGOSource,:Specifies the Trigger Output source. This parameter can be one of the following values:
  • TIM5_TRGOSource_Reset: Trigger Output source = Reset
  • TIM5_TRGOSource_Enable: Trigger Output source = TIM5 is enabled
  • TIM5_TRGOSource_Update: Trigger Output source = Update event
  • TIM5_TRGOSource_OC1: Trigger Output source = output compare channel1
  • TIM5_TRGOSource_OC1REF: Trigger Output source = output compare channel 1 reference
  • TIM5_TRGOSource_OC2REF: Trigger Output source = output compare channel 2 reference
Return values:
None

Definition at line 1821 of file stm8l15x_tim5.c.

References IS_TIM5_TRGO_SOURCE, TIM5, and TIM_CR2_MMS.

void TIM5_SelectSlaveMode ( TIM5_SlaveMode_TypeDef  TIM5_SlaveMode)

Selects the TIM5 Slave Mode.

Parameters:
TIM5_SlaveMode,:Specifies the TIM5 Slave Mode. This parameter can be one of the following values:
  • TIM5_SlaveMode_Reset: Slave Mode Selection = Reset
  • TIM5_SlaveMode_Gated: Slave Mode Selection = Gated
  • TIM5_SlaveMode_Trigger: Slave Mode Selection = Trigger
  • TIM5_SlaveMode_External1: Slave Mode Selection = External 1
Return values:
None

Definition at line 1849 of file stm8l15x_tim5.c.

References IS_TIM5_SLAVE_MODE, TIM5, and TIM_SMCR_SMS.

STM8S Firmware Library: Overview

 

 

 

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