Library Functions.
More...
Library Functions.
| #define TM_DELAY_SetTime |
( |
|
time | ) |
(TM_Time = (time)) |
Sets value for TM_Time variable.
- Parameters
-
- Return values
-
| #define TM_DELAY_SetTime2 |
( |
|
time | ) |
(TM_Time2 = (time)) |
Sets value for TM_Time variable.
- Parameters
-
- Return values
-
- Note
- This is not meant for public use
| #define TM_DELAY_Time |
( |
| ) |
(TM_Time) |
Gets the TM_Time variable value.
- Parameters
-
- Return values
-
| Current | time in milliseconds |
| #define TM_DELAY_Time2 |
( |
| ) |
(TM_Time2) |
Gets the TM_Time2 variable value.
- Parameters
-
- Return values
-
| Current | time in milliseconds |
- Note
- This is not meant for public use
| static __INLINE void Delay |
( |
uint32_t |
micros | ) |
|
|
static |
- Parameters
-
| Delays | for specific amount of microseconds |
| micros | Time in microseconds for delay |
- Return values
-
- Note
- Declared as static inline
| static __INLINE void Delayms |
( |
uint32_t |
millis | ) |
|
|
static |
- Parameters
-
| Delays | for specific amount of milliseconds |
| millis | Time in milliseconds for delay |
- Return values
-
- Note
- Declared as static inline
| __weak void TM_DELAY_1msHandler |
( |
void |
| ) |
|
User function, called each 1ms when interrupt from timer happen.
- Note
- Here user should put things which has to be called periodically
- Parameters
-
- Return values
-
- Note
- With __weak parameter to prevent link errors if not defined by user
| void TM_DELAY_DisableDelayTimer |
( |
void |
| ) |
|
Disables delay timer.
- Note
- This function disables delay timer. It can be systick or user selectable timer.
- Parameters
-
- Return values
-
| void TM_DELAY_EnableDelayTimer |
( |
void |
| ) |
|
Re-enables delay timer It has to be configured before with TM_DELAY_Init()
- Note
- This function enables delay timer. It can be systick or user selectable timer.
- Parameters
-
- Return values
-
| void TM_DELAY_Init |
( |
void |
| ) |
|
Initializes timer settings for delay.
- Note
- This function will initialize Systick or user timer, according to settings
- Parameters
-
- Return values
-
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 uint8_t 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 |
AutoReload, |
|
|
uint8_t |
StartTimer, |
|
|
void(*)(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 |
| AutoReload | 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
-