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 TIM1_ETRConfig (TIM1_ExtTRGPSC_TypeDef TIM1_ExtTRGPrescaler, TIM1_ExtTRGPolarity_TypeDef TIM1_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM1 External Trigger.
void TIM1_SelectInputTrigger (TIM1_TRGSelection_TypeDef TIM1_InputTriggerSource)
 Selects the TIM1 Input Trigger source.
void TIM1_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM1 Master/Slave Mode.
void TIM1_SelectOutputTrigger (TIM1_TRGOSource_TypeDef TIM1_TRGOSource)
 Selects the TIM1 Trigger Output Mode.
void TIM1_SelectSlaveMode (TIM1_SlaveMode_TypeDef TIM1_SlaveMode)
 Selects the TIM1 Slave Mode.

Detailed Description

Synchronization management functions.

 ===============================================================================
                       Synchronization management functions
 ===============================================================================  
                   
       ===================================================================      
              TIM1 Driver: how to use it in synchronization Mode
       =================================================================== 
       Case of two/several Timers
       **************************
       1. If TIM1 is used as master to other timers use the following functions:
          - TIM1_SelectOutputTrigger()
          - TIM1_SelectMasterSlaveMode()
       2. If TIM1 is used as slave to other timers use the following functions:
          - TIM1_SelectInputTrigger()
          - TIM1_SelectSlaveMode()
          
       Case of Timers and external trigger (TRIG pin)
       ********************************************       
       1. Configure the External trigger using TIM1_ETRConfig()
       2. Configure the Slave Timer using the following functions:
          - TIM1_SelectInputTrigger()
          - TIM1_SelectSlaveMode()


Function Documentation

void TIM1_ETRConfig ( TIM1_ExtTRGPSC_TypeDef  TIM1_ExtTRGPrescaler,
TIM1_ExtTRGPolarity_TypeDef  TIM1_ExtTRGPolarity,
uint8_t  ExtTRGFilter 
)

Configures the TIM1 External Trigger.

Parameters:
TIM1_ExtTRGPrescalerspecifies the external Trigger Prescaler. This parameter can be one of the following values:
  • TIM1_ExtTRGPSC_OFF
  • TIM1_ExtTRGPSC_DIV2
  • TIM1_ExtTRGPSC_DIV4
  • TIM1_ExtTRGPSC_DIV8.
TIM1_ExtTRGPolarityspecifies the external Trigger Polarity. This parameter can be one of the following values:
  • TIM1_ExtTRGPolarity_Inverted
  • TIM1_ExtTRGPolarity_NonInverted
ExtTRGFilterspecifies the External Trigger Filter. This parameter must be a value between 0x00 and 0x0F
Return values:
None

Definition at line 2493 of file stm8l15x_tim1.c.

References IS_TIM1_EXT_TRG_FILTER, and TIM1.

Referenced by TIM1_ETRClockMode1Config(), and TIM1_ETRClockMode2Config().

void TIM1_SelectInputTrigger ( TIM1_TRGSelection_TypeDef  TIM1_InputTriggerSource)

Selects the TIM1 Input Trigger source.

Parameters:
TIM1_InputTriggerSourcespecifies Input Trigger source. This parameter can be one of the following values:
  • TIM1_TRGSelection_TIM4
  • TIM1_TRGSelection_TIM3
  • TIM1_TRGSelection_TIM2
  • TIM1_TRGSelection_TI1F_ED: TI1 Edge Detector
  • TIM1_TRGSelection_TI1FP1: Filtered Timer Input 1
  • TIM1_TRGSelection_TI2FP2: Filtered Timer Input 2
  • TIM1_TRGSelection_ETRF: External Trigger input
Return values:
None

Definition at line 2404 of file stm8l15x_tim1.c.

References IS_TIM1_TRIGGER_SELECTION, TIM1, and TIM1_SMCR_TS.

Referenced by TIM1_TIxExternalClockConfig().

void TIM1_SelectMasterSlaveMode ( FunctionalState  NewState)

Sets or Resets the TIM1 Master/Slave Mode.

Parameters:
NewStatenew state of the synchronization between TIM1 and its slaves (through TRGO). This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 2461 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_SMCR_MSM.

void TIM1_SelectOutputTrigger ( TIM1_TRGOSource_TypeDef  TIM1_TRGOSource)

Selects the TIM1 Trigger Output Mode.

Parameters:
TIM1_TRGOSourcespecifies the Trigger Output source. This parameter can be one of the following values
  • TIM1_TRGOSource_Reset
  • TIM1_TRGOSource_Enable
  • TIM1_TRGOSource_Update
  • TIM1_TRGOSource_OC1
  • TIM1_TRGOSource_OC1REF
  • TIM1_TRGOSource_OC2REF
  • TIM1_TRGOSource_OC3REF
  • TIM1_TRGOSource_OC4REF
Return values:
None

Definition at line 2427 of file stm8l15x_tim1.c.

References IS_TIM1_TRGO_SOURCE, TIM1, and TIM1_CR2_MMS.

void TIM1_SelectSlaveMode ( TIM1_SlaveMode_TypeDef  TIM1_SlaveMode)

Selects the TIM1 Slave Mode.

Parameters:
TIM1_SlaveModespecifies the TIM1 Slave Mode. This parameter can be one of the following values
  • TIM1_SlaveMode_Reset
  • TIM1_SlaveMode_Gated
  • TIM1_SlaveMode_Trigger
  • TIM1_SlaveMode_External1
Return values:
None

Definition at line 2445 of file stm8l15x_tim1.c.

References IS_TIM1_SLAVE_MODE, TIM1, and TIM1_SMCR_SMS.

STM8S Firmware Library: Overview

 

 

 

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