Software timer functions.
More...
Software timer functions.
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
-
| *Timer | Pointer to TM_DELAY_Timer_t structure |
| AutoReload | Set to 1 if you want to enable AutoReload or 0 to disable |
- Return values
-
Sets auto reload value for timer.
- Parameters
-
| *Timer | Pointer to TM_DELAY_Timer_t structure |
| AutoReloadValue | Value 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
-
| 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
-
| ReloadValue | Number of milliseconds when timer reaches zero and callback function is called |
| AutoReloadCmd | If set to 1, timer will start again when it reaches zero and callback is called |
| StartTimer | If set to 1, timer will start immediately |
| *TM_DELAY_CustomTimerCallback | Pointer to callback function which will be called when timer reaches zero |
| *UserParameters | Pointer to void pointer to user parameters used as first parameter in callback function |
- Return values
-
| Pointer | to allocated timer structure |
Deletes already allocated timer.
- Parameters
-
- Return values
-
Resets custom timer counter value.
- Parameters
-
- Return values
-
Starts custom timer counting.
- Parameters
-
- Return values
-
Stops custom timer from counting.
- Parameters
-
- Return values
-