STM8L15x Standard Peripherals Drivers: TIM3

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

TIM3 driver modules. More...

Modules

 TIM3_Exported_Types
 TIM3_Exported_Macros
 TIM3_Private_Functions

Functions

void TIM3_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM3 peripheral Preload register on ARR.
void TIM3_BKRConfig (TIM3_OSSIState_TypeDef TIM3_OSSIState, TIM3_LockLevel_TypeDef TIM3_LockLevel, TIM3_BreakState_TypeDef TIM3_BreakState, TIM3_BreakPolarity_TypeDef TIM3_BreakPolarity, TIM3_AutomaticOutput_TypeDef TIM3_AutomaticOutput)
 Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).
void TIM3_CCxCmd (TIM3_Channel_TypeDef TIM3_Channel, FunctionalState NewState)
 Enables or disables the TIM3 Capture Compare Channel x.
void TIM3_ClearFlag (TIM3_FLAG_TypeDef TIM3_FLAG)
 Clears the TIM�s pending flags.
void TIM3_ClearITPendingBit (TIM3_IT_TypeDef TIM3_IT)
 Clears the TIM's interrupt pending bits.
void TIM3_Cmd (FunctionalState NewState)
 Enables or disables the TIM3 peripheral.
void TIM3_CounterModeConfig (TIM3_CounterMode_TypeDef TIM3_CounterMode)
 Specifies the TIM3 Counter Mode to be used.
void TIM3_CtrlPWMOutputs (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Main Outputs.
void TIM3_DeInit (void)
 Deinitialize the TIM3 peripheral registers to their default reset values.
void TIM3_DMACmd (TIM3_DMASource_TypeDef TIM3_DMASource, FunctionalState NewState)
 Enables or disables the TIM3 DMA Requests.
void TIM3_EncoderInterfaceConfig (TIM3_EncoderMode_TypeDef TIM3_EncoderMode, TIM3_ICPolarity_TypeDef TIM3_IC1Polarity, TIM3_ICPolarity_TypeDef TIM3_IC2Polarity)
 Configures the TIM3 Encoder Interface.
void TIM3_ETRClockMode1Config (TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler, TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM3 External clock Mode1.
void TIM3_ETRClockMode2Config (TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler, TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM3 External clock Mode2.
void TIM3_ETRConfig (TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler, TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM3 External Trigger.
void TIM3_ForcedOC1Config (TIM3_ForcedAction_TypeDef TIM3_ForcedAction)
 Forces the TIM3 Channel1 output waveform to active or inactive level.
void TIM3_ForcedOC2Config (TIM3_ForcedAction_TypeDef TIM3_ForcedAction)
 Forces the TIM3 Channel2 output waveform to active or inactive level.
void TIM3_GenerateEvent (TIM3_EventSource_TypeDef TIM3_EventSource)
 Configures the TIM3 event to be generated by software.
uint16_t TIM3_GetCapture1 (void)
 Gets the TIM3 Input Capture 1 value.
uint16_t TIM3_GetCapture2 (void)
 Gets the TIM3 Input Capture 2 value.
uint16_t TIM3_GetCounter (void)
 Gets the TIM3 Counter value.
FlagStatus TIM3_GetFlagStatus (TIM3_FLAG_TypeDef TIM3_FLAG)
 Checks whether the specified TIM3 flag is set or not.
ITStatus TIM3_GetITStatus (TIM3_IT_TypeDef TIM3_IT)
 Checks whether the TIM3 interrupt has occurred or not.
TIM3_Prescaler_TypeDef TIM3_GetPrescaler (void)
 Gets the TIM3 Prescaler value.
void TIM3_ICInit (TIM3_Channel_TypeDef TIM3_Channel, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, TIM3_ICSelection_TypeDef TIM3_ICSelection, TIM3_ICPSC_TypeDef TIM3_ICPrescaler, uint8_t TIM3_ICFilter)
 Initializes the TIM3 peripheral according to the specified parameters.
void TIM3_InternalClockConfig (void)
 Enables the TIM3 internal Clock.
void TIM3_ITConfig (TIM3_IT_TypeDef TIM3_IT, FunctionalState NewState)
 Enables or disables the specified TIM3 interrupts.
void TIM3_OC1FastConfig (FunctionalState NewState)
 Configures the TIM3 Capture Compare 1 Fast feature.
void TIM3_OC1Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity, TIM3_OCIdleState_TypeDef TIM3_OCIdleState)
 Initializes the TIM3 Channel1 according to the specified parameters.
void TIM3_OC1PolarityConfig (TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Configures the TIM3 Channel 1 polarity.
void TIM3_OC1PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Preload Register on CCR1.
void TIM3_OC2FastConfig (FunctionalState NewState)
 Configures the TIM3 Capture Compare 2 Fast feature.
void TIM3_OC2Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity, TIM3_OCIdleState_TypeDef TIM3_OCIdleState)
 Initializes the TIM3 Channel2 according to the specified parameters.
void TIM3_OC2PolarityConfig (TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Configures the TIM3 Channel 2 polarity.
void TIM3_OC2PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Preload Register on CCR2.
void TIM3_PrescalerConfig (TIM3_Prescaler_TypeDef Prescaler, TIM3_PSCReloadMode_TypeDef TIM3_PSCReloadMode)
 Configures the TIM3 Prescaler.
void TIM3_PWMIConfig (TIM3_Channel_TypeDef TIM3_Channel, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, TIM3_ICSelection_TypeDef TIM3_ICSelection, TIM3_ICPSC_TypeDef TIM3_ICPrescaler, uint8_t TIM3_ICFilter)
 Configures the TIM3 peripheral in PWM Input Mode according to the specified parameters.
void TIM3_SelectCCDMA (FunctionalState NewState)
 Selects the TIM3 peripheral Capture Compare DMA source.
void TIM3_SelectHallSensor (FunctionalState NewState)
 Enables or Disables the TIM�s Hall sensor interface.
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_SelectOCxM (TIM3_Channel_TypeDef TIM3_Channel, TIM3_OCMode_TypeDef TIM3_OCMode)
 Selects the TIM3 Output Compare Mode.
void TIM3_SelectOnePulseMode (TIM3_OPMode_TypeDef TIM3_OPMode)
 Selects the TIM�s One Pulse 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.
void TIM3_SetAutoreload (uint16_t Autoreload)
 Sets the TIM3 Autoreload Register value.
void TIM3_SetCompare1 (uint16_t Compare)
 Sets the TIM3 Capture Compare1 Register value.
void TIM3_SetCompare2 (uint16_t Compare)
 Sets the TIM3 Capture Compare2 Register value.
void TIM3_SetCounter (uint16_t Counter)
 Sets the TIM3 Counter Register value.
void TIM3_SetIC1Prescaler (TIM3_ICPSC_TypeDef TIM3_IC1Prescaler)
 Sets the TIM3 Input Capture 1 prescaler.
void TIM3_SetIC2Prescaler (TIM3_ICPSC_TypeDef TIM3_IC2Prescaler)
 Sets the TIM3 Input Capture 2 prescaler.
void TIM3_TimeBaseInit (TIM3_Prescaler_TypeDef TIM3_Prescaler, TIM3_CounterMode_TypeDef TIM3_CounterMode, uint16_t TIM3_Period)
 Initializes the TIM3 Time Base Unit according to the specified parameters.
void TIM3_TIxExternalClockConfig (TIM3_TIxExternalCLK1Source_TypeDef TIM3_TIxExternalCLKSource, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, uint8_t ICFilter)
 Configures the TIM3 Trigger as External Clock.
void TIM3_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM3 Update event.
void TIM3_UpdateRequestConfig (TIM3_UpdateSource_TypeDef TIM3_UpdateSource)
 Selects the TIM3 Update Request Interrupt source.

Detailed Description

TIM3 driver modules.


Function Documentation

void TIM3_ARRPreloadConfig ( FunctionalState  NewState)

Enables or disables TIM3 peripheral Preload register on ARR.

Parameters:
NewState,:The new state of the TIM3 peripheral Preload register. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 436 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR1_ARPE.

void TIM3_BKRConfig ( TIM3_OSSIState_TypeDef  TIM3_OSSIState,
TIM3_LockLevel_TypeDef  TIM3_LockLevel,
TIM3_BreakState_TypeDef  TIM3_BreakState,
TIM3_BreakPolarity_TypeDef  TIM3_BreakPolarity,
TIM3_AutomaticOutput_TypeDef  TIM3_AutomaticOutput 
)

Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).

Parameters:
TIM3_OSSIState,:Off-State Selection for Idle mode states. This parameter can be one of the following values:
  • TIM3_OSSIState_Enable: Off-State Selection for Idle mode enabled
  • TIM3_OSSIState_Disable: Off-State Selection for Idle mode disabled
TIM3_LockLevel,:Lock level. This parameter can be one of the following values:
  • TIM3_LockLevel_Off: Lock option disabled
  • TIM3_LockLevel_1: Select Lock Level 1
  • TIM3_LockLevel_2: Select Lock Level 2
  • TIM3_LockLevel_3: Select Lock Level 3
TIM3_BreakState,:Break Input enable/disable . This parameter can be one of the following values:
  • TIM3_BreakState_Disable: Break State disabled (break option disabled)
  • TIM3_BreakState_Enable: Break State enabled (break option enabled)
TIM3_BreakPolarity,:Break Polarity. This parameter can be one of the following values:
  • TIM3_BreakPolarity_High: if Break, channel polarity = High
  • TIM3_BreakPolarity_Low: if Break, channel polarity = Low
TIM3_AutomaticOutput,:TIM3 AOE Bit Set/Reset . This parameter can be one of the following values:
  • TIM3_AutomaticOutput_Enable: Automatic Output option enabled
  • TIM3_AutomaticOutput_Disable: Automatic Output option disabled
Return values:
None

Definition at line 748 of file stm8l15x_tim3.c.

References IS_TIM3_AUTOMATIC_OUTPUT_STATE, IS_TIM3_BREAK_POLARITY, IS_TIM3_BREAK_STATE, IS_TIM3_LOCK_LEVEL, IS_TIM3_OSSI_STATE, and TIM3.

void TIM3_CCxCmd ( TIM3_Channel_TypeDef  TIM3_Channel,
FunctionalState  NewState 
)

Enables or disables the TIM3 Capture Compare Channel x.

Parameters:
TIM3_Channel,:Specifies the TIM3 Channel. This parameter can be one of the following values:
  • TIM3_Channel_1: Channel 1
  • TIM3_Channel_2: Channel 2
NewState,:Specifies the TIM3 Channel CCxE bit new state. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 1068 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM3_CHANNEL, TIM3, TIM3_Channel_1, TIM_CCER1_CC1E, and TIM_CCER1_CC2E.

void TIM3_ClearFlag ( TIM3_FLAG_TypeDef  TIM3_FLAG)

Clears the TIM�s pending flags.

Parameters:
TIM3_FLAG,:Specifies the flag to clear. This parameter can be any combination of the following values:
  • TIM3_FLAG_Update: Update
  • TIM3_FLAG_CC1: Capture Compare Channel1
  • TIM3_FLAG_CC2: Capture Compare Channel2
  • TIM3_FLAG_Trigger: Trigger
  • TIM3_FLAG_Break: Break
Return values:
None

Definition at line 1500 of file stm8l15x_tim3.c.

References IS_TIM3_CLEAR_FLAG, and TIM3.

void TIM3_ClearITPendingBit ( TIM3_IT_TypeDef  TIM3_IT)

Clears the TIM's interrupt pending bits.

Parameters:
TIM3_IT,:Specifies the pending bit to clear. This parameter can be any combination of the following values:
  • TIM3_IT_Update: Update
  • TIM3_IT_CC1: Capture Compare Channel1
  • TIM3_IT_CC2: Capture Compare Channel2
  • TIM3_IT_Trigger: Trigger
  • TIM3_IT_Break: Break
Return values:
None

Definition at line 1555 of file stm8l15x_tim3.c.

References IS_TIM3_IT, and TIM3.

void TIM3_Cmd ( FunctionalState  NewState)

Enables or disables the TIM3 peripheral.

Parameters:
NewState,:The new state of the TIM3 peripheral. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 482 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR1_CEN.

void TIM3_CounterModeConfig ( TIM3_CounterMode_TypeDef  TIM3_CounterMode)

Specifies the TIM3 Counter Mode to be used.

Parameters:
TIM3_CounterMode,:Specifies the Counter Mode to be used This parameter can be one of the following values:
  • TIM3_CounterMode_Up: Counter Up Mode
  • TIM3_CounterMode_Down: Counter Down Mode
  • TIM3_CounterMode_CenterAligned1: Counter Central aligned Mode 1
  • TIM3_CounterMode_CenterAligned2: Counter Central aligned Mode 2
  • TIM3_CounterMode_CenterAligned3: Counter Central aligned Mode 3
Return values:
None

Definition at line 300 of file stm8l15x_tim3.c.

References IS_TIM3_COUNTER_MODE, TIM3, TIM_CR1_CMS, and TIM_CR1_DIR.

void TIM3_CtrlPWMOutputs ( FunctionalState  NewState)

Enables or disables the TIM3 peripheral Main Outputs.

Parameters:
NewState,:The new state of the TIM3 peripheral. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 777 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_BKR_MOE.

void TIM3_DMACmd ( TIM3_DMASource_TypeDef  TIM3_DMASource,
FunctionalState  NewState 
)

Enables or disables the TIM3 DMA Requests.

Parameters:
TIM3_DMASource,:specifies the DMA Request sources. This parameter can be any combination of the following values:
  • TIM3_DMASource_Update: TIM3 DMA Update Request
  • TIM3_DMASource_CC1: TIM3 DMA CC1 Request
  • TIM3_DMASource_CC2: TIM3 DMA CC2 Request
NewState,:new state of the DMA Request sources. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 1575 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM3_DMA_SOURCE, and TIM3.

void TIM3_EncoderInterfaceConfig ( TIM3_EncoderMode_TypeDef  TIM3_EncoderMode,
TIM3_ICPolarity_TypeDef  TIM3_IC1Polarity,
TIM3_ICPolarity_TypeDef  TIM3_IC2Polarity 
)

Configures the TIM3 Encoder Interface.

Parameters:
TIM3_EncoderMode,:Specifies the TIM3 Encoder Mode. This parameter can be one of the following values:
  • TIM3_EncoderMode_TI1: Encoder mode 1
  • TIM3_EncoderMode_TI2: Encoder mode 2
  • TIM3_EncoderMode_TI12: Encoder mode 3
TIM3_IC1Polarity,:Specifies the IC1 Polarity. This parameter can be one of the following values:
  • TIM3_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM3_ICPolarity_Falling: Input Capture on Falling Edge
TIM3_IC2Polarity,:Specifies the IC2 Polarity. This parameter can be one of the following values:
  • TIM3_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM3_ICPolarity_Falling: Input Capture on Falling Edge
Return values:
None

Definition at line 1952 of file stm8l15x_tim3.c.

References IS_TIM3_ENCODER_MODE, IS_TIM3_IC_POLARITY, TIM3, TIM3_ICPolarity_Falling, TIM_CCER1_CC1P, TIM_CCER1_CC2P, TIM_CCMR_CCxS, TIM_CCMR_TIxDirect_Set, TIM_SMCR_MSM, and TIM_SMCR_TS.

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

Configures the TIM3 External clock Mode1.

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 1701 of file stm8l15x_tim3.c.

References TIM3, TIM3_ETRConfig(), TIM3_SlaveMode_External1, TIM3_TRGSelection_ETRF, TIM_SMCR_SMS, and TIM_SMCR_TS.

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

Configures the TIM3 External clock Mode2.

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 1733 of file stm8l15x_tim3.c.

References TIM3, TIM3_ETRConfig(), and TIM_ETR_ECE.

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_ForcedOC1Config ( TIM3_ForcedAction_TypeDef  TIM3_ForcedAction)

Forces the TIM3 Channel1 output waveform to active or inactive level.

Parameters:
TIM3_ForcedAction,:Specifies the forced Action to be set to the output waveform. This parameter can be one of the following values:
  • TIM3_ForcedAction_Active: Output Reference is forced low
  • TIM3_ForcedAction_Inactive: Output Reference is forced high
Return values:
None

Definition at line 877 of file stm8l15x_tim3.c.

References IS_TIM3_FORCED_ACTION, TIM3, and TIM_CCMR_OCM.

void TIM3_ForcedOC2Config ( TIM3_ForcedAction_TypeDef  TIM3_ForcedAction)

Forces the TIM3 Channel2 output waveform to active or inactive level.

Parameters:
TIM3_ForcedAction,:Specifies the forced Action to be set to the output waveform. This parameter can be one of the following values:
  • TIM3_ForcedAction_Active: Output Reference is forced low
  • TIM3_ForcedAction_Inactive: Output Reference is forced high
Return values:
None

Definition at line 903 of file stm8l15x_tim3.c.

References IS_TIM3_FORCED_ACTION, TIM3, and TIM_CCMR_OCM.

void TIM3_GenerateEvent ( TIM3_EventSource_TypeDef  TIM3_EventSource)

Configures the TIM3 event to be generated by software.

Parameters:
TIM3_EventSource,:Specifies the event source. This parameter can be any combination of the following values:
  • TIM3_EventSource_Update: Update
  • TIM3_EventSource_CC1: Capture Compare Channel1
  • TIM3_EventSource_CC2: Capture Compare Channel2
  • TIM3_EventSource_Trigger: Trigger
  • TIM3_EventSource_Break: Break
Return values:
None

Definition at line 1445 of file stm8l15x_tim3.c.

References IS_TIM3_EVENT_SOURCE, and TIM3.

uint16_t TIM3_GetCapture1 ( void  )

Gets the TIM3 Input Capture 1 value.

Parameters:
None
Return values:
CaptureCompare 1 Register value.

Definition at line 1298 of file stm8l15x_tim3.c.

References TIM3.

uint16_t TIM3_GetCapture2 ( void  )

Gets the TIM3 Input Capture 2 value.

Parameters:
None
Return values:
CaptureCompare 2 Register value.

Definition at line 1317 of file stm8l15x_tim3.c.

References TIM3.

uint16_t TIM3_GetCounter ( void  )

Gets the TIM3 Counter value.

Parameters:
None
Return values:
CounterRegister value.

Definition at line 350 of file stm8l15x_tim3.c.

References TIM3.

FlagStatus TIM3_GetFlagStatus ( TIM3_FLAG_TypeDef  TIM3_FLAG)

Checks whether the specified TIM3 flag is set or not.

Parameters:
TIM3_FLAG,:Specifies the flag to check. This parameter can be any combination of the following values:
  • TIM3_FLAG_Update: Update
  • TIM3_FLAG_CC1: Capture Compare Channel1
  • TIM3_FLAG_CC2: Capture Compare Channel2
  • TIM3_FLAG_Trigger: Trigger
  • TIM3_FLAG_Break: Break
  • TIM3_FLAG_CC1OF: Capture compare 1 over capture
  • TIM3_FLAG_CC2OF: Capture compare 2 over capture
Return values:
FlagStatus,:The new state of TIM3_FLAG (SET or RESET)

Definition at line 1467 of file stm8l15x_tim3.c.

References IS_TIM3_GET_FLAG, RESET, SET, and TIM3.

ITStatus TIM3_GetITStatus ( TIM3_IT_TypeDef  TIM3_IT)

Checks whether the TIM3 interrupt has occurred or not.

Parameters:
TIM3_IT,:Specifies the TIM3 interrupt source to check. This parameter can be any combination of the following values:
  • TIM3_IT_Update: Update
  • TIM3_IT_CC1: Capture Compare Channel1
  • TIM3_IT_CC2: Capture Compare Channel2
  • TIM3_IT_Trigger: Trigger
  • TIM3_IT_Break: Break
Return values:
ITStatus,:The new state of the TIM3_IT (SET or RESET)

Definition at line 1520 of file stm8l15x_tim3.c.

References IS_TIM3_GET_IT, RESET, SET, and TIM3.

TIM3_Prescaler_TypeDef TIM3_GetPrescaler ( void  )

Gets the TIM3 Prescaler value.

Parameters:
None
Return values:
TIM3Prescaler, it can be one of the following values:
  • TIM3_Prescaler_1: Time base Prescaler = 1 (No effect)
  • TIM3_Prescaler_2: Time base Prescaler = 2
  • TIM3_Prescaler_4: Time base Prescaler = 4
  • TIM3_Prescaler_8: Time base Prescaler = 8
  • TIM3_Prescaler_16: Time base Prescaler = 16
  • TIM3_Prescaler_32: Time base Prescaler = 32
  • TIM3_Prescaler_64: Time base Prescaler = 64
  • TIM3_Prescaler_128: Time base Prescaler = 128

Definition at line 377 of file stm8l15x_tim3.c.

References TIM3.

void TIM3_ICInit ( TIM3_Channel_TypeDef  TIM3_Channel,
TIM3_ICPolarity_TypeDef  TIM3_ICPolarity,
TIM3_ICSelection_TypeDef  TIM3_ICSelection,
TIM3_ICPSC_TypeDef  TIM3_ICPrescaler,
uint8_t  TIM3_ICFilter 
)

Initializes the TIM3 peripheral according to the specified parameters.

Parameters:
TIM3_Channel,:TIM3 Channel This parameter can be one of the following values:
  • TIM3_Channel_1: Channel 1
  • TIM3_Channel_2: Channel 2
TIM3_ICPolarity,:Input Capture Polarity This parameter can be one of the following values:
  • TIM3_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM3_ICPolarity_Falling: Input Capture on Falling Edge
TIM3_ICSelection,:Input Capture Selection This parameter can be one of the following values:
  • TIM3_ICSelection_DirectTI: Input Capture mapped on the direct input
  • TIM3_ICSelection_IndirectTI: Input Capture mapped on the indirect input
  • TIM3_ICSelection_TRGI: Input Capture mapped on the Trigger Input
TIM3_ICPrescaler,:Input Capture Prescaler This parameter can be one of the following values:
  • TIM3_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM3_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM3_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM3_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
TIM3_ICFilter,:This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 1178 of file stm8l15x_tim3.c.

References IS_TIM3_CHANNEL, TI1_Config(), TI2_Config(), TIM3_Channel_1, TIM3_SetIC1Prescaler(), and TIM3_SetIC2Prescaler().

void TIM3_InternalClockConfig ( void  )

Enables the TIM3 internal Clock.

Parameters:
None
Return values:
None

Definition at line 1638 of file stm8l15x_tim3.c.

References TIM3, and TIM_SMCR_SMS.

void TIM3_ITConfig ( TIM3_IT_TypeDef  TIM3_IT,
FunctionalState  NewState 
)

Enables or disables the specified TIM3 interrupts.

Parameters:
TIM3_IT,:Specifies the TIM3 interrupts sources to be enabled or disabled. This parameter can be any combination of the following values:
  • TIM3_IT_Update: Update
  • TIM3_IT_CC1: Capture Compare Channel1
  • TIM3_IT_CC2: Capture Compare Channel2
  • TIM3_IT_Trigger: Trigger
  • TIM3_IT_Break: Break
NewState,:The new state of the TIM3 peripheral. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 1416 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM3_IT, and TIM3.

void TIM3_OC1FastConfig ( FunctionalState  NewState)

Configures the TIM3 Capture Compare 1 Fast feature.

Parameters:
NewState,:The new state of the Output Compare Fast Enable bit. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 971 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CCMR_OCxFE.

void TIM3_OC1Init ( TIM3_OCMode_TypeDef  TIM3_OCMode,
TIM3_OutputState_TypeDef  TIM3_OutputState,
uint16_t  TIM3_Pulse,
TIM3_OCPolarity_TypeDef  TIM3_OCPolarity,
TIM3_OCIdleState_TypeDef  TIM3_OCIdleState 
)

Initializes the TIM3 Channel1 according to the specified parameters.

Parameters:
TIM3_OCMode,:Output Compare Mode This parameter can be one of the following values:
  • TIM3_OCMode_Timing: Timing (Frozen) Mode
  • TIM3_OCMode_Active: Active Mode
  • TIM3_OCMode_Inactive: Inactive Mode
  • TIM3_OCMode_Toggle: Toggle Mode
  • TIM3_OCMode_PWM1: PWM Mode 1
  • TIM3_OCMode_PWM2: PWM Mode 2
TIM3_OutputState,:Output state This parameter can be one of the following values:
  • TIM3_OutputState_Disable: Output compare State disabled (channel output disabled)
  • TIM3_OutputState_Enable: Output compare State enabled (channel output enabled)
TIM3_Pulse,:This parameter must be a value between 0x0000 and 0xFFFF.
TIM3_OCPolarity,:Polarity This parameter can be one of the following values:
  • TIM3_OCPolarity_High: Output compare polarity = High
  • TIM3_OCPolarity_Low: Output compare polarity = Low
TIM3_OCIdleState,:Output Compare Idle State This parameter can be one of the following values:
  • TIM3_OCIdleState_Reset: Output Compare Idle state = Reset
  • TIM3_OCIdleState_Set: Output Compare Idle state = Set
Return values:
None

Definition at line 572 of file stm8l15x_tim3.c.

References IS_TIM3_OC_MODE, IS_TIM3_OC_POLARITY, IS_TIM3_OCIDLE_STATE, IS_TIM3_OUTPUT_STATE, TIM3, TIM3_OCIdleState_Set, TIM3_OCPolarity_Low, TIM3_OutputState_Enable, TIM_CCER1_CC1E, TIM_CCER1_CC1P, TIM_CCMR_OCM, and TIM_OISR_OIS1.

void TIM3_OC1PolarityConfig ( TIM3_OCPolarity_TypeDef  TIM3_OCPolarity)

Configures the TIM3 Channel 1 polarity.

Parameters:
TIM3_OCPolarity,:Specifies the OC1 Polarity. This parameter can be one of the following values:
  • TIM3_OCPolarity_High: Output compare polarity = High
  • TIM3_OCPolarity_Low: Output compare polarity = Low
Return values:
None

Definition at line 1018 of file stm8l15x_tim3.c.

References IS_TIM3_OC_POLARITY, TIM3, TIM3_OCPolarity_Low, and TIM_CCER1_CC1P.

void TIM3_OC1PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM3 peripheral Preload Register on CCR1.

Parameters:
NewState,:The new state of the Capture Compare Preload register. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 927 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CCMR_OCxPE.

void TIM3_OC2FastConfig ( FunctionalState  NewState)

Configures the TIM3 Capture Compare 2 Fast feature.

Parameters:
NewState,:The new state of the Output Compare Fast Enable bit. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 994 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CCMR_OCxFE.

void TIM3_OC2Init ( TIM3_OCMode_TypeDef  TIM3_OCMode,
TIM3_OutputState_TypeDef  TIM3_OutputState,
uint16_t  TIM3_Pulse,
TIM3_OCPolarity_TypeDef  TIM3_OCPolarity,
TIM3_OCIdleState_TypeDef  TIM3_OCIdleState 
)

Initializes the TIM3 Channel2 according to the specified parameters.

Parameters:
TIM3_OCMode,:Output Compare Mode This parameter can be one of the following values:
  • TIM3_OCMode_Timing: Timing (Frozen) Mode
  • TIM3_OCMode_Active: Active Mode
  • TIM3_OCMode_Inactive: Inactive Mode
  • TIM3_OCMode_Toggle: Toggle Mode
  • TIM3_OCMode_PWM1: PWM Mode 1
  • TIM3_OCMode_PWM2: PWM Mode 2
TIM3_OutputState,:Output state This parameter can be one of the following values:
  • TIM3_OutputState_Disable: Output compare State disabled (channel output disabled)
  • TIM3_OutputState_Enable: Output compare State enabled (channel output enabled)
TIM3_Pulse,:This parameter must be a value between 0x0000 and 0xFFFF.
TIM3_OCPolarity,:Polarity This parameter can be one of the following values:
  • TIM3_OCPolarity_High: Output compare polarity = High
  • TIM3_OCPolarity_Low: Output compare polarity = Low
TIM3_OCIdleState,:Output Compare Idle State This parameter can be one of the following values:
  • TIM3_OCIdleState_Reset: Output Compare Idle state = Reset
  • TIM3_OCIdleState_Set: Output Compare Idle state = Set
Return values:
None

Definition at line 658 of file stm8l15x_tim3.c.

References IS_TIM3_OC_MODE, IS_TIM3_OC_POLARITY, IS_TIM3_OCIDLE_STATE, IS_TIM3_OUTPUT_STATE, TIM3, TIM3_OCIdleState_Set, TIM3_OCPolarity_Low, TIM3_OutputState_Enable, TIM_CCER1_CC2E, TIM_CCER1_CC2P, TIM_CCMR_OCM, and TIM_OISR_OIS2.

void TIM3_OC2PolarityConfig ( TIM3_OCPolarity_TypeDef  TIM3_OCPolarity)

Configures the TIM3 Channel 2 polarity.

Parameters:
TIM3_OCPolarity,:Specifies the OC2 Polarity. This parameter can be one of the following values:
  • TIM3_OCPolarity_High: Output compare polarity = High
  • TIM3_OCPolarity_Low: Output compare polarity = Low
Return values:
None

Definition at line 1042 of file stm8l15x_tim3.c.

References IS_TIM3_OC_POLARITY, TIM3, TIM3_OCPolarity_Low, and TIM_CCER1_CC2P.

void TIM3_OC2PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM3 peripheral Preload Register on CCR2.

Parameters:
NewState,:The new state of the Capture Compare Preload register. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 949 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CCMR_OCxPE.

void TIM3_PrescalerConfig ( TIM3_Prescaler_TypeDef  Prescaler,
TIM3_PSCReloadMode_TypeDef  TIM3_PSCReloadMode 
)

Configures the TIM3 Prescaler.

Parameters:
Prescaler,:Specifies the Prescaler Register value This parameter can be one of the following values:
  • TIM3_Prescaler_1: Time base Prescaler = 1 (No effect)
  • TIM3_Prescaler_2: Time base Prescaler = 2
  • TIM3_Prescaler_4: Time base Prescaler = 4
  • TIM3_Prescaler_8: Time base Prescaler = 8
  • TIM3_Prescaler_16: Time base Prescaler = 16
  • TIM3_Prescaler_32: Time base Prescaler = 32
  • TIM3_Prescaler_64: Time base Prescaler = 64
  • TIM3_Prescaler_128: Time base Prescaler = 128
TIM3_PSCReloadMode,:Specifies the TIM3 Prescaler Reload mode. This parameter can be one of the following values:
  • TIM3_PSCReloadMode_Update: Prescaler value is reloaded at every update
  • TIM3_PSCReloadMode_Immediate: Prescaler value is reloaded at every update
Return values:
None

Definition at line 268 of file stm8l15x_tim3.c.

References IS_TIM3_PRESCALER, IS_TIM3_PRESCALER_RELOAD, TIM3, TIM3_PSCReloadMode_Immediate, and TIM_EGR_UG.

void TIM3_PWMIConfig ( TIM3_Channel_TypeDef  TIM3_Channel,
TIM3_ICPolarity_TypeDef  TIM3_ICPolarity,
TIM3_ICSelection_TypeDef  TIM3_ICSelection,
TIM3_ICPSC_TypeDef  TIM3_ICPrescaler,
uint8_t  TIM3_ICFilter 
)

Configures the TIM3 peripheral in PWM Input Mode according to the specified parameters.

Parameters:
TIM3_Channel,:TIM3 Channel This parameter can be one of the following values:
  • TIM3_Channel_1: Channel 1
  • TIM3_Channel_2: Channel 2
TIM3_ICPolarity,:Input Capture Polarity This parameter can be one of the following values:
  • TIM3_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM3_ICPolarity_Falling: Input Capture on Falling Edge
TIM3_ICSelection,:Input Capture Selection This parameter can be one of the following values:
  • TIM3_ICSelection_DirectTI: Input Capture mapped on the direct input
  • TIM3_ICSelection_IndirectTI: Input Capture mapped on the indirect input
  • TIM3_ICSelection_TRGI: Input Capture mapped on the Trigger Input
TIM3_ICPrescaler,:Input Capture Prescaler This parameter can be one of the following values:
  • TIM3_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM3_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM3_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM3_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1229 of file stm8l15x_tim3.c.

References IS_TIM3_CHANNEL, TI1_Config(), TI2_Config(), TIM3_Channel_1, TIM3_ICPolarity_Falling, TIM3_ICPolarity_Rising, TIM3_ICSelection_DirectTI, TIM3_ICSelection_IndirectTI, TIM3_SetIC1Prescaler(), and TIM3_SetIC2Prescaler().

void TIM3_SelectCCDMA ( FunctionalState  NewState)

Selects the TIM3 peripheral Capture Compare DMA source.

Parameters:
NewState,:new state of the Capture Compare DMA source. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 1599 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR2_CCDS.

void TIM3_SelectHallSensor ( FunctionalState  NewState)

Enables or Disables the TIM�s Hall sensor interface.

Parameters:
NewState,:The new state of the TIM3 Hall sensor interface. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 2009 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR2_TI1S.

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_SelectOCxM ( TIM3_Channel_TypeDef  TIM3_Channel,
TIM3_OCMode_TypeDef  TIM3_OCMode 
)

Selects the TIM3 Output Compare Mode.

This function disables the selected channel before changing the Output Compare Mode. User has to enable this channel using TIM3_CCxCmd and TIM3_CCxNCmd functions.

Parameters:
TIM3_Channel,:Specifies the TIM3 Channel. This parameter can be one of the following values:
  • TIM3_Channel_1: Channel 1
  • TIM3_Channel_2: Channel 2
TIM3_OCMode,:Specifies the TIM3 Output Compare Mode. This parameter can be one of the following values:
  • TIM3_OCMode_Timing: Timing (Frozen) Mode
  • TIM3_OCMode_Active: Active Mode
  • TIM3_OCMode_Inactive: Inactive Mode
  • TIM3_OCMode_Toggle: Toggle Mode
  • TIM3_OCMode_PWM1: PWM Mode 1
  • TIM3_OCMode_PWM2: PWM Mode 2
Return values:
None

Definition at line 812 of file stm8l15x_tim3.c.

References IS_TIM3_CHANNEL, IS_TIM3_OCM, TIM3, TIM3_Channel_1, TIM_CCER1_CC1E, TIM_CCER1_CC2E, and TIM_CCMR_OCM.

void TIM3_SelectOnePulseMode ( TIM3_OPMode_TypeDef  TIM3_OPMode)

Selects the TIM�s One Pulse Mode.

Parameters:
TIM3_OPMode,:Specifies the OPM Mode to be used. This parameter can be one of the following values:
  • TIM3_OPMode_Single: Single one Pulse mode (OPM Active)
  • TIM3_OPMode_Repetitive: Single one Pulse mode (OPM Active)
Return values:
None

Definition at line 460 of file stm8l15x_tim3.c.

References IS_TIM3_OPM_MODE, TIM3, TIM3_OPMode_Single, and TIM_CR1_OPM.

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.

void TIM3_SetAutoreload ( uint16_t  Autoreload)

Sets the TIM3 Autoreload Register value.

Parameters:
Autoreload,:Specifies the Autoreload register new value. This parameter is between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 338 of file stm8l15x_tim3.c.

References TIM3.

void TIM3_SetCompare1 ( uint16_t  Compare)

Sets the TIM3 Capture Compare1 Register value.

Parameters:
Compare,:Specifies the Capture Compare1 register new value. This parameter is between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 849 of file stm8l15x_tim3.c.

References TIM3.

void TIM3_SetCompare2 ( uint16_t  Compare)

Sets the TIM3 Capture Compare2 Register value.

Parameters:
Compare,:Specifies the Capture Compare2 register new value. This parameter is between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 862 of file stm8l15x_tim3.c.

References TIM3.

void TIM3_SetCounter ( uint16_t  Counter)

Sets the TIM3 Counter Register value.

Parameters:
Counter,:Specifies the Counter register new value. This parameter is between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 324 of file stm8l15x_tim3.c.

References TIM3.

void TIM3_SetIC1Prescaler ( TIM3_ICPSC_TypeDef  TIM3_IC1Prescaler)

Sets the TIM3 Input Capture 1 prescaler.

Parameters:
TIM3_IC1Prescaler,:Specifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM3_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM3_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM3_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM3_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1341 of file stm8l15x_tim3.c.

References IS_TIM3_IC_PRESCALER, TIM3, and TIM_CCMR_ICxPSC.

Referenced by TIM3_ICInit(), and TIM3_PWMIConfig().

void TIM3_SetIC2Prescaler ( TIM3_ICPSC_TypeDef  TIM3_IC2Prescaler)

Sets the TIM3 Input Capture 2 prescaler.

Parameters:
TIM3_IC2Prescaler,:Specifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM3_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM3_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM3_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM3_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1369 of file stm8l15x_tim3.c.

References IS_TIM3_IC_PRESCALER, TIM3, and TIM_CCMR_ICxPSC.

Referenced by TIM3_ICInit(), and TIM3_PWMIConfig().

void TIM3_TimeBaseInit ( TIM3_Prescaler_TypeDef  TIM3_Prescaler,
TIM3_CounterMode_TypeDef  TIM3_CounterMode,
uint16_t  TIM3_Period 
)

Initializes the TIM3 Time Base Unit according to the specified parameters.

Parameters:
TIM3_Prescaler,:Prescaler This parameter can be one of the following values:
  • TIM3_Prescaler_1: Time base Prescaler = 1 (No effect)
  • TIM3_Prescaler_2: Time base Prescaler = 2
  • TIM3_Prescaler_4: Time base Prescaler = 4
  • TIM3_Prescaler_8: Time base Prescaler = 8
  • TIM3_Prescaler_16: Time base Prescaler = 16
  • TIM3_Prescaler_32: Time base Prescaler = 32
  • TIM3_Prescaler_64: Time base Prescaler = 64
  • TIM3_Prescaler_128: Time base Prescaler = 128
TIM3_CounterMode,:Counter mode This parameter can be one of the following values:
  • TIM3_CounterMode_Up: Counter Up Mode
  • TIM3_CounterMode_Down: Counter Down Mode
  • TIM3_CounterMode_CenterAligned1: Counter Central aligned Mode 1
  • TIM3_CounterMode_CenterAligned2: Counter Central aligned Mode 2
  • TIM3_CounterMode_CenterAligned3: Counter Central aligned Mode 3
TIM3_Period,:This parameter must be a value between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 225 of file stm8l15x_tim3.c.

References IS_TIM3_COUNTER_MODE, IS_TIM3_PRESCALER, TIM3, TIM3_EventSource_Update, TIM_CR1_CMS, and TIM_CR1_DIR.

void TIM3_TIxExternalClockConfig ( TIM3_TIxExternalCLK1Source_TypeDef  TIM3_TIxExternalCLKSource,
TIM3_ICPolarity_TypeDef  TIM3_ICPolarity,
uint8_t  ICFilter 
)

Configures the TIM3 Trigger as External Clock.

Parameters:
TIM3_TIxExternalCLKSource,:Specifies Trigger source. This parameter can be one of the following values:
  • TIM3_TIxExternalCLK1Source_TI1ED: External Clock mode 1 source = TI1ED
  • TIM3_TIxExternalCLK1Source_TI1: External Clock mode 1 source = TI1
  • TIM3_TIxExternalCLK1Source_TI2: External Clock mode 1 source = TI2
TIM3_ICPolarity,:Specifies the TIx Polarity. This parameter can be one of the following values:
  • TIM3_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM3_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_tim3.c.

References IS_TIM3_IC_FILTER, IS_TIM3_IC_POLARITY, IS_TIM3_TIXCLK_SOURCE, TI1_Config(), TI2_Config(), TIM3, TIM3_ICSelection_DirectTI, TIM3_SelectInputTrigger(), TIM3_SlaveMode_External1, and TIM3_TIxExternalCLK1Source_TI2.

void TIM3_UpdateDisableConfig ( FunctionalState  NewState)

Enables or Disables the TIM3 Update event.

Parameters:
NewState,:The new state of the TIM3 peripheral Preload register. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 390 of file stm8l15x_tim3.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM3, and TIM_CR1_UDIS.

void TIM3_UpdateRequestConfig ( TIM3_UpdateSource_TypeDef  TIM3_UpdateSource)

Selects the TIM3 Update Request Interrupt source.

Parameters:
TIM3_UpdateSource,:Specifies the Update source. This parameter can be one of the following values:
  • TIM3_UpdateSource_Global: Global Update request source
  • TIM3_UpdateSource_Regular: Regular Update request source
Return values:
None

Definition at line 414 of file stm8l15x_tim3.c.

References IS_TIM3_UPDATE_SOURCE, TIM3, TIM3_UpdateSource_Regular, and TIM_CR1_URS.

STM8S Firmware Library: Overview

 

 

 

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