GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > EFC / V4-2-2

Constituent: efc     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

EFC_time.ih File Reference

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

#include "PBI/Endianness.h"
#include "EFC/EFC_time.h"

Include dependency graph for EFC_time.ih:

This graph shows which files directly or indirectly include this file:


Data Structures

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

Typedefs

typedef _EFC_time_f EFC_time_f
 Typedef for struct EFC_time_f.
typedef _EFC_time EFC_time

Functions

static __inline void EFC__timeElapsedSet (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 
EFC__timestampGet (void)
 Returns.
static __inline unsigned int EFC__timetoneGet (unsigned int pps, unsigned int *secs, unsigned int *flags)
 Jacketing/emulation routine for THS_timetoneFromEvent.
static __inline unsigned int EFC__timetonesGet (unsigned int cur_pps, unsigned int *cur_secs, unsigned int *cur_flags, unsigned int *prv_secs, unsigned int *prv_flags, unsigned int *prv_pps)
 Jacketing/emulation routine for THS_prevTimtoneFromEvent.

Variables

EFC_timeServices EfcTimeServices
 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: EFC_time.ih,v 1.4 2007/10/12 23:19:08 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 EFC__timeElapsedSet unsigned int  elapsed_reg,
unsigned int  pps_reg
[static]
 

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

Parameters:
elapsed_reg The GEM's elapsed time register
pps_reg The GEM's PPS register
Note:
This is used only for emulation and is a NOP on embedded platforms.

static __inline unsigned long long int EFC__timestampGet void   )  [static]
 

Returns.

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

static __inline void EFC__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 EFC__timetonesGet unsigned int  cur_pps,
unsigned int *  cur_secs,
unsigned int *  cur_flags,
unsigned int *  prv_secs,
unsigned int *  prv_flags,
unsigned int *  prv_pps
[static]
 

Jacketing/emulation routine for THS_prevTimtoneFromEvent.

Parameters:
cur_pps The PPS time strobe from the GEM for the current event
cur_secs Filled in with the secs for the current event
cur_flags Filled in with the flags for the current event
prv_secs Filled in with the secs for the previous event
prv_flags Filled in with the flags for the previous event
prv_pps Filled in with the PPS for the previous event
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

EFC_timeServices EfcTimeServices
 

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


Generated on Fri Sep 5 01:21:16 2008 by  doxygen 1.4.4