GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LPA / dev > lpa_siu / rhel5-64


Interface   Data Structures   File List   Data Fields   Globals  

LPA_siu.c File Reference

LAT Physics Acquisition SIU command and control functions. More...

#include <LPA/LPA_cmdxtrn.h>
#include <LPA/LPA_cmddefs.h>
#include <LPA/LPA_tlmdefs.h>
#include <LPA/LPA_msgs.h>
#include <LPA/LPA_siu.h>
#include <LPA_prvdefs.h>
#include <LPA_siu_p.h>
#include <LPA_inline.ih>
#include <LPA_utils.h>
#include <LPA_DB/LPA_DB_modes.h>
#include <ITC/ITC_pubdefs.h>
#include <IMM/FPM_pubdefs.h>
#include <LCBD/LCBD.h>
#include <LCS/LCS_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <LEM/list.h>
#include <LEM/list_structs.h>
#include <LEM/decode.h>
#include <LCFG/LCFG.h>
#include <PBS/MBA.h>
#include <PBS/WUT.h>
#include <PBS/WCT.h>
#include <PBS/TOV.h>
#include <MSG/MSG_pubdefs.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>

Functions

static unsigned int LPA_proc_ctl (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Process raw task messages from the ctl queue.
static unsigned int LPA_proc_bulk (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Process raw task messages from the bulk queue.
static unsigned int LPA_send_cpus (unsigned short fcode, unsigned int cpus, ITC_TaskID tid, ITC_QueueID qid, void *pay, unsigned int size, unsigned int ack)
 Send a message to cpus.
static unsigned int LPA_send_lim (unsigned int fcode, unsigned int epu_stat)
 Send a message to LIM.
static unsigned int LPA_cpu_response (ITC_NodeID node, LPA_MsgHdr *mhdr)
 Gather cpu response messages and send LIM ack.
static unsigned int LPA_cpu_complete (void)
 Process a cpu response completion.
static unsigned int LPA_cpu_error (void)
 Process a cpu response failure from timeout or error status.
static WUT_cb_status LPA_wut_cb (void *ptr, WUT_tmr *wut)
 The cpu response timeout callback routine.
static unsigned int LPA_cfg_ebm (void)
 Configure the EBM destination enables register.
static unsigned int LPA_latc (unsigned int file, unsigned int ignore, unsigned int consign, unsigned int *key)
 Configure the instrument with LATC (LCFG).
static unsigned int LPA_proc_start (void *pay)
 Process a start run command.
static unsigned int LPA_set_default (void *pay)
 Set start run parameter defaults.
static unsigned int LPA_set_grb (void *pay)
 Set GRB processing parameters.
static unsigned int LPA_start_run (void)
 Start physics run.
static unsigned int LPA_stop_run (void)
 Stop physics run.
static unsigned int LPA_stop_complete (void)
 Stop completion of physics run.
static unsigned int LPA_send_siu_tlm (void)
 Send diagnostic telemetry packet.
unsigned int LPA_siu_init (void)
 Initialize the LPA system on the SIU.
unsigned int LPA_siu_start (void)
 Start the LPA system.
unsigned int LPA_proc_cmd (unsigned short fcode, void *pay)
 Process and dispatch commands.
unsigned int LPA_set_mode (unsigned int mode)
 Set current mode.
void LPA_get_siu_tlm (LPA_SIUCFG_Tlm *pkt)
 Get current telemetry packet data.
unsigned int LPA_gbm_int (void)
 Notify LPA of a GBM interrupt.
void LPA_cb_siu_reset (unsigned short fmt, unsigned short len, const void *dat)
 Restore LPA siu operation after turbo reset.

Variables

LPA_Siu Lpa_siu
 The static instance of the LPA task control structure.


Detailed Description

LAT Physics Acquisition SIU command and control functions.

Author:
S.Maldonado - smaldona@slac.stanford.edu
    CVS $Id: LPA_siu.c,v 1.38 2011/03/28 22:24:21 russell Exp $
   

Function Documentation

void LPA_cb_siu_reset ( unsigned short  fmt,
unsigned short  len,
const void *  dat 
)

static unsigned int LPA_cfg_ebm ( void   )  [static]

Configure the EBM destination enables register.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cmdRsp, and _LPA_Siu::cpus.

Referenced by LPA_latc().

static unsigned int LPA_cpu_complete ( void   )  [static]

Process a cpu response completion.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::err_cpus, LPA_COMPLETE_FCODE, LPA_cpu_error(), LPA_send_cpus(), LPA_send_lim(), LPA_send_siu_tlm(), LPA_start_run(), LPA_stop_complete(), LPA_stop_run(), _LPA_Siu::mode, _LPA_Siu::opcode, and _LPA_Siu::req_mode.

Referenced by LPA_cpu_response().

static unsigned int LPA_cpu_error ( void   )  [static]

Process a cpu response failure from timeout or error status.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cpus, _LPA_Siu::err_cpus, _LPA_Siu::latc_consign, LPA_COMPLETE_FCODE, LPA_send_cpus(), LPA_send_lim(), LPA_stop_complete(), _LPA_Siu::mode, _LPA_Siu::opcode, _LPA_Siu::req_mode, and _LPA_Siu::resp_cpus.

Referenced by LPA_cpu_complete(), LPA_cpu_response(), and LPA_proc_bulk().

static unsigned int LPA_cpu_response ( ITC_NodeID  node,
LPA_MsgHdr mhdr 
) [static]

Gather cpu response messages and send LIM ack.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::err_cpus, LPA_cpu_complete(), LPA_cpu_error(), _LPA_Siu::opcode, _LPA_MsgHdr::opcode, _LPA_Siu::resp_cpus, _LPA_MsgHdr::status, _LPA_Siu::tx_id, _LPA_MsgHdr::tx_id, and _LPA_Siu::wut.

Referenced by LPA_proc_bulk().

unsigned int LPA_gbm_int ( void   ) 

Notify LPA of a GBM interrupt.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References LPA_send_cpus().

void LPA_get_siu_tlm ( LPA_SIUCFG_Tlm pkt  ) 

static unsigned int LPA_latc ( unsigned int  file,
unsigned int  ignore,
unsigned int  consign,
unsigned int *  key 
) [static]

Configure the instrument with LATC (LCFG).

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References LPA_cfg_ebm(), LPA_wut_cb(), _LPA_Siu::opcode, _LPA_Siu::run_id, and _LPA_Siu::wut.

Referenced by LPA_start_run().

static unsigned int LPA_proc_bulk ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
) [static]

Process raw task messages from the bulk queue.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_MsgHdr::fcode, LPA_cpu_error(), LPA_cpu_response(), and _LPA_MsgHdr::opcode.

Referenced by LPA_siu_init().

unsigned int LPA_proc_cmd ( unsigned short  fcode,
void *  pay 
)

static unsigned int LPA_proc_ctl ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
) [static]

Process raw task messages from the ctl queue.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cpus, _LPA_MsgHdr::fcode, LPA_send_cpus(), _LPA_MsgHdr::opcode, _LPA_Siu::opcode, and _LPA_Siu::req_mode.

Referenced by LPA_siu_init().

static unsigned int LPA_proc_start ( void *  pay  )  [static]

static unsigned int LPA_send_cpus ( unsigned short  fcode,
unsigned int  cpus,
ITC_TaskID  tid,
ITC_QueueID  qid,
void *  pay,
unsigned int  size,
unsigned int  ack 
) [static]

static unsigned int LPA_send_lim ( unsigned int  fcode,
unsigned int  lim_stat 
) [static]

Send a message to LIM.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_MsgHdr::fcode, _LPA_CompleteMsg::hdr, LPA_send_cpus(), and _LPA_CompleteMsg::status.

Referenced by LPA_cpu_complete(), and LPA_cpu_error().

static unsigned int LPA_send_siu_tlm ( void   )  [static]

static unsigned int LPA_set_default ( void *  pay  )  [static]

static unsigned int LPA_set_grb ( void *  pay  )  [static]

unsigned int LPA_set_mode ( unsigned int  mode  ) 

Set current mode.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cpus, and LPA_send_cpus().

unsigned int LPA_siu_init ( void   ) 

unsigned int LPA_siu_start ( void   ) 

Start the LPA system.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::itc_task, and _LPA_Siu::state.

static unsigned int LPA_start_run ( void   )  [static]

Start physics run.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cpus, _LPA_Siu::err_cpus, _LPA_Siu::ignore_run, _LPA_Siu::latc_consign, _LPA_Siu::latc_run, LPA_latc(), and _LPA_Siu::resp_cpus.

Referenced by LPA_cpu_complete().

static unsigned int LPA_stop_complete ( void   )  [static]

Stop completion of physics run.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cpus, _LPA_Siu::latc_consign, _LPA_Siu::mode, _LPA_Siu::req_mode, and _LPA_Siu::run_id.

Referenced by LPA_cpu_complete(), and LPA_cpu_error().

static unsigned int LPA_stop_run ( void   )  [static]

Stop physics run.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cpus, _LPA_Siu::err_cpus, LPA_wut_cb(), _LPA_Siu::opcode, _LPA_Siu::resp_cpus, and _LPA_Siu::wut.

Referenced by LPA_cpu_complete().

static WUT_cb_status LPA_wut_cb ( void *  prm,
WUT_tmr *  wut 
) [static]

The cpu response timeout callback routine.

Return values:
LPA_ERROR Failure
LPA_SUCCESS Success

References _LPA_Siu::cpus, LPA_send_cpus(), _LPA_Siu::opcode, and _LPA_Siu::resp_cpus.

Referenced by LPA_latc(), LPA_send_cpus(), and LPA_stop_run().


Generated on Mon Mar 28 16:15:12 2011 by  doxygen 1.5.8