msp_hw_ts.h File Reference

Provides a high-precision 32-bit hardware timestamp. More...


Typedefs

typedef u_int32_t msp_hw_ts32_t

Functions

int msp_hw_ts32_init (void)
 Initializes the MultiServices PIC SDK hardware timestamp framework.
u_int64_t msp_hw_ts32_frequency (void)
 Returns the timestamp frequency in Hz.
msp_hw_ts32_t msp_hw_ts32_read (void)
 Reads the 32-bit timestamp provided by the hardware.
u_int32_t msp_hw_ts32_diff (msp_hw_ts32_t ts_new, msp_hw_ts32_t ts_old)
 Computes the difference between two timestamps.
int32_t msp_hw_ts32_sdiff (msp_hw_ts32_t ts_new, msp_hw_ts32_t ts_old)
u_int32_t msp_hw_ts32_diff_now (msp_hw_ts32_t ts_old)
 Computes the difference between a specified timestamp and now.
int32_t msp_hw_ts32_sdiff_now (msp_hw_ts32_t ts_old)
void msp_hw_ts32_sadd (msp_hw_ts32_t *ts, int32_t delta)
 Adds the given delta to the timestamp.
uint32_t msp_hw_ts64_frequency (void)
 Retrieve the hardware (fpga) timestamp frequency in HZ.
uint64_t msp_hw_ts64_read (void)
 Read the current hardware (fpga) timestamp value.


Detailed Description

Provides a high-precision 32-bit hardware timestamp.

This API provides a way to access the highest resolution time provided by the hardware. The counter read from the hardware is not manipulated and provided directly. It is important to note that each CPU has it's own hardware providing this counter and these should not be assumed to be in sync. To avoid any abnormal time calculations, it is important that your software only use this facility if the process or thread using this API is tightly coupled to a given CPU.


Function Documentation

u_int32_t msp_hw_ts32_diff msp_hw_ts32_t  ts_new,
msp_hw_ts32_t  ts_old
 

Computes the difference between two timestamps.

Users can convert the time difference to seconds by dividing by the value returned by msp_hw_ts32_frequency().

Parameters:
ts_new New Timestamp.
ts_old Old Timestamp.
Returns:
Difference between timestamps.

u_int32_t msp_hw_ts32_diff_now msp_hw_ts32_t  ts_old  ) 
 

Computes the difference between a specified timestamp and now.

Users can convert this to seconds by dividing by the value returned by msp_hw_ts32_frequency().

Parameters:
ts_old Old Timestamp.
Returns:
Difference between the current and specified timestamps.

u_int64_t msp_hw_ts32_frequency void   ) 
 

Returns the timestamp frequency in Hz.

Returns:
HW Timestamp Frequency in Hz.

int msp_hw_ts32_init void   ) 
 

Initializes the MultiServices PIC SDK hardware timestamp framework.

This initialization function should be called only once per application.

Returns:
MSP_OK on success; otherwise MSP_ERROR.

msp_hw_ts32_t msp_hw_ts32_read void   ) 
 

Reads the 32-bit timestamp provided by the hardware.

Returns:
HW Timestamp.

void msp_hw_ts32_sadd msp_hw_ts32_t *  ts,
int32_t  delta
 

Adds the given delta to the timestamp.

The delta is signed and is in timestamp units. Note that this function does not modify the hardware timestamp.

Parameters:
ts Pointer to the timestamp.
delta Delta to be added to the timestamp.

uint32_t msp_hw_ts64_frequency void   ) 
 

Retrieve the hardware (fpga) timestamp frequency in HZ.

Returns:
timestamp frequency

uint64_t msp_hw_ts64_read void   ) 
 

Read the current hardware (fpga) timestamp value.

Returns:
timestamp, 0 for errors


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:24:47 2010 for libmp-sdk by Doxygen 1.4.5