STM8S/A Standard Peripherals Drivers: TIM1_Public_Functions

STM8S/A

STM8S/A Standard Peripherals Drivers
TIM1_Public_Functions

Functions

static void TI1_Config (uint8_t TIM1_ICPolarity, uint8_t TIM1_ICSelection, uint8_t TIM1_ICFilter)
 Configure the TI1 as Input.
static void TI2_Config (uint8_t TIM1_ICPolarity, uint8_t TIM1_ICSelection, uint8_t TIM1_ICFilter)
 Configure the TI2 as Input.
static void TI3_Config (uint8_t TIM1_ICPolarity, uint8_t TIM1_ICSelection, uint8_t TIM1_ICFilter)
 Configure the TI3 as Input.
static void TI4_Config (uint8_t TIM1_ICPolarity, uint8_t TIM1_ICSelection, uint8_t TIM1_ICFilter)
 Configure the TI4 as Input.
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_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_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_ForcedOC4Config (TIM1_ForcedAction_TypeDef TIM1_ForcedAction)
 Forces the TIM1 Channel4 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_OC4FastConfig (FunctionalState NewState)
 Configures the TIM1 Capture Compare 4 Fast feature.
void TIM1_OC4Init (TIM1_OCMode_TypeDef TIM1_OCMode, TIM1_OutputState_TypeDef TIM1_OutputState, uint16_t TIM1_Pulse, TIM1_OCPolarity_TypeDef TIM1_OCPolarity, TIM1_OCIdleState_TypeDef TIM1_OCIdleState)
 Initializes the TIM1 Channel4 according to the specified parameters.
void TIM1_OC4PolarityConfig (TIM1_OCPolarity_TypeDef TIM1_OCPolarity)
 Configures the TIM1 Channel 4 polarity.
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_SelectCOM (FunctionalState NewState)
 Selects the TIM1 peripheral Commutation event.
void TIM1_SelectHallSensor (FunctionalState NewState)
 Enables or Disables the TIM1�s Hall sensor interface.
void TIM1_SelectInputTrigger (TIM1_TS_TypeDef TIM1_InputTriggerSource)
 Selects the TIM1 Input Trigger source.
void TIM1_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM1 Master/Slave Mode.
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.

Function Documentation

static void TI1_Config ( uint8_t  TIM1_ICPolarity,
uint8_t  TIM1_ICSelection,
uint8_t  TIM1_ICFilter 
) [static]

Configure the TI1 as Input.

Parameters:
TIM1_ICPolarityThe Input Polarity. This parameter can be one of the following values:
  • TIM1_ICPOLARITY_FALLING
  • TIM1_ICPOLARITY_RISING
TIM1_ICSelectionspecifies the input to be used. This parameter can be one of the following values:
  • TIM1_ICSELECTION_DIRECTTI: TIM1 Input 1 is selected to be connected to IC1.
  • TIM1_ICSELECTION_INDIRECTTI: TIM1 Input 1 is selected to be connected to IC2.
TIM1_ICFilterSpecifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 2174 of file stm8s_tim1.c.

References TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC1P, TIM1_CCMR_CCxS, TIM1_CCMR_ICxF, and TIM1_ICPOLARITY_RISING.

Referenced by TIM1_ICInit(), TIM1_PWMIConfig(), and TIM1_TIxExternalClockConfig().

static void TI2_Config ( uint8_t  TIM1_ICPolarity,
uint8_t  TIM1_ICSelection,
uint8_t  TIM1_ICFilter 
) [static]

Configure the TI2 as Input.

Parameters:
TIM1_ICPolarityThe Input Polarity. This parameter can be one of the following values:
  • TIM1_ICPOLARITY_FALLING
  • TIM1_ICPOLARITY_RISING
TIM1_ICSelectionspecifies the input to be used. This parameter can be one of the following values:
  • TIM1_ICSELECTION_DIRECTTI: TIM1 Input 2 is selected to be connected to IC2.
  • TIM1_ICSELECTION_INDIRECTTI: TIM1 Input 2 is selected to be connected to IC1.
TIM1_ICFilterSpecifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 2215 of file stm8s_tim1.c.

References TIM1, TIM1_CCER1_CC2E, TIM1_CCER1_CC2P, TIM1_CCMR_CCxS, TIM1_CCMR_ICxF, and TIM1_ICPOLARITY_RISING.

Referenced by TIM1_ICInit(), TIM1_PWMIConfig(), and TIM1_TIxExternalClockConfig().

static void TI3_Config ( uint8_t  TIM1_ICPolarity,
uint8_t  TIM1_ICSelection,
uint8_t  TIM1_ICFilter 
) [static]

Configure the TI3 as Input.

Parameters:
TIM1_ICPolarityThe Input Polarity. This parameter can be one of the following values:
  • TIM1_ICPOLARITY_FALLING
  • TIM1_ICPOLARITY_RISING
TIM1_ICSelectionspecifies the input to be used. This parameter can be one of the following values:
  • TIM1_ICSELECTION_DIRECTTI: TIM1 Input 3 is selected to be connected to IC3.
  • TIM1_ICSELECTION_INDIRECTTI: TIM1 Input 3 is selected to be connected to IC4.
TIM1_ICFilterSpecifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 2254 of file stm8s_tim1.c.

References TIM1, TIM1_CCER2_CC3E, TIM1_CCER2_CC3P, TIM1_CCMR_CCxS, TIM1_CCMR_ICxF, and TIM1_ICPOLARITY_RISING.

Referenced by TIM1_ICInit().

static void TI4_Config ( uint8_t  TIM1_ICPolarity,
uint8_t  TIM1_ICSelection,
uint8_t  TIM1_ICFilter 
) [static]

Configure the TI4 as Input.

Parameters:
TIM1_ICPolarityThe Input Polarity. This parameter can be one of the following values:
  • TIM1_ICPOLARITY_FALLING
  • TIM1_ICPOLARITY_RISING
TIM1_ICSelectionspecifies the input to be used. This parameter can be one of the following values:
  • TIM1_ICSELECTION_DIRECTTI: TIM1 Input 4 is selected to be connected to IC4.
  • TIM1_ICSELECTION_INDIRECTTI: TIM1 Input 4 is selected to be connected to IC3.
TIM1_ICFilterSpecifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 2294 of file stm8s_tim1.c.

References TIM1, TIM1_CCER2_CC4E, TIM1_CCER2_CC4P, TIM1_CCMR_CCxS, TIM1_CCMR_ICxF, and TIM1_ICPOLARITY_RISING.

Referenced by TIM1_ICInit().

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 1139 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 from TIM1_OSSIState_TypeDef.
TIM1_LockLevelspecifies the lock level from TIM1_LockLevel_TypeDef.
TIM1_DeadTimespecifies the dead time value.
TIM1_Breakspecifies the Break state TIM1_BreakState_TypeDef.
TIM1_BreakPolarityspecifies the Break polarity from TIM1_BreakPolarity_TypeDef.
TIM1_AutomaticOutputspecifies the Automatic Output configuration from TIM1_AutomaticOutput_TypeDef.
Return values:
None

Definition at line 388 of file stm8s_tim1.c.

References IS_TIM1_AUTOMATIC_OUTPUT_STATE_OK, IS_TIM1_BREAK_POLARITY_OK, IS_TIM1_BREAK_STATE_OK, IS_TIM1_LOCK_LEVEL_OK, IS_TIM1_OSSI_STATE_OK, 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 1183 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 1579 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, IS_TIM1_CHANNEL_OK, 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 1647 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, IS_TIM1_COMPLEMENTARY_CHANNEL_OK, 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 2087 of file stm8s_tim1.c.

References IS_TIM1_CLEAR_FLAG_OK, 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 one of the following values:
  • TIM1_IT_UPDATE: TIM1 update Interrupt source
  • TIM1_IT_CC1: TIM1 Capture Compare 1 Interrupt source
  • TIM1_IT_CC2: TIM1 Capture Compare 2 Interrupt source
  • TIM1_IT_CC3: TIM1 Capture Compare 3 Interrupt source
  • TIM1_IT_CC4: TIM1 Capture Compare 4 Interrupt source
  • TIM1_IT_COM: TIM1 Commutation Interrupt source
  • TIM1_IT_TRIGGER: TIM1 Trigger Interrupt source
  • TIM1_IT_BREAK: TIM1 Break Interrupt source
Return values:
None.

Definition at line 2149 of file stm8s_tim1.c.

References IS_TIM1_IT_OK, and TIM1.

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 561 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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
  • TIM1_COUNTERMODE_CENTERALIGNED3: TIM1 Center Aligned Mode3
Return values:
None

Definition at line 1048 of file stm8s_tim1.c.

References IS_TIM1_COUNTER_MODE_OK, 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 583 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, TIM1, and TIM1_BKR_MOE.

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_FALLING
  • TIM1_ICPOLARITY_RISING
TIM1_IC2Polarityspecifies the IC2 Polarity. This parameter can be one of the following values
  • TIM1_ICPOLARITY_FALLING
  • TIM1_ICPOLARITY_RISING
Return values:
None

Definition at line 975 of file stm8s_tim1.c.

References CCMR_TIxDirect_Set, IS_TIM1_ENCODER_MODE_OK, IS_TIM1_IC_POLARITY_OK, 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 662 of file stm8s_tim1.c.

References IS_TIM1_EXT_POLARITY_OK, IS_TIM1_EXT_PRESCALER_OK, TIM1, TIM1_ETRConfig(), TIM1_SLAVEMODE_EXTERNAL1, TIM1_SMCR_SMS, TIM1_SMCR_TS, and TIM1_TS_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 694 of file stm8s_tim1.c.

References IS_TIM1_EXT_POLARITY_OK, IS_TIM1_EXT_PRESCALER_OK, 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 725 of file stm8s_tim1.c.

References IS_TIM1_EXT_TRG_FILTER_OK, 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 1067 of file stm8s_tim1.c.

References IS_TIM1_FORCED_ACTION_OK, 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 1085 of file stm8s_tim1.c.

References IS_TIM1_FORCED_ACTION_OK, 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 1104 of file stm8s_tim1.c.

References IS_TIM1_FORCED_ACTION_OK, TIM1, and TIM1_CCMR_OCM.

void TIM1_ForcedOC4Config ( TIM1_ForcedAction_TypeDef  TIM1_ForcedAction)

Forces the TIM1 Channel4 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 OC4REF
  • TIM1_FORCEDACTION_INACTIVE: Force inactive level on OC4REF.
Return values:
None

Definition at line 1123 of file stm8s_tim1.c.

References IS_TIM1_FORCED_ACTION_OK, 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 one of the following values:
  • TIM1_EVENTSOURCE_UPDATE: TIM1 update Event source
  • TIM1_EVENTSOURCE_CC1: TIM1 Capture Compare 1 Event source
  • TIM1_EVENTSOURCE_CC2: TIM1 Capture Compare 2 Event source
  • TIM1_EVENTSOURCE_CC3: TIM1 Capture Compare 3 Event source
  • TIM1_EVENTSOURCE_CC4: TIM1 Capture Compare 4 Event source
  • TIM1_EVENTSOURCE_COM: TIM1 COM Event source
  • TIM1_EVENTSOURCE_TRIGGER: TIM1 Trigger Event source
  • TIM1_EventSourceBreak: TIM1 Break Event source
Return values:
None

Definition at line 1389 of file stm8s_tim1.c.

References IS_TIM1_EVENT_SOURCE_OK, 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 1922 of file stm8s_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 1943 of file stm8s_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 1964 of file stm8s_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 1984 of file stm8s_tim1.c.

References TIM1.

uint16_t TIM1_GetCounter ( void  )

Gets the TIM1 Counter value.

Parameters:
None
Return values:
CounterRegister value.

Definition at line 2004 of file stm8s_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 2047 of file stm8s_tim1.c.

References IS_TIM1_GET_FLAG_OK, 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 one of the following values:
  • TIM1_IT_UPDATE: TIM1 update Interrupt source
  • TIM1_IT_CC1: TIM1 Capture Compare 1 Interrupt source
  • TIM1_IT_CC2: TIM1 Capture Compare 2 Interrupt source
  • TIM1_IT_CC3: TIM1 Capture Compare 3 Interrupt source
  • TIM1_IT_CC4: TIM1 Capture Compare 4 Interrupt source
  • TIM1_IT_COM: TIM1 Commutation Interrupt source
  • TIM1_IT_TRIGGER: TIM1 Trigger Interrupt source
  • TIM1_IT_BREAK: TIM1 Break Interrupt source
Return values:
ITStatusThe new state of the TIM1_IT(SET or RESET).

Definition at line 2112 of file stm8s_tim1.c.

References IS_TIM1_GET_IT_OK, RESET, SET, and TIM1.

uint16_t TIM1_GetPrescaler ( void  )

Gets the TIM1 Prescaler value.

Parameters:
None
Return values:
PrescalerRegister value.

Definition at line 2019 of file stm8s_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 from TIM1_Channel_TypeDef.
TIM1_ICPolarityspecifies the Input capture polarity from TIM1_ICPolarity_TypeDef .
TIM1_ICSelectionspecifies the Input capture source selection from TIM1_ICSelection_TypeDef.
TIM1_ICPrescalerspecifies the Input capture Prescaler from TIM1_ICPSC_TypeDef.
TIM1_ICFilterspecifies the Input capture filter value.
Return values:
None

Definition at line 423 of file stm8s_tim1.c.

References IS_TIM1_CHANNEL_OK, IS_TIM1_IC_FILTER_OK, IS_TIM1_IC_POLARITY_OK, IS_TIM1_IC_PRESCALER_OK, IS_TIM1_IC_SELECTION_OK, 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 640 of file stm8s_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: TIM1 update Interrupt source
  • TIM1_IT_CC1: TIM1 Capture Compare 1 Interrupt source
  • TIM1_IT_CC2: TIM1 Capture Compare 2 Interrupt source
  • TIM1_IT_CC3: TIM1 Capture Compare 3 Interrupt source
  • TIM1_IT_CC4: TIM1 Capture Compare 4 Interrupt source
  • TIM1_IT_CCUpdate: TIM1 Capture Compare Update Interrupt source
  • TIM1_IT_TRIGGER: TIM1 Trigger Interrupt source
  • TIM1_IT_BREAK: TIM1 Break Interrupt source
NewStatenew state of the TIM1 peripheral.
Return values:
None

Definition at line 617 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, IS_TIM1_IT_OK, 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 1293 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 from TIM1_OCMode_TypeDef.
TIM1_OutputStatespecifies the Output State from TIM1_OutputState_TypeDef.
TIM1_OutputNStatespecifies the Complementary Output State from TIM1_OutputNState_TypeDef.
TIM1_Pulsespecifies the Pulse width value.
TIM1_OCPolarityspecifies the Output Compare Polarity from TIM1_OCPolarity_TypeDef.
TIM1_OCNPolarityspecifies the Complementary Output Compare Polarity from TIM1_OCNPolarity_TypeDef.
TIM1_OCIdleStatespecifies the Output Compare Idle State from TIM1_OCIdleState_TypeDef.
TIM1_OCNIdleStatespecifies the Complementary Output Compare Idle State from TIM1_OCIdleState_TypeDef.
Return values:
None

Definition at line 154 of file stm8s_tim1.c.

References IS_TIM1_OC_MODE_OK, IS_TIM1_OC_POLARITY_OK, IS_TIM1_OCIDLE_STATE_OK, IS_TIM1_OCN_POLARITY_OK, IS_TIM1_OCNIDLE_STATE_OK, IS_TIM1_OUTPUT_STATE_OK, IS_TIM1_OUTPUTN_STATE_OK, 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_LOW: Output Compare active low
  • TIM1_OCNPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 1430 of file stm8s_tim1.c.

References IS_TIM1_OCN_POLARITY_OK, 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_LOW: Output Compare active low
  • TIM1_OCPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 1406 of file stm8s_tim1.c.

References IS_TIM1_OC_POLARITY_OK, 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 1205 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 1315 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 from TIM1_OCMode_TypeDef.
TIM1_OutputStatespecifies the Output State from TIM1_OutputState_TypeDef.
TIM1_OutputNStatespecifies the Complementary Output State from TIM1_OutputNState_TypeDef.
TIM1_Pulsespecifies the Pulse width value.
TIM1_OCPolarityspecifies the Output Compare Polarity from TIM1_OCPolarity_TypeDef.
TIM1_OCNPolarityspecifies the Complementary Output Compare Polarity from TIM1_OCNPolarity_TypeDef.
TIM1_OCIdleStatespecifies the Output Compare Idle State from TIM1_OCIdleState_TypeDef.
TIM1_OCNIdleStatespecifies the Complementary Output Compare Idle State from TIM1_OCIdleState_TypeDef.
Return values:
None

Definition at line 217 of file stm8s_tim1.c.

References IS_TIM1_OC_MODE_OK, IS_TIM1_OC_POLARITY_OK, IS_TIM1_OCIDLE_STATE_OK, IS_TIM1_OCN_POLARITY_OK, IS_TIM1_OCNIDLE_STATE_OK, IS_TIM1_OUTPUT_STATE_OK, IS_TIM1_OUTPUTN_STATE_OK, 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_LOW: Output Compare active low
  • TIM1_OCNPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 1478 of file stm8s_tim1.c.

References IS_TIM1_OCN_POLARITY_OK, 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_LOW: Output Compare active low
  • TIM1_OCPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 1454 of file stm8s_tim1.c.

References IS_TIM1_OC_POLARITY_OK, 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 1227 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 1337 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 from TIM1_OCMode_TypeDef.
TIM1_OutputStatespecifies the Output State from TIM1_OutputState_TypeDef.
TIM1_OutputNStatespecifies the Complementary Output State from TIM1_OutputNState_TypeDef.
TIM1_Pulsespecifies the Pulse width value.
TIM1_OCPolarityspecifies the Output Compare Polarity from TIM1_OCPolarity_TypeDef.
TIM1_OCNPolarityspecifies the Complementary Output Compare Polarity from TIM1_OCNPolarity_TypeDef.
TIM1_OCIdleStatespecifies the Output Compare Idle State from TIM1_OCIdleState_TypeDef.
TIM1_OCNIdleStatespecifies the Complementary Output Compare Idle State from TIM1_OCIdleState_TypeDef.
Return values:
None

Definition at line 281 of file stm8s_tim1.c.

References IS_TIM1_OC_MODE_OK, IS_TIM1_OC_POLARITY_OK, IS_TIM1_OCIDLE_STATE_OK, IS_TIM1_OCN_POLARITY_OK, IS_TIM1_OCNIDLE_STATE_OK, IS_TIM1_OUTPUT_STATE_OK, IS_TIM1_OUTPUTN_STATE_OK, 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_LOW: Output Compare active low
  • TIM1_OCNPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 1527 of file stm8s_tim1.c.

References IS_TIM1_OCN_POLARITY_OK, 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_LOW: Output Compare active low
  • TIM1_OCPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 1502 of file stm8s_tim1.c.

References IS_TIM1_OC_POLARITY_OK, 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 1249 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, TIM1, and TIM1_CCMR_OCxPE.

void TIM1_OC4FastConfig ( FunctionalState  NewState)

Configures the TIM1 Capture Compare 4 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 1359 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, TIM1, and TIM1_CCMR_OCxFE.

void TIM1_OC4Init ( TIM1_OCMode_TypeDef  TIM1_OCMode,
TIM1_OutputState_TypeDef  TIM1_OutputState,
uint16_t  TIM1_Pulse,
TIM1_OCPolarity_TypeDef  TIM1_OCPolarity,
TIM1_OCIdleState_TypeDef  TIM1_OCIdleState 
)

Initializes the TIM1 Channel4 according to the specified parameters.

Parameters:
TIM1_OCModespecifies the Output Compare mode from TIM1_OCMode_TypeDef.
TIM1_OutputStatespecifies the Output State from TIM1_OutputState_TypeDef.
TIM1_Pulsespecifies the Pulse width value.
TIM1_OCPolarityspecifies the Output Compare Polarity from TIM1_OCPolarity_TypeDef.
TIM1_OCIdleStatespecifies the Output Compare Idle State from TIM1_OCIdleState_TypeDef.
Return values:
None

Definition at line 338 of file stm8s_tim1.c.

References IS_TIM1_OC_MODE_OK, IS_TIM1_OC_POLARITY_OK, IS_TIM1_OCIDLE_STATE_OK, IS_TIM1_OUTPUT_STATE_OK, TIM1, TIM1_CCER2_CC4E, TIM1_CCER2_CC4P, TIM1_CCMR_OCM, TIM1_OCIDLESTATE_RESET, and TIM1_OISR_OIS4.

void TIM1_OC4PolarityConfig ( TIM1_OCPolarity_TypeDef  TIM1_OCPolarity)

Configures the TIM1 Channel 4 polarity.

Parameters:
TIM1_OCPolarityspecifies the OC4 Polarity. This parameter can be one of the following values:
  • TIM1_OCPOLARITY_LOW: Output Compare active low
  • TIM1_OCPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 1551 of file stm8s_tim1.c.

References IS_TIM1_OC_POLARITY_OK, TIM1, TIM1_CCER2_CC4P, and TIM1_OCPOLARITY_HIGH.

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 1271 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 1023 of file stm8s_tim1.c.

References IS_TIM1_PRESCALER_RELOAD_OK, 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 from TIM1_Channel_TypeDef.
TIM1_ICPolarityspecifies the Input capture polarity from TIM1_ICPolarity_TypeDef .
TIM1_ICSelectionspecifies the Input capture source selection from TIM1_ICSelection_TypeDef.
TIM1_ICPrescalerspecifies the Input capture Prescaler from TIM1_ICPSC_TypeDef.
TIM1_ICFilterspecifies the Input capture filter value.
Return values:
None

Definition at line 488 of file stm8s_tim1.c.

References IS_TIM1_IC_POLARITY_OK, IS_TIM1_IC_PRESCALER_OK, IS_TIM1_IC_SELECTION_OK, IS_TIM1_PWMI_CHANNEL_OK, 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_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 1161 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, TIM1, and TIM1_CR2_COMS.

void TIM1_SelectHallSensor ( FunctionalState  NewState)

Enables or Disables the TIM1�s Hall sensor interface.

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

Definition at line 849 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, TIM1, and TIM1_CR2_TI1S.

void TIM1_SelectInputTrigger ( TIM1_TS_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_TS_TI1F_ED: TI1 Edge Detector
  • TIM1_TS_TI1FP1: Filtered Timer Input 1
  • TIM1_TS_TI2FP2: Filtered Timer Input 2
  • TIM1_TS_ETRF: External Trigger input
Return values:
None

Definition at line 787 of file stm8s_tim1.c.

References IS_TIM1_TRIGGER_SELECTION_OK, 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 939 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, TIM1, and TIM1_SMCR_MSM.

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. 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
  • TIM1_OCMODE_ACTIVE
  • TIM1_OCMODE_TOGGLE
  • TIM1_OCMODE_PWM1
  • TIM1_OCMODE_PWM2
  • TIM1_FORCEDACTION_ACTIVE
  • TIM1_FORCEDACTION_INACTIVE
Return values:
None

Definition at line 1712 of file stm8s_tim1.c.

References IS_TIM1_CHANNEL_OK, IS_TIM1_OCM_OK, TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC2E, TIM1_CCER2_CC3E, TIM1_CCER2_CC4E, TIM1_CCMR_OCM, TIM1_CHANNEL_1, TIM1_CHANNEL_2, and TIM1_CHANNEL_3.

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 873 of file stm8s_tim1.c.

References IS_TIM1_OPM_MODE_OK, 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
Return values:
None

Definition at line 903 of file stm8s_tim1.c.

References IS_TIM1_TRGO_SOURCE_OK, 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 923 of file stm8s_tim1.c.

References IS_TIM1_SLAVE_MODE_OK, 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 1775 of file stm8s_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 1788 of file stm8s_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 1801 of file stm8s_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 1814 of file stm8s_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 1827 of file stm8s_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 1762 of file stm8s_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: no prescaler
  • TIM1_ICPSC_DIV2: capture is done once every 2 events
  • TIM1_ICPSC_DIV4: capture is done once every 4 events
  • TIM1_ICPSC_DIV8: capture is done once every 8 events
Return values:
None

Definition at line 1844 of file stm8s_tim1.c.

References IS_TIM1_IC_PRESCALER_OK, 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: no prescaler
  • TIM1_ICPSC_DIV2: capture is done once every 2 events
  • TIM1_ICPSC_DIV4: capture is done once every 4 events
  • TIM1_ICPSC_DIV8: capture is done once every 8 events
Return values:
None

Definition at line 1864 of file stm8s_tim1.c.

References IS_TIM1_IC_PRESCALER_OK, 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: no prescaler
  • TIM1_ICPSC_DIV2: capture is done once every 2 events
  • TIM1_ICPSC_DIV4: capture is done once every 4 events
  • TIM1_ICPSC_DIV8: capture is done once every 8 events
Return values:
None

Definition at line 1885 of file stm8s_tim1.c.

References IS_TIM1_IC_PRESCALER_OK, 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: no prescaler
  • TIM1_ICPSC_DIV2: capture is done once every 2 events
  • TIM1_ICPSC_DIV4: capture is done once every 4 events
  • TIM1_ICPSC_DIV8: capture is done once every 8 events
Return values:
None

Definition at line 1906 of file stm8s_tim1.c.

References IS_TIM1_IC_PRESCALER_OK, 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 TIM1_CounterMode_TypeDef .
TIM1_Periodspecifies the Period value.
TIM1_RepetitionCounterspecifies the Repetition counter value
Return values:
None

Definition at line 111 of file stm8s_tim1.c.

References IS_TIM1_COUNTER_MODE_OK, 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:
  • TIM1_ICPOLARITY_RISING
  • TIM1_ICPOLARITY_FALLING
ICFilterspecifies the filter value. This parameter must be a value between 0x00 and 0x0F
Return values:
None

Definition at line 751 of file stm8s_tim1.c.

References IS_TIM1_IC_FILTER_OK, IS_TIM1_IC_POLARITY_OK, IS_TIM1_TIXCLK_SOURCE_OK, 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 803 of file stm8s_tim1.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, 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 827 of file stm8s_tim1.c.

References IS_TIM1_UPDATE_SOURCE_OK, TIM1, TIM1_CR1_URS, and TIM1_UPDATESOURCE_GLOBAL.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com