GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > THS / V1-5-2
Constituent: thstest     Tag: mv2304
#include "PBS/PBS.h"
#include "PBS/TASK.h"
#include "PBS/TMR.h"
#include "PBI/Endianness.h"
#include "LCBD/LCBD.h"
#include "LCBD/LCBD_pci.h"
#include "LEM/defs.h"
#include "LEM/decode.h"
#include "LEM/encode.h"
#include "LEM/encode_structs.h"
#include "LEM/cli.h"
#include "MSG/MSG_pubdefs.h"
#include "THS/THS_msgs.h"
#include "THS_prvdefs.h"
#include <stdio.h>
#include <string.h>
Include dependency graph for THS_gem.c:
Functions | |
WCT_time | THS_gemAbsTimeEvent (int gemStrobeIn, int gemClk) |
Calculate absolute time for event from strobe and clk provided with event (20MHz clk). | |
unsigned int | THS_timetoneFromEvent (int gemStrobeIn, int *absTimeSecs, int *flags) |
get timetone/flags from table for this event | |
unsigned int | THS_prevTimtoneFromEvent (int gemStrobeIn, int *absTimeSecs, int *flags, int *absTimeSecsPrev, int *flagsPrev, int *gemStrobeInPrev) |
THIS IS MIS-SPELLING, it just calls THS_prevTimetoneFromEvent. | |
unsigned int | THS_prevTimetoneFromEvent (int gemStrobeIn, int *absTimeSecs, int *flags, int *absTimeSecsPrev, int *flagsPrev, int *gemStrobeInPrev) |
get timetone/flags from table for this event and for prev entry in table | |
unsigned int | THS_gemInit (int siu) |
Inits the TimeHackService module. | |
unsigned int | THS_gemWait () |
Start the TimeHackService module. | |
unsigned int | THS_gemGetTableInfo (int count, unsigned int *gemStrobe, LSU_factors *Kgem, unsigned int *flags) |
get info from hack table | |
unsigned int | THS_gemCalcClkDiff (unsigned int clk, unsigned int prevClk) |
calculate diff between clks assuming 25 bit clock | |
void | THS_gemIsr (unsigned int absTimeSec, THS_GemTableFlags flags) |
interrupt routine for gem specfic time hack | |
unsigned int | THS_gemSetWarning (unsigned int expectedClkHz, unsigned int expectedDeltaClkHz) |
Set range for gem clock warning messages. | |
void | THS_gemSetTable (unsigned int absTimeSec, THS_GemTableFlags flags, unsigned int gemStrobeIn, LSU_factors Kgem) |
Set a single entry in the gem hack table. |
This module handles calculation of absolute time using the "time hack" for the clk in the GEM (GASU).
The absolute (or true) time is provided once a second through a combination of a 1PPS (1 pulse per sec) hardware pulse and a time tone message ("at the tone the time will be") that preceeds it. The time provided in the time tone message from the scapecraft is in microSec since 1/1/2001. Hence the clock value is adjusted each second to account for clock counter drift from GEM clock.
The basic functions provided to application programs are:
Inputs:
Outputs:
|
Calculate absolute time for event from strobe and clk provided with event (20MHz clk).
|
|
calculate diff between clks assuming 25 bit clock
|
|
get info from hack table
|
|
Inits the TimeHackService module.
|
|
interrupt routine for gem specfic time hack
|
|
Set a single entry in the gem hack table.
On EPUs, this will be called as the results of a message from the SIU with this information. |
|
Set range for gem clock warning messages.
|
|
Start the TimeHackService module.
The sequence is: THS_gemInit(); start up bunch of things including LCB driver Sw to call THS_timeTone() every second as result of message from spacecraft Hw to cause PPS interrupt every second THS_gemWait() (this routine waits till received first THS_gemTimeTone() followed by PPS interrupt) |
|
get timetone/flags from table for this event and for prev entry in table
|
|
get timetone/flags from table for this event
|