GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-0-2 > lsew / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LSE_time.ih File Reference

Functions to make the time and THS semi-portable. More...

#include "LSEW_ctx.h"
#include "PBI/Endianness.h"
#include "LSE/LSE_time.h"

Classes

struct  _LSE_time_f
union  _LSE_time
 Union of a 64 bit integer with the seconds/useconds representation structure. More...

Typedefs

typedef struct
_LSE_time_f 
LSE_time_f
 Typedef for struct LSE_time_f.
typedef union _LSE_time LSE_time

Functions

void LSE_timetonesGet (unsigned int cur_pps, LSEW_ctxTim *cur, LSEW_ctxTim *prv)
static __inline void LSE__elapsedSet (unsigned int elapsed_reg, unsigned int pps_reg)
 Sets the number of ticks that have elapsed since the last 1 PPS strobe.
static __inline
unsigned long long
int 
LSE__timestampGet (void)
 Returns.
static __inline
unsigned int 
LSE__timetoneGet (unsigned int pps, unsigned int *secs, unsigned int *flags)
 Jacketing/emulation routine for THS_timetoneFromEvent.
static __inline
unsigned int 
LSE__timetonesGet (unsigned int cur_pps, LSEW_ctxTim *cur, LSEW_ctxTim *prv)
 Jacketing/emulation routine for THS_prevTimtoneFromEvent.

Variables

LSE_timeServices LseTimeServices
 The list of time services needed when filling in such information in the datagrams.


Detailed Description

Functions to make the time and THS semi-portable.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: LSE_time.ih,v 1.5 2006/11/19 15:47:30 russell Exp $

Times are used for three purposes
  1. To mark the beginnng of a run
  2. To timestamp a CCSDS packet
  3. To update the event time context
For embedded applications, the first two purposes are fulfilled by the WCT facility, while the last is fulfilled using THS.
For host systems, the initial time, in seconds, from the Spectrum-Astro offset is set by either
  1. Command (not yet supported)
  2. Using the current time
For thence on, the seconds are updated by effectively integrating the times in the GEM 1 PPS strobe. The useconds are faked by using the the offset of the last event processed. This is okay, there only one real constraint is that the time must be greater than the time of the last event.
The event time context is taken by doing the same thing, effectively integrating the number of elapsed seconds by using the GEM 1 PPS strobe.

Function Documentation

static __inline void LSE__elapsedSet ( unsigned int  elapsed_reg,
unsigned int  pps_reg 
) [static]

Sets the number of ticks that have elapsed since the last 1 PPS strobe.

Note:
This is used only for emulation and is a NOP on embedded platforms.

static __inline unsigned long long int LSE__timestampGet ( void   )  [static]

Returns.

Returns:
The current time broken-down as seconds and micro-seconds

static __inline void LSE__timetoneGet ( unsigned int  pps,
unsigned int *  secs,
unsigned int *  flags 
) [static]

Jacketing/emulation routine for THS_timetoneFromEvent.

Parameters:
pps The PPS time strobe from the GEM
secs Returned as the GPS time in secs
flags Returned as the Spectrum-Astro Flags and the FSW flags
On VxWorks platforms this is a call-through to THS_timetoneFromEvent. On host platforms this functionality is emulated.
The only value added is that bit 31 of the flags word is set if THS_timetoneFromEvent fails.

static__inline void LSE__timetonesGet ( unsigned int  cur_pps,
LSEW_ctxTim cur,
LSEW_ctxTim prv 
) [static]

Jacketing/emulation routine for THS_prevTimtoneFromEvent.

Parameters:
cur_pps The PPS time strobe from the GEM for the current event
cur Filled in with the secs and flags for the current event
prv Filled in with the secs and flags for the message previous to the current
On VxWorks platforms this is a call-throug to THS_prevTimToneFromEvent On host platforms this functionality is emulated
The only value added is adding a flag bit when the function fails


Variable Documentation

LSE_timeServices LseTimeServices

The list of time services needed when filling in such information in the datagrams.

This acts like a C++ virtual function table. It is initialized with default set of functions. These can be overriden using LSE_timeServicesConstruct.


Generated on Mon Jul 26 16:55:27 2010 by  doxygen 1.5.3