STM8L15x Standard Peripherals Drivers: TIM5

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

TIM5 driver modules. More...

Modules

 TIM5_Exported_Types
 TIM5_Exported_Macros
 TIM5_Private_Functions

Functions

void TIM5_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM5 peripheral Preload register on ARR.
void TIM5_BKRConfig (TIM5_OSSIState_TypeDef TIM5_OSSIState, TIM5_LockLevel_TypeDef TIM5_LockLevel, TIM5_BreakState_TypeDef TIM5_BreakState, TIM5_BreakPolarity_TypeDef TIM5_BreakPolarity, TIM5_AutomaticOutput_TypeDef TIM5_AutomaticOutput)
 Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).
void TIM5_CCxCmd (TIM5_Channel_TypeDef TIM5_Channel, FunctionalState NewState)
 Enables or disables the TIM5 Capture Compare Channel x.
void TIM5_ClearFlag (TIM5_FLAG_TypeDef TIM5_FLAG)
 Clears the TIM�s pending flags.
void TIM5_ClearITPendingBit (TIM5_IT_TypeDef TIM5_IT)
 Clears the TIM's interrupt pending bits.
void TIM5_Cmd (FunctionalState NewState)
 Enables or disables the TIM5 peripheral.
void TIM5_CounterModeConfig (TIM5_CounterMode_TypeDef TIM5_CounterMode)
 Specifies the TIM5 Counter Mode to be used.
void TIM5_CtrlPWMOutputs (FunctionalState NewState)
 Enables or disables the TIM5 peripheral Main Outputs.
void TIM5_DeInit (void)
 Deinitialize the TIM5 peripheral registers to their default reset values.
void TIM5_DMACmd (TIM5_DMASource_TypeDef TIM5_DMASource, FunctionalState NewState)
 Enables or disables the TIM5 DMA Requests.
void TIM5_EncoderInterfaceConfig (TIM5_EncoderMode_TypeDef TIM5_EncoderMode, TIM5_ICPolarity_TypeDef TIM5_IC1Polarity, TIM5_ICPolarity_TypeDef TIM5_IC2Polarity)
 Configures the TIM5 Encoder Interface.
void TIM5_ETRClockMode1Config (TIM5_ExtTRGPSC_TypeDef TIM5_ExtTRGPrescaler, TIM5_ExtTRGPolarity_TypeDef TIM5_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM5 External clock Mode1.
void TIM5_ETRClockMode2Config (TIM5_ExtTRGPSC_TypeDef TIM5_ExtTRGPrescaler, TIM5_ExtTRGPolarity_TypeDef TIM5_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM5 External clock Mode2.
void TIM5_ETRConfig (TIM5_ExtTRGPSC_TypeDef TIM5_ExtTRGPrescaler, TIM5_ExtTRGPolarity_TypeDef TIM5_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM5 External Trigger.
void TIM5_ForcedOC1Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction)
 Forces the TIM5 Channel1 output waveform to active or inactive level.
void TIM5_ForcedOC2Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction)
 Forces the TIM5 Channel2 output waveform to active or inactive level.
void TIM5_GenerateEvent (TIM5_EventSource_TypeDef TIM5_EventSource)
 Configures the TIM5 event to be generated by software.
uint16_t TIM5_GetCapture1 (void)
 Gets the TIM5 Input Capture 1 value.
uint16_t TIM5_GetCapture2 (void)
 Gets the TIM5 Input Capture 2 value.
uint16_t TIM5_GetCounter (void)
 Gets the TIM5 Counter value.
FlagStatus TIM5_GetFlagStatus (TIM5_FLAG_TypeDef TIM5_FLAG)
 Checks whether the specified TIM5 flag is set or not.
ITStatus TIM5_GetITStatus (TIM5_IT_TypeDef TIM5_IT)
 Checks whether the TIM5 interrupt has occurred or not.
TIM5_Prescaler_TypeDef TIM5_GetPrescaler (void)
 Gets the TIM5 Prescaler value.
void TIM5_ICInit (TIM5_Channel_TypeDef TIM5_Channel, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, TIM5_ICSelection_TypeDef TIM5_ICSelection, TIM5_ICPSC_TypeDef TIM5_ICPrescaler, uint8_t TIM5_ICFilter)
 Initializes the TIM5 peripheral according to the specified parameters.
void TIM5_InternalClockConfig (void)
 Enables the TIM5 internal Clock.
void TIM5_ITConfig (TIM5_IT_TypeDef TIM5_IT, FunctionalState NewState)
 Enables or disables the specified TIM5 interrupts.
void TIM5_OC1FastConfig (FunctionalState NewState)
 Configures the TIM5 Capture Compare 1 Fast feature.
void TIM5_OC1Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity, TIM5_OCIdleState_TypeDef TIM5_OCIdleState)
 Initializes the TIM5 Channel1 according to the specified parameters.
void TIM5_OC1PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity)
 Configures the TIM5 Channel 1 polarity.
void TIM5_OC1PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM5 peripheral Preload Register on CCR1.
void TIM5_OC2FastConfig (FunctionalState NewState)
 Configures the TIM5 Capture Compare 2 Fast feature.
void TIM5_OC2Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity, TIM5_OCIdleState_TypeDef TIM5_OCIdleState)
 Initializes the TIM5 Channel2 according to the specified parameters.
void TIM5_OC2PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity)
 Configures the TIM5 Channel 2 polarity.
void TIM5_OC2PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM5 peripheral Preload Register on CCR2.
void TIM5_PrescalerConfig (TIM5_Prescaler_TypeDef Prescaler, TIM5_PSCReloadMode_TypeDef TIM5_PSCReloadMode)
 Configures the TIM5 Prescaler.
void TIM5_PWMIConfig (TIM5_Channel_TypeDef TIM5_Channel, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, TIM5_ICSelection_TypeDef TIM5_ICSelection, TIM5_ICPSC_TypeDef TIM5_ICPrescaler, uint8_t TIM5_ICFilter)
 Configures the TIM5 peripheral in PWM Input Mode according to the specified parameters.
void TIM5_SelectCCDMA (FunctionalState NewState)
 Selects the TIM5 peripheral Capture Compare DMA source.
void TIM5_SelectHallSensor (FunctionalState NewState)
 Enables or Disables the TIM�s Hall sensor interface.
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_SelectOCxM (TIM5_Channel_TypeDef TIM5_Channel, TIM5_OCMode_TypeDef TIM5_OCMode)
 Selects the TIM5 Output Compare Mode.
void TIM5_SelectOnePulseMode (TIM5_OPMode_TypeDef TIM5_OPMode)
 Selects the TIM�s One Pulse 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.
void TIM5_SetAutoreload (uint16_t Autoreload)
 Sets the TIM5 Autoreload Register value.
void TIM5_SetCompare1 (uint16_t Compare)
 Sets the TIM5 Capture Compare1 Register value.
void TIM5_SetCompare2 (uint16_t Compare)
 Sets the TIM5 Capture Compare2 Register value.
void TIM5_SetCounter (uint16_t Counter)
 Sets the TIM5 Counter Register value.
void TIM5_SetIC1Prescaler (TIM5_ICPSC_TypeDef TIM5_IC1Prescaler)
 Sets the TIM5 Input Capture 1 prescaler.
void TIM5_SetIC2Prescaler (TIM5_ICPSC_TypeDef TIM5_IC2Prescaler)
 Sets the TIM5 Input Capture 2 prescaler.
void TIM5_TimeBaseInit (TIM5_Prescaler_TypeDef TIM5_Prescaler, TIM5_CounterMode_TypeDef TIM5_CounterMode, uint16_t TIM5_Period)
 Initializes the TIM5 Time Base Unit according to the specified parameters.
void TIM5_TIxExternalClockConfig (TIM5_TIxExternalCLK1Source_TypeDef TIM5_TIxExternalCLKSource, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, uint8_t ICFilter)
 Configures the TIM5 Trigger as External Clock.
void TIM5_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM5 Update event.
void TIM5_UpdateRequestConfig (TIM5_UpdateSource_TypeDef TIM5_UpdateSource)
 Selects the TIM5 Update Request Interrupt source.

Detailed Description

TIM5 driver modules.


Function Documentation

void TIM5_ARRPreloadConfig ( FunctionalState  NewState)

Enables or disables TIM5 peripheral Preload register on ARR.

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

Definition at line 436 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR1_ARPE.

void TIM5_BKRConfig ( TIM5_OSSIState_TypeDef  TIM5_OSSIState,
TIM5_LockLevel_TypeDef  TIM5_LockLevel,
TIM5_BreakState_TypeDef  TIM5_BreakState,
TIM5_BreakPolarity_TypeDef  TIM5_BreakPolarity,
TIM5_AutomaticOutput_TypeDef  TIM5_AutomaticOutput 
)

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

Parameters:
TIM5_OSSIState,:Off-State Selection for Idle mode states. This parameter can be one of the following values:
  • TIM5_OSSIState_Enable: Off-State Selection for Idle mode enabled
  • TIM5_OSSIState_Disable: Off-State Selection for Idle mode disabled
TIM5_LockLevel,:Lock level. This parameter can be one of the following values:
  • TIM5_LockLevel_Off: Lock option disabled
  • TIM5_LockLevel_1: Select Lock Level 1
  • TIM5_LockLevel_2: Select Lock Level 2
  • TIM5_LockLevel_3: Select Lock Level 3
TIM5_BreakState,:Break Input enable/disable . This parameter can be one of the following values:
  • TIM5_BreakState_Disable: Break State disabled (break option disabled)
  • TIM5_BreakState_Enable: Break State enabled (break option enabled)
TIM5_BreakPolarity,:Break Polarity. This parameter can be one of the following values:
  • TIM5_BreakPolarity_High: if Break, channel polarity = High
  • TIM5_BreakPolarity_Low: if Break, channel polarity = Low
TIM5_AutomaticOutput,:TIM5 AOE Bit Set/Reset . This parameter can be one of the following values:
  • TIM5_AutomaticOutput_Enable: Automatic Output option enabled
  • TIM5_AutomaticOutput_Disable: Automatic Output option disabled
Return values:
None

Definition at line 748 of file stm8l15x_tim5.c.

References IS_TIM5_AUTOMATIC_OUTPUT_STATE, IS_TIM5_BREAK_POLARITY, IS_TIM5_BREAK_STATE, IS_TIM5_LOCK_LEVEL, IS_TIM5_OSSI_STATE, and TIM5.

void TIM5_CCxCmd ( TIM5_Channel_TypeDef  TIM5_Channel,
FunctionalState  NewState 
)

Enables or disables the TIM5 Capture Compare Channel x.

Parameters:
TIM5_Channel,:Specifies the TIM5 Channel. This parameter can be one of the following values:
  • TIM5_Channel_1: Channel 1
  • TIM5_Channel_2: Channel 2
NewState,:Specifies the TIM5 Channel CCxE bit new state. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 1068 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM5_CHANNEL, TIM5, TIM5_Channel_1, TIM_CCER1_CC1E, and TIM_CCER1_CC2E.

void TIM5_ClearFlag ( TIM5_FLAG_TypeDef  TIM5_FLAG)

Clears the TIM�s pending flags.

Parameters:
TIM5_FLAG,:Specifies the flag to clear. This parameter can be any combination of the following values:
  • TIM5_FLAG_Update: Update
  • TIM5_FLAG_CC1: Capture Compare Channel1
  • TIM5_FLAG_CC2: Capture Compare Channel2
  • TIM5_FLAG_Trigger: Trigger
  • TIM5_FLAG_Break: Break
Return values:
None

Definition at line 1500 of file stm8l15x_tim5.c.

References IS_TIM5_CLEAR_FLAG, and TIM5.

void TIM5_ClearITPendingBit ( TIM5_IT_TypeDef  TIM5_IT)

Clears the TIM's interrupt pending bits.

Parameters:
TIM5_IT,:Specifies the pending bit to clear. This parameter can be any combination of the following values:
  • TIM5_IT_Update: Update
  • TIM5_IT_CC1: Capture Compare Channel1
  • TIM5_IT_CC2: Capture Compare Channel2
  • TIM5_IT_Trigger: Trigger
  • TIM5_IT_Break: Break
Return values:
None

Definition at line 1555 of file stm8l15x_tim5.c.

References IS_TIM5_IT, and TIM5.

void TIM5_Cmd ( FunctionalState  NewState)

Enables or disables the TIM5 peripheral.

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

Definition at line 482 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR1_CEN.

void TIM5_CounterModeConfig ( TIM5_CounterMode_TypeDef  TIM5_CounterMode)

Specifies the TIM5 Counter Mode to be used.

Parameters:
TIM5_CounterMode,:Specifies the Counter Mode to be used This parameter can be one of the following values:
  • TIM5_CounterMode_Up: Counter Up Mode
  • TIM5_CounterMode_Down: Counter Down Mode
  • TIM5_CounterMode_CenterAligned1: Counter Central aligned Mode 1
  • TIM5_CounterMode_CenterAligned2: Counter Central aligned Mode 2
  • TIM5_CounterMode_CenterAligned3: Counter Central aligned Mode 3
Return values:
None

Definition at line 300 of file stm8l15x_tim5.c.

References IS_TIM5_COUNTER_MODE, TIM5, TIM_CR1_CMS, and TIM_CR1_DIR.

void TIM5_CtrlPWMOutputs ( FunctionalState  NewState)

Enables or disables the TIM5 peripheral Main Outputs.

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

Definition at line 777 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_BKR_MOE.

void TIM5_DMACmd ( TIM5_DMASource_TypeDef  TIM5_DMASource,
FunctionalState  NewState 
)

Enables or disables the TIM5 DMA Requests.

Parameters:
TIM5_DMASource,:specifies the DMA Request sources. This parameter can be any combination of the following values:
  • TIM5_DMASource_Update: TIM5 DMA Update Request
  • TIM5_DMASource_CC1: TIM5 DMA CC1 Request
  • TIM5_DMASource_CC2: TIM5 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_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM5_DMA_SOURCE, and TIM5.

void TIM5_EncoderInterfaceConfig ( TIM5_EncoderMode_TypeDef  TIM5_EncoderMode,
TIM5_ICPolarity_TypeDef  TIM5_IC1Polarity,
TIM5_ICPolarity_TypeDef  TIM5_IC2Polarity 
)

Configures the TIM5 Encoder Interface.

Parameters:
TIM5_EncoderMode,:Specifies the TIM5 Encoder Mode. This parameter can be one of the following values:
  • TIM5_EncoderMode_TI1: Encoder mode 1
  • TIM5_EncoderMode_TI2: Encoder mode 2
  • TIM5_EncoderMode_TI12: Encoder mode 3
TIM5_IC1Polarity,:Specifies the IC1 Polarity. This parameter can be one of the following values:
  • TIM5_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM5_ICPolarity_Falling: Input Capture on Falling Edge
TIM5_IC2Polarity,:Specifies the IC2 Polarity. This parameter can be one of the following values:
  • TIM5_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM5_ICPolarity_Falling: Input Capture on Falling Edge
Return values:
None

Definition at line 1952 of file stm8l15x_tim5.c.

References IS_TIM5_ENCODER_MODE, IS_TIM5_IC_POLARITY, TIM5, TIM5_ICPolarity_Falling, TIM_CCER1_CC1P, TIM_CCER1_CC2P, TIM_CCMR_CCxS, TIM_CCMR_TIxDirect_Set, TIM_SMCR_MSM, and TIM_SMCR_TS.

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

Configures the TIM5 External clock Mode1.

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

References TIM5, TIM5_ETRConfig(), TIM5_SlaveMode_External1, TIM5_TRGSelection_ETRF, TIM_SMCR_SMS, and TIM_SMCR_TS.

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

Configures the TIM5 External clock Mode2.

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

References TIM5, TIM5_ETRConfig(), and TIM_ETR_ECE.

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_ForcedOC1Config ( TIM5_ForcedAction_TypeDef  TIM5_ForcedAction)

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

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

Definition at line 877 of file stm8l15x_tim5.c.

References IS_TIM5_FORCED_ACTION, TIM5, and TIM_CCMR_OCM.

void TIM5_ForcedOC2Config ( TIM5_ForcedAction_TypeDef  TIM5_ForcedAction)

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

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

Definition at line 903 of file stm8l15x_tim5.c.

References IS_TIM5_FORCED_ACTION, TIM5, and TIM_CCMR_OCM.

void TIM5_GenerateEvent ( TIM5_EventSource_TypeDef  TIM5_EventSource)

Configures the TIM5 event to be generated by software.

Parameters:
TIM5_EventSource,:Specifies the event source. This parameter can be any combination of the following values:
  • TIM5_EventSource_Update: Update
  • TIM5_EventSource_CC1: Capture Compare Channel1
  • TIM5_EventSource_CC2: Capture Compare Channel2
  • TIM5_EventSource_Trigger: Trigger
  • TIM5_EventSource_Break: Break
Return values:
None

Definition at line 1445 of file stm8l15x_tim5.c.

References IS_TIM5_EVENT_SOURCE, and TIM5.

uint16_t TIM5_GetCapture1 ( void  )

Gets the TIM5 Input Capture 1 value.

Parameters:
None
Return values:
CaptureCompare 1 Register value.

Definition at line 1298 of file stm8l15x_tim5.c.

References TIM5.

uint16_t TIM5_GetCapture2 ( void  )

Gets the TIM5 Input Capture 2 value.

Parameters:
None
Return values:
CaptureCompare 2 Register value.

Definition at line 1317 of file stm8l15x_tim5.c.

References TIM5.

uint16_t TIM5_GetCounter ( void  )

Gets the TIM5 Counter value.

Parameters:
None
Return values:
CounterRegister value.

Definition at line 350 of file stm8l15x_tim5.c.

References TIM5.

FlagStatus TIM5_GetFlagStatus ( TIM5_FLAG_TypeDef  TIM5_FLAG)

Checks whether the specified TIM5 flag is set or not.

Parameters:
TIM5_FLAG,:Specifies the flag to check. This parameter can be any combination of the following values:
  • TIM5_FLAG_Update: Update
  • TIM5_FLAG_CC1: Capture Compare Channel1
  • TIM5_FLAG_CC2: Capture Compare Channel2
  • TIM5_FLAG_Trigger: Trigger
  • TIM5_FLAG_Break: Break
  • TIM5_FLAG_CC1OF: Capture compare 1 over capture
  • TIM5_FLAG_CC2OF: Capture compare 2 over capture
Return values:
FlagStatus,:The new state of TIM5_FLAG (SET or RESET)

Definition at line 1467 of file stm8l15x_tim5.c.

References IS_TIM5_GET_FLAG, RESET, SET, and TIM5.

ITStatus TIM5_GetITStatus ( TIM5_IT_TypeDef  TIM5_IT)

Checks whether the TIM5 interrupt has occurred or not.

Parameters:
TIM5_IT,:Specifies the TIM5 interrupt source to check. This parameter can be any combination of the following values:
  • TIM5_IT_Update: Update
  • TIM5_IT_CC1: Capture Compare Channel1
  • TIM5_IT_CC2: Capture Compare Channel2
  • TIM5_IT_Trigger: Trigger
  • TIM5_IT_Break: Break
Return values:
ITStatus,:The new state of the TIM5_IT (SET or RESET)

Definition at line 1520 of file stm8l15x_tim5.c.

References IS_TIM5_GET_IT, RESET, SET, and TIM5.

TIM5_Prescaler_TypeDef TIM5_GetPrescaler ( void  )

Gets the TIM5 Prescaler value.

Parameters:
None
Return values:
TIM5Prescaler, it can be one of the following values:
  • TIM5_Prescaler_1: Time base Prescaler = 1 (No effect)
  • TIM5_Prescaler_2: Time base Prescaler = 2
  • TIM5_Prescaler_4: Time base Prescaler = 4
  • TIM5_Prescaler_8: Time base Prescaler = 8
  • TIM5_Prescaler_16: Time base Prescaler = 16
  • TIM5_Prescaler_32: Time base Prescaler = 32
  • TIM5_Prescaler_64: Time base Prescaler = 64
  • TIM5_Prescaler_128: Time base Prescaler = 128

Definition at line 377 of file stm8l15x_tim5.c.

References TIM5.

void TIM5_ICInit ( TIM5_Channel_TypeDef  TIM5_Channel,
TIM5_ICPolarity_TypeDef  TIM5_ICPolarity,
TIM5_ICSelection_TypeDef  TIM5_ICSelection,
TIM5_ICPSC_TypeDef  TIM5_ICPrescaler,
uint8_t  TIM5_ICFilter 
)

Initializes the TIM5 peripheral according to the specified parameters.

Parameters:
TIM5_Channel,:TIM5 Channel This parameter can be one of the following values:
  • TIM5_Channel_1: Channel 1
  • TIM5_Channel_2: Channel 2
TIM5_ICPolarity,:Input Capture Polarity This parameter can be one of the following values:
  • TIM5_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM5_ICPolarity_Falling: Input Capture on Falling Edge
TIM5_ICSelection,:Input Capture Selection This parameter can be one of the following values:
  • TIM5_ICSelection_DirectTI: Input Capture mapped on the direct input
  • TIM5_ICSelection_IndirectTI: Input Capture mapped on the indirect input
  • TIM5_ICSelection_TRGI: Input Capture mapped on the Trigger Input
TIM5_ICPrescaler,:Input Capture Prescaler This parameter can be one of the following values:
  • TIM5_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM5_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM5_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM5_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
TIM5_ICFilter,:This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 1178 of file stm8l15x_tim5.c.

References IS_TIM5_CHANNEL, TI1_Config(), TI2_Config(), TIM5_Channel_1, TIM5_SetIC1Prescaler(), and TIM5_SetIC2Prescaler().

void TIM5_InternalClockConfig ( void  )

Enables the TIM5 internal Clock.

Parameters:
None
Return values:
None

Definition at line 1638 of file stm8l15x_tim5.c.

References TIM5, and TIM_SMCR_SMS.

void TIM5_ITConfig ( TIM5_IT_TypeDef  TIM5_IT,
FunctionalState  NewState 
)

Enables or disables the specified TIM5 interrupts.

Parameters:
TIM5_IT,:Specifies the TIM5 interrupts sources to be enabled or disabled. This parameter can be any combination of the following values:
  • TIM5_IT_Update: Update
  • TIM5_IT_CC1: Capture Compare Channel1
  • TIM5_IT_CC2: Capture Compare Channel2
  • TIM5_IT_Trigger: Trigger
  • TIM5_IT_Break: Break
NewState,:The new state of the TIM5 peripheral. This parameter can be ENABLE or DISABLE
Return values:
None

Definition at line 1416 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM5_IT, and TIM5.

void TIM5_OC1FastConfig ( FunctionalState  NewState)

Configures the TIM5 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_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CCMR_OCxFE.

void TIM5_OC1Init ( TIM5_OCMode_TypeDef  TIM5_OCMode,
TIM5_OutputState_TypeDef  TIM5_OutputState,
uint16_t  TIM5_Pulse,
TIM5_OCPolarity_TypeDef  TIM5_OCPolarity,
TIM5_OCIdleState_TypeDef  TIM5_OCIdleState 
)

Initializes the TIM5 Channel1 according to the specified parameters.

Parameters:
TIM5_OCMode,:Output Compare Mode This parameter can be one of the following values:
  • TIM5_OCMode_Timing: Timing (Frozen) Mode
  • TIM5_OCMode_Active: Active Mode
  • TIM5_OCMode_Inactive: Inactive Mode
  • TIM5_OCMode_Toggle: Toggle Mode
  • TIM5_OCMode_PWM1: PWM Mode 1
  • TIM5_OCMode_PWM2: PWM Mode 2
TIM5_OutputState,:Output state This parameter can be one of the following values:
  • TIM5_OutputState_Disable: Output compare State disabled (channel output disabled)
  • TIM5_OutputState_Enable: Output compare State enabled (channel output enabled)
TIM5_Pulse,:This parameter must be a value between 0x0000 and 0xFFFF.
TIM5_OCPolarity,:Polarity This parameter can be one of the following values:
  • TIM5_OCPolarity_High: Output compare polarity = High
  • TIM5_OCPolarity_Low: Output compare polarity = Low
TIM5_OCIdleState,:Output Compare Idle State This parameter can be one of the following values:
  • TIM5_OCIdleState_Reset: Output Compare Idle state = Reset
  • TIM5_OCIdleState_Set: Output Compare Idle state = Set
Return values:
None

Definition at line 572 of file stm8l15x_tim5.c.

References IS_TIM5_OC_MODE, IS_TIM5_OC_POLARITY, IS_TIM5_OCIDLE_STATE, IS_TIM5_OUTPUT_STATE, TIM5, TIM5_OCIdleState_Set, TIM5_OCPolarity_Low, TIM5_OutputState_Enable, TIM_CCER1_CC1E, TIM_CCER1_CC1P, TIM_CCMR_OCM, and TIM_OISR_OIS1.

void TIM5_OC1PolarityConfig ( TIM5_OCPolarity_TypeDef  TIM5_OCPolarity)

Configures the TIM5 Channel 1 polarity.

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

Definition at line 1018 of file stm8l15x_tim5.c.

References IS_TIM5_OC_POLARITY, TIM5, TIM5_OCPolarity_Low, and TIM_CCER1_CC1P.

void TIM5_OC1PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM5 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_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CCMR_OCxPE.

void TIM5_OC2FastConfig ( FunctionalState  NewState)

Configures the TIM5 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_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CCMR_OCxFE.

void TIM5_OC2Init ( TIM5_OCMode_TypeDef  TIM5_OCMode,
TIM5_OutputState_TypeDef  TIM5_OutputState,
uint16_t  TIM5_Pulse,
TIM5_OCPolarity_TypeDef  TIM5_OCPolarity,
TIM5_OCIdleState_TypeDef  TIM5_OCIdleState 
)

Initializes the TIM5 Channel2 according to the specified parameters.

Parameters:
TIM5_OCMode,:Output Compare Mode This parameter can be one of the following values:
  • TIM5_OCMode_Timing: Timing (Frozen) Mode
  • TIM5_OCMode_Active: Active Mode
  • TIM5_OCMode_Inactive: Inactive Mode
  • TIM5_OCMode_Toggle: Toggle Mode
  • TIM5_OCMode_PWM1: PWM Mode 1
  • TIM5_OCMode_PWM2: PWM Mode 2
TIM5_OutputState,:Output state This parameter can be one of the following values:
  • TIM5_OutputState_Disable: Output compare State disabled (channel output disabled)
  • TIM5_OutputState_Enable: Output compare State enabled (channel output enabled)
TIM5_Pulse,:This parameter must be a value between 0x0000 and 0xFFFF.
TIM5_OCPolarity,:Polarity This parameter can be one of the following values:
  • TIM5_OCPolarity_High: Output compare polarity = High
  • TIM5_OCPolarity_Low: Output compare polarity = Low
TIM5_OCIdleState,:Output Compare Idle State This parameter can be one of the following values:
  • TIM5_OCIdleState_Reset: Output Compare Idle state = Reset
  • TIM5_OCIdleState_Set: Output Compare Idle state = Set
Return values:
None

Definition at line 658 of file stm8l15x_tim5.c.

References IS_TIM5_OC_MODE, IS_TIM5_OC_POLARITY, IS_TIM5_OCIDLE_STATE, IS_TIM5_OUTPUT_STATE, TIM5, TIM5_OCIdleState_Set, TIM5_OCPolarity_Low, TIM5_OutputState_Enable, TIM_CCER1_CC2E, TIM_CCER1_CC2P, TIM_CCMR_OCM, and TIM_OISR_OIS2.

void TIM5_OC2PolarityConfig ( TIM5_OCPolarity_TypeDef  TIM5_OCPolarity)

Configures the TIM5 Channel 2 polarity.

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

Definition at line 1042 of file stm8l15x_tim5.c.

References IS_TIM5_OC_POLARITY, TIM5, TIM5_OCPolarity_Low, and TIM_CCER1_CC2P.

void TIM5_OC2PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM5 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_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CCMR_OCxPE.

void TIM5_PrescalerConfig ( TIM5_Prescaler_TypeDef  Prescaler,
TIM5_PSCReloadMode_TypeDef  TIM5_PSCReloadMode 
)

Configures the TIM5 Prescaler.

Parameters:
Prescaler,:Specifies the Prescaler Register value This parameter can be one of the following values:
  • TIM5_Prescaler_1: Time base Prescaler = 1 (No effect)
  • TIM5_Prescaler_2: Time base Prescaler = 2
  • TIM5_Prescaler_4: Time base Prescaler = 4
  • TIM5_Prescaler_8: Time base Prescaler = 8
  • TIM5_Prescaler_16: Time base Prescaler = 16
  • TIM5_Prescaler_32: Time base Prescaler = 32
  • TIM5_Prescaler_64: Time base Prescaler = 64
  • TIM5_Prescaler_128: Time base Prescaler = 128
TIM5_PSCReloadMode,:Specifies the TIM5 Prescaler Reload mode. This parameter can be one of the following values:
  • TIM5_PSCReloadMode_Update: Prescaler value is reloaded at every update
  • TIM5_PSCReloadMode_Immediate: Prescaler value is reloaded at every update
Return values:
None

Definition at line 268 of file stm8l15x_tim5.c.

References IS_TIM5_PRESCALER, IS_TIM5_PRESCALER_RELOAD, TIM5, TIM5_PSCReloadMode_Immediate, and TIM_EGR_UG.

void TIM5_PWMIConfig ( TIM5_Channel_TypeDef  TIM5_Channel,
TIM5_ICPolarity_TypeDef  TIM5_ICPolarity,
TIM5_ICSelection_TypeDef  TIM5_ICSelection,
TIM5_ICPSC_TypeDef  TIM5_ICPrescaler,
uint8_t  TIM5_ICFilter 
)

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

Parameters:
TIM5_Channel,:TIM5 Channel This parameter can be one of the following values:
  • TIM5_Channel_1: Channel 1
  • TIM5_Channel_2: Channel 2
TIM5_ICPolarity,:Input Capture Polarity This parameter can be one of the following values:
  • TIM5_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM5_ICPolarity_Falling: Input Capture on Falling Edge
TIM5_ICSelection,:Input Capture Selection This parameter can be one of the following values:
  • TIM5_ICSelection_DirectTI: Input Capture mapped on the direct input
  • TIM5_ICSelection_IndirectTI: Input Capture mapped on the indirect input
  • TIM5_ICSelection_TRGI: Input Capture mapped on the Trigger Input
TIM5_ICPrescaler,:Input Capture Prescaler This parameter can be one of the following values:
  • TIM5_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM5_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM5_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM5_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1229 of file stm8l15x_tim5.c.

References IS_TIM5_CHANNEL, TI1_Config(), TI2_Config(), TIM5_Channel_1, TIM5_ICPolarity_Falling, TIM5_ICPolarity_Rising, TIM5_ICSelection_DirectTI, TIM5_ICSelection_IndirectTI, TIM5_SetIC1Prescaler(), and TIM5_SetIC2Prescaler().

void TIM5_SelectCCDMA ( FunctionalState  NewState)

Selects the TIM5 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_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR2_CCDS.

void TIM5_SelectHallSensor ( FunctionalState  NewState)

Enables or Disables the TIM�s Hall sensor interface.

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

Definition at line 2009 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR2_TI1S.

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_SelectOCxM ( TIM5_Channel_TypeDef  TIM5_Channel,
TIM5_OCMode_TypeDef  TIM5_OCMode 
)

Selects the TIM5 Output Compare Mode.

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

Parameters:
TIM5_Channel,:Specifies the TIM5 Channel. This parameter can be one of the following values:
  • TIM5_Channel_1: Channel 1
  • TIM5_Channel_2: Channel 2
TIM5_OCMode,:Specifies the TIM5 Output Compare Mode. This parameter can be one of the following values:
  • TIM5_OCMode_Timing: Timing (Frozen) Mode
  • TIM5_OCMode_Active: Active Mode
  • TIM5_OCMode_Inactive: Inactive Mode
  • TIM5_OCMode_Toggle: Toggle Mode
  • TIM5_OCMode_PWM1: PWM Mode 1
  • TIM5_OCMode_PWM2: PWM Mode 2
Return values:
None

Definition at line 812 of file stm8l15x_tim5.c.

References IS_TIM5_CHANNEL, IS_TIM5_OCM, TIM5, TIM5_Channel_1, TIM_CCER1_CC1E, TIM_CCER1_CC2E, and TIM_CCMR_OCM.

void TIM5_SelectOnePulseMode ( TIM5_OPMode_TypeDef  TIM5_OPMode)

Selects the TIM�s One Pulse Mode.

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

Definition at line 460 of file stm8l15x_tim5.c.

References IS_TIM5_OPM_MODE, TIM5, TIM5_OPMode_Single, and TIM_CR1_OPM.

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.

void TIM5_SetAutoreload ( uint16_t  Autoreload)

Sets the TIM5 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_tim5.c.

References TIM5.

void TIM5_SetCompare1 ( uint16_t  Compare)

Sets the TIM5 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_tim5.c.

References TIM5.

void TIM5_SetCompare2 ( uint16_t  Compare)

Sets the TIM5 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_tim5.c.

References TIM5.

void TIM5_SetCounter ( uint16_t  Counter)

Sets the TIM5 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_tim5.c.

References TIM5.

void TIM5_SetIC1Prescaler ( TIM5_ICPSC_TypeDef  TIM5_IC1Prescaler)

Sets the TIM5 Input Capture 1 prescaler.

Parameters:
TIM5_IC1Prescaler,:Specifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM5_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM5_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM5_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM5_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1341 of file stm8l15x_tim5.c.

References IS_TIM5_IC_PRESCALER, TIM5, and TIM_CCMR_ICxPSC.

Referenced by TIM5_ICInit(), and TIM5_PWMIConfig().

void TIM5_SetIC2Prescaler ( TIM5_ICPSC_TypeDef  TIM5_IC2Prescaler)

Sets the TIM5 Input Capture 2 prescaler.

Parameters:
TIM5_IC2Prescaler,:Specifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM5_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM5_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM5_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM5_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1369 of file stm8l15x_tim5.c.

References IS_TIM5_IC_PRESCALER, TIM5, and TIM_CCMR_ICxPSC.

Referenced by TIM5_ICInit(), and TIM5_PWMIConfig().

void TIM5_TimeBaseInit ( TIM5_Prescaler_TypeDef  TIM5_Prescaler,
TIM5_CounterMode_TypeDef  TIM5_CounterMode,
uint16_t  TIM5_Period 
)

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

Parameters:
TIM5_Prescaler,:Prescaler This parameter can be one of the following values:
  • TIM5_Prescaler_1: Time base Prescaler = 1 (No effect)
  • TIM5_Prescaler_2: Time base Prescaler = 2
  • TIM5_Prescaler_4: Time base Prescaler = 4
  • TIM5_Prescaler_8: Time base Prescaler = 8
  • TIM5_Prescaler_16: Time base Prescaler = 16
  • TIM5_Prescaler_32: Time base Prescaler = 32
  • TIM5_Prescaler_64: Time base Prescaler = 64
  • TIM5_Prescaler_128: Time base Prescaler = 128
TIM5_CounterMode,:Counter mode This parameter can be one of the following values:
  • TIM5_CounterMode_Up: Counter Up Mode
  • TIM5_CounterMode_Down: Counter Down Mode
  • TIM5_CounterMode_CenterAligned1: Counter Central aligned Mode 1
  • TIM5_CounterMode_CenterAligned2: Counter Central aligned Mode 2
  • TIM5_CounterMode_CenterAligned3: Counter Central aligned Mode 3
TIM5_Period,:This parameter must be a value between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 225 of file stm8l15x_tim5.c.

References IS_TIM5_COUNTER_MODE, IS_TIM5_PRESCALER, TIM5, TIM5_EventSource_Update, TIM_CR1_CMS, and TIM_CR1_DIR.

void TIM5_TIxExternalClockConfig ( TIM5_TIxExternalCLK1Source_TypeDef  TIM5_TIxExternalCLKSource,
TIM5_ICPolarity_TypeDef  TIM5_ICPolarity,
uint8_t  ICFilter 
)

Configures the TIM5 Trigger as External Clock.

Parameters:
TIM5_TIxExternalCLKSource,:Specifies Trigger source. This parameter can be one of the following values:
  • TIM5_TIxExternalCLK1Source_TI1ED: External Clock mode 1 source = TI1ED
  • TIM5_TIxExternalCLK1Source_TI1: External Clock mode 1 source = TI1
  • TIM5_TIxExternalCLK1Source_TI2: External Clock mode 1 source = TI2
TIM5_ICPolarity,:Specifies the TIx Polarity. This parameter can be one of the following values:
  • TIM5_ICPolarity_Rising: Input Capture on Rising Edge
  • TIM5_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_tim5.c.

References IS_TIM5_IC_FILTER, IS_TIM5_IC_POLARITY, IS_TIM5_TIXCLK_SOURCE, TI1_Config(), TI2_Config(), TIM5, TIM5_ICSelection_DirectTI, TIM5_SelectInputTrigger(), TIM5_SlaveMode_External1, and TIM5_TIxExternalCLK1Source_TI2.

void TIM5_UpdateDisableConfig ( FunctionalState  NewState)

Enables or Disables the TIM5 Update event.

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

Definition at line 390 of file stm8l15x_tim5.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM5, and TIM_CR1_UDIS.

void TIM5_UpdateRequestConfig ( TIM5_UpdateSource_TypeDef  TIM5_UpdateSource)

Selects the TIM5 Update Request Interrupt source.

Parameters:
TIM5_UpdateSource,:Specifies the Update source. This parameter can be one of the following values:
  • TIM5_UpdateSource_Global: Global Update request source
  • TIM5_UpdateSource_Regular: Regular Update request source
Return values:
None

Definition at line 414 of file stm8l15x_tim5.c.

References IS_TIM5_UPDATE_SOURCE, TIM5, TIM5_UpdateSource_Regular, and TIM_CR1_URS.

STM8S Firmware Library: Overview

 

 

 

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