mbgtools-lx  4.2.8
Fast API functions reading high resolution timestamps, but no status

Functions

_MBG_API_ATTR int _MBG_API mbg_get_fast_hr_timestamp_cycles (MBG_DEV_HANDLE dh, PCPS_TIME_STAMP_CYCLES *p)
 Read a high resolution PCPS_TIME_STAMP_CYCLES structure via memory mapped access. More...
 
_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. More...
 
_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. More...
 

Detailed Description

These functions are fast, but return only the UTC time. No status flags, no time zone offset. The time stamps are read from a latched counter chain in the PCI chip set, so this is only supported by cards whose chip set supports this.

See also
mbg_chk_dev_has_fast_hr_timestamp
mbg_get_fast_hr_timestamp
mbg_get_fast_hr_timestamp_cycles
mbg_get_fast_hr_timestamp_comp
API functions reading high resolution time, plus status
Legacy API functions to read the time

Function Documentation

◆ mbg_get_fast_hr_timestamp()

int 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.

This function does not return or evaluate a cycles count, so the latency of the call can not be determined. However, depending on the timer hardware used as cycles counter it may take quite some time to read the cycles count on some hardware architectures, so this call can be used to yield lower latencies, under the restriction to be unable to determine the exact latency.

Parameters
[in]dhValid MBG_DEV_HANDLE handle to a Meinberg device.
[out]pPointer to a PCPS_TIME_STAMP structure to be filled up.
Returns
MBG_SUCCESS on success, else one of the MBG_ERROR_CODES
See also
mbg_chk_dev_has_fast_hr_timestamp
mbg_get_fast_hr_timestamp_comp
mbg_get_fast_hr_timestamp_cycles
Fast API functions reading high resolution timestamps, but no status

Definition at line 7066 of file mbgdevio.c.

References _mbgdevio_cnv_ret_val, _mbgdevio_read_var, IOCTL_GET_FAST_HR_TIMESTAMP, MBG_ERR_NOT_SUPP_ON_OS, and MBGDEVIO_RET_VAL.

Referenced by show_fast_hr_timestamp(), show_fast_hr_timestamp_burst(), and show_time_and_status().

◆ mbg_get_fast_hr_timestamp_comp()

int 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.

The retrieved PCPS_TIME_STAMP is read from memory mapped registers, and timestamp is compensated for the call's latency before it is returned.

Parameters
[in]dhValid MBG_DEV_HANDLE handle to a Meinberg device.
[out]pPointer to a PCPS_TIME_STAMP structure to be filled up
[out]hns_latencyOptionally receives the latency in hectonanoseconds //### TODO Check if hns
Returns
MBG_SUCCESS on success, else one of the MBG_ERROR_CODES
See also
mbg_chk_dev_has_fast_hr_timestamp
mbg_get_fast_hr_timestamp_cycles
mbg_get_fast_hr_timestamp
Fast API functions reading high resolution timestamps, but no status

Definition at line 7017 of file mbgdevio.c.

References PCPS_TIME_STAMP_CYCLES::cycles, mbg_comp_hr_latency(), mbg_get_fast_hr_timestamp_cycles(), mbg_get_pc_cycles(), mbg_init_pc_cycles_frequency(), mbg_rc_is_success, pc_cycles_frequency, and PCPS_TIME_STAMP_CYCLES::tstamp.

Referenced by show_fast_hr_timestamp(), and show_fast_hr_timestamp_burst().

◆ mbg_get_fast_hr_timestamp_cycles()

int mbg_get_fast_hr_timestamp_cycles ( MBG_DEV_HANDLE  dh,
PCPS_TIME_STAMP_CYCLES p 
)

Read a high resolution PCPS_TIME_STAMP_CYCLES structure via memory mapped access.

Parameters
[in]dhValid MBG_DEV_HANDLE handle to a Meinberg device.
[out]pPointer to a PCPS_TIME_STAMP_CYCLES structure to be filled up.
Returns
MBG_SUCCESS on success, else one of the MBG_ERROR_CODES
See also
mbg_chk_dev_has_fast_hr_timestamp
mbg_get_fast_hr_timestamp_comp
mbg_get_fast_hr_timestamp
Fast API functions reading high resolution timestamps, but no status

Definition at line 6981 of file mbgdevio.c.

References _mbgdevio_cnv_ret_val, _mbgdevio_read_var, IOCTL_GET_FAST_HR_TIMESTAMP_CYCLES, MBG_ERR_NOT_SUPP_ON_OS, and MBGDEVIO_RET_VAL.

Referenced by get_htc_timestamps(), and mbg_get_fast_hr_timestamp_comp().