GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCM / dev > lcm_siu / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

LCM_house.c File Reference

CPU generic functions for housekeeping support functions. More...

#include <string.h>
#include <FILE/FILE_upl.h>
#include <ITC/ITC_drvdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LCBD/LCBD.h>
#include <LHK/LHK_pubdefs.h>
#include <LHK/LHK_tlmdefs.h>
#include <MDB/MDB_pubdefs.h>
#include <MEM/MEM_pubdefs.h>
#include <MON/MON_pubdefs.h>
#include <PBS/FORK.h>
#include <PBS/FPA.h>
#include <PBS/MBA.h>
#include <PBS/PBS.h>
#include <PBS/PTS.h>
#include <PBS/TOV.h>
#include <THS/THS.h>
#include <LCM/LCM_msgs.h>
#include <LCM_prvdefs.h>

Defines

#define LCM_L_RECORD_PKT   (8)
#define LCM_K_PID_SC_0   (23)
#define LCM_K_PID_SC_1   (24)
#define LCM_K_PID_SC_2   (25)
#define LCM_K_PID_SEL   (7)
#define LCM_PIDCONFIG(_pn, _t, _s, _o)
 Configure a PID.
#define LCM_PIDGET(_pn, _pv)
 Read an input PID.

Functions

static WUT_cb_status expireTickle (void *prm, WUT_tmr *tmr)
 Timer callback routine (called at interrupt level).
static FORK_cb_status forkTickle (FORK_cb_prm *prm, FORK_msg_hdr *hdr)
 Task level target of the CPU metric cyclic interrupt timer.
static void fpa_free_cb (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx)
 Clean up after sending a housekeeping record to the SIU.
unsigned int LCM_houseInitialize (LCM_Control *ctl)
 Initialize the housekeeping function (common to all CPUs).
unsigned int LCM_houseSendCPU (unsigned int report)
 Acquire and send CPU metric information.
unsigned int LCM_houseSendITC (unsigned int report)
 Acquire and send ITC configuration information.
unsigned int LCM_houseSendLPA (unsigned int report)
 Acquire and send LPA (filter) configuration information.
unsigned int LCM_houseTaskInitialize (LCM_Control *ctl)
 One-time call in LCM task context to start housekeeping sub-function.


Detailed Description

CPU generic functions for housekeeping support functions.

CVS $Id: LCM_house.c,v 1.7 2011/03/29 21:59:33 apw Exp $
Author:
A.P.Waite
LCM_house.c provides CPU generic support for LCM's housekeeping support functions.

Define Documentation

#define LCM_PIDCONFIG ( _pn,
_t,
_s,
_o   ) 

Value:

{                                                 \
    if( pidCnf( _pn, _t, _s, _o ) == ERROR )      \
    {                                             \
        _msg_report( LCM_PIDCFGFL, 0, 1, _pn );   \
    }                                             \
}
Configure a PID.

Parameters:
_pn (in) PID number
_t (in) DISABLE, IN, OUT, IN_OUT
_s (in) Input sensitivity IN_LEVEL, IN_EDGE
_o (in) OUT_REG or OUT_TIMER

Referenced by LCM_houseInitialize().

#define LCM_PIDGET ( _pn,
_pv   ) 

Value:

{                                                 \
    int _pid_value;                               \
    if( ( _pid_value = pidGet( _pn ) ) == ERROR ) \
    {                                             \
        _msg_report( LCM_PIDGETFL, 0, 1, _pn );   \
    }                                             \
    else                                          \
    {                                             \
        _pv = _pid_value;                         \
    }                                             \
}
Read an input PID.

Parameters:
_pn (in) PID number
_pv (out) PID value (left untouched if pidGet() fails)

Referenced by LCM_houseSendCPU().


Function Documentation

static WUT_cb_status expireTickle ( void *  prm,
WUT_tmr *  tmr 
) [static]

Timer callback routine (called at interrupt level).

Parameters:
prm (in) User parameter (a "tickle" block)
tmr (in) Wake up timer handle
expireTimer() is a timer callback routine. It simply wakes up the LCM task using a FORK message to the "fqi" (ITC_Q_SYNC) queue, requesting execution by the routine listed in the tickle block.

References forkTickle(), _LCM_Control::fqi, _LCM_Tickle::frk, and LCM_lcb.

Referenced by LCM_houseTaskInitialize().

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

Task level target of the CPU metric cyclic interrupt timer.

Parameters:
prm (in) FORK parameter (not used) (cannot be used!)
hdr (in) The fork message
forkTickle() drives the cyclic acquisition housekeeping information

References _LCM_Tickle::delta, _LCM_Control::house, _LCM_Control::image, LCM_houseSendCPU(), LCM_houseSendITC(), LCM_houseSendLPA(), LCM_HSK_RECORD_CPU, LCM_HSK_RECORD_ITC, LCM_HSK_RECORD_LPA, LCM_K_SRC_INTERNAL, LCM_lcb, _LCM_ImageControl::once, _LCM_Tickle::sav, _LCM_HouseControl::tkl, and _LCM_Tickle::tmr.

Referenced by expireTickle().

static void fpa_free_cb ( ITC_QueueItem *  qitem,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2,
unsigned int  tx 
) [static]

Clean up after sending a housekeeping record to the SIU.

Parameters:
qitem (in) Queue item
status (in) Status from ITC_send()
prm0 (in) User param 0 (FPA control block)
prm1 (in) User param 1 (unused)
prm2 (in) User param 2 (unused)
tx (in) Failure during send phase of ITC_send() (unused)
fpa_free_cb() is the callback routine that's called once a housekeeping record has been delivered to the SIU (a standard ITC completion routine).

Referenced by LCM_houseSendCPU(), LCM_houseSendITC(), and LCM_houseSendLPA().

unsigned int LCM_houseInitialize ( LCM_Control ctl  ) 

Initialize the housekeeping function (common to all CPUs).

Parameters:
ctl (in) LCM control block
LCM_houseInitialize() builds up the CPU common elements for providing housekeeping information.

References _LCM_Tickle::delta, _LCM_Tickle::fpa, _LCM_Control::house, _LCM_Control::itc, _LCM_Control::itc_hdr_size, LCM_HSK_RECORD_CPU, LCM_L_RECORD_TYPES, LCM_PIDCONFIG, _LCM_HouseControl::ptux, _LCM_HouseControl::timx, _LCM_HouseControl::tkl, and _LCM_Tickle::tmr.

Referenced by LCM_initialize().

unsigned int LCM_houseSendCPU ( unsigned int  report  ) 

unsigned int LCM_houseSendITC ( unsigned int  report  ) 

Acquire and send ITC configuration information.

Parameters:
report (in) Force a diagnostic packet on the SIU
LCM_houseSendITC() does an immediate acquisition and send of ITC configuration information to the SIU.

References _LCM_Tickle::fpa, fpa_free_cb(), _LCM_Control::house, LCM_HSK_RECORD_ITC, LCM_lcb, _LCM_Control::msg_level_ctdb, _LCM_Control::msg_level_ssr, _LCM_Record::node, _LCM_Control::node_id, _LCM_Record::report, _LCM_Tickle::seq, _LCM_Record::seq, _LCM_HouseControl::tkl, and _LCM_Record::type.

Referenced by forkTickle().

unsigned int LCM_houseSendLPA ( unsigned int  report  ) 

Acquire and send LPA (filter) configuration information.

Parameters:
report (in) Force a diagnostic packet on the SIU
LCM_houseSendLPA() does an immediate acquisition and send of LPA (filter) configuration information to the SIU.

References _LCM_Tickle::fpa, fpa_free_cb(), _LHK_LpaCfgSiu_Tlm::hdr, _LCM_Control::house, LCM_HSK_RECORD_LPA, LCM_lcb, _LCM_Record::node, _LCM_Control::node_id, _LCM_Record::report, _LCM_Tickle::seq, _LCM_Record::seq, _LCM_HouseControl::tkl, and _LCM_Record::type.

Referenced by forkTickle().

unsigned int LCM_houseTaskInitialize ( LCM_Control ctl  ) 

One-time call in LCM task context to start housekeeping sub-function.

Parameters:
ctl (in) LCM control block
LCM_houseTaskInitialize() performs any initialization required by the house- keeping subfunction which must be performed in the context of the LCM task.

References expireTickle(), _LCM_Control::house, LCM_L_RECORD_TYPES, _LCM_Tickle::sav, _LCM_HouseControl::tkl, and _LCM_Tickle::tmr.

Referenced by taskStartOnce().


Generated on Wed Mar 30 16:05:43 2011 by  doxygen 1.5.8