GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LPA / dev > lpa_epu / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LPA_epu.c File Reference

LAT Physics Acquisition EPU command and control. More...

#include <LPA_utils.h>
#include <LPA/LPA_epu.h>
#include <LPA/LPA_siu.h>
#include <LPA/LPA_msgs.h>
#include <LPA/LPA_tlmdefs.h>
#include <LPA_prvdefs.h>
#include <LPA_slvdefs.h>
#include <LPA/LPA_cmddefs.h>
#include <LPA_DB/LPA_DB_schema.h>
#include <LPA_DB/LPA_DB_modes.h>
#include <LPA_inline.ih>
#include <LSF/LSF_reason.h>
#include <LSE/LFR_key.h>
#include <TRD/TRD_pubdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <ITC/ITC_msgs.h>
#include <IMM/FPM_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <LCBD/LCBD.h>
#include <CDM/CDM_pubdefs.h>
#include <CPU_DB/CPU_DB_pubdefs.h>
#include <PBS/MBA.h>
#include <PBS/WCT.h>
#include <MSG/MSG_pubdefs.h>
#include <PBI/FFS.ih>
#include <string.h>
#include <stdio.h>

Classes

struct  _LPA_Epu_Reset
 Structure to restore LPA operation after a turbo reset. More...
struct  _LPA_Cfg
 Structure to hold the LPA mode configuration. More...
struct  _LPA_Epu
 Structure to hold the LPA task application control block. More...

Defines

#define LPA_K_EPU_RESET_FORMAT_0   0
 Format of LPA EPU entries in the turbo reset database.

Typedefs

typedef struct _LPA_Epu_Reset LPA_Epu_Reset
 Typedef for struct _LPA_Epu_Reset.
typedef struct _LPA_Cfg LPA_Cfg
 Typedef for struct _LPA_Cfg.
typedef struct _LPA_Epu LPA_Epu
 Typedef for struct _LPA_Epu.

Functions

static unsigned int LPA_epu_proc (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Process raw task messages.
static unsigned int LPA_scan_db (CDM_Database *cdb, void *prm)
 Scan for LPA_DB files.
static unsigned int LPA_set_config (void *pay)
 Change the mode handler association.
static unsigned int LPA_set_output (void *pay)
 Change the output stream state.
static unsigned int LPA_set_compress (void *pay)
 Change the data compression level.
static unsigned int LPA_set_grb (void *pay)
 Change the active GRB processor.
static unsigned int LPA_associate (void *pay)
 Associates handler internal configurations with modes.
static unsigned int LPA_start (void *pay, unsigned int time)
 Process start config command.
static unsigned int LPA_stop (void)
 Process stop config command.
static unsigned int LPA_abort (void)
 Process abort command.
static unsigned int LPA_select_mode (unsigned int mode)
 Select the active handler mode.
static unsigned int LPA_swap (unsigned int list)
 Reverse handler list bit order to LSB == bit 0.
static FORK_cb_status LPA_fork_cb (FORK_cb_prm *prm, FORK_msg_hdr *hdr)
 Process forked task messages.
static unsigned int LPA_fork_msg (unsigned int opcode, void *pay, unsigned int prm)
 Fork a message to the event task.
static unsigned int LPA_send_response (unsigned int opcode, unsigned int siu_stat)
 Send response status message to SIU.
static unsigned int LPA_send_epu_tlm (void)
 Send diagnostic telemetry packet.
unsigned int LPA_epu_init (void)
 Initialize the LPA system.
unsigned int LPA_epu_start (void)
 Start the LPA system.
unsigned int LPA_getRunState ()
 Returns the LPA run state.
void LPA_get_epu_tlm (LPA_EPU0CFG_Tlm *pkt)
 Get current telemetry packet data.
void LPA_cb_epu_reset (unsigned short fmt, unsigned short len, const void *dat)
 Restore LPA epu operation after turbo reset.

Variables

static LPA_Epu Lpa_epu
 The static instance of the LPA task control structure.


Detailed Description

LAT Physics Acquisition EPU command and control.

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

Function Documentation

static unsigned int LPA_abort ( void   )  [static]

Process abort command.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Cfg::handlers, _LPA_Cfg::lpa, LPA_disconnect(), LPA_flush(), and _LPA_Epu::run_state.

Referenced by LPA_fork_cb().

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

Associates handler internal configurations with modes.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Cfg::assoc, _LPA_Cfg::last_cfgid, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_modeAssociate(), LPA_swap(), and _LPA_Epu::run_state.

Referenced by LPA_epu_proc().

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

Restore LPA epu operation after turbo reset.

Parameters:
fmt (in) Format of global context data
len (in) Length of global context data
dat (in) Global context data

References _LPA_Epu::epu_fpm, LPA_free_fpm(), LPA_K_EPU_RESET_FORMAT_0, _LPA_Epu::node_id, _LPA_Epu_Reset::setgrb, and _LPA_Epu_Reset::setout.

unsigned int LPA_epu_init ( void   ) 

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

Process raw task messages.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::last_db, LPA_associate(), LPA_fork_msg(), LPA_send_epu_tlm(), LPA_send_response(), LPA_set_compress(), LPA_set_config(), LPA_set_grb(), LPA_set_output(), _LPA_Epu::node_id, and _LPA_Epu::tx_id.

Referenced by LPA_epu_init().

unsigned int LPA_epu_start ( void   ) 

Start the LPA system.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::itc_task, and _LPA_Epu::state.

static FORK_cb_status LPA_fork_cb ( FORK_cb_prm *  prm,
FORK_msg_hdr *  hdr 
) [static]

Process forked task messages.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::fpa, LPA_abort(), LPA_select_mode(), LPA_send_response(), LPA_start(), and LPA_stop().

Referenced by LPA_fork_msg().

static unsigned int LPA_fork_msg ( unsigned int  opcode,
void *  pay,
unsigned int  prm 
) [static]

Fork a message to the event task.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::evt_que, _LPA_Epu::fpa, and LPA_fork_cb().

Referenced by LPA_epu_proc().

void LPA_get_epu_tlm ( LPA_EPU0CFG_Tlm pkt  ) 

unsigned int LPA_getRunState ( void   ) 

Returns the LPA run state.

Return values:
0 No LPA run in progress
1 LPA run in progress

References _LPA_Epu::run_state.

Referenced by LPA_grbWutFork().

static unsigned int LPA_scan_db ( CDM_Database *  cdb,
void *  prm 
) [static]

static unsigned int LPA_select_mode ( unsigned int  mode  )  [static]

Select the active handler mode.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Cfg::handlers, _LPA_Cfg::lpa, LPA_change_handlers(), and LPA_select().

Referenced by LPA_fork_cb().

static unsigned int LPA_send_epu_tlm ( void   )  [static]

static unsigned int LPA_send_response ( unsigned int  opcode,
unsigned int  siu_stat 
) [static]

Send response status message to SIU.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::active_cfg, _LPA_Epu::active_mode, _LPA_Epu::epu_fpm, _LPA_Cfg::handlers, _LPA_Cfg::lpa, LPA_flush(), LPA_free_fpm(), and _LPA_Epu::tx_id.

Referenced by LPA_epu_proc(), LPA_fork_cb(), and LPA_scan_db().

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

Change the data compression level.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Cfg::comp_level, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, and LPA_change_compress().

Referenced by LPA_epu_proc().

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

Change the mode handler association.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Cfg::handlers, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, and LPA_swap().

Referenced by LPA_epu_proc().

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

Change the active GRB processor.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::epu_reset, _LPA_Epu::grb_id, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_change_grb(), LPA_K_EPU_RESET_FORMAT_0, _LPA_Epu_Reset::setgrb, and _LPA_Epu::trd.

Referenced by LPA_epu_proc().

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

Change the output stream state.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::epu_reset, _LPA_Cfg::evh_post, _LPA_Cfg::lpa, _LPA_Epu::lpa_cfg, LPA_change_eds_out(), LPA_change_post_out(), LPA_K_EPU_RESET_FORMAT_0, _LPA_Cfg::lpa_post, LPA_swap(), _LPA_Epu_Reset::setout, and _LPA_Epu::trd.

Referenced by LPA_epu_proc().

static unsigned int LPA_start ( void *  pay,
unsigned int  time 
) [static]

static unsigned int LPA_stop ( void   )  [static]

Process stop config command.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

References _LPA_Epu::active_cfg, _LPA_Cfg::lpa, LPA_connect_stop_marker(), and _LPA_Epu::run_state.

Referenced by LPA_fork_cb().

static unsigned int LPA_swap ( unsigned int  list  )  [static]

Reverse handler list bit order to LSB == bit 0.

Return values:
LPA_GENERROR Failure
LPA_SUCCESS Success

Referenced by LPA_associate(), LPA_get_epu_tlm(), LPA_scan_db(), LPA_send_epu_tlm(), LPA_set_config(), and LPA_set_output().


Generated on Mon Mar 28 16:13:13 2011 by  doxygen 1.5.8