Functions

TimeBase management functions. More...

Collaboration diagram for TimeBase management functions:

Functions

void TIM_ARRPreloadConfig (TIM_TypeDef *TIMx, FunctionalState NewState)
 Enables or disables TIMx peripheral Preload register on ARR. More...
 
void TIM_Cmd (TIM_TypeDef *TIMx, FunctionalState NewState)
 Enables or disables the specified TIM peripheral. More...
 
void TIM_CounterModeConfig (TIM_TypeDef *TIMx, uint16_t TIM_CounterMode)
 Specifies the TIMx Counter Mode to be used. More...
 
void TIM_DeInit (TIM_TypeDef *TIMx)
 Deinitializes the TIMx peripheral registers to their default reset values. More...
 
uint32_t TIM_GetCounter (TIM_TypeDef *TIMx)
 Gets the TIMx Counter value. More...
 
uint16_t TIM_GetPrescaler (TIM_TypeDef *TIMx)
 Gets the TIMx Prescaler value. More...
 
void TIM_PrescalerConfig (TIM_TypeDef *TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode)
 Configures the TIMx Prescaler. More...
 
void TIM_SelectOnePulseMode (TIM_TypeDef *TIMx, uint16_t TIM_OPMode)
 Selects the TIMx's One Pulse Mode. More...
 
void TIM_SetAutoreload (TIM_TypeDef *TIMx, uint32_t Autoreload)
 Sets the TIMx Autoreload Register value. More...
 
void TIM_SetClockDivision (TIM_TypeDef *TIMx, uint16_t TIM_CKD)
 Sets the TIMx Clock Division value. More...
 
void TIM_SetCounter (TIM_TypeDef *TIMx, uint32_t Counter)
 Sets the TIMx Counter Register value. More...
 
void TIM_TimeBaseInit (TIM_TypeDef *TIMx, TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
 Initializes the TIMx Time Base Unit peripheral according to the specified parameters in the TIM_TimeBaseInitStruct. More...
 
void TIM_TimeBaseStructInit (TIM_TimeBaseInitTypeDef *TIM_TimeBaseInitStruct)
 Fills each TIM_TimeBaseInitStruct member with its default value. More...
 
void TIM_UIFRemap (TIM_TypeDef *TIMx, FunctionalState NewState)
 Sets or resets the update interrupt flag (UIF)status bit Remapping. when sets, reading TIMx_CNT register returns UIF bit instead of CNT[31]. More...
 
void TIM_UpdateDisableConfig (TIM_TypeDef *TIMx, FunctionalState NewState)
 Enables or Disables the TIMx Update event. More...
 
void TIM_UpdateRequestConfig (TIM_TypeDef *TIMx, uint16_t TIM_UpdateSource)
 Configures the TIMx Update Request Interrupt source. More...
 

Detailed Description

TimeBase management functions.

 ===============================================================================
                     ##### TimeBase management functions #####
 ===============================================================================  
  
     
            ##### TIM Driver: how to use it in Timing(Time base) Mode #####
 ===============================================================================
    [..] 
    To use the Timer in Timing(Time base) mode, the following steps are mandatory:
       
      (#) Enable TIM clock using RCC_APBxPeriphClockCmd(RCC_APBxPeriph_TIMx, ENABLE) function
                    
      (#) Fill the TIM_TimeBaseInitStruct with the desired parameters.
       
      (#) Call TIM_TimeBaseInit(TIMx, &TIM_TimeBaseInitStruct) to configure the Time Base unit
          with the corresponding configuration
          
      (#) Enable the NVIC if you need to generate the update interrupt. 
          
      (#) Enable the corresponding interrupt using the function TIM_ITConfig(TIMx, TIM_IT_Update) 
       
      (#) Call the TIM_Cmd(ENABLE) function to enable the TIM counter.
             
       -@- All other functions can be used separately to modify, if needed,
           a specific feature of the Timer. 
 ===============================================================================
                   ##### TimeBase management functions #####
 ===============================================================================  
  
             
    *** TIM Driver: how to use it in Timing(Time base) Mode ***
    ============================================================ 
    [..]
    To use the Timer in Timing(Time base) mode, the following steps are mandatory:
       
    (#) Enable TIM clock using 
        RCC_APBxPeriphClockCmd(RCC_APBxPeriph_TIMx, ENABLE) function               
    (#) Fill the TIM_TimeBaseInitStruct with the desired parameters.   
    (#) Call TIM_TimeBaseInit(TIMx, &TIM_TimeBaseInitStruct) to configure 
        the Time Base unit
        with the corresponding configuration        
    (#) Enable the NVIC if you need to generate the update interrupt.        
    (#) Enable the corresponding interrupt using the function 
        TIM_ITConfig(TIMx, TIM_IT_Update)      
    (#) Call the TIM_Cmd(ENABLE) function to enable the TIM counter.
    [..]                  
    (@) All other functions can be used separately to modify, if needed,
        a specific feature of the Timer. 

Function Documentation

void TIM_ARRPreloadConfig ( TIM_TypeDef TIMx,
FunctionalState  NewState 
)

Enables or disables TIMx peripheral Preload register on ARR.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
NewStatenew state of the TIMx peripheral Preload register This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
NewStatenew state of the TIMx peripheral Preload register This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 522 of file stm32f4xx_tim.c.

void TIM_Cmd ( TIM_TypeDef TIMx,
FunctionalState  NewState 
)

Enables or disables the specified TIM peripheral.

Parameters
TIMxwhere x can be 1 to 14 to select the TIMx peripheral.
NewStatenew state of the TIMx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6, 7, 8, 15, 16 or 17 to select the TIMx peripheral.
NewStatenew state of the TIMx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 592 of file stm32f4xx_tim.c.

void TIM_CounterModeConfig ( TIM_TypeDef TIMx,
uint16_t  TIM_CounterMode 
)

Specifies the TIMx Counter Mode to be used.

Parameters
TIMxwhere x can be 1, 2, 3, 4, 5 or 8 to select the TIM peripheral.
TIM_CounterModespecifies the Counter Mode to be used This parameter can be one of the following values:
  • TIM_CounterMode_Up: TIM Up Counting Mode
  • TIM_CounterMode_Down: TIM Down Counting Mode
  • TIM_CounterMode_CenterAligned1: TIM Center Aligned Mode1
  • TIM_CounterMode_CenterAligned2: TIM Center Aligned Mode2
  • TIM_CounterMode_CenterAligned3: TIM Center Aligned Mode3
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4 or 8 to select the TIM peripheral.
TIM_CounterModespecifies the Counter Mode to be used This parameter can be one of the following values:
  • TIM_CounterMode_Up: TIM Up Counting Mode
  • TIM_CounterMode_Down: TIM Down Counting Mode
  • TIM_CounterMode_CenterAligned1: TIM Center Aligned Mode1
  • TIM_CounterMode_CenterAligned2: TIM Center Aligned Mode2
  • TIM_CounterMode_CenterAligned3: TIM Center Aligned Mode3
Return values
None

Definition at line 383 of file stm32f4xx_tim.c.

void TIM_DeInit ( TIM_TypeDef TIMx)

Deinitializes the TIMx peripheral registers to their default reset values.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
Return values
None

Definition at line 200 of file stm32f4xx_tim.c.

uint32_t TIM_GetCounter ( TIM_TypeDef TIMx)

Gets the TIMx Counter value.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
Return values
CounterRegister value
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
Return values
CounterRegister value

Definition at line 438 of file stm32f4xx_tim.c.

uint16_t TIM_GetPrescaler ( TIM_TypeDef TIMx)

Gets the TIMx Prescaler value.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
Return values
PrescalerRegister value.
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
Return values
PrescalerRegister value.

Definition at line 452 of file stm32f4xx_tim.c.

void TIM_PrescalerConfig ( TIM_TypeDef TIMx,
uint16_t  Prescaler,
uint16_t  TIM_PSCReloadMode 
)

Configures the TIMx Prescaler.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
Prescalerspecifies the Prescaler Register value
TIM_PSCReloadModespecifies the TIM Prescaler Reload mode This parameter can be one of the following values:
  • TIM_PSCReloadMode_Update: The Prescaler is loaded at the update event.
  • TIM_PSCReloadMode_Immediate: The Prescaler is loaded immediatly.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 8, 15, 16 or 17 to select the TIM peripheral.
Prescalerspecifies the Prescaler Register value
TIM_PSCReloadModespecifies the TIM Prescaler Reload mode This parameter can be one of the following values:
  • TIM_PSCReloadMode_Update: The Prescaler is loaded at the update event.
  • TIM_PSCReloadMode_Immediate: The Prescaler is loaded immediatly.
Return values
None

Definition at line 360 of file stm32f4xx_tim.c.

void TIM_SelectOnePulseMode ( TIM_TypeDef TIMx,
uint16_t  TIM_OPMode 
)

Selects the TIMx's One Pulse Mode.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
TIM_OPModespecifies the OPM Mode to be used. This parameter can be one of the following values:
  • TIM_OPMode_Single
  • TIM_OPMode_Repetitive
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
TIM_OPModespecifies the OPM Mode to be used. This parameter can be one of the following values:
  • TIM_OPMode_Single
  • TIM_OPMode_Repetitive
Return values
None

Definition at line 549 of file stm32f4xx_tim.c.

void TIM_SetAutoreload ( TIM_TypeDef TIMx,
uint32_t  Autoreload 
)

Sets the TIMx Autoreload Register value.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
Autoreloadspecifies the Autoreload register new value.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
Autoreloadspecifies the Autoreload register new value.
Return values
None

Definition at line 424 of file stm32f4xx_tim.c.

void TIM_SetClockDivision ( TIM_TypeDef TIMx,
uint16_t  TIM_CKD 
)

Sets the TIMx Clock Division value.

Parameters
TIMxwhere x can be 1 to 14 except 6 and 7, to select the TIM peripheral.
TIM_CKDspecifies the clock division value. This parameter can be one of the following value:
  • TIM_CKD_DIV1: TDTS = Tck_tim
  • TIM_CKD_DIV2: TDTS = 2*Tck_tim
  • TIM_CKD_DIV4: TDTS = 4*Tck_tim
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 8, 15, 16 or 17, to select the TIM peripheral.
TIM_CKDspecifies the clock division value. This parameter can be one of the following value:
  • TIM_CKD_DIV1: TDTS = Tck_tim
  • TIM_CKD_DIV2: TDTS = 2*Tck_tim
  • TIM_CKD_DIV4: TDTS = 4*Tck_tim
Return values
None

Definition at line 572 of file stm32f4xx_tim.c.

void TIM_SetCounter ( TIM_TypeDef TIMx,
uint32_t  Counter 
)

Sets the TIMx Counter Register value.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
Counterspecifies the Counter register new value.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
Counterspecifies the Counter register new value.
Return values
None

Definition at line 409 of file stm32f4xx_tim.c.

void TIM_TimeBaseInit ( TIM_TypeDef TIMx,
TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct 
)

Initializes the TIMx Time Base Unit peripheral according to the specified parameters in the TIM_TimeBaseInitStruct.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
TIM_TimeBaseInitStructpointer to a TIM_TimeBaseInitTypeDef structure that contains the configuration information for the specified TIM peripheral.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
TIM_TimeBaseInitStructpointer to a TIM_TimeBaseInitTypeDef structure that contains the configuration information for the specified TIM peripheral.
Return values
None

Definition at line 288 of file stm32f4xx_tim.c.

void TIM_TimeBaseStructInit ( TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct)

Fills each TIM_TimeBaseInitStruct member with its default value.

Parameters
TIM_TimeBaseInitStruct: pointer to a TIM_TimeBaseInitTypeDef structure which will be initialized.
Return values
None

Definition at line 340 of file stm32f4xx_tim.c.

void TIM_UIFRemap ( TIM_TypeDef TIMx,
FunctionalState  NewState 
)

Sets or resets the update interrupt flag (UIF)status bit Remapping. when sets, reading TIMx_CNT register returns UIF bit instead of CNT[31].

Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
NewStatenew state of the UIFREMAP bit. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 502 of file stm32f30x_tim.c.

void TIM_UpdateDisableConfig ( TIM_TypeDef TIMx,
FunctionalState  NewState 
)

Enables or Disables the TIMx Update event.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
NewStatenew state of the TIMx UDIS bit This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
NewStatenew state of the TIMx UDIS bit This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 468 of file stm32f4xx_tim.c.

void TIM_UpdateRequestConfig ( TIM_TypeDef TIMx,
uint16_t  TIM_UpdateSource 
)

Configures the TIMx Update Request Interrupt source.

Parameters
TIMxwhere x can be 1 to 14 to select the TIM peripheral.
TIM_UpdateSourcespecifies the Update source. This parameter can be one of the following values:
  • TIM_UpdateSource_Global: Source of update is the counter overflow/underflow or the setting of UG bit, or an update generation through the slave mode controller.
  • TIM_UpdateSource_Regular: Source of update is counter overflow/underflow.
Return values
None
Parameters
TIMxwhere x can be 1, 2, 3, 4, 6 ,7 ,8, 15, 16 or 17 to select the TIM peripheral.
TIM_UpdateSourcespecifies the Update source. This parameter can be one of the following values:
  • TIM_UpdateSource_Regular: Source of update is the counter overflow/underflow or the setting of UG bit, or an update generation through the slave mode controller.
  • TIM_UpdateSource_Global: Source of update is counter overflow/underflow.
Return values
None

Definition at line 497 of file stm32f4xx_tim.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:55