ChibiOS/RT 7.0.5
chtime.h File Reference

Time and intervals macros and structures. More...

Go to the source code of this file.

Macros

Special time constants
#define TIME_IMMEDIATE   ((sysinterval_t)0)
 Zero interval specification for some functions with a timeout specification.
#define TIME_INFINITE   ((sysinterval_t)-1)
 Infinite interval specification for all functions with a timeout specification.
#define TIME_MAX_INTERVAL   ((sysinterval_t)-2)
 Maximum interval constant usable as timeout.
#define TIME_MAX_SYSTIME   ((systime_t)-1)
 Maximum system of system time before it wraps.
Fast time conversion utilities
#define TIME_S2I(secs)
 Seconds to time interval.
#define TIME_MS2I(msecs)
 Milliseconds to time interval.
#define TIME_US2I(usecs)
 Microseconds to time interval.
#define TIME_I2S(interval)
 Time interval to seconds.
#define TIME_I2MS(interval)
 Time interval to milliseconds.
#define TIME_I2US(interval)
 Time interval to microseconds.

Typedefs

typedef uint64_t systime_t
 Type of system time.
typedef uint64_t sysinterval_t
 Type of time interval.
typedef uint64_t systimestamp_t
 Type of a time stamp.
typedef uint32_t time_secs_t
 Type of seconds.
typedef uint32_t time_msecs_t
 Type of milliseconds.
typedef uint32_t time_usecs_t
 Type of microseconds.
typedef uint64_t time_conv_t
 Type of time conversion variable.

Functions

Secure time conversion utilities
static sysinterval_t chTimeS2I (time_secs_t secs)
 Seconds to time interval.
static sysinterval_t chTimeMS2I (time_msecs_t msec)
 Milliseconds to time interval.
static sysinterval_t chTimeUS2I (time_usecs_t usec)
 Microseconds to time interval.
static time_secs_t chTimeI2S (sysinterval_t interval)
 Time interval to seconds.
static time_msecs_t chTimeI2MS (sysinterval_t interval)
 Time interval to milliseconds.
static time_usecs_t chTimeI2US (sysinterval_t interval)
 Time interval to microseconds.
static systime_t chTimeAddX (systime_t systime, sysinterval_t interval)
 Adds an interval to a system time returning a system time.
static sysinterval_t chTimeDiffX (systime_t start, systime_t end)
 Subtracts two system times returning an interval.
static bool chTimeIsInRangeX (systime_t time, systime_t start, systime_t end)
 Checks if the specified time is within the specified time range.
static systimestamp_t chTimeStampAddX (systimestamp_t stamp, sysinterval_t interval)
 Adds an interval to a time stamp returning a time stamp.
static sysinterval_t chTimeStampDiffX (systimestamp_t start, systimestamp_t end)
 Subtracts two time stamps returning an interval.
static bool chTimeStampIsInRangeX (systimestamp_t stamp, systimestamp_t start, systimestamp_t end)
 Checks if the specified time stamp is within the specified time stamps range.

Detailed Description

Time and intervals macros and structures.

Definition in file chtime.h.