OS  v7.3.3
Documentation
Loading...
Searching...
No Matches
Software-Timers

API interface for the STimers extension. More...

Collaboration diagram for Software-Timers:

Data Structures

struct  qSTimer_t
 A STimer(Software Timer) object. More...
 

Macros

#define QSTIMER_DISARM_VALUE
 Macro that defines the value of a disarmed STimer.
 
#define QSTIMER_INITIALIZER
 Macro that can be used to initialize a disarmed STimer instance.
 
#define QSTIMER_ARMED
 Macro that defines the status of an armed STimer.
 
#define QSTIMER_DISARMED
 Macro that defines the status of a disarmed STimer.
 
#define QSTIMER_REMAINING_IN_DISARMED_STATE
 Macro that defines the value that a disarmed STimer returns when the remaining time is requested.
 

Functions

qBool_t qSTimer_Reload (qSTimer_t *const t)
 Reload the STimer with the previous specified time.
 
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.
 
qBool_t qSTimer_Expired (const qSTimer_t *const t)
 Non-Blocking STimer check.
 
qBool_t qSTimer_FreeRun (qSTimer_t *const t, const qTime_t tTime)
 Non-Blocking STimer check with automatic arming.
 
qClock_t qSTimer_Elapsed (const qSTimer_t *const t)
 Retrieve the elapsed time in epochs.
 
qClock_t qSTimer_Remaining (const qSTimer_t *const t)
 Retrieve the remaining time in epochs.
 
qBool_t qSTimer_Disarm (qSTimer_t *const t)
 Disarms the STimer object.
 
qBool_t qSTimer_Status (const qSTimer_t *const t)
 Get the current status of the STimer (Armed or Disarmed)
 

Detailed Description

API interface for the STimers extension.

Precondition
This extension requires the operating system is previously initialized with qOS_Setup() with a functional time-base. Please read Timing Approach .

Function Documentation

◆ qSTimer_Disarm()

qBool_t qSTimer_Disarm ( qSTimer_t *const t)

Disarms the STimer object.

Parameters
[in]tA pointer to the STimer object.
Returns
Returns qTrue on success, otherwise, returns qFalse.

◆ qSTimer_Elapsed()

qClock_t qSTimer_Elapsed ( const qSTimer_t *const t)

Retrieve the elapsed time in epochs.

Parameters
[in]tA pointer to the STimer object.
Returns
The Elapsed time specified in epochs.

◆ qSTimer_Expired()

qBool_t qSTimer_Expired ( const qSTimer_t *const t)

Non-Blocking STimer check.

Parameters
[in]tA pointer to the STimer object.
Returns
Returns qTrue when STimer expires, otherwise, returns qFalse.
Note
A disarmed STimer also returns qFalse.

◆ qSTimer_FreeRun()

qBool_t qSTimer_FreeRun ( qSTimer_t *const t,
const qTime_t tTime )

Non-Blocking STimer check with automatic arming.

Behavior: If disarmed, it gets armed immediately with the specified time.

If armed, the time argument is ignored and the API only checks for expiration. When the time expires, the STimer gets armed immediately taking the specified time.

Note
After the STimer expiration, qSTimer_FreeRun() re-arms the STimer
The OS must be running before using STimers.
The expiration time should be at least, two times greater than the clock-Tick.
Parameters
[in]tA pointer to the STimer object.
[in]tTimeThe expiration time(Must be specified in seconds).
Returns
Returns qTrue on success, otherwise, returns qFalse.
Note
A disarmed STimer also returns qFalse.

◆ qSTimer_Reload()

qBool_t qSTimer_Reload ( qSTimer_t *const t)

Reload the STimer with the previous specified time.

Note
STimer should be armed before this operation
Parameters
[in]tA pointer to the STimer object.
Returns
Returns qTrue on success, otherwise, returns qFalse.

◆ qSTimer_Remaining()

qClock_t qSTimer_Remaining ( const qSTimer_t *const t)

Retrieve the remaining time in epochs.

Parameters
[in]tA pointer to the STimer object.
Returns
The remaining time specified in epochs.

◆ qSTimer_Set()

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.

Note
The OS must be running before using STimers.
The expiration time should be at least, two times greater than the clock-Tick.
Parameters
[in]tA pointer to the STimer object.
[in]tTimeThe expiration time(Must be specified in seconds).
Returns
Returns qTrue on success, otherwise, returns qFalse.

◆ qSTimer_Status()

qBool_t qSTimer_Status ( const qSTimer_t *const t)

Get the current status of the STimer (Armed or Disarmed)

Parameters
[in]tA pointer to the STimer object.
Returns
qTrue when armed, otherwise qFalse when disarmed.