STM8S/A Standard Peripherals Firmware Library: TIM4_Exported_Functions

STM8S/A

STM8S/A Standard Peripherals Firmware Library
TIM4_Exported_Functions

Functions

void TIM4_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM4 peripheral Preload register on ARR.
void TIM4_ClearFlag (TIM4_FLAG_TypeDef TIM4_FLAG)
 Clears the TIM4�s pending flags.
void TIM4_ClearITPendingBit (TIM4_IT_TypeDef TIM4_IT)
 Clears the TIM4's interrupt pending bits.
void TIM4_Cmd (FunctionalState NewState)
 Enables or disables the TIM4 peripheral.
void TIM4_DeInit (void)
 Deinitializes the TIM4 peripheral registers to their default reset values.
void TIM4_GenerateEvent (TIM4_EventSource_TypeDef TIM4_EventSource)
 Configures the TIM4 event to be generated by software.
uint8_t TIM4_GetCounter (void)
 Gets the TIM4 Counter value.
FlagStatus TIM4_GetFlagStatus (TIM4_FLAG_TypeDef TIM4_FLAG)
 Checks whether the specified TIM4 flag is set or not.
ITStatus TIM4_GetITStatus (TIM4_IT_TypeDef TIM4_IT)
 Checks whether the TIM4 interrupt has occurred or not.
TIM4_Prescaler_TypeDef TIM4_GetPrescaler (void)
 Gets the TIM4 Prescaler value.
void TIM4_ITConfig (TIM4_IT_TypeDef TIM4_IT, FunctionalState NewState)
 Enables or disables the specified TIM4 interrupts.
void TIM4_PrescalerConfig (TIM4_Prescaler_TypeDef Prescaler, TIM4_PSCReloadMode_TypeDef TIM4_PSCReloadMode)
 Configures the TIM4 Prescaler.
void TIM4_SelectOnePulseMode (TIM4_OPMode_TypeDef TIM4_OPMode)
 Selects the TIM4�s One Pulse Mode.
void TIM4_SetAutoreload (uint8_t Autoreload)
 Sets the TIM4 Autoreload Register value.
void TIM4_SetCounter (uint8_t Counter)
 Sets the TIM4 Counter Register value.
void TIM4_TimeBaseInit (TIM4_Prescaler_TypeDef TIM4_Prescaler, uint8_t TIM4_Period)
 Initializes the TIM4 Time Base Unit according to the specified parameters.
void TIM4_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM4 Update event.
void TIM4_UpdateRequestConfig (TIM4_UpdateSource_TypeDef TIM4_UpdateSource)
 Selects the TIM4 Update Request Interrupt source.

Function Documentation

void TIM4_ARRPreloadConfig ( FunctionalState  NewState)

Enables or disables TIM4 peripheral Preload register on ARR.

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

Definition at line 234 of file stm8s_tim4.c.

References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM4_CR1_ARPE.

void TIM4_ClearFlag ( TIM4_FLAG_TypeDef  TIM4_FLAG)

Clears the TIM4�s pending flags.

Parameters:
TIM4_FLAGspecifies the flag to clear. This parameter can be one of the following values:
  • TIM4_FLAG_UPDATE: TIM4 update Flag
Return values:
None.

Definition at line 344 of file stm8s_tim4.c.

References assert_param, and IS_TIM4_GET_FLAG_OK.

Referenced by TIM4_Config().

void TIM4_ClearITPendingBit ( TIM4_IT_TypeDef  TIM4_IT)

Clears the TIM4's interrupt pending bits.

Parameters:
TIM4_ITspecifies the pending bit to clear. This parameter can be one of the following values:
  • TIM4_IT_UPDATE: TIM4 update Interrupt source
Return values:
None.

Definition at line 391 of file stm8s_tim4.c.

References assert_param, and IS_TIM4_IT_OK.

Referenced by INTERRUPT_HANDLER().

void TIM4_Cmd ( FunctionalState  NewState)

Enables or disables the TIM4 peripheral.

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

Definition at line 81 of file stm8s_tim4.c.

References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM4_CR1_CEN.

Referenced by TIM4_Config().

void TIM4_DeInit ( void  )

Deinitializes the TIM4 peripheral registers to their default reset values.

Parameters:
None
Return values:
None

Definition at line 49 of file stm8s_tim4.c.

References TIM4_ARR_RESET_VALUE, TIM4_CNTR_RESET_VALUE, TIM4_CR1_RESET_VALUE, TIM4_IER_RESET_VALUE, TIM4_PSCR_RESET_VALUE, and TIM4_SR1_RESET_VALUE.

void TIM4_GenerateEvent ( TIM4_EventSource_TypeDef  TIM4_EventSource)

Configures the TIM4 event to be generated by software.

Parameters:
TIM4_EventSourcespecifies the event source. This parameter can be one of the following values:
  • TIM4_EVENTSOURCE_UPDATE: TIM4 update Event source
Return values:
None

Definition at line 257 of file stm8s_tim4.c.

References assert_param, and IS_TIM4_EVENT_SOURCE_OK.

uint8_t TIM4_GetCounter ( void  )

Gets the TIM4 Counter value.

Parameters:
None
Return values:
CounterRegister value.

Definition at line 295 of file stm8s_tim4.c.

FlagStatus TIM4_GetFlagStatus ( TIM4_FLAG_TypeDef  TIM4_FLAG)

Checks whether the specified TIM4 flag is set or not.

Parameters:
TIM4_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • TIM4_FLAG_UPDATE: TIM4 update Flag
Return values:
FlagStatusThe new state of TIM4_FLAG (SET or RESET).

Definition at line 319 of file stm8s_tim4.c.

References assert_param, IS_TIM4_GET_FLAG_OK, RESET, and SET.

ITStatus TIM4_GetITStatus ( TIM4_IT_TypeDef  TIM4_IT)

Checks whether the TIM4 interrupt has occurred or not.

Parameters:
TIM4_ITspecifies the TIM4 interrupt source to check. This parameter can be one of the following values:
  • TIM4_IT_UPDATE: TIM4 update Interrupt source
Return values:
ITStatusThe new state of the TIM4_IT (SET or RESET).

Definition at line 360 of file stm8s_tim4.c.

References assert_param, IS_TIM4_IT_OK, RESET, and SET.

TIM4_Prescaler_TypeDef TIM4_GetPrescaler ( void  )

Gets the TIM4 Prescaler value.

Parameters:
None
Return values:
PrescalerRegister configuration value.

Definition at line 306 of file stm8s_tim4.c.

void TIM4_ITConfig ( TIM4_IT_TypeDef  TIM4_IT,
FunctionalState  NewState 
)

Enables or disables the specified TIM4 interrupts.

Parameters:
NewStatenew state of the TIM4 peripheral. This parameter can be: ENABLE or DISABLE.
TIM4_ITspecifies the TIM4 interrupts sources to be enabled or disabled. This parameter can be any combination of the following values:
  • TIM4_IT_UPDATE: TIM4 update Interrupt source
NewStatenew state of the TIM4 peripheral.
Return values:
None

Definition at line 107 of file stm8s_tim4.c.

References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and IS_TIM4_IT_OK.

Referenced by TIM4_Config().

void TIM4_PrescalerConfig ( TIM4_Prescaler_TypeDef  Prescaler,
TIM4_PSCReloadMode_TypeDef  TIM4_PSCReloadMode 
)

Configures the TIM4 Prescaler.

Parameters:
Prescalerspecifies the Prescaler Register value This parameter can be one of the following values
  • TIM4_PRESCALER_1
  • TIM4_PRESCALER_2
  • TIM4_PRESCALER_4
  • TIM4_PRESCALER_8
  • TIM4_PRESCALER_16
  • TIM4_PRESCALER_32
  • TIM4_PRESCALER_64
  • TIM4_PRESCALER_128
TIM4_PSCReloadModespecifies the TIM4 Prescaler Reload mode. This parameter can be one of the following values
  • TIM4_PSCRELOADMODE_IMMEDIATE: The Prescaler is loaded immediatly.
  • TIM4_PSCRELOADMODE_UPDATE: The Prescaler is loaded at the update event.
Return values:
None

Definition at line 215 of file stm8s_tim4.c.

References assert_param, IS_TIM4_PRESCALER_OK, and IS_TIM4_PRESCALER_RELOAD_OK.

void TIM4_SelectOnePulseMode ( TIM4_OPMode_TypeDef  TIM4_OPMode)

Selects the TIM4�s One Pulse Mode.

Parameters:
TIM4_OPModespecifies the OPM Mode to be used. This parameter can be one of the following values
  • TIM4_OPMODE_SINGLE
  • TIM4_OPMODE_REPETITIVE
Return values:
None

Definition at line 179 of file stm8s_tim4.c.

References assert_param, IS_TIM4_OPM_MODE_OK, TIM4_CR1_OPM, and TIM4_OPMODE_REPETITIVE.

void TIM4_SetAutoreload ( uint8_t  Autoreload)

Sets the TIM4 Autoreload Register value.

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

Definition at line 284 of file stm8s_tim4.c.

void TIM4_SetCounter ( uint8_t  Counter)

Sets the TIM4 Counter Register value.

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

Definition at line 272 of file stm8s_tim4.c.

void TIM4_TimeBaseInit ( TIM4_Prescaler_TypeDef  TIM4_Prescaler,
uint8_t  TIM4_Period 
)

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

Parameters:
TIM4_Prescalerspecifies the Prescaler from TIM4_Prescaler_TypeDef.
TIM4_Periodspecifies the Period value.
Return values:
None

Definition at line 65 of file stm8s_tim4.c.

References assert_param, and IS_TIM4_PRESCALER_OK.

Referenced by TIM4_Config().

void TIM4_UpdateDisableConfig ( FunctionalState  NewState)

Enables or Disables the TIM4 Update event.

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

Definition at line 131 of file stm8s_tim4.c.

References assert_param, DISABLE, IS_FUNCTIONALSTATE_OK, and TIM4_CR1_UDIS.

void TIM4_UpdateRequestConfig ( TIM4_UpdateSource_TypeDef  TIM4_UpdateSource)

Selects the TIM4 Update Request Interrupt source.

Parameters:
TIM4_UpdateSourcespecifies the Update source. This parameter can be one of the following values
  • TIM4_UPDATESOURCE_REGULAR
  • TIM4_UPDATESOURCE_GLOBAL
Return values:
None

Definition at line 155 of file stm8s_tim4.c.

References assert_param, IS_TIM4_UPDATE_SOURCE_OK, TIM4_CR1_URS, and TIM4_UPDATESOURCE_GLOBAL.

STM8 Standard Peripherals Library: Footer

 

 

 

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