Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

Synchronization management functions

Synchronization management functions
[TIM_Private_Functions]

Synchronization management functions. More...

Functions

void TIM_SelectInputTrigger (TIM_TypeDef *TIMx, uint16_t TIM_InputTriggerSource)
 Selects the Input Trigger source.
void TIM_SelectOutputTrigger (TIM_TypeDef *TIMx, uint16_t TIM_TRGOSource)
 Selects the TIMx Trigger Output Mode.
void TIM_SelectOutputTrigger2 (TIM_TypeDef *TIMx, uint32_t TIM_TRGO2Source)
 Selects the TIMx Trigger Output Mode2 (TRGO2).
void TIM_SelectSlaveMode (TIM_TypeDef *TIMx, uint32_t TIM_SlaveMode)
 Selects the TIMx Slave Mode.
void TIM_SelectMasterSlaveMode (TIM_TypeDef *TIMx, uint16_t TIM_MasterSlaveMode)
 Sets or Resets the TIMx Master/Slave Mode.
void TIM_ETRConfig (TIM_TypeDef *TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity, uint16_t ExtTRGFilter)
 Configures the TIMx External Trigger (ETR).

Detailed Description

Synchronization management functions.

 ===============================================================================
                 ##### Synchronization management functions #####
 ===============================================================================  
                         
  *** TIM Driver: how to use it in synchronization Mode ***
  ========================================================= 
  [..] Case of two/several Timers
       
       (#) Configure the Master Timers using the following functions:
           (++) void TIM_SelectOutputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_TRGOSource); 
           (++) void TIM_SelectMasterSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_MasterSlaveMode);  
       (#) Configure the Slave Timers using the following functions: 
           (++) void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource);  
           (++) void TIM_SelectSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_SlaveMode); 
          
  [..] Case of Timers and external trigger(ETR pin)
           
       (#) Configure the External trigger using this function:
           (++) void TIM_ETRConfig(TIM_TypeDef* TIMx, uint16_t TIM_ExtTRGPrescaler, uint16_t TIM_ExtTRGPolarity,
                                   uint16_t ExtTRGFilter);
       (#) Configure the Slave Timers using the following functions: 
           (++) void TIM_SelectInputTrigger(TIM_TypeDef* TIMx, uint16_t TIM_InputTriggerSource);  
           (++) void TIM_SelectSlaveMode(TIM_TypeDef* TIMx, uint16_t TIM_SlaveMode); 


Function Documentation

void TIM_ETRConfig ( TIM_TypeDef *  TIMx,
uint16_t  TIM_ExtTRGPrescaler,
uint16_t  TIM_ExtTRGPolarity,
uint16_t  ExtTRGFilter 
)

Configures the TIMx External Trigger (ETR).

Parameters:
TIMx,:where x can be 1, 2, 3, 4, 20 or 8 to select the TIM peripheral.
TIM_ExtTRGPrescaler,:The external Trigger Prescaler. This parameter can be one of the following values:

  • TIM_ExtTRGPSC_OFF: ETRP Prescaler OFF.
  • TIM_ExtTRGPSC_DIV2: ETRP frequency divided by 2.
  • TIM_ExtTRGPSC_DIV4: ETRP frequency divided by 4.
  • TIM_ExtTRGPSC_DIV8: ETRP frequency divided by 8.
TIM_ExtTRGPolarity,:The external Trigger Polarity. This parameter can be one of the following values:

  • TIM_ExtTRGPolarity_Inverted: active low or falling edge active.
  • TIM_ExtTRGPolarity_NonInverted: active high or rising edge active.
ExtTRGFilter,:External Trigger Filter. This parameter must be a value between 0x00 and 0x0F
Return values:
None

Definition at line 3642 of file stm32f30x_tim.c.

void TIM_SelectInputTrigger ( TIM_TypeDef *  TIMx,
uint16_t  TIM_InputTriggerSource 
)

Selects the Input Trigger source.

Parameters:
TIMx,:where x can be 1, 2, 3, 4, 8, 20 or 15 to select the TIM peripheral.
TIM_InputTriggerSource,:The Input Trigger source. This parameter can be one of the following values:

  • TIM_TS_ITR0: Internal Trigger 0
  • TIM_TS_ITR1: Internal Trigger 1
  • TIM_TS_ITR2: Internal Trigger 2
  • TIM_TS_ITR3: Internal Trigger 3
  • TIM_TS_TI1F_ED: TI1 Edge Detector
  • TIM_TS_TI1FP1: Filtered Timer Input 1
  • TIM_TS_TI2FP2: Filtered Timer Input 2
  • TIM_TS_ETRF: External Trigger input
Return values:
None

Definition at line 3481 of file stm32f30x_tim.c.

void TIM_SelectMasterSlaveMode ( TIM_TypeDef *  TIMx,
uint16_t  TIM_MasterSlaveMode 
)

Sets or Resets the TIMx Master/Slave Mode.

Parameters:
TIMx,:where x can be 1, 2, 3, 4, 8, 20 or 15 to select the TIM peripheral.
TIM_MasterSlaveMode,:specifies the Timer Master Slave Mode. This parameter can be one of the following values:

  • TIM_MasterSlaveMode_Enable: synchronization between the current timer and its slaves (through TRGO)
  • TIM_MasterSlaveMode_Disable: No action
Return values:
None

Definition at line 3612 of file stm32f30x_tim.c.

void TIM_SelectOutputTrigger ( TIM_TypeDef *  TIMx,
uint16_t  TIM_TRGOSource 
)

Selects the TIMx Trigger Output Mode.

Parameters:
TIMx,:where x can be 1, 2, 3, 4, 5, 6, 7, 8 or 15 to select the TIM peripheral.
TIM_TRGOSource,:specifies the Trigger Output source. This parameter can be one of the following values:
  • For all TIMx
    • TIM_TRGOSource_Reset: The UG bit in the TIM_EGR register is used as the trigger output(TRGO)
    • TIM_TRGOSource_Enable: The Counter Enable CEN is used as the trigger output(TRGO)
    • TIM_TRGOSource_Update: The update event is selected as the trigger output(TRGO)
  • For all TIMx except TIM6 and TIM7
    • TIM_TRGOSource_OC1: The trigger output sends a positive pulse when the CC1IF flag is to be set, as soon as a capture or compare match occurs(TRGO)
    • TIM_TRGOSource_OC1Ref: OC1REF signal is used as the trigger output(TRGO)
    • TIM_TRGOSource_OC2Ref: OC2REF signal is used as the trigger output(TRGO)
    • TIM_TRGOSource_OC3Ref: OC3REF signal is used as the trigger output(TRGO)
    • TIM_TRGOSource_OC4Ref: OC4REF signal is used as the trigger output(TRGO)
    Return values:
    None

Definition at line 3524 of file stm32f30x_tim.c.

void TIM_SelectOutputTrigger2 ( TIM_TypeDef *  TIMx,
uint32_t  TIM_TRGO2Source 
)

Selects the TIMx Trigger Output Mode2 (TRGO2).

Parameters:
TIMx,:where x can be 1 or 8 or 20 to select the TIM peripheral.
TIM_TRGO2Source,:specifies the Trigger Output source. This parameter can be one of the following values:
  • For all TIMx
    • TIM_TRGOSource_Reset: The UG bit in the TIM_EGR register is used as the trigger output(TRGO2)
    • TIM_TRGOSource_Enable: The Counter Enable CEN is used as the trigger output(TRGO2)
    • TIM_TRGOSource_Update: The update event is selected as the trigger output(TRGO2)
    • TIM_TRGOSource_OC1: The trigger output sends a positive pulse when the CC1IF flag is to be set, as soon as a capture or compare match occurs(TRGO2)
    • TIM_TRGOSource_OC1Ref: OC1REF signal is used as the trigger output(TRGO2)
    • TIM_TRGOSource_OC2Ref: OC2REF signal is used as the trigger output(TRGO2)
    • TIM_TRGOSource_OC3Ref: OC3REF signal is used as the trigger output(TRGO2)
    • TIM_TRGOSource_OC4Ref: OC4REF signal is used as the trigger output(TRGO2)
    • TIM_TRGO2Source_OC4Ref_RisingFalling: OC4Ref Rising and Falling are used as the trigger output(TRGO2)
    • TIM_TRGO2Source_OC6Ref_RisingFalling: OC6Ref Rising and Falling are used as the trigger output(TRGO2)
    • TIM_TRGO2Source_OC4RefRising_OC6RefRising: OC4Ref Rising and OC6Ref Rising are used as the trigger output(TRGO2)
    • TIM_TRGO2Source_OC4RefRising_OC6RefFalling: OC4Ref Rising and OC6Ref Falling are used as the trigger output(TRGO2)
    • TIM_TRGO2Source_OC5RefRising_OC6RefRising: OC5Ref Rising and OC6Ref Rising are used as the trigger output(TRGO2)
    • TIM_TRGO2Source_OC5RefRising_OC6RefFalling: OC5Ref Rising and OC6Ref Falling are used as the trigger output(TRGO2)
    Return values:
    None

Definition at line 3562 of file stm32f30x_tim.c.

void TIM_SelectSlaveMode ( TIM_TypeDef *  TIMx,
uint32_t  TIM_SlaveMode 
)

Selects the TIMx Slave Mode.

Parameters:
TIMx,:where x can be 1, 2, 3, 4, 8, 20 or 15 to select the TIM peripheral.
TIM_SlaveMode,:specifies the Timer Slave Mode. This parameter can be one of the following values:

  • TIM_SlaveMode_Reset: Rising edge of the selected trigger signal(TRGI) reinitialize the counter and triggers an update of the registers
  • TIM_SlaveMode_Gated: The counter clock is enabled when the trigger signal (TRGI) is high
  • TIM_SlaveMode_Trigger: The counter starts at a rising edge of the trigger TRGI
  • TIM_SlaveMode_External1: Rising edges of the selected trigger (TRGI) clock the counter
  • TIM_SlaveMode_Combined_ResetTrigger: Rising edge of the selected trigger input (TRGI) reinitializes the counter, generates an update of the registers and starts the counter.
Return values:
None

Definition at line 3589 of file stm32f30x_tim.c.