GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EFC / V4-5-5 > gfilter / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

EFC_time.h File Reference

Time emulation interface. This is used only for testing. More...


Classes

struct  _EFC_timeServices
 The set of virtual functions needed to implement the time emulation routines. More...
struct  _EFC_timeFlagSpec
 Time hack flag specification. More...

Typedefs

typedef enum _EFC_TIME_K EFC_TIME_K
 Typedef for enum _EFC_TIME_K.
typedef void(* EFC_timeServicesConstruct )(void *prm)
 Constructs/initializes the time services.
typedef void(* EFC_timeServicesSet )(unsigned int seconds, unsigned int flags, unsigned int frequency)
 Establishes the initial time and clock frequency.
typedef void(* EFC_timeServicesElapsedSet )(unsigned int evt_reg, unsigned int pps_reg)
 Sets the elapsed time since the last 1-PPS.
typedef unsigned long long int(* EFC_timeServicesTimestampGet )(void)
 Gets the current timestamp.
typedef unsigned int(* EFC_timeServicesTimetoneGet )(unsigned int pps_reg, unsigned int *secs, unsigned int *flags)
 Fills in the current seconds and flags.
typedef unsigned int(* EFC_timeServicesTimetonesGet )(unsigned int cur_pps, unsigned int *cur_secs, unsigned int *cur_flags, unsigned int *prv_secs, unsigned int *prv_flags, unsigned int *prv_pps)
 Fills in the timetone message corresponding to cur_pps and the most recent timetone message occuring prior to cur_pps.
typedef struct _EFC_timeServices EFC_timeServices
 Typedef for struct _EFC_timeServices.
typedef struct _EFC_timeFlagSpec EFC_timeFlagSpec
 Typedef for struct _TimeFlagSpec.

Enumerations

enum  _EFC_TIME_K {
  EFC_TIME_K_ASIS = 0,
  EFC_TIME_K_DEFAULT = -1
}
 Used to specify the use of ASIS or DEFAULT parameters. More...

Functions

void EFC_timeConstruct (const EFC_timeServices *services, void *prm)
void EFC_timeSet (unsigned int seconds, unsigned int flags, unsigned int frequency)
unsigned int EFC_timeSecsGet (void)
unsigned int EFC_timeOffset (void)


Detailed Description

Time emulation interface. This is used only for testing.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: EFC_time.h,v 1.1 2007/10/10 23:40:42 russell Exp $

In a testing environment, this establishes the callback functions used to implement the various time requests used when completing a datagram

Typedef Documentation

Typedef for struct _TimeFlagSpec.

This is used to simulate the progression of the Time Hack Flags. Typically this is presented to the time simulation routines. The routine sets the flag value to the first on the list for the specified number of calls, then moves on to the next value. If the value of cnt is specified as 0, then the flag maintains its value until the second rolls over.

void(* EFC_timeServicesConstruct)(void *prm)

Constructs/initializes the time services.

Parameters:
prm An arbitrary user context parameter. For the standard services this is a pointer to an EFC_timeflagSpec

void(* EFC_timeServicesElapsedSet)(unsigned int evt_reg, unsigned int pps_reg)

Sets the elapsed time since the last 1-PPS.

Parameters:
evt_reg The value of the event time register in the GEM
pps_reg The value of the 1-PPS time register in the GEM
This function is called once per event. It is used to update the fractional part of the elapsed time.

void(* EFC_timeServicesSet)(unsigned int seconds, unsigned int flags, unsigned int frequency)

Establishes the initial time and clock frequency.

Parameters:
seconds The initial time, specified in the number of seconds since the Spectrum-Astro epoch. If specified as 0, EFC_TIME_K_ASIS, then the time is not adjusted. If specified as -1, EFC_TIME_K_DEFAULT, then use the current time.
flags The initial value of the timetone message's flag word. There is no default value, but 0 would be a good choice as a default (no errors).
frequency The frequency, in Hertz. If specified as 0, then the frequency will not be changed. If specified as 0, EFC_TIME_K_ASIS, then the time is not adjusted. If specified as -1, EFC_TIME_K_DEFAULT, then use the current time.

unsigned long long int(* EFC_timeServicesTimestampGet)(void)

Gets the current timestamp.

Returns:
The current time stamp, formatted with the seconds in the upper 32-bits and the micro-seconds in the lower 32-bits of the returned 64-bit value.

typedef unsigned int(* EFC_timeServicesTimetoneGet)(unsigned int pps_reg unsigned int *secs, unsigned int *flags)

Fills in the current seconds and flags.

Returns:
Status 0 == success
Parameters:
pps_reg The 1-PPS register used as a key to get the seconds
secs Returned with the elapsed time in seconds
flags Returned with the status flag value (0= no errors)

unsigned int(* EFC_timeServicesTimetonesGet)(unsigned int cur_pps, unsigned int *cur_secs, unsigned int *cur_flags, unsigned int *prv_secs, unsigned int *prv_flags, unsigned int *prv_pps)

Fills in the timetone message corresponding to cur_pps and the most recent timetone message occuring prior to cur_pps.

Returns:
Status
Parameters:
cur_pps The value of the GEM's 1-PPS register to use as a key in locating the timetone messages
cur_secs Filled in with the time since the Spectrum-Astro epoch corresponding the current timetone message
cur_flags Filled in with status flags/values (see THS) corresponding the current timetone message
prv_secs Filled in with the time since the Spectrum-Astro epoch corresponding the previous timetone message
prv_flags Filled in with status flags/values (see THS) corresponding the previous timetone message
prv_pps Filled in with the value of GEM's 1-PPS register corresponding the previous timetone message


Enumeration Type Documentation

Used to specify the use of ASIS or DEFAULT parameters.

Enumerator:
EFC_TIME_K_ASIS  Do not modify the specified parameter
EFC_TIME_K_DEFAULT  Use the default value for the specified parameter


Generated on Wed Jan 16 14:04:41 2013 by  doxygen 1.5.8