OS  v7.3.4
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
24
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
52 /*Only for backward compatibility*/
53 #define qSTimer_FreeRun qSTimer_ReloadIfExpired
55
62 qBool_t qSTimer_Reload( qSTimer_t * const t );
63
74 qBool_t qSTimer_Set( qSTimer_t * const t,
75 const qTime_t tTime );
76
83 qBool_t qSTimer_Expired( const qSTimer_t * const t );
84
104 const qTime_t tTime );
105
111 qClock_t qSTimer_Elapsed( const qSTimer_t * const t );
112
118 qClock_t qSTimer_Remaining( const qSTimer_t * const t );
119
125 qBool_t qSTimer_Disarm( qSTimer_t * const t );
126
132 qBool_t qSTimer_Status( const qSTimer_t * const t );
133
135
136 #ifdef __cplusplus
137 }
138 #endif
139
140#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
qBool_t qSTimer_ReloadIfExpired(qSTimer_t *const t, const qTime_t tTime)
Non-Blocking STimer check with automatic arming.
Definition qstimers.c:36
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
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