RasPi Direct Hardware Access
Integrated peripheral access without operating system drivers.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Macros | Typedefs | Functions
System Timer

Utility functions for measuring time and busy-waiting short amounts of time. More...

Macros

#define ST_NOW   ((st_time_t)HW.ST.CLO)
 Return current system timer timestamp. It measures time independent of clock scaling.
 
#define ST_1s   ((st_delta_t)1000000)
 System timer frequency in Hz (== timer ticks in 1 s)
 
#define ST_1ms   (ST_1s/1000)
 System timer ticks in 1 ms.
 
#define ST_1us   (ST_1s/1000000)
 System timer ticks in 1 µs.
 

Typedefs

typedef uint32_t st_time_t
 Type for system timer time stamps.
 
typedef uint32_t st_delta_t
 Type for system timer time stamp differences.
 

Functions

static int st_elapsed (st_time_t before, st_time_t after, st_delta_t diff)
 Return true if after is at least diff ticks after before.
 
static void st_delay (st_delta_t delay)
 Busy-wait for the given delay.
 

Detailed Description

Utility functions for measuring time and busy-waiting short amounts of time.

Declared in raspi/hw.h.