GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / dev > pbs / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

PTS.c.vx-ppc-gcc File Reference

Implements the PPC/GCC version of the PTS routines. More...

#include <PBS/PTS.h>
#include <PBS/PTS_comdefs.h>
#include <PBS/BUG.h>

Classes

struct  _PTS_parameters
 Defines the parameters needed to determine the processor clock speed and to convert this speed to nanoseconds. More...

Defines

#define PTS_INIT_FAILURE(_rate)   (BUG_check (_rate, "PTS_initialize, unknown bus speed\n"), -1)
 Compile selectable macro that either BUG checks on failure or returns -1 on failure.

Typedefs

typedef struct _PTS_parameters PTS_parameters
 Typedef for struct _PTS_parameters.

Functions

int PTS_initialize (void)
 Initializes the PTS facility.
unsigned int PTS_nsecs_to_ptus (unsigned int nanoseconds)
 Convert a number of nanoseconds to PTUs.
unsigned long long int PTS_nsecx_to_ptux (unsigned long long int nanoseconds)
unsigned int PTS_ptus_to_nsecs (unsigned int ptus)
 Convert a number of ptus to nanoseconds.
unsigned long long int PTS_ptux_to_nsecx (unsigned long long int ptus)
unsigned int PTS_frequency (void)
 Get the frequency of the PTS clock.

Variables

static struct _PTS_parameters PTS_Parameters = {0, 0, 0, 0}
 Local storage for the PTS parameters.


Detailed Description

Implements the PPC/GCC version of the PTS routines.

Author:
JJRussell - russell@slac.stanford.edu

    CVS $Id: PTS.c.vx-ppc-gcc,v 1.8 2011/03/24 23:05:47 apw Exp $

Define Documentation

#define PTS_INIT_FAILURE ( _rate   )     (BUG_check (_rate, "PTS_initialize, unknown bus speed\n"), -1)

Compile selectable macro that either BUG checks on failure or returns -1 on failure.

Parameters:
_rate The rate that cannot be translated

Referenced by PTS_initialize().


Function Documentation

unsigned int PTS_frequency ( void   ) 

Get the frequency of the PTS clock.

Returns:
The frequency, in Hertz, to the processor clock

References _PTS_parameters::frequency.

Referenced by PBS_initialize2(), and WUT_frequency().

int PTS_initialize ( void   ) 

Initializes the PTS facility.

This is a one time only call to initialize internal data structures. This routine should be called as part of the library initialization sequence.

References _PTS_parameters::frequency, _PTS_parameters::nsecs_per_ptu, _PTS_parameters::nsecs_per_ptu_den, _PTS_parameters::nsecs_per_ptu_num, and PTS_INIT_FAILURE.

Referenced by PBS_initialize2().

unsigned int PTS_nsecs_to_ptus ( unsigned int  nanoseconds  ) 

Convert a number of nanoseconds to PTUs.

Parameters:
nanoseconds The number of nanoseconds to convert to PTUs
Returns:
The number of equivalent PTUs

References _PTS_parameters::nsecs_per_ptu, _PTS_parameters::nsecs_per_ptu_den, and _PTS_parameters::nsecs_per_ptu_num.

unsigned int PTS_ptus_to_nsecs ( unsigned int  ptus  ) 

Convert a number of ptus to nanoseconds.

Parameters:
ptus The number of PTUs to convert to nanoseconds
Returns:
The number of equivalent PTUs

References _PTS_parameters::nsecs_per_ptu_den, and _PTS_parameters::nsecs_per_ptu_num.


Generated on Fri Aug 5 18:37:53 2011 by  doxygen 1.5.8