\hypertarget{LCBT_8h}{
\section{LCBT.h File Reference}
\label{LCBT_8h}\index{LCBT.h@{LCBT.h}}
}
Regression test for LCB LAT COmmunication boards.  


{\tt \#include $<$LCBT/LCBT\_\-initBoard.h$>$}\par
{\tt \#include $<$LCBT/TDATA.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{LCBT_8h_2dc21f4c68e7808b1b83ecfe5bcb26ca}{
\#define \hyperlink{LCBT_8h_2dc21f4c68e7808b1b83ecfe5bcb26ca}{LCBT\_\-STALL}~(0)}
\label{LCBT_8h_2dc21f4c68e7808b1b83ecfe5bcb26ca}

\begin{CompactList}\small\item\em standard stall value for register access, possible use in testing \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{LCBT_8h_48c9cd852ea567ce53d3e2e807056c29}{
typedef enum \hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a}{\_\-LCBT\_\-OPTION} \hyperlink{LCBT_8h_48c9cd852ea567ce53d3e2e807056c29}{LCBT\_\-OPTION}}
\label{LCBT_8h_48c9cd852ea567ce53d3e2e807056c29}

\begin{CompactList}\small\item\em Masks for test option mask. \item\end{CompactList}\item 
\hypertarget{LCBT_8h_5807ef289478e090047d395afd0184de}{
typedef enum \hyperlink{LCBT_8h_d0335fa357b7a3705183f81e91dd4152}{\_\-LCBT\_\-AVAIL} \hyperlink{LCBT_8h_5807ef289478e090047d395afd0184de}{LCBT\_\-AVAIL}}
\label{LCBT_8h_5807ef289478e090047d395afd0184de}

\begin{CompactList}\small\item\em defines used with sHwAvail to determine what HW is connected for \hyperlink{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{LCBT\_\-cmdExternalTest()} \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a}{\_\-LCBT\_\-OPTION} \{ \par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a7e4483ef7eac7f28cb85b8c13ac970a6}{LCBT\_\-OPTION\_\-BUSYPRINT} =  1, 
\par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a28e08effd7d8d1083e0e2cdce7200992}{LCBT\_\-OPTION\_\-VERBOSE} =  2, 
\par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a558903b6ff8849690572eb796f16df33}{LCBT\_\-OPTION\_\-FOREVER} =  4, 
\par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a85bd5905d338219a94a7f18b468b160f}{LCBT\_\-OPTION\_\-INCTESTPARM} =  0x10, 
\par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a65988540d722fe545ddac3a65d9d997e}{LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO} =  0x20, 
\par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833aa84d96c74814c8aa860367f29eedecbf}{LCBT\_\-OPTION\_\-RLCL\_\-ADDR} =  0x40, 
\par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a1e663dac145eb0922092028edd8e0372}{LCBT\_\-OPTION\_\-NOWRITEOVER} =  0x80, 
\par
\hyperlink{LCBT_8h_1dceb15e138ffe521d8534d2002b833a9a019b7f8de9a994ff05db953627fd1f}{LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP} =  0x100
 \}
\item 
enum \hyperlink{LCBT_8h_d0335fa357b7a3705183f81e91dd4152}{\_\-LCBT\_\-AVAIL} \{ \par
\textbf{LCBT\_\-TEM\_\-AVAIL} =  1, 
\par
\hyperlink{LCBT_8h_d0335fa357b7a3705183f81e91dd4152080d9b05217fa5e74744214c849e3b73}{LCBT\_\-GASU\_\-AVAIL} =  2, 
\par
\hyperlink{LCBT_8h_d0335fa357b7a3705183f81e91dd4152885f2f21726dd87e21c53940eb9ba376}{LCBT\_\-MASK\_\-VALID} =  0x8000
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{LCBT_8h_e40cfdebf673339c53847caa8af47f47}{LCBT\_\-init} (int latpAddr, int useRedundantPath, LCBD lcb)
\begin{CompactList}\small\item\em inits LCB driver (which starts 2 tasks associated with driver) \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_3f3272e0ac34b5aca3d159da87b2c12f}{LCBT\_\-isInit} ()
\begin{CompactList}\small\item\em indicates if LCBT\_\-init has been run ok \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_da1b59bac02fa4d33932310d76f45075}{LCBT\_\-setSiu} (int idx)
\begin{CompactList}\small\item\em Set boardID in Csr to SIU addr. \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_32368717ecf2e364ac3586aadc15f191}{LCBT\_\-setEpu} (int idx)
\begin{CompactList}\small\item\em Set boardID in Csr to EPU addr. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_3feb524cb391024778e2f572aa1998cc}{LCBT\_\-eventInit} (int forkPri)
\begin{CompactList}\small\item\em Setup module in this file to echo event data back to sender. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}{LCBT\_\-testAll} (int num, int nLoops, int latpAddr, int loopbackCable)
\begin{CompactList}\small\item\em overall test, does complete regression test of LCB \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_ec2a27c0fde6a7d762152ea23d5dd3c4}{LCBT\_\-testAllEpu} (int num, int nLoops, int latpAddr, int loopbackCable)
\begin{CompactList}\small\item\em overall test for EPU, does complete regression test of LCB minus cmdResp test \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_1f75fe8c5b30bcf46ea14e349ff90167}{LCBT\_\-setOption} (unsigned int optionMask)
\begin{CompactList}\small\item\em set test option mask, see \hyperlink{LCBT_8h}{LCBT.h} for values \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_ad3855e9e7275d19719d2169a0a04997}{LCBT\_\-localRegTest} (int num, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em Read/write/compare test on all PCI accessable registers on LCB board. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_20e613453b72dadd795867035a27f3e1}{LCBT\_\-cmdLocalTest} (int num, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em read-only test on LCB local registers that require Cmd list DMA \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_7e67797bd11d4ff2b32ddb64533bf4e9}{LCBT\_\-cmdLocalTest2} (int num, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em 2 task read test on LCB local registers that require Cmd list DMA \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_2a9da93776961c6c4956b3dfcf621aac}{LCBT\_\-cmdLocalTest3} (int num, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em 3 task read test on LCB local registers that require Cmd list DMA \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{LCBT\_\-cmdExternalTest} (int num, int singleAccess, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em read test on LCB local registers that require Cmd list DMA \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_83b90cb0c56f6f928042d0985246efb5}{LCBT\_\-eventTest} (int num, int maxLen, int latpAddr, int randomLen, int ccsds, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em Test to send/recv/compare event data thru loopback on LCB board. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_27823a419ac589558edca7227de94b62}{LCBT\_\-eventTest2} (int num, int maxLen, int latpAddr, int randomLen, int ccsds, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em 2 concurrent task test to send/recv/compare event data thru loopback on LCB board \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_b85bd908f76613039921d8b3363d859d}{LCBT\_\-eventTest3} (int num, int maxLen, int latpAddr, int randomLen, int ccsds, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em 3 concurrent task test to send/recv/compare event data thru loopback on LCB board \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_67b2c774505332c7d95639c2583efaba}{LCBT\_\-eventTest5} (int num, int maxLen, int latpAddr, int randomLen, int ccsds, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em 5 concurrent task test to send/recv/compare event data thru loopback on LCB board \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_3ba9ed7a052ea98f11b12bae2c16f18d}{LCBT\_\-comboTest} (int num, int maxLen, int latpAddr, int randomLen, int ccsds, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em 2 concurrent tasks running event and localCmdReg test \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_bc80f8c25ceb2ed7e87426ecd6220410}{LCBT\_\-eventWatermarkTest} (int num, int latpAddr)
\begin{CompactList}\small\item\em Check for proper operation of watermarks on Event and EventData queues. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_04fe8fd58a08036d4822fb135aca22fb}{LCBT\_\-fillQueueTest} (int numLoop, int disableResultInt)
\begin{CompactList}\small\item\em Fill requestQ with requests to make sure it handles it properly. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_edd0168c5a33c92020e009934931b346}{LCBT\_\-eventFillTest} (int num, int latpAddr, int buffSize32, int printInfo)
\begin{CompactList}\small\item\em Check for proper operation circular buffFUll interrupt. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw} ()
\begin{CompactList}\small\item\em get mask determined by \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw()} for use in LCBT\_\-determineHw () \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_c37678485b7a4333ceea632617cdd7ab}{LCBT\_\-hwAvail} ()
\begin{CompactList}\small\item\em get mask of hw determined by \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw()} for use in \hyperlink{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{LCBT\_\-cmdExternalTest()} \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_fe61aa1d20d346b6745673fa3663093b}{LCBT\_\-initGasu} ()
\begin{CompactList}\small\item\em setup registers in GASU \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_bc797ff7c781c3c30f2b1fa39d902679}{LCBT\_\-setCfg} (int haveGasu, int haveTem)
\begin{CompactList}\small\item\em get mask determined by \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw()} for use in \hyperlink{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{LCBT\_\-cmdExternalTest()} \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_55a0f3f8783d736520f08849655086c2}{LCBT\_\-lam} (int latpAddr)
\begin{CompactList}\small\item\em Send out LAM (lookAtMe) to specified addr. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_ccff75fe79f5fc9015dd6da30918c91a}{LCBT\_\-remoteLatpCsr} (int latpAddr, unsigned int val, unsigned int mask, int broadcast)
\begin{CompactList}\small\item\em send value to LatpCsr on another CPU over CmdResponse \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_8cf5d018013688e19a8e0f14e7edddd9}{LCBT\_\-setRemoteBoardId} (int latpAddr)
\begin{CompactList}\small\item\em set board ID to latpAddr on CPU determined by CRU \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_0d0d62c5c9fdef82d8cc12a3f638f206}{LCBT\_\-clearErrorTotals} ()
\begin{CompactList}\small\item\em clear the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_ea0ea4f8241a0aeee6082848b925f034}{LCBT\_\-printErrorTotals} (char $\ast$title)
\begin{CompactList}\small\item\em print the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_db10811205ee26e4a931c22953518ffe}{LCBT\_\-updateErrorTotals} (int access, int rErr, int wErr, int cErr)
\begin{CompactList}\small\item\em update the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_d8b8998394e7f54f6bd32f493488a6fb}{LCBT\_\-saveErrorForDeltas} ()
\begin{CompactList}\small\item\em stash global error counts to use with \hyperlink{LCBT_8h_7f159fe5d1b8a10755e971732bc093af}{LCBT\_\-printErrorDeltas()} \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_7f159fe5d1b8a10755e971732bc093af}{LCBT\_\-printErrorDeltas} (char $\ast$title)
\begin{CompactList}\small\item\em print the delta error counts since \hyperlink{LCBT_8h_d8b8998394e7f54f6bd32f493488a6fb}{LCBT\_\-saveErrorForDeltas()} \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_7025441d89d7d5b2f2ceebef4ad26103}{LCBT\_\-getErrorTotals} (int $\ast$numAccess, int $\ast$rErr, int $\ast$wErr, int $\ast$cErr)
\begin{CompactList}\small\item\em get the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_67a7b8318cf1ea7401da43612e632eaf}{LCBT\_\-eventRecv} (int numRecv, int ccsds)
\begin{CompactList}\small\item\em Setup to receive and compare data from \hyperlink{LCBT__event_8c_c0fca72966470de20d1e7548228c70c6}{LCBT\_\-eventSend()}. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_c0fca72966470de20d1e7548228c70c6}{LCBT\_\-eventSend} (int numEvents, int maxEvtSize, int latpAddr, int randomLen, int ccsds, \hyperlink{TDATA_8h_fafb1ba1ffdfa0f77e907069435b6f43}{TDATA\_\-DTEST} testType, unsigned int testParm)
\begin{CompactList}\small\item\em Send out test event data to be received by \hyperlink{LCBT__event_8c_67a7b8318cf1ea7401da43612e632eaf}{LCBT\_\-eventRecv()}. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_928f177accfc71b3e3a233da173486bb}{LCBT\_\-eventSendDelay} (int delayNanosec)
\begin{CompactList}\small\item\em Set delay in nanoSec between event sends, can be 0. \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_1a07ffdd3823e728ecdcd233df964da7}{LCBT\_\-regs} ()
\begin{CompactList}\small\item\em print vals of all registers in LCB \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_82bc2eaaae8a40ff893700c28210d117}{LCBT\_\-readCsr} ()
\begin{CompactList}\small\item\em Read CSR register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_d0280ce9db442c2a55ad93589234bc13}{LCBT\_\-readIrq} ()
\begin{CompactList}\small\item\em Read IRQ register which has interrupt status. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_c1f1cf359722ce9479f91f8ddf21cdeb}{LCBT\_\-readEventBase} ()
\begin{CompactList}\small\item\em Read Event Base register which is start of Event circular buffer. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_c1a79e3d4b02516c2c8b9c15fbd60689}{LCBT\_\-readEventFree} ()
\begin{CompactList}\small\item\em Read Event Free register which is offset in Event circular buffer HW will write to. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_323aaa63677d1e44516cb99693280875}{LCBT\_\-readEventQ} ()
\begin{CompactList}\small\item\em Read eventQueue NOTE this will pull value from queue and effect operation. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_eb5afd983030b4b6db43b24fe9edb886}{LCBT\_\-readResultQ} ()
\begin{CompactList}\small\item\em Read resultQueue NOTE this will pull value from queue and effect operation. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_f4f440fbfa7ed1ddcba2fdb0657c5024}{LCBT\_\-readRequestQ} ()
\begin{CompactList}\small\item\em Read requestQueue, 0=notEMpty, not0=empty NOTE this will pull value from queue and effect operation. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_d54a8947bccc0bbee5c58c24932b1cf9}{LCBT\_\-readLatpCsr} ()
\begin{CompactList}\small\item\em read LATp CSR register (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a616c23a1d17d2393ae2cd1f5b77a5f0}{LCBT\_\-readFifoFault} ()
\begin{CompactList}\small\item\em read Fifo Fault registers (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_f59b295633df10b4fbba35053240e903}{LCBT\_\-readFabricSelect} ()
\begin{CompactList}\small\item\em Read FabricSelect register which indicates primary or redundant. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_4ac046edfe61d6dceef9fd3f2cbe1eb7}{LCBT\_\-readStats} ()
\begin{CompactList}\small\item\em read stats register (requires a DMA) \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_fc2f435b9bf3afdb7cd6d813b03cfa2f}{LCBT\_\-readHwInfo} ()
\begin{CompactList}\small\item\em Read hwInfo register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_73a9340f377147f6e91d9c6dcc5f5a49}{LCBT\_\-writeCsr} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_3e41bd06463f4103c825b3e3d46b00ff}{LCBT\_\-writeIrq} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_73f58f6aad77f9e6a388e32cff47db5b}{LCBT\_\-writeEventBase} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_803d3936027f3240e53ef3351cec1bdb}{LCBT\_\-writeEventFree} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_fb2edda470465630197334d723f0fcf7}{LCBT\_\-writeFabricSelect} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_99b345d13e1797dd240fce82346341a7}{LCBT\_\-writeLatpCsr} (unsigned int data, unsigned int mask)
\begin{CompactList}\small\item\em write LATp CSR register (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_fe5cd32fa625ec64c11b007a4988c345}{LCBT\_\-writeFifoFault} (unsigned int data, unsigned int mask)
\begin{CompactList}\small\item\em write Fifo Fault register (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_cdd698aee5f1702e007917368aca485c}{LCBT\_\-writeStats} (unsigned int data, unsigned int mask)
\begin{CompactList}\small\item\em write Stats register (requires a DMA) \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_dbde863cea87180b410f4e720e8c3292}{LCBT\_\-latReset} (unsigned int stall)
\begin{CompactList}\small\item\em sends LAT reset (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_e3bb1902ff33a736b013d5624c83d7c3}{LCBT\_\-setWatermark} (unsigned int val)
\begin{CompactList}\small\item\em Write the watermark field in the CSR. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_255362ca0a32acec6f12a895d19d4618}{LCBT\_\-readReg} (int latpAddr, int block, int reg, unsigned int $\ast$value)
\begin{CompactList}\small\item\em read a single register over the cmdResponse fabric \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_797ad37e93eb5cfbd09071f9c5130dc2}{LCBT\_\-writeReg} (int latpAddr, int block, int reg, unsigned int value, int broadcast)
\begin{CompactList}\small\item\em write to single register over the cmdResponse fabric \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_d098b606037b7ace51e8cd1d26d73816}{LCBT\_\-stats} (int mask)
\begin{CompactList}\small\item\em print stats for LCB driver \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_672b5565f962fa95fe4ffe768b091778}{LCBT\_\-clearStats} ()
\begin{CompactList}\small\item\em clear stats for LCB driver \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_1fd40ba3040035b542c4108af81e76ee}{LCBT\_\-resetTest} (int numReqPer)
\begin{CompactList}\small\item\em special test for reset fix on FpgaLat=0x5d \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_45a2a6654f769267f2fc3af75f371dfd}{LCBT\_\-printAllocBuffs} (int numErrLines, int numPrntLines, int wrap)
\begin{CompactList}\small\item\em allocates buffers for PRINTF and EPRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_1bd9a45c758f7ac606954f05958b13dd}{LCBT\_\-printReleaseBuffs} ()
\begin{CompactList}\small\item\em releases buffers for PRINTF and EPRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_5fec647ebc7790095ae110bb9d82a9ec}{LCBT\_\-printClearBuffs} ()
\begin{CompactList}\small\item\em clear buffers for PRINTF and EPRINTF, i.e. no text \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_7ab5d7f0290220c95285ba2485599d83}{LCBT\_\-printGetErrBuff} (char $\ast$errBuff, int maxLen)
\begin{CompactList}\small\item\em fills buffers for EPRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_8bc1d4298a5aac67c57a2abd67b09b3c}{LCBT\_\-printGetPrntBuff} (char $\ast$prntBuff, int maxLen)
\begin{CompactList}\small\item\em fills buffers for PRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_1c5b5ee507cd295ca26f12147617853a}{LCBT\_\-printShellDisable} (int disable)
\begin{CompactList}\small\item\em set disable flag to stop PRINTF and EPRINTF to VxSHell \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Regression test for LCB LAT COmmunication boards. 

\begin{Desc}
\item[Author:]Ed Bacho - \href{mailto:ebacho@slac.stanford.edu}{\tt ebacho@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

    These are the main subroutines for running LCB regression tests. They
    are intended to be run on VxWorks through the WindSh or across the
    network via LTX.
   
    The subroutines are structured to be used thru the WindSh rather than
    be called by other progs. They assume a single LCB board.

   CVS $Id: LCBT.h,v 1.34 2011/03/25 19:31:37 apw Exp $
\end{verbatim}
\normalsize
 

\subsection{Enumeration Type Documentation}
\hypertarget{LCBT_8h_d0335fa357b7a3705183f81e91dd4152}{
\index{LCBT.h@{LCBT.h}!\_\-LCBT\_\-AVAIL@{\_\-LCBT\_\-AVAIL}}
\index{\_\-LCBT\_\-AVAIL@{\_\-LCBT\_\-AVAIL}!LCBT.h@{LCBT.h}}
\subsubsection[{\_\-LCBT\_\-AVAIL}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf \_\-LCBT\_\-AVAIL}}}
\label{LCBT_8h_d0335fa357b7a3705183f81e91dd4152}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{LCBT\_\-GASU\_\-AVAIL@{LCBT\_\-GASU\_\-AVAIL}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-GASU\_\-AVAIL@{LCBT\_\-GASU\_\-AVAIL}}\item[{\em 
\hypertarget{LCBT_8h_d0335fa357b7a3705183f81e91dd4152080d9b05217fa5e74744214c849e3b73}{
LCBT\_\-GASU\_\-AVAIL}
\label{LCBT_8h_d0335fa357b7a3705183f81e91dd4152080d9b05217fa5e74744214c849e3b73}
}]TEM connected to LCB \index{LCBT\_\-MASK\_\-VALID@{LCBT\_\-MASK\_\-VALID}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-MASK\_\-VALID@{LCBT\_\-MASK\_\-VALID}}\item[{\em 
\hypertarget{LCBT_8h_d0335fa357b7a3705183f81e91dd4152885f2f21726dd87e21c53940eb9ba376}{
LCBT\_\-MASK\_\-VALID}
\label{LCBT_8h_d0335fa357b7a3705183f81e91dd4152885f2f21726dd87e21c53940eb9ba376}
}]GASU(EBM) connected to LCB \end{description}
\end{Desc}

\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a}{
\index{LCBT.h@{LCBT.h}!\_\-LCBT\_\-OPTION@{\_\-LCBT\_\-OPTION}}
\index{\_\-LCBT\_\-OPTION@{\_\-LCBT\_\-OPTION}!LCBT.h@{LCBT.h}}
\subsubsection[{\_\-LCBT\_\-OPTION}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf \_\-LCBT\_\-OPTION}}}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{LCBT\_\-OPTION\_\-BUSYPRINT@{LCBT\_\-OPTION\_\-BUSYPRINT}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-BUSYPRINT@{LCBT\_\-OPTION\_\-BUSYPRINT}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a7e4483ef7eac7f28cb85b8c13ac970a6}{
LCBT\_\-OPTION\_\-BUSYPRINT}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a7e4483ef7eac7f28cb85b8c13ac970a6}
}]print count every 1000 accesses \index{LCBT\_\-OPTION\_\-VERBOSE@{LCBT\_\-OPTION\_\-VERBOSE}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-VERBOSE@{LCBT\_\-OPTION\_\-VERBOSE}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a28e08effd7d8d1083e0e2cdce7200992}{
LCBT\_\-OPTION\_\-VERBOSE}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a28e08effd7d8d1083e0e2cdce7200992}
}]lots of printouts \index{LCBT\_\-OPTION\_\-FOREVER@{LCBT\_\-OPTION\_\-FOREVER}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-FOREVER@{LCBT\_\-OPTION\_\-FOREVER}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a558903b6ff8849690572eb796f16df33}{
LCBT\_\-OPTION\_\-FOREVER}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a558903b6ff8849690572eb796f16df33}
}]ignore count and loop forever \index{LCBT\_\-OPTION\_\-INCTESTPARM@{LCBT\_\-OPTION\_\-INCTESTPARM}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-INCTESTPARM@{LCBT\_\-OPTION\_\-INCTESTPARM}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a85bd5905d338219a94a7f18b468b160f}{
LCBT\_\-OPTION\_\-INCTESTPARM}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a85bd5905d338219a94a7f18b468b160f}
}]increment test parm every loop \index{LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO@{LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO@{LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a65988540d722fe545ddac3a65d9d997e}{
LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a65988540d722fe545ddac3a65d9d997e}
}]use compare server for echo server \index{LCBT\_\-OPTION\_\-RLCL\_\-ADDR@{LCBT\_\-OPTION\_\-RLCL\_\-ADDR}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-RLCL\_\-ADDR@{LCBT\_\-OPTION\_\-RLCL\_\-ADDR}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833aa84d96c74814c8aa860367f29eedecbf}{
LCBT\_\-OPTION\_\-RLCL\_\-ADDR}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833aa84d96c74814c8aa860367f29eedecbf}
}]print cmd and rst list pointers in event test \index{LCBT\_\-OPTION\_\-NOWRITEOVER@{LCBT\_\-OPTION\_\-NOWRITEOVER}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-NOWRITEOVER@{LCBT\_\-OPTION\_\-NOWRITEOVER}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a1e663dac145eb0922092028edd8e0372}{
LCBT\_\-OPTION\_\-NOWRITEOVER}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a1e663dac145eb0922092028edd8e0372}
}]disable writing over events after received \index{LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP@{LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP}!LCBT.h@{LCBT.h}}\index{LCBT.h@{LCBT.h}!LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP@{LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP}}\item[{\em 
\hypertarget{LCBT_8h_1dceb15e138ffe521d8534d2002b833a9a019b7f8de9a994ff05db953627fd1f}{
LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP}
\label{LCBT_8h_1dceb15e138ffe521d8534d2002b833a9a019b7f8de9a994ff05db953627fd1f}
}]disable dump of event buff after error \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{LCBT_8h_0d0d62c5c9fdef82d8cc12a3f638f206}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-clearErrorTotals@{LCBT\_\-clearErrorTotals}}
\index{LCBT\_\-clearErrorTotals@{LCBT\_\-clearErrorTotals}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-clearErrorTotals}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-clearErrorTotals ()}}
\label{LCBT_8h_0d0d62c5c9fdef82d8cc12a3f638f206}


clear the global error counts 

\begin{Desc}
\item[Returns:]total error count before clearing \end{Desc}
\hypertarget{LCBT_8h_672b5565f962fa95fe4ffe768b091778}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-clearStats@{LCBT\_\-clearStats}}
\index{LCBT\_\-clearStats@{LCBT\_\-clearStats}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-clearStats}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-clearStats ()}}
\label{LCBT_8h_672b5565f962fa95fe4ffe768b091778}


clear stats for LCB driver 

\begin{Desc}
\item[Returns:]none \end{Desc}
\hypertarget{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-cmdExternalTest@{LCBT\_\-cmdExternalTest}}
\index{LCBT\_\-cmdExternalTest@{LCBT\_\-cmdExternalTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-cmdExternalTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-cmdExternalTest (int {\em num}, \/  int {\em singleAccess}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}


read test on LCB local registers that require Cmd list DMA 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of accesses to do in the test \item[{\em singleAccess}]1=single acess per DMA, all reg are access within single DMA \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs This test excersizes LCB board and driver by write/read/compare to registers on the TEMP or EBM if HW is availible. The registers are NOT set to reasonable values and only those register where this is not problematic are used. \end{Desc}


References LCBT\_\-GASU\_\-AVAIL, LCBT\_\-hwAvail(), LCBT\_\-MASK\_\-VALID, LCBT\_\-OPTION\_\-VERBOSE, LCBT\_\-printErrorDeltas(), LCBT\_\-readReg(), LCBT\_\-saveErrorForDeltas(), LCBT\_\-writeReg(), and PRINTF.\hypertarget{LCBT_8h_20e613453b72dadd795867035a27f3e1}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-cmdLocalTest@{LCBT\_\-cmdLocalTest}}
\index{LCBT\_\-cmdLocalTest@{LCBT\_\-cmdLocalTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-cmdLocalTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-cmdLocalTest (int {\em num}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_20e613453b72dadd795867035a27f3e1}


read-only test on LCB local registers that require Cmd list DMA 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of accesses to do in the test \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs \end{Desc}


References LCBT\_\-printErrorDeltas(), and LCBT\_\-saveErrorForDeltas().

Referenced by LCBT\_\-comboTest().\hypertarget{LCBT_8h_7e67797bd11d4ff2b32ddb64533bf4e9}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-cmdLocalTest2@{LCBT\_\-cmdLocalTest2}}
\index{LCBT\_\-cmdLocalTest2@{LCBT\_\-cmdLocalTest2}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-cmdLocalTest2}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-cmdLocalTest2 (int {\em num}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_7e67797bd11d4ff2b32ddb64533bf4e9}


2 task read test on LCB local registers that require Cmd list DMA 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of accesses to do in the test \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs This is similar to LCBT\_\-cmdLocalTest except that two tasks are spawned and do the test concurrently. \end{Desc}


References LCBT\_\-printErrorDeltas(), and LCBT\_\-saveErrorForDeltas().\hypertarget{LCBT_8h_2a9da93776961c6c4956b3dfcf621aac}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-cmdLocalTest3@{LCBT\_\-cmdLocalTest3}}
\index{LCBT\_\-cmdLocalTest3@{LCBT\_\-cmdLocalTest3}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-cmdLocalTest3}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-cmdLocalTest3 (int {\em num}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_2a9da93776961c6c4956b3dfcf621aac}


3 task read test on LCB local registers that require Cmd list DMA 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of accesses to do in the test \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs This is similar to LCBT\_\-cmdLocalTest except that three tasks are spawned and do the test concurrently. \end{Desc}


References LCBT\_\-printErrorDeltas(), and LCBT\_\-saveErrorForDeltas().\hypertarget{LCBT_8h_3ba9ed7a052ea98f11b12bae2c16f18d}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-comboTest@{LCBT\_\-comboTest}}
\index{LCBT\_\-comboTest@{LCBT\_\-comboTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-comboTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-comboTest (int {\em num}, \/  int {\em maxLen}, \/  int {\em latpAddr}, \/  int {\em randomLen}, \/  int {\em ccsds}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_3ba9ed7a052ea98f11b12bae2c16f18d}


2 concurrent tasks running event and localCmdReg test 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of events to send \item[{\em maxLen}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latpAddr}]- LATp address of board to send to, 0=self \item[{\em randomLen}]1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none This test is intended to run when loopback cable is attached to LCB board ir the LCB is connected to a GASU. Test combines localCmdReg test and event test to prove board properly handles this case. Both these tests use the Cmd list and send to the Request Queue. Num should be set to a high value to guarantee overlap of tests. \end{Desc}


References LCBT\_\-cmdLocalTest(), LCBT\_\-eventRecv(), LCBT\_\-eventSend(), and TDATA\_\-testStr().\hypertarget{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-determineHw@{LCBT\_\-determineHw}}
\index{LCBT\_\-determineHw@{LCBT\_\-determineHw}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-determineHw}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-determineHw ()}}
\label{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}


get mask determined by \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw()} for use in LCBT\_\-determineHw () 

determine which HW is connected to the LCBThis routine is used to determine what HW is connected to the LCB so that the \hyperlink{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{LCBT\_\-cmdExternalTest()} can be run. The most likly configurations are: LCB to TEM (teststand) LCB to GASU (i.e. EBM) LCB to GASU to TEM (i.e. EBM and TEM) It determines HW by trying to read registers in that HW. If HW config is known and user wishes to receive errors if HW is not operating, use the \hyperlink{LCBT_8h_bc797ff7c781c3c30f2b1fa39d902679}{LCBT\_\-setCfg()} call to setup. Configuration is essentially only for \hyperlink{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}{LCBT\_\-testAll()} as it choose the tests to run. If tests withint \hyperlink{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}{LCBT\_\-testAll()} are called directly they will not consider the configuration setting. 

References LCBT\_\-hwAvail(), LCBT\_\-lam(), LCBT\_\-readReg(), LCBT\_\-setCfg(), and PRINTF.

Referenced by LCBT\_\-initGasu().\hypertarget{LCBT_8h_edd0168c5a33c92020e009934931b346}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventFillTest@{LCBT\_\-eventFillTest}}
\index{LCBT\_\-eventFillTest@{LCBT\_\-eventFillTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventFillTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventFillTest (int {\em num}, \/  int {\em latpAddr}, \/  int {\em buffSize32}, \/  int {\em printInfo})}}
\label{LCBT_8h_edd0168c5a33c92020e009934931b346}


Check for proper operation circular buffFUll interrupt. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of times to do the test \item[{\em latpAddr}]- LATp address of board to send to, 0=self \item[{\em printInfo}]print irq and other info while processing \item[{\em buffSize32}]buffSize to send, must be multiple of 32 to match EBM, min is 128 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0=sucess, otherwise returns number of failed tests This tests the circEvtBuff full interrupt by filling the event buffer but not freeing the buffer. It checks that the proper interrupt sequence occurs when the last event is added to cause it to go full. \end{Desc}


References EPRINTF, LCBT\_\-eventRecv(), LCBT\_\-eventSend(), and PRINTF.\hypertarget{LCBT_8h_3feb524cb391024778e2f572aa1998cc}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventInit@{LCBT\_\-eventInit}}
\index{LCBT\_\-eventInit@{LCBT\_\-eventInit}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventInit}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventInit (int {\em echoForkPri})}}
\label{LCBT_8h_3feb524cb391024778e2f572aa1998cc}


Setup module in this file to echo event data back to sender. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em echoForkPri}]priority of forked task to send event data back \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}


Referenced by LCBT\_\-init().\hypertarget{LCBT_8h_67a7b8318cf1ea7401da43612e632eaf}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventRecv@{LCBT\_\-eventRecv}}
\index{LCBT\_\-eventRecv@{LCBT\_\-eventRecv}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventRecv}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventRecv (int {\em numRecv}, \/  int {\em ccsds})}}
\label{LCBT_8h_67a7b8318cf1ea7401da43612e632eaf}


Setup to receive and compare data from \hyperlink{LCBT__event_8c_c0fca72966470de20d1e7548228c70c6}{LCBT\_\-eventSend()}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em numRecv}]0=sets up and return, 1=waits for numRecv events \item[{\em ccsds}]1=expect CCSDS header on event data received \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none This test sets up the receive end for data from \hyperlink{LCBT__event_8c_c0fca72966470de20d1e7548228c70c6}{LCBT\_\-eventSend()}. The data received is self describing so compares can be dome on it. \end{Desc}


Referenced by LCBT\_\-comboTest(), LCBT\_\-eventFillTest(), LCBT\_\-eventTest(), LCBT\_\-eventTest2(), LCBT\_\-eventTest3(), LCBT\_\-eventTest5(), and LCBT\_\-eventWatermarkTest().\hypertarget{LCBT_8h_c0fca72966470de20d1e7548228c70c6}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventSend@{LCBT\_\-eventSend}}
\index{LCBT\_\-eventSend@{LCBT\_\-eventSend}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventSend}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventSend (int {\em numEvents}, \/  int {\em maxEvtSize}, \/  int {\em latpAddr}, \/  int {\em randomLen}, \/  int {\em ccsds}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_c0fca72966470de20d1e7548228c70c6}


Send out test event data to be received by \hyperlink{LCBT__event_8c_67a7b8318cf1ea7401da43612e632eaf}{LCBT\_\-eventRecv()}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em numEvents}]number of events to send \item[{\em maxEvtSize}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latpAddr}]- LATp address of board to send to, 0=self \item[{\em randomLen}]1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none This test creates and send self-describing test data over the event fabric. The len of the event packet is random over legal values. This routine is usually not called directly since it does not call LCBT\_\-eventRecv. \hyperlink{LCBT__event_8c_67a7b8318cf1ea7401da43612e632eaf}{LCBT\_\-eventRecv()} sets up LCB to receive and interpret the data packets sent by \hyperlink{LCBT__event_8c_c0fca72966470de20d1e7548228c70c6}{LCBT\_\-eventSend()} \end{Desc}


References EPRINTF, LCBT\_\-OPTION\_\-BUSYPRINT, LCBT\_\-OPTION\_\-FOREVER, LCBT\_\-OPTION\_\-INCTESTPARM, LCBT\_\-OPTION\_\-RLCL\_\-ADDR, LCBT\_\-OPTION\_\-VERBOSE, PRINTF, RND\_\-lc0\_\-gen(), RND\_\-lc0\_\-init(), TDATA\_\-create(), and TDATA\_\-testStr().

Referenced by LCBT\_\-comboTest(), LCBT\_\-eventFillTest(), LCBT\_\-eventTest(), LCBT\_\-eventTest2(), LCBT\_\-eventTest3(), and LCBT\_\-eventTest5().\hypertarget{LCBT_8h_928f177accfc71b3e3a233da173486bb}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventSendDelay@{LCBT\_\-eventSendDelay}}
\index{LCBT\_\-eventSendDelay@{LCBT\_\-eventSendDelay}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventSendDelay}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventSendDelay (int {\em delayNanosec})}}
\label{LCBT_8h_928f177accfc71b3e3a233da173486bb}


Set delay in nanoSec between event sends, can be 0. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em delayNanosec}]delay in nanoSec \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]previous setting of delay Sets s delay between eventSend's to avoid filling up queues. \end{Desc}
\hypertarget{LCBT_8h_83b90cb0c56f6f928042d0985246efb5}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventTest@{LCBT\_\-eventTest}}
\index{LCBT\_\-eventTest@{LCBT\_\-eventTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventTest (int {\em num}, \/  int {\em maxLen}, \/  int {\em latpAddr}, \/  int {\em randomLen}, \/  int {\em ccsds}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_83b90cb0c56f6f928042d0985246efb5}


Test to send/recv/compare event data thru loopback on LCB board. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of events to send \item[{\em maxLen}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latpAddr}]- LATp address of board to send to, 0=self \item[{\em randomLen}]1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none This test is intended to run with either a loopback cable attached to LCB board, or an LCB connected to a GASU. Events are sent in random legal sizes. The latpAddr should be the addr of the sending LCB or the address of another CPU/LCB running an echo server. \end{Desc}


References LCBT\_\-eventRecv(), LCBT\_\-eventSend(), and TDATA\_\-testStr().\hypertarget{LCBT_8h_27823a419ac589558edca7227de94b62}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventTest2@{LCBT\_\-eventTest2}}
\index{LCBT\_\-eventTest2@{LCBT\_\-eventTest2}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventTest2}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventTest2 (int {\em num}, \/  int {\em maxLen}, \/  int {\em latpAddr}, \/  int {\em randomLen}, \/  int {\em ccsds}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_27823a419ac589558edca7227de94b62}


2 concurrent task test to send/recv/compare event data thru loopback on LCB board 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of events to send \item[{\em maxLen}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latpAddr}]- LATp address of board to send to, 0=self \item[{\em randomLen}]1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none Test is similar to LCBT\_\-eventTest except two tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests. \end{Desc}


References LCBT\_\-eventRecv(), LCBT\_\-eventSend(), and TDATA\_\-testStr().\hypertarget{LCBT_8h_b85bd908f76613039921d8b3363d859d}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventTest3@{LCBT\_\-eventTest3}}
\index{LCBT\_\-eventTest3@{LCBT\_\-eventTest3}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventTest3}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventTest3 (int {\em num}, \/  int {\em maxLen}, \/  int {\em latpAddr}, \/  int {\em randomLen}, \/  int {\em ccsds}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_b85bd908f76613039921d8b3363d859d}


3 concurrent task test to send/recv/compare event data thru loopback on LCB board 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of events to send \item[{\em maxLen}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latpAddr}]- LATp address of board to send to, 0=self \item[{\em randomLen}]1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none Test is similar to LCBT\_\-eventTest except three tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests. \end{Desc}


References LCBT\_\-eventRecv(), LCBT\_\-eventSend(), and TDATA\_\-testStr().\hypertarget{LCBT_8h_67b2c774505332c7d95639c2583efaba}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventTest5@{LCBT\_\-eventTest5}}
\index{LCBT\_\-eventTest5@{LCBT\_\-eventTest5}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventTest5}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventTest5 (int {\em num}, \/  int {\em maxLen}, \/  int {\em latpAddr}, \/  int {\em randomLen}, \/  int {\em ccsds}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_67b2c774505332c7d95639c2583efaba}


5 concurrent task test to send/recv/compare event data thru loopback on LCB board 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of events to send \item[{\em maxLen}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latpAddr}]- LATp address of board to send to, 0=self \item[{\em randomLen}]1=packet range from 4 to maxEvtSize, 0=packets are maxEvtSize \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em testType}]Specifies the data sequence for test \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none Test is similar to LCBT\_\-eventTest except three tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests. \end{Desc}


References LCBT\_\-eventRecv(), LCBT\_\-eventSend(), and TDATA\_\-testStr().\hypertarget{LCBT_8h_bc80f8c25ceb2ed7e87426ecd6220410}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-eventWatermarkTest@{LCBT\_\-eventWatermarkTest}}
\index{LCBT\_\-eventWatermarkTest@{LCBT\_\-eventWatermarkTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-eventWatermarkTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-eventWatermarkTest (int {\em num}, \/  int {\em latpAddr})}}
\label{LCBT_8h_bc80f8c25ceb2ed7e87426ecd6220410}


Check for proper operation of watermarks on Event and EventData queues. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of times to do the test \item[{\em latpAddr}]- LATp address of board to send to, 0=self \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0=sucess, otherwise returns number of failed tests This test checks that the watermark event come when expected given the settings of the watermarks on the queues. \end{Desc}


References LCBT\_\-eventRecv(), and PRINTF.\hypertarget{LCBT_8h_04fe8fd58a08036d4822fb135aca22fb}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-fillQueueTest@{LCBT\_\-fillQueueTest}}
\index{LCBT\_\-fillQueueTest@{LCBT\_\-fillQueueTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-fillQueueTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-fillQueueTest (int {\em numLoop}, \/  int {\em disableResult})}}
\label{LCBT_8h_04fe8fd58a08036d4822fb135aca22fb}


Fill requestQ with requests to make sure it handles it properly. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em numLoop}]Number of times to do in the test \item[{\em disableResult}]fill up all queues by disabling result queue \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs This test is used to test the HW and driver to make sure it can handle the requestQ filling. In this case the driver should put the requests on a list and submit to the HW as the HW finishes other requests. The two test cases are: disableResult=0 THis should fill up Request queue and all queues before the transfer engine. disableResult=1 THis should fill up Request queue all queues before and after the transfer engine, and the result queue \end{Desc}


References EPRINTF, LCBT\_\-OPTION\_\-VERBOSE, LCBT\_\-STALL, and PRINTF.\hypertarget{LCBT_8h_7025441d89d7d5b2f2ceebef4ad26103}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-getErrorTotals@{LCBT\_\-getErrorTotals}}
\index{LCBT\_\-getErrorTotals@{LCBT\_\-getErrorTotals}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-getErrorTotals}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-getErrorTotals (int $\ast$ {\em numAccess}, \/  int $\ast$ {\em rErr}, \/  int $\ast$ {\em wErr}, \/  int $\ast$ {\em cErr})}}
\label{LCBT_8h_7025441d89d7d5b2f2ceebef4ad26103}


get the global error counts 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em numAccess}]if not NULL, return number of R/W/Compare ops \item[{\em rErr}]if not NULL, return number of read errors \item[{\em wErr}]if not NULL, return number of write errors \item[{\em cErr}]if not NULL, return number of compare errors \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total error count \end{Desc}
\hypertarget{LCBT_8h_c37678485b7a4333ceea632617cdd7ab}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-hwAvail@{LCBT\_\-hwAvail}}
\index{LCBT\_\-hwAvail@{LCBT\_\-hwAvail}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-hwAvail}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-hwAvail ()}}
\label{LCBT_8h_c37678485b7a4333ceea632617cdd7ab}


get mask of hw determined by \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw()} for use in \hyperlink{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{LCBT\_\-cmdExternalTest()} 

\begin{Desc}
\item[Returns:]mask of HW connected to LCB \end{Desc}


Referenced by LCBT\_\-cmdExternalTest(), LCBT\_\-determineHw(), LCBT\_\-testAll(), and LCBT\_\-testAllEpu().\hypertarget{LCBT_8h_e40cfdebf673339c53847caa8af47f47}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-init@{LCBT\_\-init}}
\index{LCBT\_\-init@{LCBT\_\-init}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-init (int {\em latpAddr}, \/  int {\em useRedundantPath}, \/  LCBD {\em lcb})}}
\label{LCBT_8h_e40cfdebf673339c53847caa8af47f47}


inits LCB driver (which starts 2 tasks associated with driver) 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latpAddr}]LATp addr to assign to this board \item[{\em useRedundantPath}]0=primary path, 1=redundant path \item[{\em lcb}]lcbd driver handle is driver if already init (use LCBD\_\-get()), if 0 will load driver \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0=sucess else indicates errors in init This routine inits the LCBT module and optionaly load the LCBD driver. It must be called once after boot to setup the LCBT module for tests. \end{Desc}


References LCBT\_\-eventInit(), LCBT\_\-initBoard(), and LCBT\_\-printInit().\hypertarget{LCBT_8h_fe61aa1d20d346b6745673fa3663093b}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-initGasu@{LCBT\_\-initGasu}}
\index{LCBT\_\-initGasu@{LCBT\_\-initGasu}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-initGasu}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-initGasu ()}}
\label{LCBT_8h_fe61aa1d20d346b6745673fa3663093b}


setup registers in GASU 

determine which HW is connected to the LCBThis routine is used as an alternative to PIG to init the GASU. DO NOT use if you are using PIG to setup the HW. 

References EPRINTF, LCBT\_\-determineHw(), LCBT\_\-lam(), LCBT\_\-readReg(), LCBT\_\-writeReg(), and PRINTF.\hypertarget{LCBT_8h_3f3272e0ac34b5aca3d159da87b2c12f}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-isInit@{LCBT\_\-isInit}}
\index{LCBT\_\-isInit@{LCBT\_\-isInit}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-isInit}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-isInit ()}}
\label{LCBT_8h_3f3272e0ac34b5aca3d159da87b2c12f}


indicates if LCBT\_\-init has been run ok 

\begin{Desc}
\item[Returns:]0=not init, 1=been init \end{Desc}
\hypertarget{LCBT_8h_55a0f3f8783d736520f08849655086c2}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-lam@{LCBT\_\-lam}}
\index{LCBT\_\-lam@{LCBT\_\-lam}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-lam}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-lam (int {\em latpAddr})}}
\label{LCBT_8h_55a0f3f8783d736520f08849655086c2}


Send out LAM (lookAtMe) to specified addr. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latpAddr}]addr to send LAM to \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status \end{Desc}


References LCBT\_\-writeReg().

Referenced by LCBT\_\-determineHw(), LCBT\_\-initGasu(), and LCBT\_\-lamCruLoop().\hypertarget{LCBT_8h_dbde863cea87180b410f4e720e8c3292}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-latReset@{LCBT\_\-latReset}}
\index{LCBT\_\-latReset@{LCBT\_\-latReset}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-latReset}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-latReset (unsigned int {\em stall})}}
\label{LCBT_8h_dbde863cea87180b410f4e720e8c3292}


sends LAT reset (requires a DMA) 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em stall}]stall after reset in 50 nSec tics \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status To be used with great discretion, i.e. in case of emergency break glass. \end{Desc}


References EPRINTF.\hypertarget{LCBT_8h_ad3855e9e7275d19719d2169a0a04997}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-localRegTest@{LCBT\_\-localRegTest}}
\index{LCBT\_\-localRegTest@{LCBT\_\-localRegTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-localRegTest}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-localRegTest (int {\em num}, \/  {\bf TDATA\_\-DTEST} {\em testType}, \/  unsigned int {\em testParm})}}
\label{LCBT_8h_ad3855e9e7275d19719d2169a0a04997}


Read/write/compare test on all PCI accessable registers on LCB board. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of events to do in the test \item[{\em testType}]Specified the data sequence used for test data \item[{\em testParm}]Parm to use with testType \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}


References EPRINTF, LCBT\_\-OPTION\_\-BUSYPRINT, LCBT\_\-saveErrorForDeltas(), LCBT\_\-updateErrorTotals(), PRINTF, TDATA\_\-getNextSeqVal(), and TDATA\_\-getRandCtxForSeqVal().\hypertarget{LCBT_8h_45a2a6654f769267f2fc3af75f371dfd}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printAllocBuffs@{LCBT\_\-printAllocBuffs}}
\index{LCBT\_\-printAllocBuffs@{LCBT\_\-printAllocBuffs}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printAllocBuffs}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-printAllocBuffs (int {\em numErrLines}, \/  int {\em numPrntLines}, \/  int {\em wrap})}}
\label{LCBT_8h_45a2a6654f769267f2fc3af75f371dfd}


allocates buffers for PRINTF and EPRINTF 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em numErrLines}]number of lines to be buffered \item[{\em numPrntLines}]number of lines to be buffered \item[{\em wrap}]0=buffer fills and stops, 1=buffer wraps and deltes oldest \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}


References LCBT\_\-printClearBuffs().\hypertarget{LCBT_8h_5fec647ebc7790095ae110bb9d82a9ec}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printClearBuffs@{LCBT\_\-printClearBuffs}}
\index{LCBT\_\-printClearBuffs@{LCBT\_\-printClearBuffs}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printClearBuffs}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-printClearBuffs ()}}
\label{LCBT_8h_5fec647ebc7790095ae110bb9d82a9ec}


clear buffers for PRINTF and EPRINTF, i.e. no text 

\begin{Desc}
\item[Returns:]none \end{Desc}


Referenced by LCBT\_\-printAllocBuffs().\hypertarget{LCBT_8h_7f159fe5d1b8a10755e971732bc093af}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printErrorDeltas@{LCBT\_\-printErrorDeltas}}
\index{LCBT\_\-printErrorDeltas@{LCBT\_\-printErrorDeltas}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printErrorDeltas}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-printErrorDeltas (char $\ast$ {\em title})}}
\label{LCBT_8h_7f159fe5d1b8a10755e971732bc093af}


print the delta error counts since \hyperlink{LCBT_8h_d8b8998394e7f54f6bd32f493488a6fb}{LCBT\_\-saveErrorForDeltas()} 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em title}]title to print before totals \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total error count \end{Desc}


References PRINTF.

Referenced by LCBT\_\-cmdExternalTest(), LCBT\_\-cmdLocalTest(), LCBT\_\-cmdLocalTest2(), and LCBT\_\-cmdLocalTest3().\hypertarget{LCBT_8h_ea0ea4f8241a0aeee6082848b925f034}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printErrorTotals@{LCBT\_\-printErrorTotals}}
\index{LCBT\_\-printErrorTotals@{LCBT\_\-printErrorTotals}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printErrorTotals}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-printErrorTotals (char $\ast$ {\em title})}}
\label{LCBT_8h_ea0ea4f8241a0aeee6082848b925f034}


print the global error counts 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em title}]title to print before totals \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total error count \end{Desc}


References PRINTF.\hypertarget{LCBT_8h_7ab5d7f0290220c95285ba2485599d83}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printGetErrBuff@{LCBT\_\-printGetErrBuff}}
\index{LCBT\_\-printGetErrBuff@{LCBT\_\-printGetErrBuff}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printGetErrBuff}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-printGetErrBuff (char $\ast$ {\em errBuff}, \/  int {\em maxLen})}}
\label{LCBT_8h_7ab5d7f0290220c95285ba2485599d83}


fills buffers for EPRINTF 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em errBuff}]buffer to fill in \item[{\em maxLen}]length of buffer to fill in \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}
\hypertarget{LCBT_8h_8bc1d4298a5aac67c57a2abd67b09b3c}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printGetPrntBuff@{LCBT\_\-printGetPrntBuff}}
\index{LCBT\_\-printGetPrntBuff@{LCBT\_\-printGetPrntBuff}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printGetPrntBuff}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-printGetPrntBuff (char $\ast$ {\em prntBuff}, \/  int {\em maxLen})}}
\label{LCBT_8h_8bc1d4298a5aac67c57a2abd67b09b3c}


fills buffers for PRINTF 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prntBuff}]buffer to fill in \item[{\em maxLen}]length of buffer to fill in \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}
\hypertarget{LCBT_8h_1bd9a45c758f7ac606954f05958b13dd}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printReleaseBuffs@{LCBT\_\-printReleaseBuffs}}
\index{LCBT\_\-printReleaseBuffs@{LCBT\_\-printReleaseBuffs}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printReleaseBuffs}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-printReleaseBuffs ()}}
\label{LCBT_8h_1bd9a45c758f7ac606954f05958b13dd}


releases buffers for PRINTF and EPRINTF 

\begin{Desc}
\item[Returns:]none \end{Desc}
\hypertarget{LCBT_8h_1c5b5ee507cd295ca26f12147617853a}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-printShellDisable@{LCBT\_\-printShellDisable}}
\index{LCBT\_\-printShellDisable@{LCBT\_\-printShellDisable}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-printShellDisable}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-printShellDisable (int {\em disable})}}
\label{LCBT_8h_1c5b5ee507cd295ca26f12147617853a}


set disable flag to stop PRINTF and EPRINTF to VxSHell 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em disable}]0=print to shell, 1=no print to shell \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}
\hypertarget{LCBT_8h_82bc2eaaae8a40ff893700c28210d117}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readCsr@{LCBT\_\-readCsr}}
\index{LCBT\_\-readCsr@{LCBT\_\-readCsr}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readCsr}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readCsr ()}}
\label{LCBT_8h_82bc2eaaae8a40ff893700c28210d117}


Read CSR register. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}


References PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_c1f1cf359722ce9479f91f8ddf21cdeb}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readEventBase@{LCBT\_\-readEventBase}}
\index{LCBT\_\-readEventBase@{LCBT\_\-readEventBase}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readEventBase}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readEventBase ()}}
\label{LCBT_8h_c1f1cf359722ce9479f91f8ddf21cdeb}


Read Event Base register which is start of Event circular buffer. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}


References PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_c1a79e3d4b02516c2c8b9c15fbd60689}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readEventFree@{LCBT\_\-readEventFree}}
\index{LCBT\_\-readEventFree@{LCBT\_\-readEventFree}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readEventFree}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readEventFree ()}}
\label{LCBT_8h_c1a79e3d4b02516c2c8b9c15fbd60689}


Read Event Free register which is offset in Event circular buffer HW will write to. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}


References PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_323aaa63677d1e44516cb99693280875}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readEventQ@{LCBT\_\-readEventQ}}
\index{LCBT\_\-readEventQ@{LCBT\_\-readEventQ}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readEventQ}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readEventQ ()}}
\label{LCBT_8h_323aaa63677d1e44516cb99693280875}


Read eventQueue NOTE this will pull value from queue and effect operation. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}
\hypertarget{LCBT_8h_f59b295633df10b4fbba35053240e903}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readFabricSelect@{LCBT\_\-readFabricSelect}}
\index{LCBT\_\-readFabricSelect@{LCBT\_\-readFabricSelect}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readFabricSelect}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readFabricSelect ()}}
\label{LCBT_8h_f59b295633df10b4fbba35053240e903}


Read FabricSelect register which indicates primary or redundant. 

\begin{Desc}
\item[Returns:]Value of register, 0=promary, 1=redundant \end{Desc}


References PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_a616c23a1d17d2393ae2cd1f5b77a5f0}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readFifoFault@{LCBT\_\-readFifoFault}}
\index{LCBT\_\-readFifoFault@{LCBT\_\-readFifoFault}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readFifoFault}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readFifoFault ()}}
\label{LCBT_8h_a616c23a1d17d2393ae2cd1f5b77a5f0}


read Fifo Fault registers (requires a DMA) 

\begin{Desc}
\item[Returns:]value in register \end{Desc}


References EPRINTF, LCBT\_\-STALL, and PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_fc2f435b9bf3afdb7cd6d813b03cfa2f}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readHwInfo@{LCBT\_\-readHwInfo}}
\index{LCBT\_\-readHwInfo@{LCBT\_\-readHwInfo}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readHwInfo}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-readHwInfo ()}}
\label{LCBT_8h_fc2f435b9bf3afdb7cd6d813b03cfa2f}


Read hwInfo register. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}


Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_d0280ce9db442c2a55ad93589234bc13}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readIrq@{LCBT\_\-readIrq}}
\index{LCBT\_\-readIrq@{LCBT\_\-readIrq}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readIrq}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readIrq ()}}
\label{LCBT_8h_d0280ce9db442c2a55ad93589234bc13}


Read IRQ register which has interrupt status. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}


References PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_d54a8947bccc0bbee5c58c24932b1cf9}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readLatpCsr@{LCBT\_\-readLatpCsr}}
\index{LCBT\_\-readLatpCsr@{LCBT\_\-readLatpCsr}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readLatpCsr}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readLatpCsr ()}}
\label{LCBT_8h_d54a8947bccc0bbee5c58c24932b1cf9}


read LATp CSR register (requires a DMA) 

\begin{Desc}
\item[Returns:]value in register \end{Desc}


References EPRINTF, LCBT\_\-STALL, and PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_255362ca0a32acec6f12a895d19d4618}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readReg@{LCBT\_\-readReg}}
\index{LCBT\_\-readReg@{LCBT\_\-readReg}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readReg}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readReg (int {\em latpAddr}, \/  int {\em block}, \/  int {\em reg}, \/  unsigned int $\ast$ {\em value})}}
\label{LCBT_8h_255362ca0a32acec6f12a895d19d4618}


read a single register over the cmdResponse fabric 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latpAddr}]LCB address to access, HW type is inferred from addr \item[{\em block}]Register block to access \item[{\em reg}]Register number to access \item[{\em value}]value to return, if 0 it will printf() value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status This routine does a syncronous read from a single register on HW connected thru LCB. Format of message is determined from latpAddr (so expects standard assignments). \end{Desc}


References LCBT\_\-OPTION\_\-RLCL\_\-ADDR, and PRINTF.

Referenced by LCBT\_\-cmdExternalTest(), LCBT\_\-determineHw(), LCBT\_\-initGasu(), LCBT\_\-lamCruLoop(), and LCBT\_\-setRemoteBoardId().\hypertarget{LCBT_8h_f4f440fbfa7ed1ddcba2fdb0657c5024}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readRequestQ@{LCBT\_\-readRequestQ}}
\index{LCBT\_\-readRequestQ@{LCBT\_\-readRequestQ}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readRequestQ}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readRequestQ ()}}
\label{LCBT_8h_f4f440fbfa7ed1ddcba2fdb0657c5024}


Read requestQueue, 0=notEMpty, not0=empty NOTE this will pull value from queue and effect operation. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}
\hypertarget{LCBT_8h_eb5afd983030b4b6db43b24fe9edb886}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readResultQ@{LCBT\_\-readResultQ}}
\index{LCBT\_\-readResultQ@{LCBT\_\-readResultQ}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readResultQ}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readResultQ ()}}
\label{LCBT_8h_eb5afd983030b4b6db43b24fe9edb886}


Read resultQueue NOTE this will pull value from queue and effect operation. 

\begin{Desc}
\item[Returns:]Value of register \end{Desc}


Referenced by LCBT\_\-resetTest().\hypertarget{LCBT_8h_4ac046edfe61d6dceef9fd3f2cbe1eb7}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-readStats@{LCBT\_\-readStats}}
\index{LCBT\_\-readStats@{LCBT\_\-readStats}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-readStats}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-readStats ()}}
\label{LCBT_8h_4ac046edfe61d6dceef9fd3f2cbe1eb7}


read stats register (requires a DMA) 

\begin{Desc}
\item[Returns:]value in register \end{Desc}


References EPRINTF, LCBT\_\-STALL, and PRINTF.

Referenced by LCBT\_\-regs().\hypertarget{LCBT_8h_1a07ffdd3823e728ecdcd233df964da7}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-regs@{LCBT\_\-regs}}
\index{LCBT\_\-regs@{LCBT\_\-regs}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-regs}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-regs ()}}
\label{LCBT_8h_1a07ffdd3823e728ecdcd233df964da7}


print vals of all registers in LCB 

\begin{Desc}
\item[Returns:]none \end{Desc}


References LCBT\_\-readCsr(), LCBT\_\-readEventBase(), LCBT\_\-readEventFree(), LCBT\_\-readFabricSelect(), LCBT\_\-readFifoFault(), LCBT\_\-readHwInfo(), LCBT\_\-readIrq(), LCBT\_\-readLatpCsr(), and LCBT\_\-readStats().\hypertarget{LCBT_8h_ccff75fe79f5fc9015dd6da30918c91a}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-remoteLatpCsr@{LCBT\_\-remoteLatpCsr}}
\index{LCBT\_\-remoteLatpCsr@{LCBT\_\-remoteLatpCsr}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-remoteLatpCsr}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-remoteLatpCsr (int {\em latpAddr}, \/  unsigned int {\em val}, \/  unsigned int {\em mask}, \/  int {\em broadcast})}}
\label{LCBT_8h_ccff75fe79f5fc9015dd6da30918c91a}


send value to LatpCsr on another CPU over CmdResponse 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latpAddr}]addr to send to, ignored if broadcast=0 \item[{\em val}]value to write to LatpCsr \item[{\em mask}]mask on register,if =0 will assume 0xfffffff (all bits) \item[{\em broadcast}]send out as broadcast (needed to set boardID) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status \end{Desc}


References LCBT\_\-writeReg().

Referenced by LCBT\_\-setRemoteBoardId().\hypertarget{LCBT_8h_1fd40ba3040035b542c4108af81e76ee}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-resetTest@{LCBT\_\-resetTest}}
\index{LCBT\_\-resetTest@{LCBT\_\-resetTest}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-resetTest}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-resetTest (int {\em numReqPer})}}
\label{LCBT_8h_1fd40ba3040035b542c4108af81e76ee}


special test for reset fix on FpgaLat=0x5d 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em numReqPer}]num of read for each of 4 part test \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]nothing This test was developed to reproduce a problem seen with LatFpga $<$ 0x5d on the cPci LCB board. The problem was that the discrete fifo's failed to be reset properly if there was no 20 MHz clock from the GASU (i.e. GASU was not yet powered up).\end{Desc}
This test requires USER INTERACTION to turn off/on the 20 MHz clock (usually by powering the GASU on and off).

The fix in LatFpga=0x5d allows this test to run sucessfully without errors. 

References LCBT\_\-readResultQ(), LCBT\_\-writeCsr(), LCBT\_\-writeIrq(), and PRINTF.\hypertarget{LCBT_8h_d8b8998394e7f54f6bd32f493488a6fb}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-saveErrorForDeltas@{LCBT\_\-saveErrorForDeltas}}
\index{LCBT\_\-saveErrorForDeltas@{LCBT\_\-saveErrorForDeltas}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-saveErrorForDeltas}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-saveErrorForDeltas ()}}
\label{LCBT_8h_d8b8998394e7f54f6bd32f493488a6fb}


stash global error counts to use with \hyperlink{LCBT_8h_7f159fe5d1b8a10755e971732bc093af}{LCBT\_\-printErrorDeltas()} 

\begin{Desc}
\item[Returns:]total error count \end{Desc}


Referenced by LCBT\_\-cmdExternalTest(), LCBT\_\-cmdLocalTest(), LCBT\_\-cmdLocalTest2(), LCBT\_\-cmdLocalTest3(), and LCBT\_\-localRegTest().\hypertarget{LCBT_8h_bc797ff7c781c3c30f2b1fa39d902679}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-setCfg@{LCBT\_\-setCfg}}
\index{LCBT\_\-setCfg@{LCBT\_\-setCfg}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-setCfg}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-setCfg (int {\em haveGasu}, \/  int {\em haveTem})}}
\label{LCBT_8h_bc797ff7c781c3c30f2b1fa39d902679}


get mask determined by \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw()} for use in \hyperlink{LCBT_8h_c298b8772ef06d7e969e4db2bd9d857d}{LCBT\_\-cmdExternalTest()} 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em haveGasu}]1=have GASU/EBM \item[{\em haveTem}]1=have TEM either thru GASU or Transition Board \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]mask of HW connected to LCB This routine is used instead of LCNT\_\-determineHw() when the HW configuration is already known. Configuration is essentially only for \hyperlink{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}{LCBT\_\-testAll()} as it choose the tests to run. If tests withint \hyperlink{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}{LCBT\_\-testAll()} are called directly they will not consider the configuration setting. \end{Desc}


References LCBT\_\-GASU\_\-AVAIL, and LCBT\_\-MASK\_\-VALID.

Referenced by LCBT\_\-determineHw().\hypertarget{LCBT_8h_32368717ecf2e364ac3586aadc15f191}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-setEpu@{LCBT\_\-setEpu}}
\index{LCBT\_\-setEpu@{LCBT\_\-setEpu}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-setEpu}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-setEpu (int {\em idx})}}
\label{LCBT_8h_32368717ecf2e364ac3586aadc15f191}


Set boardID in Csr to EPU addr. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em idx}]which EPU,0=EPU0,1=EPU1,2=EPU3 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}


References PRINTF.\hypertarget{LCBT_8h_1f75fe8c5b30bcf46ea14e349ff90167}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-setOption@{LCBT\_\-setOption}}
\index{LCBT\_\-setOption@{LCBT\_\-setOption}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-setOption}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-setOption (unsigned int {\em mask})}}
\label{LCBT_8h_1f75fe8c5b30bcf46ea14e349ff90167}


set test option mask, see \hyperlink{LCBT_8h}{LCBT.h} for values 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mask}]mask of tests options \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}
\hypertarget{LCBT_8h_8cf5d018013688e19a8e0f14e7edddd9}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-setRemoteBoardId@{LCBT\_\-setRemoteBoardId}}
\index{LCBT\_\-setRemoteBoardId@{LCBT\_\-setRemoteBoardId}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-setRemoteBoardId}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-setRemoteBoardId (int {\em latpAddr})}}
\label{LCBT_8h_8cf5d018013688e19a8e0f14e7edddd9}


set board ID to latpAddr on CPU determined by CRU 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latpAddr}]addr to send to, ignored if broadcast=0 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status This routine sets up CRU to enable one path to a CPU (determined by latpAddr) and then sets the CPU on that path for boardId=latpAddr. This function is normally done by PIG so this routine should be used with CAUTION. \end{Desc}


References EPRINTF, LCBT\_\-readReg(), LCBT\_\-remoteLatpCsr(), and LCBT\_\-writeReg().\hypertarget{LCBT_8h_da1b59bac02fa4d33932310d76f45075}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-setSiu@{LCBT\_\-setSiu}}
\index{LCBT\_\-setSiu@{LCBT\_\-setSiu}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-setSiu}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-setSiu (int {\em idx})}}
\label{LCBT_8h_da1b59bac02fa4d33932310d76f45075}


Set boardID in Csr to SIU addr. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em idx}]which SIU,0=SIU0,1=SIU1,-1=SIUX \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}


References PRINTF.\hypertarget{LCBT_8h_e3bb1902ff33a736b013d5624c83d7c3}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-setWatermark@{LCBT\_\-setWatermark}}
\index{LCBT\_\-setWatermark@{LCBT\_\-setWatermark}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-setWatermark}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-setWatermark (unsigned int {\em val})}}
\label{LCBT_8h_e3bb1902ff33a736b013d5624c83d7c3}


Write the watermark field in the CSR. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em val}]0=3/4 full,1=1/2 full, 2=1/4 full, 3=notEmpty \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Value of csr register \end{Desc}


References PRINTF.\hypertarget{LCBT_8h_d098b606037b7ace51e8cd1d26d73816}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-stats@{LCBT\_\-stats}}
\index{LCBT\_\-stats@{LCBT\_\-stats}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-stats}]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-stats (int {\em mask})}}
\label{LCBT_8h_d098b606037b7ace51e8cd1d26d73816}


print stats for LCB driver 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mask}]0=all,1=ISR,2=rst,4=evt,8=time \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none \end{Desc}
\hypertarget{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-testAll@{LCBT\_\-testAll}}
\index{LCBT\_\-testAll@{LCBT\_\-testAll}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-testAll}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-testAll (int {\em num}, \/  int {\em nLoops}, \/  int {\em latpAddr}, \/  int {\em loopbackCable})}}
\label{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}


overall test, does complete regression test of LCB 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of accesses to board per test \item[{\em nLoops}]number of times thru all tests test \item[{\em latpAddr}]0=route event tests back to self, else route event test to echo server at this addr \item[{\em loopbackCable}]1=loopback cable present and will run event test, 0=no cable so run event tests only if GASU availible \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0=success, else indicates errors detected This routine does all the regression tests for an LCB board. The routines uses the configuration set thru \hyperlink{LCBT_8h_70d0f351ca4f9ce9c83c88b7a79d0ce4}{LCBT\_\-determineHw()} or \hyperlink{LCBT_8h_bc797ff7c781c3c30f2b1fa39d902679}{LCBT\_\-setCfg()} to determine which tests are appropriate to run. It keeps a sum of total accesses and errors over all the tests.\end{Desc}
The events test run can be looped back thru a loopback cable, a GASU, or another CPU (running echo server) connected to the GASU. 

References LCBT\_\-GASU\_\-AVAIL, LCBT\_\-hwAvail(), LCBT\_\-MASK\_\-VALID, and PRINTF.\hypertarget{LCBT_8h_ec2a27c0fde6a7d762152ea23d5dd3c4}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-testAllEpu@{LCBT\_\-testAllEpu}}
\index{LCBT\_\-testAllEpu@{LCBT\_\-testAllEpu}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-testAllEpu}]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-testAllEpu (int {\em num}, \/  int {\em nLoops}, \/  int {\em latpAddr}, \/  int {\em loopbackCable})}}
\label{LCBT_8h_ec2a27c0fde6a7d762152ea23d5dd3c4}


overall test for EPU, does complete regression test of LCB minus cmdResp test 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of accesses to board per test \item[{\em nLoops}]number of times thru all tests test \item[{\em latpAddr}]0=route event tests back to self, else route event test to echo server at this addr \item[{\em loopbackCable}]1=loopback cable present and will run event test, 0=no cable so run event tests only if GASU availible \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0=success, else indicates errors detected Same as \hyperlink{LCBT_8h_4e4324632bbde4a374f3d2a33ba285eb}{LCBT\_\-testAll()} except will not do cmdResponse tests since can only be done from a commander. \end{Desc}


References LCBT\_\-GASU\_\-AVAIL, LCBT\_\-hwAvail(), LCBT\_\-MASK\_\-VALID, and PRINTF.\hypertarget{LCBT_8h_db10811205ee26e4a931c22953518ffe}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-updateErrorTotals@{LCBT\_\-updateErrorTotals}}
\index{LCBT\_\-updateErrorTotals@{LCBT\_\-updateErrorTotals}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-updateErrorTotals}]{\setlength{\rightskip}{0pt plus 5cm}LCBT\_\-updateErrorTotals (int {\em numAccess}, \/  int {\em rErr}, \/  int {\em wErr}, \/  int {\em cErr})}}
\label{LCBT_8h_db10811205ee26e4a931c22953518ffe}


update the global error counts 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em numAccess}]Number of R/W/Compare ops \item[{\em rErr}]number of read errors \item[{\em wErr}]number of write errors \item[{\em cErr}]number of compare errors \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total error count g \end{Desc}


Referenced by LCBT\_\-localRegTest().\hypertarget{LCBT_8h_73a9340f377147f6e91d9c6dcc5f5a49}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeCsr@{LCBT\_\-writeCsr}}
\index{LCBT\_\-writeCsr@{LCBT\_\-writeCsr}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeCsr}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeCsr (unsigned int {\em data})}}
\label{LCBT_8h_73a9340f377147f6e91d9c6dcc5f5a49}


Write given value to register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Value of register \end{Desc}


Referenced by LCBT\_\-resetTest().\hypertarget{LCBT_8h_73f58f6aad77f9e6a388e32cff47db5b}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeEventBase@{LCBT\_\-writeEventBase}}
\index{LCBT\_\-writeEventBase@{LCBT\_\-writeEventBase}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeEventBase}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeEventBase (unsigned int {\em data})}}
\label{LCBT_8h_73f58f6aad77f9e6a388e32cff47db5b}


Write given value to register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Value of register \end{Desc}
\hypertarget{LCBT_8h_803d3936027f3240e53ef3351cec1bdb}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeEventFree@{LCBT\_\-writeEventFree}}
\index{LCBT\_\-writeEventFree@{LCBT\_\-writeEventFree}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeEventFree}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeEventFree (unsigned int {\em data})}}
\label{LCBT_8h_803d3936027f3240e53ef3351cec1bdb}


Write given value to register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Value of register \end{Desc}
\hypertarget{LCBT_8h_fb2edda470465630197334d723f0fcf7}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeFabricSelect@{LCBT\_\-writeFabricSelect}}
\index{LCBT\_\-writeFabricSelect@{LCBT\_\-writeFabricSelect}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeFabricSelect}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeFabricSelect (unsigned int {\em data})}}
\label{LCBT_8h_fb2edda470465630197334d723f0fcf7}


Write given value to register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Value of register \end{Desc}
\hypertarget{LCBT_8h_fe5cd32fa625ec64c11b007a4988c345}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeFifoFault@{LCBT\_\-writeFifoFault}}
\index{LCBT\_\-writeFifoFault@{LCBT\_\-writeFifoFault}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeFifoFault}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeFifoFault (unsigned int {\em data}, \/  unsigned int {\em mask})}}
\label{LCBT_8h_fe5cd32fa625ec64c11b007a4988c345}


write Fifo Fault register (requires a DMA) 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \item[{\em mask}]mask of bits to write, if 0 will default to full register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]value in register \end{Desc}


References EPRINTF, and LCBT\_\-STALL.\hypertarget{LCBT_8h_3e41bd06463f4103c825b3e3d46b00ff}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeIrq@{LCBT\_\-writeIrq}}
\index{LCBT\_\-writeIrq@{LCBT\_\-writeIrq}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeIrq}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeIrq (unsigned int {\em data})}}
\label{LCBT_8h_3e41bd06463f4103c825b3e3d46b00ff}


Write given value to register. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Value of register \end{Desc}


Referenced by LCBT\_\-resetTest().\hypertarget{LCBT_8h_99b345d13e1797dd240fce82346341a7}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeLatpCsr@{LCBT\_\-writeLatpCsr}}
\index{LCBT\_\-writeLatpCsr@{LCBT\_\-writeLatpCsr}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeLatpCsr}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeLatpCsr (unsigned int {\em data}, \/  unsigned int {\em mask})}}
\label{LCBT_8h_99b345d13e1797dd240fce82346341a7}


write LATp CSR register (requires a DMA) 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \item[{\em mask}]mask of bits to write, if 0 will default to full register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]value in register \end{Desc}


References EPRINTF, and LCBT\_\-STALL.\hypertarget{LCBT_8h_797ad37e93eb5cfbd09071f9c5130dc2}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeReg@{LCBT\_\-writeReg}}
\index{LCBT\_\-writeReg@{LCBT\_\-writeReg}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeReg}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeReg (int {\em latpAddr}, \/  int {\em block}, \/  int {\em reg}, \/  unsigned int {\em value}, \/  int {\em broadcast})}}
\label{LCBT_8h_797ad37e93eb5cfbd09071f9c5130dc2}


write to single register over the cmdResponse fabric 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latpAddr}]LCB address to access, HW type is inferred from addr \item[{\em block}]Register block to access \item[{\em reg}]Register number to access \item[{\em value}]value to write to register \item[{\em broadcast}]broadcast to all address \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status This routine does a syncronous write to a single register on HW connected thru LCB. Format of message is determined from latpAddr (so expects standard assignments). \end{Desc}


References LCBT\_\-OPTION\_\-RLCL\_\-ADDR, and PRINTF.

Referenced by LCBT\_\-cmdExternalTest(), LCBT\_\-initGasu(), LCBT\_\-lam(), LCBT\_\-remoteLatpCsr(), and LCBT\_\-setRemoteBoardId().\hypertarget{LCBT_8h_cdd698aee5f1702e007917368aca485c}{
\index{LCBT.h@{LCBT.h}!LCBT\_\-writeStats@{LCBT\_\-writeStats}}
\index{LCBT\_\-writeStats@{LCBT\_\-writeStats}!LCBT.h@{LCBT.h}}
\subsubsection[{LCBT\_\-writeStats}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBT\_\-writeStats (unsigned int {\em data}, \/  unsigned int {\em mask})}}
\label{LCBT_8h_cdd698aee5f1702e007917368aca485c}


write Stats register (requires a DMA) 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]value to write to register \item[{\em mask}]mask of bits to write, if 0 will default to full register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]value in register \end{Desc}


References EPRINTF, and LCBT\_\-STALL.