OS  v7.3.3
Documentation
Loading...
Searching...
No Matches
qstimers.h
1
8#ifndef QSTIMERS_H
9 #define QSTIMERS_H
10
11 #include "qtypes.h"
12 #include "qclock.h"
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
32 typedef struct _qSTimer_s { // skipcq: CXX-E2000
34 qClock_t tStart; /*< The time(epochs) taken at the arming moment. */
35 qClock_t tv; /*< The required time in epochs. */
37 }
39
41 #define QSTIMER_DISARM_VALUE ( 0UL )
43 #define QSTIMER_INITIALIZER { QSTIMER_DISARM_VALUE, QSTIMER_DISARM_VALUE }
45 #define QSTIMER_ARMED ( qTrue )
47 #define QSTIMER_DISARMED ( qFalse )
49 #define QSTIMER_REMAINING_IN_DISARMED_STATE ( (qClock_t)0xFFFFFFFFUL )
50
57 qBool_t qSTimer_Reload( qSTimer_t * const t );
58
69 qBool_t qSTimer_Set( qSTimer_t * const t,
70 const qTime_t tTime );
71
78 qBool_t qSTimer_Expired( const qSTimer_t * const t );
79
99 const qTime_t tTime );
100
106 qClock_t qSTimer_Elapsed( const qSTimer_t * const t );
107
113 qClock_t qSTimer_Remaining( const qSTimer_t * const t );
114
120 qBool_t qSTimer_Disarm( qSTimer_t * const t );
121
127 qBool_t qSTimer_Status( const qSTimer_t * const t );
128
131 #ifdef __cplusplus
132 }
133 #endif
134
135#endif
qUINT32_t qClock_t
A 32-bit unsigned integer to hold ticks count. Epochs counter.
Definition qclock.h:66
qFloat32_t qTime_t
The typedef that specified an time quantity, usually expressed in seconds.
Definition qclock.h:33
qBool_t qSTimer_Expired(const qSTimer_t *const t)
Non-Blocking STimer check.
Definition qstimers.c:55
qClock_t qSTimer_Elapsed(const qSTimer_t *const t)
Retrieve the elapsed time in epochs.
Definition qstimers.c:68
qBool_t qSTimer_Set(qSTimer_t *const t, const qTime_t tTime)
Set the expiration time for a STimer. On success, the STimer gets armed immediately.
Definition qstimers.c:22
qBool_t qSTimer_Disarm(qSTimer_t *const t)
Disarms the STimer object.
Definition qstimers.c:94
qBool_t qSTimer_Status(const qSTimer_t *const t)
Get the current status of the STimer (Armed or Disarmed)
Definition qstimers.c:107
qBool_t qSTimer_Reload(qSTimer_t *const t)
Reload the STimer with the previous specified time.
Definition qstimers.c:10
qBool_t qSTimer_FreeRun(qSTimer_t *const t, const qTime_t tTime)
Non-Blocking STimer check with automatic arming.
Definition qstimers.c:36
qClock_t qSTimer_Remaining(const qSTimer_t *const t)
Retrieve the remaining time in epochs.
Definition qstimers.c:81
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition qtypes.h:139
A STimer(Software Timer) object.
Definition qstimers.h:32