55 #define MBG_FIRST_COPYRIGHT_YEAR 2007 56 #define MBG_LAST_COPYRIGHT_YEAR 0 // use default 58 static const char *
pname =
"mbgfasttstamp";
61 #define MAX_TS_BURST 1000 79 int this_loops =
loops;
81 int32_t hns_latency = 0;
96 if ( this_loops == 0 )
134 for ( i = 0; i < this_loops; i++ )
143 for ( i = 0; i < this_loops; i++ )
151 for ( i = 0; i < this_loops; i++ )
171 "support fast (memory mapped) time stamps" );
192 "This example program reads fast high resolution time stamps.\n" 194 "This is done using memory mapped I/O in the kernel driver, so\n" 195 "this works only with cards which support memory mapped I/O." 211 int main(
int argc,
char *argv[] )
219 while ( ( c = getopt( argc, argv,
"bcn:rs:u:h?" ) ) != -1 )
232 loops = atoi( optarg );
262 #if !MBG_TGT_SUPP_MEM_ACC 263 printf(
"** Memory mapped access not supported on this target platform.\n\n" );
267 #if !MBG_PC_CYCLES_SUPPORTED 268 printf(
"** Warning: No cycles support to compute real latencies on this platform!\n" );
273 printf(
"** Falling back to raw mode.\n" );
static int show_fast_hr_timestamp_burst(MBG_DEV_HANDLE dh)
Requested action completed successfully.
static const char * pname
bool mbg_cond_err_msg(int rc, const char *what)
Check if a value is an error code and print an associated error message.
Unable to handle requested action, usage printed.
#define mbg_rc_is_success(_rc)
_MBG_API_ATTR int _MBG_API mbg_get_fast_hr_timestamp(MBG_DEV_HANDLE dh, PCPS_TIME_STAMP *p)
Read a high resolution PCPS_TIME_STAMP structure via memory mapped access.
#define MBG_LAST_COPYRIGHT_YEAR
_MBG_API_ATTR int _MBG_API mbg_get_fast_hr_timestamp_comp(MBG_DEV_HANDLE dh, PCPS_TIME_STAMP *p, int32_t *hns_latency)
Read a high resolution timestamp and compensate the latency of the call.
bool mbg_cond_err_msg_info(int rc, const char *what, const char *info)
Check if a value is an general or a "not supported" error code and print an associated message...
static MBG_DEV_HANDLER_FNC do_mbgfasttstamp
#define MBG_SUCCESS
Error codes used with Meinberg devices and drivers.
MBG_CHK_SUPP_FNC mbg_chk_dev_has_fast_hr_timestamp
Check if a device supports the mbg_get_fast_hr_timestamp... calls.
int main(int argc, char *argv[])
Action failed for specified device.
#define MBG_FIRST_COPYRIGHT_YEAR
A high resolution time stamp.
#define mbg_rc_is_error(_rc)
static int show_fast_hr_timestamp(MBG_DEV_HANDLE dh)