STM8S/A Standard Peripherals Drivers: TIM3_Public_Functions

STM8S/A

STM8S/A Standard Peripherals Drivers
TIM3_Public_Functions

Functions

static void TI1_Config (uint8_t TIM3_ICPolarity, uint8_t TIM3_ICSelection, uint8_t TIM3_ICFilter)
 Configure the TI1 as Input.
static void TI2_Config (uint8_t TIM3_ICPolarity, uint8_t TIM3_ICSelection, uint8_t TIM3_ICFilter)
 Configure the TI2 as Input.
void TIM3_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM3 peripheral Preload register on ARR.
void TIM3_CCxCmd (TIM3_Channel_TypeDef TIM3_Channel, FunctionalState NewState)
 Enables or disables the TIM3 Capture Compare Channel x.
void TIM3_ClearFlag (TIM3_FLAG_TypeDef TIM3_FLAG)
 Clears the TIM3�s pending flags.
void TIM3_ClearITPendingBit (TIM3_IT_TypeDef TIM3_IT)
 Clears the TIM3's interrupt pending bits.
void TIM3_Cmd (FunctionalState NewState)
 Enables or disables the TIM3 peripheral.
void TIM3_DeInit (void)
 Deinitializes the TIM3 peripheral registers to their default reset values.
void TIM3_ForcedOC1Config (TIM3_ForcedAction_TypeDef TIM3_ForcedAction)
 Forces the TIM3 Channel1 output waveform to active or inactive level.
void TIM3_ForcedOC2Config (TIM3_ForcedAction_TypeDef TIM3_ForcedAction)
 Forces the TIM3 Channel2 output waveform to active or inactive level.
void TIM3_GenerateEvent (TIM3_EventSource_TypeDef TIM3_EventSource)
 Configures the TIM3 event to be generated by software.
uint16_t TIM3_GetCapture1 (void)
 Gets the TIM3 Input Capture 1 value.
uint16_t TIM3_GetCapture2 (void)
 Gets the TIM3 Input Capture 2 value.
uint16_t TIM3_GetCounter (void)
 Gets the TIM3 Counter value.
FlagStatus TIM3_GetFlagStatus (TIM3_FLAG_TypeDef TIM3_FLAG)
 Checks whether the specified TIM3 flag is set or not.
ITStatus TIM3_GetITStatus (TIM3_IT_TypeDef TIM3_IT)
 Checks whether the TIM3 interrupt has occurred or not.
TIM3_Prescaler_TypeDef TIM3_GetPrescaler (void)
 Gets the TIM3 Prescaler value.
void TIM3_ICInit (TIM3_Channel_TypeDef TIM3_Channel, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, TIM3_ICSelection_TypeDef TIM3_ICSelection, TIM3_ICPSC_TypeDef TIM3_ICPrescaler, uint8_t TIM3_ICFilter)
 Initializes the TIM3 peripheral according to the specified parameters.
void TIM3_ITConfig (TIM3_IT_TypeDef TIM3_IT, FunctionalState NewState)
 Enables or disables the specified TIM3 interrupts.
void TIM3_OC1Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Initializes the TIM3 Channel1 according to the specified parameters.
void TIM3_OC1PolarityConfig (TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Configures the TIM3 Channel 1 polarity.
void TIM3_OC1PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Preload Register on CCR1.
void TIM3_OC2Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Initializes the TIM3 Channel2 according to the specified parameters.
void TIM3_OC2PolarityConfig (TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Configures the TIM3 Channel 2 polarity.
void TIM3_OC2PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Preload Register on CCR2.
void TIM3_PrescalerConfig (TIM3_Prescaler_TypeDef Prescaler, TIM3_PSCReloadMode_TypeDef TIM3_PSCReloadMode)
 Configures the TIM3 Prescaler.
void TIM3_PWMIConfig (TIM3_Channel_TypeDef TIM3_Channel, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, TIM3_ICSelection_TypeDef TIM3_ICSelection, TIM3_ICPSC_TypeDef TIM3_ICPrescaler, uint8_t TIM3_ICFilter)
 Configures the TIM3 peripheral in PWM Input Mode according to the specified parameters.
void TIM3_SelectOCxM (TIM3_Channel_TypeDef TIM3_Channel, TIM3_OCMode_TypeDef TIM3_OCMode)
 Selects the TIM3 Output Compare Mode.
void TIM3_SelectOnePulseMode (TIM3_OPMode_TypeDef TIM3_OPMode)
 Selects the TIM3�s One Pulse Mode.
void TIM3_SetAutoreload (uint16_t Autoreload)
 Sets the TIM3 Autoreload Register value.
void TIM3_SetCompare1 (uint16_t Compare1)
 Sets the TIM3 Capture Compare1 Register value.
void TIM3_SetCompare2 (uint16_t Compare2)
 Sets the TIM3 Capture Compare2 Register value.
void TIM3_SetCounter (uint16_t Counter)
 Sets the TIM3 Counter Register value.
void TIM3_SetIC1Prescaler (TIM3_ICPSC_TypeDef TIM3_IC1Prescaler)
 Sets the TIM3 Input Capture 1 prescaler.
void TIM3_SetIC2Prescaler (TIM3_ICPSC_TypeDef TIM3_IC2Prescaler)
 Sets the TIM3 Input Capture 2 prescaler.
void TIM3_TimeBaseInit (TIM3_Prescaler_TypeDef TIM3_Prescaler, uint16_t TIM3_Period)
 Initializes the TIM3 Time Base Unit according to the specified parameters.
void TIM3_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM3 Update event.
void TIM3_UpdateRequestConfig (TIM3_UpdateSource_TypeDef TIM3_UpdateSource)
 Selects the TIM3 Update Request Interrupt source.

Function Documentation

static void TI1_Config ( uint8_t  TIM3_ICPolarity,
uint8_t  TIM3_ICSelection,
uint8_t  TIM3_ICFilter 
) [static]

Configure the TI1 as Input.

Parameters:
TIM3_ICPolarityThe Input Polarity. This parameter can be one of the following values:
  • TIM3_ICPOLARITY_FALLING
  • TIM3_ICPOLARITY_RISING
TIM3_ICSelectionspecifies the input to be used. This parameter can be one of the following values:
  • TIM3_ICSELECTION_DIRECTTI: TIM3 Input 1 is selected to be connected to IC1.
  • TIM3_ICSELECTION_INDIRECTTI: TIM3 Input 1 is selected to be connected to IC2.
TIM3_ICFilterSpecifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 970 of file stm8s_tim3.c.

References TIM3_CCER1_CC1E, TIM3_CCER1_CC1P, TIM3_CCMR_CCxS, TIM3_CCMR_ICxF, and TIM3_ICPOLARITY_RISING.

Referenced by TIM3_ICInit(), and TIM3_PWMIConfig().

static void TI2_Config ( uint8_t  TIM3_ICPolarity,
uint8_t  TIM3_ICSelection,
uint8_t  TIM3_ICFilter 
) [static]

Configure the TI2 as Input.

Parameters:
TIM3_ICPolarityThe Input Polarity. This parameter can be one of the following values:
  • TIM3_ICPOLARITY_FALLING
  • TIM3_ICPOLARITY_RISING
TIM3_ICSelectionspecifies the input to be used. This parameter can be one of the following values:
  • TIM3_ICSELECTION_DIRECTTI: TIM3 Input 2 is selected to be connected to IC2.
  • TIM3_ICSELECTION_INDIRECTTI: TIM3 Input 2 is selected to be connected to IC1.
TIM3_ICFilterSpecifies the Input Capture Filter. This parameter must be a value between 0x00 and 0x0F.
Return values:
None

Definition at line 1009 of file stm8s_tim3.c.

References TIM3_CCER1_CC2E, TIM3_CCER1_CC2P, TIM3_CCMR_CCxS, TIM3_CCMR_ICxF, and TIM3_ICPOLARITY_RISING.

Referenced by TIM3_ICInit(), and TIM3_PWMIConfig().

void TIM3_ARRPreloadConfig ( FunctionalState  NewState)

Enables or disables TIM3 peripheral Preload register on ARR.

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

Definition at line 483 of file stm8s_tim3.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM3_CR1_ARPE.

void TIM3_CCxCmd ( TIM3_Channel_TypeDef  TIM3_Channel,
FunctionalState  NewState 
)

Enables or disables the TIM3 Capture Compare Channel x.

Parameters:
TIM3_Channelspecifies the TIM3 Channel. This parameter can be one of the following values:
  • TIM3_CHANNEL_1: TIM3 Channel1
  • TIM3_CHANNEL_2: TIM3 Channel2
NewStatespecifies the TIM3 Channel CCxE bit new state. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 619 of file stm8s_tim3.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, IS_TIM3_CHANNEL_OK, TIM3_CCER1_CC1E, TIM3_CCER1_CC2E, and TIM3_CHANNEL_1.

void TIM3_ClearFlag ( TIM3_FLAG_TypeDef  TIM3_FLAG)

Clears the TIM3�s pending flags.

Parameters:
TIM3_FLAGspecifies the flag to clear. This parameter can be one of the following values:
  • TIM3_FLAG_UPDATE: TIM3 update Flag
  • TIM3_FLAG_CC1: TIM3 Capture Compare 1 Flag
  • TIM3_FLAG_CC2: TIM3 Capture Compare 2 Flag
  • TIM3_FLAG_CC1OF: TIM3 Capture Compare 1 over capture Flag
  • TIM3_FLAG_CC2OF: TIM3 Capture Compare 2 over capture Flag
Return values:
None.

Definition at line 894 of file stm8s_tim3.c.

References IS_TIM3_CLEAR_FLAG_OK.

void TIM3_ClearITPendingBit ( TIM3_IT_TypeDef  TIM3_IT)

Clears the TIM3's interrupt pending bits.

Parameters:
TIM3_ITspecifies the pending bit to clear. This parameter can be one of the following values:
  • TIM3_IT_UPDATE: TIM3 update Interrupt source
  • TIM3_IT_CC1: TIM3 Capture Compare 1 Interrupt source
  • TIM3_IT_CC2: TIM3 Capture Compare 2 Interrupt source
Return values:
None.

Definition at line 945 of file stm8s_tim3.c.

References IS_TIM3_IT_OK.

void TIM3_Cmd ( FunctionalState  NewState)

Enables or disables the TIM3 peripheral.

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

Definition at line 283 of file stm8s_tim3.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM3_CR1_CEN.

void TIM3_ForcedOC1Config ( TIM3_ForcedAction_TypeDef  TIM3_ForcedAction)

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

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

Definition at line 450 of file stm8s_tim3.c.

References IS_TIM3_FORCED_ACTION_OK, and TIM3_CCMR_OCM.

void TIM3_ForcedOC2Config ( TIM3_ForcedAction_TypeDef  TIM3_ForcedAction)

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

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

Definition at line 468 of file stm8s_tim3.c.

References IS_TIM3_FORCED_ACTION_OK, and TIM3_CCMR_OCM.

void TIM3_GenerateEvent ( TIM3_EventSource_TypeDef  TIM3_EventSource)

Configures the TIM3 event to be generated by software.

Parameters:
TIM3_EventSourcespecifies the event source. This parameter can be one of the following values:
  • TIM3_EVENTSOURCE_UPDATE: TIM3 update Event source
  • TIM3_EVENTSOURCE_CC1: TIM3 Capture Compare 1 Event source
  • TIM3_EVENTSOURCE_CC2: TIM3 Capture Compare 2 Event source
Return values:
None

Definition at line 552 of file stm8s_tim3.c.

References IS_TIM3_EVENT_SOURCE_OK.

uint16_t TIM3_GetCapture1 ( void  )

Gets the TIM3 Input Capture 1 value.

Parameters:
None
Return values:
CaptureCompare 1 Register value.

Definition at line 790 of file stm8s_tim3.c.

uint16_t TIM3_GetCapture2 ( void  )

Gets the TIM3 Input Capture 2 value.

Parameters:
None
Return values:
CaptureCompare 2 Register value.

Definition at line 810 of file stm8s_tim3.c.

uint16_t TIM3_GetCounter ( void  )

Gets the TIM3 Counter value.

Parameters:
None
Return values:
CounterRegister value.

Definition at line 830 of file stm8s_tim3.c.

FlagStatus TIM3_GetFlagStatus ( TIM3_FLAG_TypeDef  TIM3_FLAG)

Checks whether the specified TIM3 flag is set or not.

Parameters:
TIM3_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • TIM3_FLAG_UPDATE: TIM3 update Flag
  • TIM3_FLAG_CC1: TIM3 Capture Compare 1 Flag
  • TIM3_FLAG_CC2: TIM3 Capture Compare 2 Flag
  • TIM3_FLAG_CC1OF: TIM3 Capture Compare 1 over capture Flag
  • TIM3_FLAG_CC2OF: TIM3 Capture Compare 2 over capture Flag
Return values:
FlagStatusThe new state of TIM3_FLAG (SET or RESET).

Definition at line 861 of file stm8s_tim3.c.

References IS_TIM3_GET_FLAG_OK, RESET, and SET.

ITStatus TIM3_GetITStatus ( TIM3_IT_TypeDef  TIM3_IT)

Checks whether the TIM3 interrupt has occurred or not.

Parameters:
TIM3_ITspecifies the TIM3 interrupt source to check. This parameter can be one of the following values:
  • TIM3_IT_UPDATE: TIM3 update Interrupt source
  • TIM3_IT_CC1: TIM3 Capture Compare 1 Interrupt source
  • TIM3_IT_CC2: TIM3 Capture Compare 2 Interrupt source
Return values:
ITStatusThe new state of the TIM3_IT(SET or RESET).

Definition at line 913 of file stm8s_tim3.c.

References IS_TIM3_GET_IT_OK, RESET, and SET.

TIM3_Prescaler_TypeDef TIM3_GetPrescaler ( void  )

Gets the TIM3 Prescaler value.

Parameters:
None
Return values:
PrescalerRegister configuration value TIM3_Prescaler_TypeDef.

Definition at line 844 of file stm8s_tim3.c.

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

Initializes the TIM3 peripheral according to the specified parameters.

Parameters:
TIM3_Channelspecifies the Input Capture Channel from TIM3_Channel_TypeDef.
TIM3_ICPolarityspecifies the Input Capture Polarity from TIM3_ICPolarity_TypeDef.
TIM3_ICSelectionspecifies the Input Capture Selection from TIM3_ICSelection_TypeDef.
TIM3_ICPrescalerspecifies the Input Capture Prescaler from TIM3_ICPSC_TypeDef.
TIM3_ICFilterspecifies the Input Capture Filter value (value can be an integer from 0x00 to 0x0F).
Return values:
None

Definition at line 166 of file stm8s_tim3.c.

References IS_TIM3_CHANNEL_OK, IS_TIM3_IC_FILTER_OK, IS_TIM3_IC_POLARITY_OK, IS_TIM3_IC_PRESCALER_OK, IS_TIM3_IC_SELECTION_OK, TI1_Config(), TI2_Config(), TIM3_CHANNEL_2, TIM3_SetIC1Prescaler(), and TIM3_SetIC2Prescaler().

void TIM3_ITConfig ( TIM3_IT_TypeDef  TIM3_IT,
FunctionalState  NewState 
)

Enables or disables the specified TIM3 interrupts.

Parameters:
NewStatenew state of the TIM3 peripheral. This parameter can be: ENABLE or DISABLE.
TIM3_ITspecifies the TIM3 interrupts sources to be enabled or disabled. This parameter can be any combination of the following values:
  • TIM3_IT_UPDATE: TIM3 update Interrupt source
  • TIM3_IT_CC1: TIM3 Capture Compare 1 Interrupt source
  • TIM3_IT_CC2: TIM3 Capture Compare 2 Interrupt source
  • TIM3_IT_CC3: TIM3 Capture Compare 3 Interrupt source
NewStatenew state of the TIM3 peripheral. *
Return values:
None

Definition at line 311 of file stm8s_tim3.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, and IS_TIM3_IT_OK.

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

Initializes the TIM3 Channel1 according to the specified parameters.

Parameters:
TIM3_OCModespecifies the Output Compare mode from TIM3_OCMode_TypeDef.
TIM3_OutputStatespecifies the Output State from TIM3_OutputState_TypeDef.
TIM3_Pulsespecifies the Pulse width value.
TIM3_OCPolarityspecifies the Output Compare Polarity from TIM3_OCPolarity_TypeDef.
Return values:
None

Definition at line 100 of file stm8s_tim3.c.

References IS_TIM3_OC_MODE_OK, IS_TIM3_OC_POLARITY_OK, IS_TIM3_OUTPUT_STATE_OK, TIM3_CCER1_CC1E, TIM3_CCER1_CC1P, and TIM3_CCMR_OCM.

void TIM3_OC1PolarityConfig ( TIM3_OCPolarity_TypeDef  TIM3_OCPolarity)

Configures the TIM3 Channel 1 polarity.

Parameters:
TIM3_OCPolarityspecifies the OC1 Polarity. This parameter can be one of the following values:
  • TIM3_OCPOLARITY_LOW: Output Compare active low
  • TIM3_OCPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 569 of file stm8s_tim3.c.

References IS_TIM3_OC_POLARITY_OK, TIM3_CCER1_CC1P, and TIM3_OCPOLARITY_HIGH.

void TIM3_OC1PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM3 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 505 of file stm8s_tim3.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM3_CCMR_OCxPE.

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

Initializes the TIM3 Channel2 according to the specified parameters.

Parameters:
TIM3_OCModespecifies the Output Compare mode from TIM3_OCMode_TypeDef.
TIM3_OutputStatespecifies the Output State from TIM3_OutputState_TypeDef.
TIM3_Pulsespecifies the Pulse width value.
TIM3_OCPolarityspecifies the Output Compare Polarity from TIM3_OCPolarity_TypeDef.
Return values:
None

Definition at line 131 of file stm8s_tim3.c.

References IS_TIM3_OC_MODE_OK, IS_TIM3_OC_POLARITY_OK, IS_TIM3_OUTPUT_STATE_OK, TIM3_CCER1_CC2E, TIM3_CCER1_CC2P, and TIM3_CCMR_OCM.

void TIM3_OC2PolarityConfig ( TIM3_OCPolarity_TypeDef  TIM3_OCPolarity)

Configures the TIM3 Channel 2 polarity.

Parameters:
TIM3_OCPolarityspecifies the OC2 Polarity. This parameter can be one of the following values:
  • TIM3_OCPOLARITY_LOW: Output Compare active low
  • TIM3_OCPOLARITY_HIGH: Output Compare active high
Return values:
None

Definition at line 593 of file stm8s_tim3.c.

References IS_TIM3_OC_POLARITY_OK, TIM3_CCER1_CC2P, and TIM3_OCPOLARITY_HIGH.

void TIM3_OC2PreloadConfig ( FunctionalState  NewState)

Enables or disables the TIM3 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 527 of file stm8s_tim3.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM3_CCMR_OCxPE.

void TIM3_PrescalerConfig ( TIM3_Prescaler_TypeDef  Prescaler,
TIM3_PSCReloadMode_TypeDef  TIM3_PSCReloadMode 
)

Configures the TIM3 Prescaler.

Parameters:
Prescalerspecifies the Prescaler Register value This parameter can be one of the following values
  • TIM3_PRESCALER_1
  • TIM3_PRESCALER_2
  • TIM3_PRESCALER_4
  • TIM3_PRESCALER_8
  • TIM3_PRESCALER_16
  • TIM3_PRESCALER_32
  • TIM3_PRESCALER_64
  • TIM3_PRESCALER_128
  • TIM3_PRESCALER_256
  • TIM3_PRESCALER_512
  • TIM3_PRESCALER_1024
  • TIM3_PRESCALER_2048
  • TIM3_PRESCALER_4096
  • TIM3_PRESCALER_8192
  • TIM3_PRESCALER_16384
  • TIM3_PRESCALER_32768
TIM3_PSCReloadModespecifies the TIM3 Prescaler Reload mode. This parameter can be one of the following values
  • TIM3_PSCRELOADMODE_IMMEDIATE: The Prescaler is loaded immediately.
  • TIM3_PSCRELOADMODE_UPDATE: The Prescaler is loaded at the update event.
Return values:
None

Definition at line 427 of file stm8s_tim3.c.

References IS_TIM3_PRESCALER_OK, and IS_TIM3_PRESCALER_RELOAD_OK.

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

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

Parameters:
TIM3_Channelspecifies the Input Capture Channel from TIM3_Channel_TypeDef.
TIM3_ICPolarityspecifies the Input Capture Polarity from TIM3_ICPolarity_TypeDef.
TIM3_ICSelectionspecifies the Input Capture Selection from TIM3_ICSelection_TypeDef.
TIM3_ICPrescalerspecifies the Input Capture Prescaler from TIM3_ICPSC_TypeDef.
TIM3_ICFilterspecifies the Input Capture Filter value (value can be an integer from 0x00 to 0x0F).
Return values:
None

Definition at line 210 of file stm8s_tim3.c.

References IS_TIM3_IC_POLARITY_OK, IS_TIM3_IC_PRESCALER_OK, IS_TIM3_IC_SELECTION_OK, IS_TIM3_PWMI_CHANNEL_OK, TI1_Config(), TI2_Config(), TIM3_CHANNEL_2, TIM3_ICPOLARITY_FALLING, TIM3_ICPOLARITY_RISING, TIM3_ICSELECTION_DIRECTTI, TIM3_ICSELECTION_INDIRECTTI, TIM3_SetIC1Prescaler(), and TIM3_SetIC2Prescaler().

void TIM3_SelectOCxM ( TIM3_Channel_TypeDef  TIM3_Channel,
TIM3_OCMode_TypeDef  TIM3_OCMode 
)

Selects the TIM3 Output Compare Mode.

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

Parameters:
TIM3_Channelspecifies the TIM3 Channel. This parameter can be one of the following values:
  • TIM3_CHANNEL_1: TIM3 Channel1
  • TIM3_CHANNEL_2: TIM3 Channel2
TIM3_OCModespecifies the TIM3 Output Compare Mode. This parameter can be one of the following values:
  • TIM3_OCMODE_TIMING
  • TIM3_OCMODE_ACTIVE
  • TIM3_OCMODE_TOGGLE
  • TIM3_OCMODE_PWM1
  • TIM3_OCMODE_PWM2
  • TIM3_FORCEDACTION_ACTIVE
  • TIM3_FORCEDACTION_INACTIVE
Return values:
None

Definition at line 671 of file stm8s_tim3.c.

References IS_TIM3_CHANNEL_OK, IS_TIM3_OCM_OK, TIM3_CCER1_CC1E, TIM3_CCER1_CC2E, TIM3_CCMR_OCM, and TIM3_CHANNEL_1.

void TIM3_SelectOnePulseMode ( TIM3_OPMode_TypeDef  TIM3_OPMode)

Selects the TIM3�s One Pulse Mode.

Parameters:
TIM3_OPModespecifies the OPM Mode to be used. This parameter can be one of the following values
  • TIM3_OPMODE_SINGLE
  • TIM3_OPMODE_REPETITIVE
Return values:
None

Definition at line 383 of file stm8s_tim3.c.

References IS_TIM3_OPM_MODE_OK, TIM3_CR1_OPM, and TIM3_OPMODE_REPETITIVE.

void TIM3_SetAutoreload ( uint16_t  Autoreload)

Sets the TIM3 Autoreload Register value.

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

Definition at line 714 of file stm8s_tim3.c.

void TIM3_SetCompare1 ( uint16_t  Compare1)

Sets the TIM3 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 727 of file stm8s_tim3.c.

void TIM3_SetCompare2 ( uint16_t  Compare2)

Sets the TIM3 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 740 of file stm8s_tim3.c.

void TIM3_SetCounter ( uint16_t  Counter)

Sets the TIM3 Counter Register value.

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

Definition at line 701 of file stm8s_tim3.c.

void TIM3_SetIC1Prescaler ( TIM3_ICPSC_TypeDef  TIM3_IC1Prescaler)

Sets the TIM3 Input Capture 1 prescaler.

Parameters:
TIM3_IC1Prescalerspecifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM3_ICPSC_DIV1: no prescaler
  • TIM3_ICPSC_DIV2: capture is done once every 2 events
  • TIM3_ICPSC_DIV4: capture is done once every 4 events
  • TIM3_ICPSC_DIV8: capture is done once every 8 events
Return values:
None

Definition at line 757 of file stm8s_tim3.c.

References IS_TIM3_IC_PRESCALER_OK, and TIM3_CCMR_ICxPSC.

Referenced by TIM3_ICInit(), and TIM3_PWMIConfig().

void TIM3_SetIC2Prescaler ( TIM3_ICPSC_TypeDef  TIM3_IC2Prescaler)

Sets the TIM3 Input Capture 2 prescaler.

Parameters:
TIM3_IC2Prescalerspecifies the Input Capture prescaler new value This parameter can be one of the following values:
  • TIM3_ICPSC_DIV1: no prescaler
  • TIM3_ICPSC_DIV2: capture is done once every 2 events
  • TIM3_ICPSC_DIV4: capture is done once every 4 events
  • TIM3_ICPSC_DIV8: capture is done once every 8 events
Return values:
None

Definition at line 776 of file stm8s_tim3.c.

References IS_TIM3_IC_PRESCALER_OK, and TIM3_CCMR_ICxPSC.

Referenced by TIM3_ICInit(), and TIM3_PWMIConfig().

void TIM3_TimeBaseInit ( TIM3_Prescaler_TypeDef  TIM3_Prescaler,
uint16_t  TIM3_Period 
)

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

Parameters:
TIM3_Prescalerspecifies the Prescaler from TIM3_Prescaler_TypeDef.
TIM3_Periodspecifies the Period value.
Return values:
None

Definition at line 82 of file stm8s_tim3.c.

void TIM3_UpdateDisableConfig ( FunctionalState  NewState)

Enables or Disables the TIM3 Update event.

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

Definition at line 335 of file stm8s_tim3.c.

References DISABLE, IS_FUNCTIONALSTATE_OK, and TIM3_CR1_UDIS.

void TIM3_UpdateRequestConfig ( TIM3_UpdateSource_TypeDef  TIM3_UpdateSource)

Selects the TIM3 Update Request Interrupt source.

Parameters:
TIM3_UpdateSourcespecifies the Update source. This parameter can be one of the following values
  • TIM3_UPDATESOURCE_REGULAR
  • TIM3_UPDATESOURCE_GLOBAL
Return values:
None

Definition at line 359 of file stm8s_tim3.c.

References IS_TIM3_UPDATE_SOURCE_OK, TIM3_CR1_URS, and TIM3_UPDATESOURCE_GLOBAL.

STM8 Standard Peripherals Library: Footer

 

 

 

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