GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIH / V0-2-7 > lih / linux-gcc
#include <string.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CDM/CDM_pubdefs.h>
#include <IMM/FPM_pubdefs.h>
#include <IMM/RBM_pubdefs.h>
#include <ITC/ITC_drvdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LCBD/LCBD_drv.h>
#include <LIH_DB/LIH_DB_schema.h>
#include <LHK/LHK_pubdefs.h>
#include <MDB/MDB_pubdefs.h>
#include <PBS/FPA.h>
#include <PBS/MBA.h>
#include <PBS/MTX.h>
#include <PBS/RW.ih>
#include <PBS/WUT.h>
#include <LIH/LIH_cmdxtrn.h>
#include <LIH/LIH_msgs.h>
#include <LIH/LIH_tlmdefs.h>
#include <LIH_packet.h>
#include <LIH_prvdefs.h>
#include <LIH_source.h>
Functions | |
static LHK_PacketStatus | capture (unsigned int *prv, unsigned int abas, unsigned int aidx, unsigned int seq, unsigned char *out) |
Copy hardware monitoring housekeeping packets from packet database. | |
static unsigned int | control_rx (void *prm, const ITC_QueueItem *qitem, void *pay, unsigned int len) |
Process messages arriving on the control queue. | |
static WUT_cb_status | expireTimer (void *prm, WUT_tmr *tmr) |
Timer callback routine (called at interrupt level). | |
static FORK_cb_status | forkTimer (FORK_cb_prm *prm, FORK_msg_hdr *hdr) |
Task level target of the cyclic interrupt timer. | |
static unsigned int | initializeAcq (LIH_Control *hcb, LIH_DB_Schema *ldb) |
Initialize the hardware acquisition facilities. | |
static unsigned int | initializeLCB (LIH_Control *hcb, LIH_DB_Schema *ldb) |
Initialize the LCB controls. | |
static unsigned int | initializeLimits (LIH_Control *hcb, LIH_DB_Schema *ldb) |
Initialize the ADC limit monitoring controls. | |
static unsigned int | initializeTask (LIH_Control *hcb, LIH_DB_Schema *ldb) |
Initialize the LIH hardware monitoring task. | |
static void | taskOnce (void *prm) |
One-time call (in task context) to initialize the cLIH task. | |
unsigned int | LIH_initialize () |
Initialize the LIH hardware monitoring facility. | |
unsigned int | LIH_start () |
Start the LIH hardware monitoring task. | |
Variables | |
LIH_Control * | LIH_hcb |
Control block for the LIH hardware monitoring facility. | |
unsigned int | LIH_aidx2hpk [ITC_L_APID_HOUSE] |
Reverse map from APID index to hardware packet. | |
static const char * | s_offon [2] = { "off", "on" } |
Strings used in error reporting. |
CVS $Id: LIH_control.c,v 1.5 2011/03/29 22:38:00 apw Exp $
static LHK_PacketStatus capture | ( | unsigned int * | sav, | |
unsigned int | abas, | |||
unsigned int | aidx, | |||
unsigned int | seq, | |||
unsigned char * | out | |||
) | [static] |
Copy hardware monitoring housekeeping packets from packet database.
sav | (in) User parameter (update counter of last packet copy) | |
abas | (in) Base of APID table (ITC_K_APID_HOUSE or ITC_K_APID_DIAG) | |
aidx | (in) APID index | |
seq | (in) CCSDS sequence count | |
out | (in) Output buffer (beginning of CCSDS telemetry header) |
References _LIH_Database::cnt, _LIH_Database::hpk, _LIH_Control::pdb, and _LIH_Packet::tim.
Referenced by initializeAcq().
static unsigned int control_rx | ( | void * | prm, | |
const ITC_QueueItem * | qitem, | |||
void * | pay, | |||
unsigned int | len | |||
) | [static] |
Process messages arriving on the control queue.
prm | (in) User context parameter | |
qitem | (in) Queue item to process | |
pay | (in) Queue item payload | |
len | (in) Queue item payload length |
Referenced by initializeTask().
static WUT_cb_status expireTimer | ( | void * | prm, | |
WUT_tmr * | tmr | |||
) | [static] |
Timer callback routine (called at interrupt level).
prm | (in) User parameter (harware monitoring control block) | |
tmr | (in) Wake up timer handle |
References forkTimer(), _LIH_Control::fqi, _LIH_Message::frk, and _LIH_Control::msg.
Referenced by taskOnce().
static FORK_cb_status forkTimer | ( | FORK_cb_prm * | prm, | |
FORK_msg_hdr * | hdr | |||
) | [static] |
Task level target of the cyclic interrupt timer.
prm | (in) FORK parameter (not used) (cannot be used!) | |
hdr | (in) The fork message (not used) |
References _LIH_Device::acq, _LIH_Control::count, _LIH_Control::delta, _LIH_Control::dvc, _LIH_Control::lcbd, LIH_L_DEVICE, _LIH_Control::major, _LIH_Device::minor, _LIH_Control::minor, _LIH_Control::online, _LIH_Device::prm, and _LIH_Control::tmr.
Referenced by expireTimer().
static unsigned int initializeAcq | ( | LIH_Control * | hcb, | |
LIH_DB_Schema * | ldb | |||
) | [static] |
Initialize the hardware acquisition facilities.
hcb | (in) LIH hardware monitoring control block | |
ldb | (in) LIH data handle (from CDM) |
References _LIH_Device::acq, capture(), _LIH_Control::delta, _LIH_Control::dvc, LIH_AEMinit(), LIH_defineCmdCnt(), LIH_defineCtdbCounts(), LIH_defineGasuCounts(), LIH_defineLatcStatus(), LIH_defineLimStatus(), LIH_defineLtcData(), LIH_defineMiscSlow(), LIH_defineTopCpu(), LIH_hpk2aidx, LIH_K_DVC_AEM, LIH_K_DVC_PDU, LIH_K_DVC_PIG, LIH_K_DVC_TEM, LIH_L_DEVICE, LIH_PDUinit(), LIH_PIGinit(), LIH_TEMinit(), _LIH_Control::major, _LIH_Control::minor, _LIH_Device::minor, _LIH_Control::pdb, _LIH_Device::prm, _LIH_Database::sav, and _LIH_Control::tmr.
Referenced by LIH_initialize().
static unsigned int initializeLCB | ( | LIH_Control * | hcb, | |
LIH_DB_Schema * | ldb | |||
) | [static] |
Initialize the LCB controls.
hcb | (in) LIH hardware monitoring control block | |
ldb | (in) LIH data handle (from CDM) |
References _LIH_Control::count, _LIH_Control::lcbd, and _LIH_Control::online.
Referenced by LIH_initialize().
static unsigned int initializeLimits | ( | LIH_Control * | hcb, | |
LIH_DB_Schema * | ldb | |||
) | [static] |
Initialize the ADC limit monitoring controls.
hcb | (in) LIH hardware monitoring control block | |
ldb | (in) LIH data handle (from CDM) |
References _LIH_Control::afp, _LIH_LimitSave::confirm, _LIH_Control::dfp, LIH_limitCheckCDM(), LIH_limitExternalDefault(), LIH_limitExternalTable(), LIH_limitInternalDefault(), _LIH_Control::sav, _LIH_Control::tbl, and _LIH_Control::tlm.
Referenced by LIH_initialize().
static unsigned int initializeTask | ( | LIH_Control * | hcb, | |
LIH_DB_Schema * | ldb | |||
) | [static] |
Initialize the LIH hardware monitoring task.
hcb | (in) LIH hardware monitoring control block | |
ldb | (in) LIH data handle (from CDM) |
References control_rx(), _LIH_Control::itc, LIH_Apid654, _LIH_Control::pcb, and _LIH_Control::rcb.
Referenced by LIH_initialize().
unsigned int LIH_initialize | ( | ) |
Initialize the LIH hardware monitoring facility.
LIH_initialize() does all the initialization required by the hardware monitoring facilities in LIH.
References _LIH_Control::cdm, _LIH_Control::fil, initializeAcq(), initializeLCB(), initializeLimits(), initializeTask(), LIH_CTL_BROKEN, LIH_CTL_INITIALIZED, LIH_CTL_UNINITIALIZED, _LIH_Control::mtx, _LIH_Control::rwi, and _LIH_Control::state.
unsigned int LIH_start | ( | ) |
Start the LIH hardware monitoring task.
LIH_start() starts the LIH hardware monitoring task
References _LIH_Control::itc, LIH_CTL_BROKEN, LIH_CTL_INITIALIZED, LIH_CTL_STARTING, _LIH_Control::mtx, _LIH_Control::state, and taskOnce().