GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LTC / V6-2-4 > ltct / rad750
#include <LTC/LTC_msgs.h>
#include <ltcPrivate.h>
#include <CCSDS/CCSDS_pkt.h>
#include <LEM/defs.h>
#include <LEM/encode.h>
#include <LEM/encode_structs.h>
#include <LEM/decode.h>
#include <IMM/FPM_pubdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <LCBD/LCBD.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/FPA.h>
#include <PBS/WUT.h>
#include <PBS/TOV.h>
#include <PBS/TOC.h>
#include <string.h>
#include <stdlib.h>
Functions | |
static unsigned int | LTC_LcbRspCB (LTC_Wrk *tw, LCBD_xcb *xcb) |
LCB callback to process responses from reads of PDU registers. | |
static void | LTC_freeCmd (ITC_QueueItem *qitem, unsigned int status, LTC_Wrk *tw, void *prm1, void *prm2) |
static void | LTC_freePdu (ITC_QueueItem *qitem, unsigned int status, LTC_Wrk *tw, void *prm1, void *prm2) |
static void | LTC_freeTelem (ITC_QueueItem *qitem, unsigned int status, LTC_Wrk *tw, void *prm1, void *prm2) |
static unsigned int | LTC_CnvSmthSnsrs (LTC_Wrk *tw, LTC_HeatPipe *hp, LTC_SnsrType sTyp) |
Converts sensor values to smoothed temperature for a heat pipe. | |
static int | LTC_IsGoodTemps (const LTC_HeatPipe *hp) |
Check goodness of collected temperature values for this heat pipe. | |
static void | LTC_CalcHtrOnOff (LTC_Wrk *tw, const int h) |
Calculate on or off commands for a HP reservoir heater. | |
static signed int | LTC_EstTmp (const LTC_Temperature *tmp) |
Estimates temperature for next cycle. | |
static signed int | LTC_Smooth (LTC_Temperature *tmp) |
Returns smoothed value for temperature. | |
static void | LTC_CnvAdcToTmp (LTC_Sensor *snsr, LTC_Temperature *tmp) |
Converts sensor values to temperature for given heat pipe. | |
unsigned short | GetADCBits (const unsigned int *pduR, const int adc) |
Get 12-bit ADC values from PDU register given ADC number. | |
static void | LTC_CmdHtrs (LTC_Wrk *ltcW) |
Issue "on" or off commands to HP reservoir heaters. | |
static void | LTC_SndTlm (LTC_Wrk *tw) |
Collect, format and send telemetry for LTC. | |
unsigned int | LTC_ProcPduRsp (LTC_Wrk *tw, LTC_CntlProc_Prm *rb, const LTC_rl *rl) |
Callback to process responses from asynchrous reads of PDU registers. | |
void | LTC_ReadSensors (LTC_Wrk *tw) |
Start cycle of LTC control - issue LCB commands. | |
WUT_cb_status | LTC_WkUp (void *p, WUT_tmr *wut) |
Wake up LTC for another processing cycle and restart wake timer. |
unsigned short GetADCBits | ( | const unsigned int * | pduR, | |
const int | adc | |||
) |
Get 12-bit ADC values from PDU register given ADC number.
pduR | - PDU register bits (96 bits or 3 x 32) | |
adc | - adc number relative to this register (0 - 7) Byte Offsets 0 1 2 3 4 5 6 7 8 9 0 11 12 |
Referenced by LTC_ProcPduRsp().
static void LTC_CalcHtrOnOff | ( | LTC_Wrk * | tw, | |
const int | h | |||
) | [static] |
Calculate on or off commands for a HP reservoir heater.
tw | - LTC working storage. | |
h | - Heat pipe index. |
References LTC_Temperature::celsius, LTC_Cntrl::cmd, LTC_Options::cntrlMode, LTC_Options::fail, _LTC_Wrk::htP, LTC_ALWAYS_ON, LTC_AUTO, LTC_IsGoodTemps(), _LTC_Wrk::ltcCntrl, LTC_HeatPipe::opts, LTC_HeatPipe::param, PRINTF, RES_TMP, RIT_TMP, LTC_HeatPipe::temp, and TSCLF.
Referenced by LTC_ProcPduRsp().
static void LTC_CmdHtrs | ( | LTC_Wrk * | ltcW | ) | [static] |
Issue "on" or off commands to HP reservoir heaters.
ltcW | - LTC working storage. |
References LTC_Cntrl::cmd, _LTC_Wrk::HtrCntrlRg, _LTC_Wrk::HtrWDogRg, _LTC_Wrk::ltcCntrl, and PRINTF.
Referenced by LTC_ProcPduRsp().
void LTC_CnvAdcToTmp | ( | LTC_Sensor * | snsr, | |
LTC_Temperature * | tmp | |||
) | [static] |
Converts sensor values to temperature for given heat pipe.
snsr | - Heat pipe sensor record. | |
tmp | - Heat pipe temperature. A consistency check is made that the sensor value has not exceeded the maximum change limit in one LTC interval. |
References LTC_Sensor::bdRd, BROKEN, LTC_Temperature::celsius, LTC_Sensor::cnt, LTC_Temperature::cnv, LTC_Temperature::est, LTC_Temperature::estTol, LTC_Sensor::failLimit, LTC_Filter::fdf, LTC_FltDf::fln, LTC_Temperature::flt, LTC_Filter::nv, PRINTF, READ_BAD, READ_GOOD, LTC_Sensor::stat, TSCLF, and LTC_Sensor::tTyp.
Referenced by LTC_CnvSmthSnsrs().
unsigned int LTC_CnvSmthSnsrs | ( | LTC_Wrk * | tw, | |
LTC_HeatPipe * | hp, | |||
LTC_SnsrType | sTyp | |||
) | [static] |
Converts sensor values to smoothed temperature for a heat pipe.
tw | - LTC working storage. | |
hp | - Heat pipe record to get smoothed celsius temperature. | |
sTyp | - Sensor type. |
A | LTC MSG code. |
References LTC_Temperature::celsius, LTC_Temperature::est, LTC_CnvAdcToTmp(), LTC_EstTmp(), LTC_Smooth(), PRINTF, LTC_HeatPipe::snsr, LTC_HeatPipe::temp, TSCLF, and LTC_Sensor::tTyp.
Referenced by LTC_ProcPduRsp().
signed int LTC_EstTmp | ( | const LTC_Temperature * | tmp | ) | [static] |
Estimates temperature for next cycle.
tmp | - Heat pipe temperature structure. Estimates temperature for next cycle using last good raw temperature. |
References LTC_Temperature::flt, and LTC_Filter::zn.
Referenced by LTC_CnvSmthSnsrs().
static void LTC_freeCmd | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
LTC_Wrk * | tw, | |||
void * | prm1, | |||
void * | prm2 | |||
) | [static] |
Free memory after sending ITC command packets.
qitem | The memory buffer. | |
status | Status of telemetry. | |
tw | LTC control structure. | |
prm1 | Completion callback paramter 1. | |
prm2 | Completion callback paramter 2. |
References _LTC_Wrk::cmdPool.
static void LTC_freePdu | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
LTC_Wrk * | tw, | |||
void * | prm1, | |||
void * | prm2 | |||
) | [static] |
Free memory after receiving PDU response packet.
qitem | The memory buffer. | |
status | Status of telemetry. | |
tw | LTC control structure. | |
prm1 | Completion callback paramter 1. | |
prm2 | Completion callback paramter 2. |
References _LTC_Wrk::pduPool.
Referenced by LTC_ReadSensors().
static void LTC_freeTelem | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
LTC_Wrk * | tw, | |||
void * | prm1, | |||
void * | prm2 | |||
) | [static] |
Free memory after sending ITC telemetry packets.
qitem | The memory buffer. | |
status | Status of telemetry. | |
tw | LTC control structure. | |
prm1 | Completion callback paramter 1. | |
prm2 | Completion callback paramter 2. |
References _LTC_Wrk::tlmPool.
Referenced by LTC_SndTlm().
static int LTC_IsGoodTemps | ( | const LTC_HeatPipe * | hp | ) | [static] |
Check goodness of collected temperature values for this heat pipe.
hp | - Heat pipe data structure. |
References BROKEN, LTC_Filter::fdf, LTC_FltDf::fln, LTC_Temperature::flt, LTC_Filter::nv, LTC_HeatPipe::opts, PRINTF, RES_TMP, LTC_Options::resSel, RIT_TMP, LTC_Options::ritSel, LTC_HeatPipe::snsr, LTC_Sensor::stat, and LTC_HeatPipe::temp.
Referenced by LTC_CalcHtrOnOff().
static unsigned int LTC_LcbRspCB | ( | LTC_Wrk * | tw, | |
LCBD_xcb * | xcb | |||
) | [static] |
LCB callback to process responses from reads of PDU registers.
tw | - LTC working storage. | |
xcb | - LCBD control block. |
'0'. |
References _LTC_Wrk::cmdHdrSize, _LTC_Wrk::itcHdrSize, MSG_SIGNAL, and _LTC_Wrk::pduPool.
Referenced by LTC_ReadSensors().
unsigned int LTC_ProcPduRsp | ( | LTC_Wrk * | tw, | |
LTC_CntlProc_Prm * | rb, | |||
const LTC_rl * | rl | |||
) |
Callback to process responses from asynchrous reads of PDU registers.
tw | - LTC working storage. | |
rb | - Response processing block. | |
rl | - A pointer to the LTC PDU response data. |
A | LTC MSG code. |
References _LTC_Wrk::cmdMode, LTC_Sensor::cnt, GetADCBits(), _LTC_CntlProc_Prm::grp, _LTC_Wrk::htP, _LTC_Wrk::lastClNum, LTC_ACTIVE, LTC_CalcHtrOnOff(), LTC_CmdHtrs(), LTC_CnvSmthSnsrs(), LTC_NO, LTC_SndTlm(), LTC_YES, _LTC_CntlProc_Prm::mr, _LTC_CntlProc_Prm::ncl, _LTC_CntlProc_Prm::pdu, _LTC_Wrk::pduReg, _LTC_Wrk::pduTbl, PRINTF, _LTC_rl::rd_rsp, READ_BAD, READ_GOOD, LTC_HeatPipe::snsr, _LTC_Wrk::tlmCnt, and _LTC_Wrk::tlmFreq.
Referenced by LTC_CntlProc().
void LTC_ReadSensors | ( | LTC_Wrk * | tw | ) |
Start cycle of LTC control - issue LCB commands.
Queue-up commands (LCBD command list) to read sensors from actvie PDUs.
tw | - LTC working storage |
References _LTC_Wrk::cl, _LTC_Wrk::cmdHdrSize, _LTC_CntlProc_Prm::grp, _LTC_Wrk::htP, _LTC_Wrk::itcHdrSize, _LTC_Wrk::lcb, LTC_CNTLPROC_FCODE, LTC_freePdu(), LTC_INTERNAL_CMD_APID, LTC_LcbRspCB(), LTC_NUM_HPs, LTC_PDU_GRPS, LTC_PDUs, LTC_SNSR_TYPS, _LTC_CntlProc_Prm::mr, MSG_SIGNAL, _LTC_CntlProc_Prm::ncl, NOT_READ, _LTC_CntlProc_Prm::pdu, _LTC_Wrk::pdu, _LTC_Wrk::pduPool, _LTC_Wrk::pduReg, _LTC_Wrk::pduTbl, PRINTF, LTC_HeatPipe::snsr, and LTC_Sensor::stat.
Referenced by LTC_CntlStart().
static void LTC_Smooth | ( | LTC_Temperature * | tmp | ) | [static] |
Returns smoothed value for temperature.
tmp | - Temperature record for heat pipe. |
References LTC_Temperature::celsius, LTC_FltDf::cf, CFSCL, LTC_Filter::fdf, LTC_FltDf::fln, LTC_Temperature::flt, LTC_Filter::nv, and LTC_Filter::zn.
Referenced by LTC_CnvSmthSnsrs().
static void LTC_SndTlm | ( | LTC_Wrk * | tw | ) | [static] |
Collect, format and send telemetry for LTC.
tw | - LTC working storage. |
References _LTC_Wrk::itcHdrSize, LTC_DIAGLTC_TLM_APID, LTC_freeTelem(), LTC_GetTlm(), MSG_SIGNAL, _LTC_Wrk::tlmHdrSize, and _LTC_Wrk::tlmPool.
Referenced by LTC_ProcPduRsp().
WUT_cb_status LTC_WkUp | ( | void * | p, | |
WUT_tmr * | wut | |||
) |
Wake up LTC for another processing cycle and restart wake timer.
p | - LTC Working storage. | |
wut | - LTC wake up timer. |
References _LTC_Wrk::cmdHdrSize, _LTC_Wrk::cmdPool, _LTC_Wrk::itcHdrSize, LTC_CNTLSTART_FCODE, LTC_freeCmd(), LTC_INTERNAL_CMD_APID, MSG_SIGNAL, PRINTF, _LTC_CntlStart_Prm::spare, and _LTC_Wrk::wutNSecs.
Referenced by LTC_StartTask().