TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle

Software timer functions. More...

Functions

TM_DELAY_Timer_tTM_DELAY_TimerCreate (uint32_t ReloadValue, uint8_t AutoReloadCmd, uint8_t StartTimer, void(*TM_DELAY_CustomTimerCallback)(struct _TM_DELAY_Timer_t *, void *), void *UserParameters)
 Creates a new custom timer which has 1ms resolution. More...
 
void TM_DELAY_TimerDelete (TM_DELAY_Timer_t *Timer)
 Deletes already allocated timer. More...
 
TM_DELAY_Timer_tTM_DELAY_TimerStop (TM_DELAY_Timer_t *Timer)
 Stops custom timer from counting. More...
 
TM_DELAY_Timer_tTM_DELAY_TimerStart (TM_DELAY_Timer_t *Timer)
 Starts custom timer counting. More...
 
TM_DELAY_Timer_tTM_DELAY_TimerReset (TM_DELAY_Timer_t *Timer)
 Resets custom timer counter value. More...
 
TM_DELAY_Timer_tTM_DELAY_TimerAutoReloadCommand (TM_DELAY_Timer_t *Timer, uint8_t AutoReloadCmd)
 Sets auto reload feature for timer. More...
 
TM_DELAY_Timer_tTM_DELAY_TimerAutoReloadValue (TM_DELAY_Timer_t *Timer, uint32_t AutoReloadValue)
 Sets auto reload value for timer. More...
 

Detailed Description

Software timer functions.

Function Documentation

TM_DELAY_Timer_t* TM_DELAY_TimerAutoReloadCommand ( TM_DELAY_Timer_t Timer,
uint8_t  AutoReloadCmd 
)

Sets auto reload feature for timer.

Note
Auto reload features is used for timer which starts again when zero is reached if auto reload active
Parameters
*TimerPointer to TM_DELAY_Timer_t structure
AutoReloadSet to 1 if you want to enable AutoReload or 0 to disable
Return values
Pointerto TM_DELAY_Timer_t structure
TM_DELAY_Timer_t* TM_DELAY_TimerAutoReloadValue ( TM_DELAY_Timer_t Timer,
uint32_t  AutoReloadValue 
)

Sets auto reload value for timer.

Parameters
*TimerPointer to TM_DELAY_Timer_t structure
AutoReloadValueValue for timer to be set when zero is reached and callback is called
Note
AutoReload feature must be enabled for timer in order to get this to work properly
Return values
Pointerto TM_DELAY_Timer_t structure
TM_DELAY_Timer_t* TM_DELAY_TimerCreate ( uint32_t  ReloadValue,
uint8_t  AutoReloadCmd,
uint8_t  StartTimer,
void(*)(struct _TM_DELAY_Timer_t *, void *)  TM_DELAY_CustomTimerCallback,
void *  UserParameters 
)

Creates a new custom timer which has 1ms resolution.

Note
It uses malloc for memory allocation for timer structure
Parameters
ReloadValueNumber of milliseconds when timer reaches zero and callback function is called
AutoReloadCmdIf set to 1, timer will start again when it reaches zero and callback is called
StartTimerIf set to 1, timer will start immediately
*TM_DELAY_CustomTimerCallbackPointer to callback function which will be called when timer reaches zero
*UserParametersPointer to void pointer to user parameters used as first parameter in callback function
Return values
Pointerto allocated timer structure
void TM_DELAY_TimerDelete ( TM_DELAY_Timer_t Timer)

Deletes already allocated timer.

Parameters
*TimerPointer to TM_DELAY_Timer_t structure
Return values
None
TM_DELAY_Timer_t* TM_DELAY_TimerReset ( TM_DELAY_Timer_t Timer)

Resets custom timer counter value.

Parameters
*TimerPointer to TM_DELAY_Timer_t structure
Return values
Pointerto TM_DELAY_Timer_t structure
TM_DELAY_Timer_t* TM_DELAY_TimerStart ( TM_DELAY_Timer_t Timer)

Starts custom timer counting.

Parameters
*TimerPointer to TM_DELAY_Timer_t structure
Return values
Pointerto TM_DELAY_Timer_t structure
TM_DELAY_Timer_t* TM_DELAY_TimerStop ( TM_DELAY_Timer_t Timer)

Stops custom timer from counting.

Parameters
*TimerPointer to TM_DELAY_Timer_t structure
Return values
Pointerto TM_DELAY_Timer_t structure