STM8L15x Standard Peripherals Drivers: TIM1

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

TIM1 driver modules. More...

Modules

 TIM1_Exported_Types
 TIM1_Exported_Macros
 TIM1_Private_Functions_Prototypes
 TIM1_Private_Functions

Functions

void TIM1_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM1 peripheral Preload register on ARR.
void TIM1_BDTRConfig (TIM1_OSSIState_TypeDef TIM1_OSSIState, TIM1_LockLevel_TypeDef TIM1_LockLevel, uint8_t TIM1_DeadTime, TIM1_BreakState_TypeDef TIM1_Break, TIM1_BreakPolarity_TypeDef TIM1_BreakPolarity, TIM1_AutomaticOutput_TypeDef TIM1_AutomaticOutput)
 Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).
void TIM1_CCPreloadControl (FunctionalState NewState)
 Sets or Resets the TIM1 peripheral Capture Compare Preload Control bit.
void TIM1_CCxCmd (TIM1_Channel_TypeDef TIM1_Channel, FunctionalState NewState)
 Enables or disables the TIM1 Capture Compare Channel x (x=1,..,4).
void TIM1_CCxNCmd (TIM1_Channel_TypeDef TIM1_Channel, FunctionalState NewState)
 Enables or disables the TIM1 Capture Compare Channel xN (xN=1,..,3).
void TIM1_ClearFlag (TIM1_FLAG_TypeDef TIM1_FLAG)
 Clears the TIM1�s pending flags.
void TIM1_ClearITPendingBit (TIM1_IT_TypeDef TIM1_IT)
 Clears the TIM1's interrupt pending bits.
void TIM1_ClearOC1Ref (FunctionalState NewState)
 Clears or safeguards the OC1REF signal.
void TIM1_ClearOC2Ref (FunctionalState NewState)
 Clears or safeguards the OC2REF signal.
void TIM1_ClearOC3Ref (FunctionalState NewState)
 Clears or safeguards the OC3REF signal.
void TIM1_ClearOC4Ref (FunctionalState NewState)
 Clears or safeguards the OC4REF signal.
void TIM1_Cmd (FunctionalState NewState)
 Enables or disables the TIM1 peripheral.
void TIM1_CounterModeConfig (TIM1_CounterMode_TypeDef TIM1_CounterMode)
 Specifies the TIM1 Counter Mode to be used.
void TIM1_CtrlPWMOutputs (FunctionalState NewState)
 Enables or disables the TIM1 peripheral Main Outputs.
void TIM1_DeInit (void)
 Deinitializes the TIM1 peripheral registers to their default reset values.
void TIM1_DMACmd (TIM1_DMASource_TypeDef TIM1_DMASource, FunctionalState NewState)
 Enables or disables the TIM�s DMA Requests.
void TIM1_DMAConfig (TIM1_DMABase_TypeDef TIM1_DMABase, TIM1_DMABurstLength_TypeDef TIM1_DMABurstLength)
 Configures the TIM1�s DMA interface.
void TIM1_EncoderInterfaceConfig (TIM1_EncoderMode_TypeDef TIM1_EncoderMode, TIM1_ICPolarity_TypeDef TIM1_IC1Polarity, TIM1_ICPolarity_TypeDef TIM1_IC2Polarity)
 Configures the TIM1 Encoder Interface.
void TIM1_ETRClockMode1Config (TIM1_ExtTRGPSC_TypeDef TIM1_ExtTRGPrescaler, TIM1_ExtTRGPolarity_TypeDef TIM1_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM1 External clock Mode1.
void TIM1_ETRClockMode2Config (TIM1_ExtTRGPSC_TypeDef TIM1_ExtTRGPrescaler, TIM1_ExtTRGPolarity_TypeDef TIM1_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM1 External clock Mode2.
void TIM1_ETRConfig (TIM1_ExtTRGPSC_TypeDef TIM1_ExtTRGPrescaler, TIM1_ExtTRGPolarity_TypeDef TIM1_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM1 External Trigger.
void TIM1_ForcedOC1Config (TIM1_ForcedAction_TypeDef TIM1_ForcedAction)
 Forces the TIM1 Channel1 output waveform to active or inactive level.
void TIM1_ForcedOC2Config (TIM1_ForcedAction_TypeDef TIM1_ForcedAction)
 Forces the TIM1 Channel2 output waveform to active or inactive level.
void TIM1_ForcedOC3Config (TIM1_ForcedAction_TypeDef TIM1_ForcedAction)
 Forces the TIM1 Channel3 output waveform to active or inactive level.
void TIM1_GenerateEvent (TIM1_EventSource_TypeDef TIM1_EventSource)
 Configures the TIM1 event to be generated by software.
uint16_t TIM1_GetCapture1 (void)
 Gets the TIM1 Input Capture 1 value.
uint16_t TIM1_GetCapture2 (void)
 Gets the TIM1 Input Capture 2 value.
uint16_t TIM1_GetCapture3 (void)
 Gets the TIM1 Input Capture 3 value.
uint16_t TIM1_GetCapture4 (void)
 Gets the TIM1 Input Capture 4 value.
uint16_t TIM1_GetCounter (void)
 Gets the TIM1 Counter value.
FlagStatus TIM1_GetFlagStatus (TIM1_FLAG_TypeDef TIM1_FLAG)
 Checks whether the specified TIM1 flag is set or not.
ITStatus TIM1_GetITStatus (TIM1_IT_TypeDef TIM1_IT)
 Checks whether the TIM1 interrupt has occurred or not.
uint16_t TIM1_GetPrescaler (void)
 Gets the TIM1 Prescaler value.
void TIM1_ICInit (TIM1_Channel_TypeDef TIM1_Channel, TIM1_ICPolarity_TypeDef TIM1_ICPolarity, TIM1_ICSelection_TypeDef TIM1_ICSelection, TIM1_ICPSC_TypeDef TIM1_ICPrescaler, uint8_t TIM1_ICFilter)
 Initializes the TIM1 peripheral according to the specified parameters.
void TIM1_InternalClockConfig (void)
 Configures the TIM1 internal Clock.
void TIM1_ITConfig (TIM1_IT_TypeDef TIM1_IT, FunctionalState NewState)
 Enables or disables the specified TIM1 interrupts.
void TIM1_OC1FastConfig (FunctionalState NewState)
 Configures the TIM1 Capture Compare 1 Fast feature.
void TIM1_OC1Init (TIM1_OCMode_TypeDef TIM1_OCMode, TIM1_OutputState_TypeDef TIM1_OutputState, TIM1_OutputNState_TypeDef TIM1_OutputNState, uint16_t TIM1_Pulse, TIM1_OCPolarity_TypeDef TIM1_OCPolarity, TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity, TIM1_OCIdleState_TypeDef TIM1_OCIdleState, TIM1_OCNIdleState_TypeDef TIM1_OCNIdleState)
 Initializes the TIM1 Channel1 according to the specified parameters.
void TIM1_OC1NPolarityConfig (TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity)
 Configures the TIM1 Channel 1N polarity.
void TIM1_OC1PolarityConfig (TIM1_OCPolarity_TypeDef TIM1_OCPolarity)
 Configures the TIM1 Channel 1 polarity.
void TIM1_OC1PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM1 peripheral Preload Register on CCR1.
void TIM1_OC2FastConfig (FunctionalState NewState)
 Configures the TIM1 Capture Compare 2 Fast feature.
void TIM1_OC2Init (TIM1_OCMode_TypeDef TIM1_OCMode, TIM1_OutputState_TypeDef TIM1_OutputState, TIM1_OutputNState_TypeDef TIM1_OutputNState, uint16_t TIM1_Pulse, TIM1_OCPolarity_TypeDef TIM1_OCPolarity, TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity, TIM1_OCIdleState_TypeDef TIM1_OCIdleState, TIM1_OCNIdleState_TypeDef TIM1_OCNIdleState)
 Initializes the TIM1 Channel2 according to the specified parameters.
void TIM1_OC2NPolarityConfig (TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity)
 Configures the TIM1 Channel 2N polarity.
void TIM1_OC2PolarityConfig (TIM1_OCPolarity_TypeDef TIM1_OCPolarity)
 Configures the TIM1 Channel 2 polarity.
void TIM1_OC2PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM1 peripheral Preload Register on CCR2.
void TIM1_OC3FastConfig (FunctionalState NewState)
 Configures the TIM1 Capture Compare 3 Fast feature.
void TIM1_OC3Init (TIM1_OCMode_TypeDef TIM1_OCMode, TIM1_OutputState_TypeDef TIM1_OutputState, TIM1_OutputNState_TypeDef TIM1_OutputNState, uint16_t TIM1_Pulse, TIM1_OCPolarity_TypeDef TIM1_OCPolarity, TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity, TIM1_OCIdleState_TypeDef TIM1_OCIdleState, TIM1_OCNIdleState_TypeDef TIM1_OCNIdleState)
 Initializes the TIM1 Channel3 according to the specified parameters.
void TIM1_OC3NPolarityConfig (TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity)
 Configures the TIM1 Channel 3N polarity.
void TIM1_OC3PolarityConfig (TIM1_OCPolarity_TypeDef TIM1_OCPolarity)
 Configures the TIM1 Channel 3 polarity.
void TIM1_OC3PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM1 peripheral Preload Register on CCR3.
void TIM1_OC4PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM1 peripheral Preload Register on CCR4.
void TIM1_PrescalerConfig (uint16_t Prescaler, TIM1_PSCReloadMode_TypeDef TIM1_PSCReloadMode)
 Configures the TIM1 Prescaler.
void TIM1_PWMIConfig (TIM1_Channel_TypeDef TIM1_Channel, TIM1_ICPolarity_TypeDef TIM1_ICPolarity, TIM1_ICSelection_TypeDef TIM1_ICSelection, TIM1_ICPSC_TypeDef TIM1_ICPrescaler, uint8_t TIM1_ICFilter)
 Configures the TIM1 peripheral in PWM Input Mode according to the specified parameters.
void TIM1_SelectCCDMA (FunctionalState NewState)
 Selects the TIM1 peripheral Capture Compare DMA source.
void TIM1_SelectCOM (FunctionalState NewState)
 Selects the TIM1 peripheral Commutation event.
void TIM1_SelectHallSensor (FunctionalState NewState)
 Enables or Disables the TIM�s Hall sensor interface.
void TIM1_SelectInputTrigger (TIM1_TRGSelection_TypeDef TIM1_InputTriggerSource)
 Selects the TIM1 Input Trigger source.
void TIM1_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM1 Master/Slave Mode.
void TIM1_SelectOCREFClear (TIM1_OCReferenceClear_TypeDef TIM1_OCReferenceClear)
 Selects the OCReference Clear source.
void TIM1_SelectOCxM (TIM1_Channel_TypeDef TIM1_Channel, TIM1_OCMode_TypeDef TIM1_OCMode)
 Selects the TIM1 Output Compare Mode.
void TIM1_SelectOnePulseMode (TIM1_OPMode_TypeDef TIM1_OPMode)
 Selects the TIM1�s One Pulse Mode.
void TIM1_SelectOutputTrigger (TIM1_TRGOSource_TypeDef TIM1_TRGOSource)
 Selects the TIM1 Trigger Output Mode.
void TIM1_SelectSlaveMode (TIM1_SlaveMode_TypeDef TIM1_SlaveMode)
 Selects the TIM1 Slave Mode.
void TIM1_SetAutoreload (uint16_t Autoreload)
 Sets the TIM1 Autoreload Register value.
void TIM1_SetCompare1 (uint16_t Compare1)
 Sets the TIM1 Capture Compare1 Register value.
void TIM1_SetCompare2 (uint16_t Compare2)
 Sets the TIM1 Capture Compare2 Register value.
void TIM1_SetCompare3 (uint16_t Compare3)
 Sets the TIM1 Capture Compare3 Register value.
void TIM1_SetCompare4 (uint16_t Compare4)
 Sets the TIM1 Capture Compare4 Register value.
void TIM1_SetCounter (uint16_t Counter)
 Sets the TIM1 Counter Register value.
void TIM1_SetIC1Prescaler (TIM1_ICPSC_TypeDef TIM1_IC1Prescaler)
 Sets the TIM1 Input Capture 1 prescaler.
void TIM1_SetIC2Prescaler (TIM1_ICPSC_TypeDef TIM1_IC2Prescaler)
 Sets the TIM1 Input Capture 2 prescaler.
void TIM1_SetIC3Prescaler (TIM1_ICPSC_TypeDef TIM1_IC3Prescaler)
 Sets the TIM1 Input Capture 3 prescaler.
void TIM1_SetIC4Prescaler (TIM1_ICPSC_TypeDef TIM1_IC4Prescaler)
 Sets the TIM1 Input Capture 4 prescaler.
void TIM1_TimeBaseInit (uint16_t TIM1_Prescaler, TIM1_CounterMode_TypeDef TIM1_CounterMode, uint16_t TIM1_Period, uint8_t TIM1_RepetitionCounter)
 Initializes the TIM1 Time Base Unit according to the specified parameters.
void TIM1_TIxExternalClockConfig (TIM1_TIxExternalCLK1Source_TypeDef TIM1_TIxExternalCLKSource, TIM1_ICPolarity_TypeDef TIM1_ICPolarity, uint8_t ICFilter)
 Configures the TIM1 Trigger as External Clock.
void TIM1_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM1 Update event.
void TIM1_UpdateRequestConfig (TIM1_UpdateSource_TypeDef TIM1_UpdateSource)
 Selects the TIM1 Update Request Interrupt source.

Detailed Description

TIM1 driver modules.


Function Documentation

void TIM1_ARRPreloadConfig ( FunctionalState  NewState)

Enables or disables TIM1 peripheral Preload register on ARR.

Parameters:
NewStatenew state of the TIM1 peripheral Preload register. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 420 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_ARPE.

void TIM1_BDTRConfig ( TIM1_OSSIState_TypeDef  TIM1_OSSIState,
TIM1_LockLevel_TypeDef  TIM1_LockLevel,
uint8_t  TIM1_DeadTime,
TIM1_BreakState_TypeDef  TIM1_Break,
TIM1_BreakPolarity_TypeDef  TIM1_BreakPolarity,
TIM1_AutomaticOutput_TypeDef  TIM1_AutomaticOutput 
)

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

Parameters:
TIM1_OSSIStatespecifies the OSSIS State This parameter can be one of the following values:
  • TIM1_OSSIState_Enable: OSSIS State enabled
  • TIM1_OSSIState_Disable: OSSIS State disabled
TIM1_LockLevelspecifies the lock level This parameter can be one of the following values:
  • TIM1_LockLevel_Off: No lock level
  • TIM1_LockLevel_1: Lock level 1
  • TIM1_LockLevel_2: Lock level 2
  • TIM1_LockLevel_3: Lock level 3
TIM1_DeadTimespecifies the dead time value.
TIM1_Breakspecifies the Break state This parameter can be one of the following values:
  • TIM1_BreakState_Enable: Break enabled
  • TIM1_BreakState_Disable: Break disabled
TIM1_BreakPolarityspecifies the Break polarity This parameter can be one of the following values:
  • TIM1_BreakPolarity_Low: Break polarity high
  • TIM1_BreakPolarity_High: Break polarity low
TIM1_AutomaticOutputspecifies the Automatic Output configuration This parameter can be one of the following values:
  • TIM1_AutomaticOutput_Enable: Automatic Output enabled
  • TIM1_AutomaticOutput_Disable: Automatic Output disabled
Return values:
None

Definition at line 797 of file stm8l15x_tim1.c.

References IS_TIM1_AUTOMATIC_OUTPUT_STATE, IS_TIM1_BREAK_POLARITY, IS_TIM1_BREAK_STATE, IS_TIM1_LOCK_LEVEL, IS_TIM1_OSSI_STATE, and TIM1.

void TIM1_CCPreloadControl ( FunctionalState  NewState)

Sets or Resets the TIM1 peripheral Capture Compare Preload Control bit.

Parameters:
NewStatenew state of the Capture Compare Preload Control bit. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 957 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_CCPC.

void TIM1_CCxCmd ( TIM1_Channel_TypeDef  TIM1_Channel,
FunctionalState  NewState 
)

Enables or disables the TIM1 Capture Compare Channel x (x=1,..,4).

Parameters:
TIM1_Channelspecifies the TIM1 Channel. This parameter can be one of the following values:
  • TIM1_Channel_1: TIM1 Channel1
  • TIM1_Channel_2: TIM1 Channel2
  • TIM1_Channel_3: TIM1 Channel3
  • TIM1_CHANNEL_4: TIM1 Channel4
NewStatespecifies the TIM1 Channel CCxE bit new state. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 1462 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_CHANNEL, TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC2E, TIM1_CCER2_CC3E, TIM1_CCER2_CC4E, TIM1_Channel_1, TIM1_Channel_2, and TIM1_Channel_3.

void TIM1_CCxNCmd ( TIM1_Channel_TypeDef  TIM1_Channel,
FunctionalState  NewState 
)

Enables or disables the TIM1 Capture Compare Channel xN (xN=1,..,3).

Parameters:
TIM1_Channelspecifies the TIM1 Channel. This parameter can be one of the following values:
  • TIM1_Channel_1: TIM1 Channel1
  • TIM1_Channel_2: TIM1 Channel2
  • TIM1_Channel_3: TIM1 Channel3
NewStatespecifies the TIM1 Channel CCxNE bit new state. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 1529 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_COMPLEMENTARY_CHANNEL, TIM1, TIM1_CCER1_CC1NE, TIM1_CCER1_CC2NE, TIM1_CCER2_CC3NE, TIM1_Channel_1, and TIM1_Channel_2.

void TIM1_ClearFlag ( TIM1_FLAG_TypeDef  TIM1_FLAG)

Clears the TIM1�s pending flags.

Parameters:
TIM1_FLAGspecifies the flag to clear. This parameter can be one of the following values:
  • TIM1_FLAG_Update: TIM1 update Flag
  • TIM1_FLAG_CC1: TIM1 Capture Compare 1 Flag
  • TIM1_FLAG_CC2: TIM1 Capture Compare 2 Flag
  • TIM1_FLAG_CC3: TIM1 Capture Compare 3 Flag
  • TIM1_FLAG_CC4: TIM1 Capture Compare 4 Flag
  • TIM1_FLAG_COM: TIM1 Commutation Flag
  • TIM1_FLAG_Trigger: TIM1 Trigger Flag
  • TIM1_FLAG_Break: TIM1 Break Flag
  • TIM1_FLAG_CC1OF: TIM1 Capture Compare 1 overcapture Flag
  • TIM1_FLAG_CC2OF: TIM1 Capture Compare 2 overcapture Flag
  • TIM1_FLAG_CC3OF: TIM1 Capture Compare 3 overcapture Flag
  • TIM1_FLAG_CC4OF: TIM1 Capture Compare 4 overcapture Flag
Return values:
None.

Definition at line 2083 of file stm8l15x_tim1.c.

References IS_TIM1_CLEAR_FLAG, and TIM1.

void TIM1_ClearITPendingBit ( TIM1_IT_TypeDef  TIM1_IT)

Clears the TIM1's interrupt pending bits.

Parameters:
TIM1_ITspecifies the pending bit to clear. This parameter can be any combination of the following values:
  • TIM1_IT_Update: Update
  • TIM1_IT_CC1: Capture Compare Channel1
  • TIM1_IT_CC2: Capture Compare Channel2
  • TIM1_IT_CC3: Capture Compare Channel3
  • TIM1_IT_CC4: Capture Compare Channel4
  • TIM1_IT_COM: Commutation
  • TIM1_IT_Trigger: Trigger
  • TIM1_IT_Break: Break
Return values:
None.

Definition at line 2146 of file stm8l15x_tim1.c.

References IS_TIM1_IT, and TIM1.

void TIM1_ClearOC1Ref ( FunctionalState  NewState)

Clears or safeguards the OC1REF signal.

Parameters:
NewStatenew state of the Output Compare 1 Clear Enable bit. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 1184 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.

void TIM1_ClearOC2Ref ( FunctionalState  NewState)

Clears or safeguards the OC2REF signal.

Parameters:
NewStatenew state of the Output Compare 2 Clear Enable bit. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 1206 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.

void TIM1_ClearOC3Ref ( FunctionalState  NewState)

Clears or safeguards the OC3REF signal.

Parameters:
NewStatenew state of the Output Compare 3 Clear Enable bit. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 1228 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.

void TIM1_ClearOC4Ref ( FunctionalState  NewState)

Clears or safeguards the OC4REF signal.

Parameters:
NewStatenew state of the Output Compare 4 Clear Enable bit. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 1250 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.

void TIM1_Cmd ( FunctionalState  NewState)

Enables or disables the TIM1 peripheral.

Parameters:
NewStatenew state of the TIM1 peripheral. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 466 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_CEN.

void TIM1_CounterModeConfig ( TIM1_CounterMode_TypeDef  TIM1_CounterMode)

Specifies the TIM1 Counter Mode to be used.

Parameters:
TIM1_CounterModespecifies the Counter Mode to be used This parameter can be one of the following values:
  • TIM1_CounterMode_Up: TIM1 Up Counting Mode
  • TIM1_CounterMode_Down: TIM1 Down Counting Mode
  • TIM1_CounterMode_CenterAligned1: TIM1 Center Aligned Mode1
  • TIM1_CounterMode_CenterAligned2: TIM1 Center Aligned Mode2
  • IM1_CounterMode_CenterAligned3: TIM1 Center Aligned Mode3
Return values:
None

Definition at line 297 of file stm8l15x_tim1.c.

References IS_TIM1_COUNTER_MODE, TIM1, TIM1_CR1_CMS, and TIM1_CR1_DIR.

void TIM1_CtrlPWMOutputs ( FunctionalState  NewState)

Enables or disables the TIM1 peripheral Main Outputs.

Parameters:
NewStatenew state of the TIM1 peripheral. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 828 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_BKR_MOE.

void TIM1_DMACmd ( TIM1_DMASource_TypeDef  TIM1_DMASource,
FunctionalState  NewState 
)

Enables or disables the TIM�s DMA Requests.

Parameters:
TIM1_DMASources,:specifies the DMA Request sources. This parameter can be any combination of the following values:
  • TIM1_DMA_Update: TIM1 update Interrupt source
  • DMA_Trigger: TIM1 Trigger DMA source
NewStatenew state of the DMA Request sources. This parameter can be: ENABLE or DISABLE.
Return values:
None.

Definition at line 2183 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_DMA_SOURCE, and TIM1.

void TIM1_DMAConfig ( TIM1_DMABase_TypeDef  TIM1_DMABase,
TIM1_DMABurstLength_TypeDef  TIM1_DMABurstLength 
)

Configures the TIM1�s DMA interface.

Parameters:
TIM1_DMABase,:DMA Base address.
TIM1_DMABurstLength,:DMA Burst length.
Return values:
None.

Definition at line 2161 of file stm8l15x_tim1.c.

References IS_TIM1_DMABase, IS_TIM1_DMABurstLength, and TIM1.

void TIM1_EncoderInterfaceConfig ( TIM1_EncoderMode_TypeDef  TIM1_EncoderMode,
TIM1_ICPolarity_TypeDef  TIM1_IC1Polarity,
TIM1_ICPolarity_TypeDef  TIM1_IC2Polarity 
)

Configures the TIM1 Encoder Interface.

Parameters:
TIM1_EncoderModespecifies the TIM1 Encoder Mode. This parameter can be one of the following values
  • TIM1_EncoderMode_TI1: Counter counts on TI1FP1 edge depending on TI2FP2 level.
  • TIM1_EncoderMode_TI2: Counter counts on TI2FP2 edge depending on TI1FP1 level.
  • TIM1_EncoderMode_TI12: Counter counts on both TI1FP1 and TI2FP2 edges depending on the level of the other input.
TIM1_IC1Polarityspecifies the IC1 Polarity. This parameter can be one of the following values:
  • TIM1_ICPolarity_Rising: Input capture polarity rising
  • TIM1_ICPolarity_Falling: Input capture polarity falling
TIM1_IC2Polarityspecifies the IC2 Polarity. This parameter can be one of the following values:
  • TIM1_ICPolarity_Rising: Input capture polarity rising
  • TIM1_ICPolarity_Falling: Input capture polarity falling
Return values:
None

Definition at line 2541 of file stm8l15x_tim1.c.

References CCMR_TIxDirect_Set, IS_TIM1_ENCODER_MODE, IS_TIM1_IC_POLARITY, TIM1, TIM1_CCER1_CC1P, TIM1_CCER1_CC2P, TIM1_CCMR_CCxS, TIM1_ICPolarity_Rising, TIM1_SMCR_MSM, and TIM1_SMCR_TS.

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

Configures the TIM1 External clock Mode1.

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

Definition at line 2308 of file stm8l15x_tim1.c.

References IS_TIM1_EXT_POLARITY, IS_TIM1_EXT_PRESCALER, IS_TIM1_EXT_TRG_FILTER, TIM1, TIM1_ETRConfig(), TIM1_SlaveMode_External1, TIM1_SMCR_SMS, TIM1_SMCR_TS, and TIM1_TRGSelection_ETRF.

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

Configures the TIM1 External clock Mode2.

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

Definition at line 2341 of file stm8l15x_tim1.c.

References IS_TIM1_EXT_POLARITY, IS_TIM1_EXT_PRESCALER, TIM1, TIM1_ETR_ECE, and TIM1_ETRConfig().

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

Configures the TIM1 External Trigger.

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

Definition at line 2493 of file stm8l15x_tim1.c.

References IS_TIM1_EXT_TRG_FILTER, and TIM1.

Referenced by TIM1_ETRClockMode1Config(), and TIM1_ETRClockMode2Config().

void TIM1_ForcedOC1Config ( TIM1_ForcedAction_TypeDef  TIM1_ForcedAction)

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

Parameters:
TIM1_ForcedActionspecifies the forced Action to be set to the output waveform. This parameter can be one of the following values:
  • TIM1_ForcedAction_Active: Force active level on OC1REF
  • TIM1_ForcedAction_Inactive: Force inactive level on OC1REF.
Return values:
None

Definition at line 981 of file stm8l15x_tim1.c.

References IS_TIM1_FORCED_ACTION, TIM1, and TIM1_CCMR_OCM.

void TIM1_ForcedOC2Config ( TIM1_ForcedAction_TypeDef  TIM1_ForcedAction)

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

Parameters:
TIM1_ForcedActionspecifies the forced Action to be set to the output waveform. This parameter can be one of the following values:
  • TIM1_ForcedAction_Active: Force active level on OC2REF
  • TIM1_ForcedAction_Inactive: Force inactive level on OC2REF.
Return values:
None

Definition at line 998 of file stm8l15x_tim1.c.

References IS_TIM1_FORCED_ACTION, TIM1, and TIM1_CCMR_OCM.

void TIM1_ForcedOC3Config ( TIM1_ForcedAction_TypeDef  TIM1_ForcedAction)

Forces the TIM1 Channel3 output waveform to active or inactive level.

Parameters:
TIM1_ForcedActionspecifies the forced Action to be set to the output waveform. This parameter can be one of the following values:
  • TIM1_ForcedAction_Active: Force active level on OC3REF
  • TIM1_ForcedAction_Inactive: Force inactive level on OC3REF.
Return values:
None

Definition at line 1015 of file stm8l15x_tim1.c.

References IS_TIM1_FORCED_ACTION, TIM1, and TIM1_CCMR_OCM.

void TIM1_GenerateEvent ( TIM1_EventSource_TypeDef  TIM1_EventSource)

Configures the TIM1 event to be generated by software.

Parameters:
TIM1_EventSourcespecifies the event source. This parameter can be any combination of the following values:
  • TIM1_EventSource_Update: Update
  • TIM1_EventSource_CC1: Capture Compare Channel1
  • TIM1_EventSource_CC2: Capture Compare Channel2
  • TIM1_EventSource_CC3: Capture Compare Channel3
  • TIM1_EventSource_CC4: Capture Compare Channel4
  • TIM1_EventSource_COM: Commutation
  • TIM1_EventSource_Trigger: Trigger
  • TIM1_EventSource_Break: Break
Return values:
None

Definition at line 2017 of file stm8l15x_tim1.c.

References IS_TIM1_EVENT_SOURCE, and TIM1.

uint16_t TIM1_GetCapture1 ( void  )

Gets the TIM1 Input Capture 1 value.

Parameters:
None
Return values:
CaptureCompare 1 Register value.

Definition at line 1797 of file stm8l15x_tim1.c.

References TIM1.

uint16_t TIM1_GetCapture2 ( void  )

Gets the TIM1 Input Capture 2 value.

Parameters:
None
Return values:
CaptureCompare 2 Register value.

Definition at line 1818 of file stm8l15x_tim1.c.

References TIM1.

uint16_t TIM1_GetCapture3 ( void  )

Gets the TIM1 Input Capture 3 value.

Parameters:
None
Return values:
CaptureCompare 3 Register value.

Definition at line 1839 of file stm8l15x_tim1.c.

References TIM1.

uint16_t TIM1_GetCapture4 ( void  )

Gets the TIM1 Input Capture 4 value.

Parameters:
None
Return values:
CaptureCompare 4 Register value.

Definition at line 1859 of file stm8l15x_tim1.c.

References TIM1.

uint16_t TIM1_GetCounter ( void  )

Gets the TIM1 Counter value.

Parameters:
None
Return values:
CounterRegister value.

Definition at line 339 of file stm8l15x_tim1.c.

References TIM1.

FlagStatus TIM1_GetFlagStatus ( TIM1_FLAG_TypeDef  TIM1_FLAG)

Checks whether the specified TIM1 flag is set or not.

Parameters:
TIM1_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • TIM1_FLAG_Update: TIM1 update Flag
  • TIM1_FLAG_CC1: TIM1 Capture Compare 1 Flag
  • TIM1_FLAG_CC2: TIM1 Capture Compare 2 Flag
  • TIM1_FLAG_CC3: TIM1 Capture Compare 3 Flag
  • TIM1_FLAG_CC4: TIM1 Capture Compare 4 Flag
  • TIM1_FLAG_COM: TIM1 Commutation Flag
  • TIM1_FLAG_Trigger: TIM1 Trigger Flag
  • TIM1_FLAG_Break: TIM1 Break Flag
  • TIM1_FLAG_CC1OF: TIM1 Capture Compare 1 overcapture Flag
  • TIM1_FLAG_CC2OF: TIM1 Capture Compare 2 overcapture Flag
  • TIM1_FLAG_CC3OF: TIM1 Capture Compare 3 overcapture Flag
  • TIM1_FLAG_CC4OF: TIM1 Capture Compare 4 overcapture Flag
Return values:
FlagStatusThe new state of TIM1_FLAG (SET or RESET).

Definition at line 2043 of file stm8l15x_tim1.c.

References IS_TIM1_GET_FLAG, RESET, SET, and TIM1.

ITStatus TIM1_GetITStatus ( TIM1_IT_TypeDef  TIM1_IT)

Checks whether the TIM1 interrupt has occurred or not.

Parameters:
TIM1_ITspecifies the TIM1 interrupt source to check. This parameter can be any combination of the following values:
  • TIM1_IT_Update: Update
  • TIM1_IT_CC1: Capture Compare Channel1
  • TIM1_IT_CC2: Capture Compare Channel2
  • TIM1_IT_CC3: Capture Compare Channel3
  • TIM1_IT_CC4: Capture Compare Channel4
  • TIM1_IT_COM: Commutation
  • TIM1_IT_Trigger: Trigger
  • TIM1_IT_Break: Break
Return values:
ITStatusThe new state of the TIM1_IT(SET or RESET).

Definition at line 2108 of file stm8l15x_tim1.c.

References IS_TIM1_GET_IT, RESET, SET, and TIM1.

uint16_t TIM1_GetPrescaler ( void  )

Gets the TIM1 Prescaler value.

Parameters:
None
Return values:
PrescalerRegister value.

Definition at line 360 of file stm8l15x_tim1.c.

References TIM1.

void TIM1_ICInit ( TIM1_Channel_TypeDef  TIM1_Channel,
TIM1_ICPolarity_TypeDef  TIM1_ICPolarity,
TIM1_ICSelection_TypeDef  TIM1_ICSelection,
TIM1_ICPSC_TypeDef  TIM1_ICPrescaler,
uint8_t  TIM1_ICFilter 
)

Initializes the TIM1 peripheral according to the specified parameters.

Parameters:
TIM1_Channelspecifies the input capture channel This parameter can be one of the following values:
  • TIM1_Channel_1: TIM1 Channel1
  • TIM1_Channel_2: TIM1 Channel2
  • TIM1_Channel_3: TIM1 Channel3
  • TIM1_Channel_4: TIM1 Channel4
TIM1_ICPolarityspecifies the Input capture polarity This parameter can be one of the following values:
  • TIM1_ICPolarity_Rising: Input capture polarity rising
  • TIM1_ICPolarity_Falling: Input capture polarity falling
TIM1_ICSelectionspecifies the Input capture source selection This parameter can be one of the following values:
  • TIM1_ICSelection_DirectTI: TIM1 Input x is selected to be connected to ICx.
  • TIM1_ICSelection_IndirectTI: TIM1 Input x is selected to be connected to ICy.
  • TIM1_ICSelection_TRGI: TIM1 Input x is selected to be connected to the TRGI
TIM1_ICPrescalerspecifies the Input capture Prescaler This parameter can be one of the following values:
  • TIM1_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM1_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM1_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM1_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
TIM1_ICFilterspecifies the Input capture filter value.
Note:
If the channel 3 is selected the TIM1_ICSelection_IndirectTI parameter is forbidden.
If the channel 4 is selected the TIM1_ICSelection_DirectTI parameter is forbidden.
Return values:
None

Definition at line 1658 of file stm8l15x_tim1.c.

References IS_TIM1_CHANNEL, IS_TIM1_IC_FILTER, IS_TIM1_IC_POLARITY, IS_TIM1_IC_PRESCALER, IS_TIM1_IC_SELECTION, TI1_Config(), TI2_Config(), TI3_Config(), TI4_Config(), TIM1_Channel_1, TIM1_Channel_2, TIM1_Channel_3, TIM1_SetIC1Prescaler(), TIM1_SetIC2Prescaler(), TIM1_SetIC3Prescaler(), and TIM1_SetIC4Prescaler().

void TIM1_InternalClockConfig ( void  )

Configures the TIM1 internal Clock.

Parameters:
None
Return values:
None

Definition at line 2245 of file stm8l15x_tim1.c.

References TIM1, and TIM1_SMCR_SMS.

void TIM1_ITConfig ( TIM1_IT_TypeDef  TIM1_IT,
FunctionalState  NewState 
)

Enables or disables the specified TIM1 interrupts.

Parameters:
NewStatenew state of the TIM1 peripheral. This parameter can be: ENABLE or DISABLE.
TIM1_ITspecifies the TIM1 interrupts sources to be enabled or disabled. This parameter can be any combination of the following values:
  • TIM1_IT_Update: Update
  • TIM1_IT_CC1: Capture Compare Channel1
  • TIM1_IT_CC2: Capture Compare Channel2
  • TIM1_IT_CC3: Capture Compare Channel3
  • TIM1_IT_CC4: Capture Compare Channel4
  • TIM1_IT_COM: Commutation
  • TIM1_IT_Trigger: Trigger
  • TIM1_IT_Break: Break
NewStatenew state of the TIM1 peripheral.
Return values:
None

Definition at line 1985 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_IT, and TIM1.

void TIM1_OC1FastConfig ( FunctionalState  NewState)

Configures the TIM1 Capture Compare 1 Fast feature.

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

Definition at line 1118 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxFE.

void TIM1_OC1Init ( TIM1_OCMode_TypeDef  TIM1_OCMode,
TIM1_OutputState_TypeDef  TIM1_OutputState,
TIM1_OutputNState_TypeDef  TIM1_OutputNState,
uint16_t  TIM1_Pulse,
TIM1_OCPolarity_TypeDef  TIM1_OCPolarity,
TIM1_OCNPolarity_TypeDef  TIM1_OCNPolarity,
TIM1_OCIdleState_TypeDef  TIM1_OCIdleState,
TIM1_OCNIdleState_TypeDef  TIM1_OCNIdleState 
)

Initializes the TIM1 Channel1 according to the specified parameters.

Parameters:
TIM1_OCModespecifies the Output Compare mode This parameter can be one of the following values:
  • TIM1_OCMode_Timing: OC Mode Timing
  • TIM1_OCMode_Active: OC Mode Active
  • TIM1_OCMode_Inactive: OC Mode Inactive
  • TIM1_OCMode_Toggle: OC Mode Toggle
  • TIM1_OCMode_PWM1: OC Mode PWM1
  • TIM1_OCMode_PWM2: OC Mode PWM2
TIM1_OutputStatespecifies the Output State This parameter can be one of the following values:
  • TIM1_OutputState_Disable: Output state disable
  • TIM1_OutputState_Enable: Output state enable
TIM1_OutputNStatespecifies the Complementary Output State This parameter can be one of the following values:
  • TIM1_OutputNState_Disable: Output N state disable
  • TIM1_OutputNState_Enable: Output N state enable
TIM1_Pulsespecifies the Pulse width value.
TIM1_OCPolarityspecifies the Output Compare Polarity This parameter can be one of the following values:
  • TIM1_OCPolarity_High: Output Compare active low
  • TIM1_OCPolarity_Low: Output Compare active high
TIM1_OCNPolarityspecifies the Complementary Output Compare Polarity This parameter can be one of the following values:
  • TIM1_OCNPolarity_High: Complementary Output Compare active low
  • TIM1_OCNPolarity_Low: Complementary Output Compare active high
TIM1_OCIdleStatespecifies the Output Compare Idle State This parameter can be one of the following values:
  • TIM1_OCIdleState_Set: Output Compare Idle state set
  • TIM1_OCIdleState_Reset: Output Compare Idle state reset
TIM1_OCNIdleStatespecifies the Complementary Output Compare Idle State This parameter can be one of the following values:
  • TIM1_OCNIdleState_Set: Complementary Output Compare Idle state set
  • TIM1_OCNIdleState_Reset: Complementary Output Compare Idle state reset
Return values:
None

Definition at line 571 of file stm8l15x_tim1.c.

References IS_TIM1_OC_MODE, IS_TIM1_OC_POLARITY, IS_TIM1_OCIDLE_STATE, IS_TIM1_OCN_POLARITY, IS_TIM1_OCNIDLE_STATE, IS_TIM1_OUTPUT_STATE, IS_TIM1_OUTPUTN_STATE, TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC1NE, TIM1_CCER1_CC1NP, TIM1_CCER1_CC1P, TIM1_CCMR_OCM, TIM1_OISR_OIS1, and TIM1_OISR_OIS1N.

void TIM1_OC1NPolarityConfig ( TIM1_OCNPolarity_TypeDef  TIM1_OCNPolarity)

Configures the TIM1 Channel 1N polarity.

Parameters:
TIM1_OCNPolarityspecifies the OC1N Polarity. This parameter can be one of the following values:
  • TIM1_OCNPolarity_High: Complementary Output Compare active low
  • TIM1_OCNPolarity_Low: Complementary Output Compare active high
Return values:
None

Definition at line 1298 of file stm8l15x_tim1.c.

References IS_TIM1_OCN_POLARITY, TIM1, TIM1_CCER1_CC1NP, and TIM1_OCNPolarity_High.

void TIM1_OC1PolarityConfig ( TIM1_OCPolarity_TypeDef  TIM1_OCPolarity)

Configures the TIM1 Channel 1 polarity.

Parameters:
TIM1_OCPolarityspecifies the OC1 Polarity. This parameter can be one of the following values:
  • TIM1_OCPolarity_High: Output Compare active low
  • TIM1_OCPolarity_Low: Output Compare active high
Return values:
None

Definition at line 1274 of file stm8l15x_tim1.c.

References IS_TIM1_OC_POLARITY, TIM1, TIM1_CCER1_CC1P, and TIM1_OCPolarity_High.

void TIM1_OC1PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM1 peripheral Preload Register on CCR1.

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

Definition at line 1030 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.

void TIM1_OC2FastConfig ( FunctionalState  NewState)

Configures the TIM1 Capture Compare 2 Fast feature.

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

Definition at line 1140 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxFE.

void TIM1_OC2Init ( TIM1_OCMode_TypeDef  TIM1_OCMode,
TIM1_OutputState_TypeDef  TIM1_OutputState,
TIM1_OutputNState_TypeDef  TIM1_OutputNState,
uint16_t  TIM1_Pulse,
TIM1_OCPolarity_TypeDef  TIM1_OCPolarity,
TIM1_OCNPolarity_TypeDef  TIM1_OCNPolarity,
TIM1_OCIdleState_TypeDef  TIM1_OCIdleState,
TIM1_OCNIdleState_TypeDef  TIM1_OCNIdleState 
)

Initializes the TIM1 Channel2 according to the specified parameters.

Parameters:
TIM1_OCModespecifies the Output Compare mode This parameter can be one of the following values:
  • TIM1_OCMode_Timing: OC Mode Timing
  • TIM1_OCMode_Active: OC Mode Active
  • TIM1_OCMode_Inactive: OC Mode Inactive
  • TIM1_OCMode_Toggle: OC Mode Toggle
  • TIM1_OCMode_PWM1: OC Mode PWM1
  • TIM1_OCMode_PWM2: OC Mode PWM2
TIM1_OutputStatespecifies the Output State This parameter can be one of the following values:
  • TIM1_OutputState_Disable: Output state disable
  • TIM1_OutputState_Enable: Output state enable
TIM1_OutputNStatespecifies the Complementary Output State This parameter can be one of the following values:
  • TIM1_OutputNState_Disable: Output N state disable
  • TIM1_OutputNState_Enable: Output N state enable
TIM1_Pulsespecifies the Pulse width value.
TIM1_OCPolarityspecifies the Output Compare Polarity This parameter can be one of the following values:
  • TIM1_OCPolarity_High: Output Compare active low
  • TIM1_OCPolarity_Low: Output Compare active high
TIM1_OCNPolarityspecifies the Complementary Output Compare This parameter can be one of the following values:
  • TIM1_OCNPolarity_High: Complementary Output Compare active low
  • TIM1_OCNPolarity_Low: Complementary Output Compare active high
TIM1_OCIdleStatespecifies the Output Compare Idle State This parameter can be one of the following values:
  • TIM1_OCIdleState_Set: Output Compare Idle state set
  • TIM1_OCIdleState_Reset: Output Compare Idle state reset
TIM1_OCNIdleStatespecifies the Complementary Output Compare Idle State This parameter can be one of the following values:
  • TIM1_OCNIdleState_Set: Complementary Output Compare Idle state set
  • TIM1_OCNIdleState_Reset: Complementary Output Compare Idle state reset
Return values:
None

Definition at line 652 of file stm8l15x_tim1.c.

References IS_TIM1_OC_MODE, IS_TIM1_OC_POLARITY, IS_TIM1_OCIDLE_STATE, IS_TIM1_OCN_POLARITY, IS_TIM1_OCNIDLE_STATE, IS_TIM1_OUTPUT_STATE, IS_TIM1_OUTPUTN_STATE, TIM1, TIM1_CCER1_CC2E, TIM1_CCER1_CC2NE, TIM1_CCER1_CC2NP, TIM1_CCER1_CC2P, TIM1_CCMR_OCM, TIM1_OISR_OIS2, and TIM1_OISR_OIS2N.

void TIM1_OC2NPolarityConfig ( TIM1_OCNPolarity_TypeDef  TIM1_OCNPolarity)

Configures the TIM1 Channel 2N polarity.

Parameters:
TIM1_OCNPolarityspecifies the OC2N Polarity. This parameter can be one of the following values:
  • TIM1_OCNPolarity_High: Complementary Output Compare active low
  • TIM1_OCNPolarity_Low: Complementary Output Compare active high
Return values:
None

Definition at line 1346 of file stm8l15x_tim1.c.

References IS_TIM1_OCN_POLARITY, TIM1, TIM1_CCER1_CC2NP, and TIM1_OCNPolarity_High.

void TIM1_OC2PolarityConfig ( TIM1_OCPolarity_TypeDef  TIM1_OCPolarity)

Configures the TIM1 Channel 2 polarity.

Parameters:
TIM1_OCPolarityspecifies the OC2 Polarity. This parameter can be one of the following values:
  • TIM1_OCPolarity_High: Output Compare active low
  • TIM1_OCPolarity_Low: Output Compare active high
Return values:
None

Definition at line 1322 of file stm8l15x_tim1.c.

References IS_TIM1_OC_POLARITY, TIM1, TIM1_CCER1_CC2P, and TIM1_OCPolarity_High.

void TIM1_OC2PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM1 peripheral Preload Register on CCR2.

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

Definition at line 1052 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.

void TIM1_OC3FastConfig ( FunctionalState  NewState)

Configures the TIM1 Capture Compare 3 Fast feature.

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

Definition at line 1162 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxFE.

void TIM1_OC3Init ( TIM1_OCMode_TypeDef  TIM1_OCMode,
TIM1_OutputState_TypeDef  TIM1_OutputState,
TIM1_OutputNState_TypeDef  TIM1_OutputNState,
uint16_t  TIM1_Pulse,
TIM1_OCPolarity_TypeDef  TIM1_OCPolarity,
TIM1_OCNPolarity_TypeDef  TIM1_OCNPolarity,
TIM1_OCIdleState_TypeDef  TIM1_OCIdleState,
TIM1_OCNIdleState_TypeDef  TIM1_OCNIdleState 
)

Initializes the TIM1 Channel3 according to the specified parameters.

Parameters:
TIM1_OCModespecifies the Output Compare mode This parameter can be one of the following values:
  • TIM1_OCMode_Timing: OC Mode Timing
  • TIM1_OCMode_Active: OC Mode Active
  • TIM1_OCMode_Inactive: OC Mode Inactive
  • TIM1_OCMode_Toggle: OC Mode Toggle
  • TIM1_OCMode_PWM1: OC Mode PWM1
  • TIM1_OCMode_PWM2: OC Mode PWM2
TIM1_OutputStatespecifies the Output State This parameter can be one of the following values:
  • TIM1_OutputState_Disable: Output state disable
  • TIM1_OutputState_Enable: Output state enable
TIM1_OutputNStatespecifies the Complementary Output State This parameter can be one of the following values:
  • TIM1_OutputNState_Disable: Output N state disable
  • TIM1_OutputNState_Enable: Output N state enable
TIM1_Pulsespecifies the Pulse width value.
TIM1_OCPolarityspecifies the Output Compare Polarity This parameter can be one of the following values:
  • TIM1_OCPolarity_High: Output Compare active low
  • TIM1_OCPolarity_Low: Output Compare active high
TIM1_OCNPolarityspecifies the Complementary Output Compare Polarity This parameter can be one of the following values:
  • TIM1_OCNPolarity_High: Complementary Output Compare active low
  • TIM1_OCNPolarity_Low: Complementary Output Compare active high
TIM1_OCIdleStatespecifies the Output Compare Idle State This parameter can be one of the following values:
  • TIM1_OCIdleState_Set: Output Compare Idle state set
  • TIM1_OCIdleState_Reset: Output Compare Idle state reset
TIM1_OCNIdleStatespecifies the Complementary Output Compare Idle State This parameter can be one of the following values:
  • TIM1_OCNIdleState_Set: Complementary Output Compare Idle state set
  • TIM1_OCNIdleState_Reset: Complementary Output Compare Idle state reset
Return values:
None

Definition at line 729 of file stm8l15x_tim1.c.

References IS_TIM1_OC_MODE, IS_TIM1_OC_POLARITY, IS_TIM1_OCIDLE_STATE, IS_TIM1_OCN_POLARITY, IS_TIM1_OCNIDLE_STATE, IS_TIM1_OUTPUT_STATE, IS_TIM1_OUTPUTN_STATE, TIM1, TIM1_CCER2_CC3E, TIM1_CCER2_CC3NE, TIM1_CCER2_CC3NP, TIM1_CCER2_CC3P, TIM1_CCMR_OCM, TIM1_OISR_OIS3, and TIM1_OISR_OIS3N.

void TIM1_OC3NPolarityConfig ( TIM1_OCNPolarity_TypeDef  TIM1_OCNPolarity)

Configures the TIM1 Channel 3N polarity.

Parameters:
TIM1_OCNPolarityspecifies the OC3N Polarity. This parameter can be one of the following values:
  • TIM1_OCNPolarity_High: Complementary Output Compare active low
  • TIM1_OCNPolarity_Low: Complementary Output Compare active high
Return values:
None

Definition at line 1394 of file stm8l15x_tim1.c.

References IS_TIM1_OCN_POLARITY, TIM1, TIM1_CCER2_CC3NP, and TIM1_OCNPolarity_High.

void TIM1_OC3PolarityConfig ( TIM1_OCPolarity_TypeDef  TIM1_OCPolarity)

Configures the TIM1 Channel 3 polarity.

Parameters:
TIM1_OCPolarityspecifies the OC3 Polarity. This parameter can be one of the following values:
  • TIM1_OCPolarity_High: Output Compare active low
  • TIM1_OCPolarity_Low: Output Compare active high
Return values:
None

Definition at line 1370 of file stm8l15x_tim1.c.

References IS_TIM1_OC_POLARITY, TIM1, TIM1_CCER2_CC3P, and TIM1_OCPolarity_High.

void TIM1_OC3PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM1 peripheral Preload Register on CCR3.

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

Definition at line 1074 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.

void TIM1_OC4PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM1 peripheral Preload Register on CCR4.

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

Definition at line 1096 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.

void TIM1_PrescalerConfig ( uint16_t  Prescaler,
TIM1_PSCReloadMode_TypeDef  TIM1_PSCReloadMode 
)

Configures the TIM1 Prescaler.

Parameters:
Prescalerspecifies the Prescaler Register value This parameter must be a value between 0x0000 and 0xFFFF
TIM1_PSCReloadModespecifies the TIM1 Prescaler Reload mode. This parameter can be one of the following values
  • TIM1_PSCReloadMode_Immediate: The Prescaler is loaded immediately.
  • TIM1_PSCReloadMode_Update: The Prescaler is loaded at the update event.
Return values:
None

Definition at line 273 of file stm8l15x_tim1.c.

References IS_TIM1_PRESCALER_RELOAD, and TIM1.

void TIM1_PWMIConfig ( TIM1_Channel_TypeDef  TIM1_Channel,
TIM1_ICPolarity_TypeDef  TIM1_ICPolarity,
TIM1_ICSelection_TypeDef  TIM1_ICSelection,
TIM1_ICPSC_TypeDef  TIM1_ICPrescaler,
uint8_t  TIM1_ICFilter 
)

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

Parameters:
TIM1_Channelspecifies the input capture channel This parameter can be one of the following values:
  • TIM1_Channel_1: TIM1 Channel1
  • TIM1_Channel_2: TIM1 Channel2
TIM1_ICPolarityspecifies the Input capture polarity This parameter can be one of the following values:
  • TIM1_ICPolarity_Rising: Input capture polarity rising
  • TIM1_ICPolarity_Falling: Input capture polarity falling
TIM1_ICSelectionspecifies the Input capture source selection This parameter can be one of the following values:
  • TIM1_ICSelection_DirectTI: TIM1 Input x is selected to be connected to ICx.
  • TIM1_ICSelection_IndirectTI: TIM1 Input x is selected to be connected to ICy.
  • TIM1_ICSelection_TRGI: TIM1 Input x is selected to be connected to the TRGI
TIM1_ICPrescalerspecifies the Input capture Prescaler This parameter can be one of the following values:
  • TIM1_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM1_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM1_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM1_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
TIM1_ICFilterspecifies the Input capture filter value.
Return values:
None

Definition at line 1727 of file stm8l15x_tim1.c.

References IS_TIM1_IC_POLARITY, IS_TIM1_IC_PRESCALER, IS_TIM1_IC_SELECTION, IS_TIM1_PWMI_CHANNEL, TI1_Config(), TI2_Config(), TIM1_Channel_1, TIM1_ICPolarity_Falling, TIM1_ICPolarity_Rising, TIM1_ICSelection_DirectTI, TIM1_ICSelection_IndirectTI, TIM1_SetIC1Prescaler(), and TIM1_SetIC2Prescaler().

void TIM1_SelectCCDMA ( FunctionalState  NewState)

Selects the TIM1 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 2207 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_CCDS.

void TIM1_SelectCOM ( FunctionalState  NewState)

Selects the TIM1 peripheral Commutation event.

Parameters:
NewStatenew state of the Commutation event. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 1434 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_CCUS.

void TIM1_SelectHallSensor ( FunctionalState  NewState)

Enables or Disables the TIM�s Hall sensor interface.

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

Definition at line 2583 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_TI1S.

void TIM1_SelectInputTrigger ( TIM1_TRGSelection_TypeDef  TIM1_InputTriggerSource)

Selects the TIM1 Input Trigger source.

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

Definition at line 2404 of file stm8l15x_tim1.c.

References IS_TIM1_TRIGGER_SELECTION, TIM1, and TIM1_SMCR_TS.

Referenced by TIM1_TIxExternalClockConfig().

void TIM1_SelectMasterSlaveMode ( FunctionalState  NewState)

Sets or Resets the TIM1 Master/Slave Mode.

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

Definition at line 2461 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_SMCR_MSM.

void TIM1_SelectOCREFClear ( TIM1_OCReferenceClear_TypeDef  TIM1_OCReferenceClear)

Selects the OCReference Clear source.

Parameters:
TIM1_OCReferenceClear,:specifies the OCReference Clear source. This parameter can be one of the following values:
  • TIM1_OCReferenceClear_ETRF: OCReference Clear source ETR
  • TIM1_OCReferenceClear_OCREFCLR: OCReference Clear source OCREF
Return values:
None

Definition at line 1418 of file stm8l15x_tim1.c.

References IS_TIM1_OCREFERENCECECLEAR_SOURCE, TIM1, and TIM1_SMCR_OCCS.

void TIM1_SelectOCxM ( TIM1_Channel_TypeDef  TIM1_Channel,
TIM1_OCMode_TypeDef  TIM1_OCMode 
)

Selects the TIM1 Output Compare Mode.

This function disables the selected channel before changing the Output Compare Mode.

Note:
User has to enable this channel using TIM1_CCxCmd and TIM1_CCxNCmd functions.
Parameters:
TIM1_Channelspecifies the TIM1 Channel. This parameter can be one of the following values:
  • TIM1_Channel_1: TIM1 Channel1
  • TIM1_Channel_2: TIM1 Channel2
  • TIM1_Channel_3: TIM1 Channel3
  • TIM1_Channel_4: TIM1 Channel4
TIM1_OCModespecifies the TIM1 Output Compare Mode. This parameter can be one of the following values:
  • TIM1_OCMode_Timing: OC Mode Timing
  • TIM1_OCMode_Active: OC Mode Active
  • TIM1_OCMode_Inactive: OC Mode Inactive
  • TIM1_OCMode_Toggle: OC Mode Toggle
  • TIM1_OCMode_PWM1: OC Mode PWM1
  • TIM1_OCMode_PWM2: OC Mode PWM2
Return values:
None

Definition at line 865 of file stm8l15x_tim1.c.

References IS_TIM1_CHANNEL, IS_TIM1_OCM, TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC2E, TIM1_CCER2_CC3E, TIM1_CCMR_OCM, TIM1_Channel_1, and TIM1_Channel_2.

void TIM1_SelectOnePulseMode ( TIM1_OPMode_TypeDef  TIM1_OPMode)

Selects the TIM1�s One Pulse Mode.

Parameters:
TIM1_OPModespecifies the OPM Mode to be used. This parameter can be one of the following values
  • TIM1_OPMode_Single
  • TIM1_OPMode_Repetitive
Return values:
None

Definition at line 444 of file stm8l15x_tim1.c.

References IS_TIM1_OPM_MODE, TIM1, TIM1_CR1_OPM, and TIM1_OPMode_Repetitive.

void TIM1_SelectOutputTrigger ( TIM1_TRGOSource_TypeDef  TIM1_TRGOSource)

Selects the TIM1 Trigger Output Mode.

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

Definition at line 2427 of file stm8l15x_tim1.c.

References IS_TIM1_TRGO_SOURCE, TIM1, and TIM1_CR2_MMS.

void TIM1_SelectSlaveMode ( TIM1_SlaveMode_TypeDef  TIM1_SlaveMode)

Selects the TIM1 Slave Mode.

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

Definition at line 2445 of file stm8l15x_tim1.c.

References IS_TIM1_SLAVE_MODE, TIM1, and TIM1_SMCR_SMS.

void TIM1_SetAutoreload ( uint16_t  Autoreload)

Sets the TIM1 Autoreload Register value.

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

Definition at line 327 of file stm8l15x_tim1.c.

References TIM1.

void TIM1_SetCompare1 ( uint16_t  Compare1)

Sets the TIM1 Capture Compare1 Register value.

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

Definition at line 904 of file stm8l15x_tim1.c.

References TIM1.

void TIM1_SetCompare2 ( uint16_t  Compare2)

Sets the TIM1 Capture Compare2 Register value.

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

Definition at line 918 of file stm8l15x_tim1.c.

References TIM1.

void TIM1_SetCompare3 ( uint16_t  Compare3)

Sets the TIM1 Capture Compare3 Register value.

Parameters:
Compare3specifies the Capture Compare3 register new value. This parameter is between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 931 of file stm8l15x_tim1.c.

References TIM1.

void TIM1_SetCompare4 ( uint16_t  Compare4)

Sets the TIM1 Capture Compare4 Register value.

Parameters:
Compare4specifies the Capture Compare4 register new value. This parameter is between 0x0000 and 0xFFFF.
Return values:
None

Definition at line 944 of file stm8l15x_tim1.c.

References TIM1.

void TIM1_SetCounter ( uint16_t  Counter)

Sets the TIM1 Counter Register value.

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

Definition at line 314 of file stm8l15x_tim1.c.

References TIM1.

void TIM1_SetIC1Prescaler ( TIM1_ICPSC_TypeDef  TIM1_IC1Prescaler)

Sets the TIM1 Input Capture 1 prescaler.

Parameters:
TIM1_IC1Prescalerspecifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM1_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM1_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM1_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM1_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1884 of file stm8l15x_tim1.c.

References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.

Referenced by TIM1_ICInit(), and TIM1_PWMIConfig().

void TIM1_SetIC2Prescaler ( TIM1_ICPSC_TypeDef  TIM1_IC2Prescaler)

Sets the TIM1 Input Capture 2 prescaler.

Parameters:
TIM1_IC2Prescalerspecifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM1_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM1_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM1_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM1_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1903 of file stm8l15x_tim1.c.

References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.

Referenced by TIM1_ICInit(), and TIM1_PWMIConfig().

void TIM1_SetIC3Prescaler ( TIM1_ICPSC_TypeDef  TIM1_IC3Prescaler)

Sets the TIM1 Input Capture 3 prescaler.

Parameters:
TIM1_IC3Prescalerspecifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM1_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM1_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM1_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM1_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1922 of file stm8l15x_tim1.c.

References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.

Referenced by TIM1_ICInit().

void TIM1_SetIC4Prescaler ( TIM1_ICPSC_TypeDef  TIM1_IC4Prescaler)

Sets the TIM1 Input Capture 4 prescaler.

Parameters:
TIM1_IC4Prescalerspecifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM1_ICPSC_DIV1: Input Capture Prescaler = 1 (one capture every 1 event)
  • TIM1_ICPSC_DIV2: Input Capture Prescaler = 2 (one capture every 2 events)
  • TIM1_ICPSC_DIV4: Input Capture Prescaler = 4 (one capture every 4 events)
  • TIM1_ICPSC_DIV8: Input Capture Prescaler = 8 (one capture every 8 events)
Return values:
None

Definition at line 1942 of file stm8l15x_tim1.c.

References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.

Referenced by TIM1_ICInit().

void TIM1_TimeBaseInit ( uint16_t  TIM1_Prescaler,
TIM1_CounterMode_TypeDef  TIM1_CounterMode,
uint16_t  TIM1_Period,
uint8_t  TIM1_RepetitionCounter 
)

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

Parameters:
TIM1_Prescalerspecifies the Prescaler value.
TIM1_CounterModespecifies the counter mode from This parameter can be one of the following values:
  • TIM1_CounterMode_Up: Counter mode Up
  • TIM1_CounterMode_Down: Counter mode Down
  • TIM1_CounterMode_CenterAligned1: Counter mode center aligned
  • TIM1_CounterMode_CenterAligned2: Counter mode center aligned
  • TIM1_CounterMode_CenterAligned3: Counter mode center aligned
TIM1_Periodspecifies the Period value.
TIM1_RepetitionCounterspecifies the Repetition counter value
Return values:
None

Definition at line 235 of file stm8l15x_tim1.c.

References IS_TIM1_COUNTER_MODE, TIM1, TIM1_CR1_CMS, and TIM1_CR1_DIR.

void TIM1_TIxExternalClockConfig ( TIM1_TIxExternalCLK1Source_TypeDef  TIM1_TIxExternalCLKSource,
TIM1_ICPolarity_TypeDef  TIM1_ICPolarity,
uint8_t  ICFilter 
)

Configures the TIM1 Trigger as External Clock.

Parameters:
TIM1_TIxExternalCLKSourcespecifies Trigger source. This parameter can be one of the following values:
  • TIM1_TIxExternalCLK1Source_TI1: TI1 Edge Detector
  • TIM1_TIxExternalCLK1Source_TI2: Filtered TIM1 Input 1
  • TIM1_TIxExternalCLK1Source_TI1ED: Filtered TIM1 Input 2
TIM1_ICPolarityspecifies the TIx Polarity. This parameter can be one of the following values:
  • TIM1_ICPolarity_Rising: Input capture polarity rising
  • TIM1_ICPolarity_Falling: Input capture polarity falling
ICFilterspecifies the filter value. This parameter must be a value between 0x00 and 0x0F
Return values:
None

Definition at line 2266 of file stm8l15x_tim1.c.

References IS_TIM1_IC_FILTER, IS_TIM1_IC_POLARITY, IS_TIM1_TIXCLK_SOURCE, TI1_Config(), TI2_Config(), TIM1, TIM1_ICSelection_DirectTI, TIM1_SelectInputTrigger(), TIM1_SlaveMode_External1, and TIM1_TIxExternalCLK1Source_TI2.

void TIM1_UpdateDisableConfig ( FunctionalState  NewState)

Enables or Disables the TIM1 Update event.

Parameters:
NewStatenew state of the TIM1 peripheral Preload register. This parameter can be ENABLE or DISABLE.
Return values:
None

Definition at line 374 of file stm8l15x_tim1.c.

References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_UDIS.

void TIM1_UpdateRequestConfig ( TIM1_UpdateSource_TypeDef  TIM1_UpdateSource)

Selects the TIM1 Update Request Interrupt source.

Parameters:
TIM1_UpdateSourcespecifies the Update source. This parameter can be one of the following values
  • TIM1_UpdateSource_Regular
  • TIM1_UpdateSource_Global
Return values:
None

Definition at line 398 of file stm8l15x_tim1.c.

References IS_TIM1_UPDATE_SOURCE, TIM1, TIM1_CR1_URS, and TIM1_UpdateSource_Global.

STM8S Firmware Library: Overview

 

 

 

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