\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 \char`\"{}LCBT/LCBT\_\-init\-Board.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBT/TDATA.h\char`\"{}}\par


Include dependency graph for LCBT.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=210pt]{LCBT_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=128pt]{LCBT_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{LCBT_8h_a0}{
\#define \hyperlink{LCBT_8h_a0}{LCBT\_\-STALL}~(0)}
\label{LCBT_8h_a0}

\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_a1}{
typedef enum \hyperlink{LCBT_8h_a85}{\_\-LCBT\_\-OPTION} \hyperlink{LCBT_8h_a1}{LCBT\_\-OPTION}}
\label{LCBT_8h_a1}

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

\begin{CompactList}\small\item\em defines used with s\-Hw\-Avail to determine what HW is connected for \hyperlink{LCBT_8h_a26}{LCBT\_\-cmd\-External\-Test()} \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{LCBT_8h_a85}{\_\-LCBT\_\-OPTION} \{ \par
\hyperlink{LCBT_8h_a85a3}{LCBT\_\-OPTION\_\-BUSYPRINT} =  1, 
\par
\hyperlink{LCBT_8h_a85a4}{LCBT\_\-OPTION\_\-VERBOSE} =  2, 
\par
\hyperlink{LCBT_8h_a85a5}{LCBT\_\-OPTION\_\-FOREVER} =  4, 
\par
\hyperlink{LCBT_8h_a85a6}{LCBT\_\-OPTION\_\-INCTESTPARM} =  0x10, 
\par
\hyperlink{LCBT_8h_a85a7}{LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO} =  0x20, 
\par
\hyperlink{LCBT_8h_a85a8}{LCBT\_\-OPTION\_\-RLCL\_\-ADDR} =  0x40, 
\par
\hyperlink{LCBT_8h_a85a9}{LCBT\_\-OPTION\_\-NOWRITEOVER} =  0x80, 
\par
\hyperlink{LCBT_8h_a85a10}{LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP} =  0x100
 \}
\item 
enum \hyperlink{LCBT_8h_a86}{\_\-LCBT\_\-AVAIL} \{ \par
{\bf LCBT\_\-TEM\_\-AVAIL} =  1, 
\par
\hyperlink{LCBT_8h_a86a12}{LCBT\_\-GASU\_\-AVAIL} =  2, 
\par
\hyperlink{LCBT_8h_a86a13}{LCBT\_\-MASK\_\-VALID} =  0x8000
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{LCBT_8h_a14}{LCBT\_\-init} (int latp\-Addr, int use\-Redundant\-Path, 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_a15}{LCBT\_\-is\-Init} ()
\begin{CompactList}\small\item\em indicates if LCBT\_\-init has been run ok \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a16}{LCBT\_\-set\-Siu} (int idx)
\begin{CompactList}\small\item\em Set board\-ID in Csr to SIU addr. \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a17}{LCBT\_\-set\-Epu} (int idx)
\begin{CompactList}\small\item\em Set board\-ID in Csr to EPU addr. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a18}{LCBT\_\-event\-Init} (int fork\-Pri)
\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_a19}{LCBT\_\-test\-All} (int num, int n\-Loops, int latp\-Addr, int loopback\-Cable)
\begin{CompactList}\small\item\em overall test, does complete regression test of LCB \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a20}{LCBT\_\-test\-All\-Epu} (int num, int n\-Loops, int latp\-Addr, int loopback\-Cable)
\begin{CompactList}\small\item\em overall test for EPU, does complete regression test of LCB minus cmd\-Resp test \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a21}{LCBT\_\-set\-Option} (unsigned int option\-Mask)
\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_a22}{LCBT\_\-local\-Reg\-Test} (int num, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a23}{LCBT\_\-cmd\-Local\-Test} (int num, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a24}{LCBT\_\-cmd\-Local\-Test2} (int num, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a25}{LCBT\_\-cmd\-Local\-Test3} (int num, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a26}{LCBT\_\-cmd\-External\-Test} (int num, int single\-Access, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\begin{CompactList}\small\item\em read test on LCB local registers that require Cmd list DMA \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a27}{LCBT\_\-event\-Test} (int num, int max\-Len, int latp\-Addr, int random\-Len, int ccsds, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a28}{LCBT\_\-event\-Test2} (int num, int max\-Len, int latp\-Addr, int random\-Len, int ccsds, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a29}{LCBT\_\-event\-Test3} (int num, int max\-Len, int latp\-Addr, int random\-Len, int ccsds, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a30}{LCBT\_\-event\-Test5} (int num, int max\-Len, int latp\-Addr, int random\-Len, int ccsds, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\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_a31}{LCBT\_\-combo\-Test} (int num, int max\-Len, int latp\-Addr, int random\-Len, int ccsds, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\begin{CompactList}\small\item\em 2 concurrent tasks running event and local\-Cmd\-Reg test \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a32}{LCBT\_\-event\-Watermark\-Test} (int num, int latp\-Addr)
\begin{CompactList}\small\item\em Check for proper operation of watermarks on Event and Event\-Data queues. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a33}{LCBT\_\-fill\-Queue\-Test} (int num\-Loop, int disable\-Result\-Int)
\begin{CompactList}\small\item\em Fill request\-Q with requests to make sure it handles it properly. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a34}{LCBT\_\-event\-Fill\-Test} (int num, int latp\-Addr, int buff\-Size32, int print\-Info)
\begin{CompactList}\small\item\em Check for proper operation circular buff\-FUll interrupt. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw} ()
\begin{CompactList}\small\item\em get mask determined by \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw()} for use in LCBT\_\-determine\-Hw () determine which HW is connected to the LCB \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a36}{LCBT\_\-hw\-Avail} ()
\begin{CompactList}\small\item\em get mask of hw determined by \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw()} for use in \hyperlink{LCBT_8h_a26}{LCBT\_\-cmd\-External\-Test()} \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a37}{LCBT\_\-init\-Gasu} ()
\begin{CompactList}\small\item\em setup registers in GASU determine which HW is connected to the LCB \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a38}{LCBT\_\-set\-Cfg} (int have\-Gasu, int have\-Tem)
\begin{CompactList}\small\item\em get mask determined by \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw()} for use in \hyperlink{LCBT_8h_a26}{LCBT\_\-cmd\-External\-Test()} \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a39}{LCBT\_\-lam} (int latp\-Addr)
\begin{CompactList}\small\item\em Send out LAM (look\-At\-Me) to specified addr. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a40}{LCBT\_\-remote\-Latp\-Csr} (int latp\-Addr, unsigned int val, unsigned int mask, int broadcast)
\begin{CompactList}\small\item\em send value to Latp\-Csr on another CPU over Cmd\-Response \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a41}{LCBT\_\-set\-Remote\-Board\-Id} (int latp\-Addr)
\begin{CompactList}\small\item\em set board ID to latp\-Addr on CPU determined by CRU \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a42}{LCBT\_\-clear\-Error\-Totals} ()
\begin{CompactList}\small\item\em clear the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a43}{LCBT\_\-print\-Error\-Totals} (char $\ast$title)
\begin{CompactList}\small\item\em print the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a44}{LCBT\_\-update\-Error\-Totals} (int access, int r\-Err, int w\-Err, int c\-Err)
\begin{CompactList}\small\item\em update the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a45}{LCBT\_\-save\-Error\-For\-Deltas} ()
\begin{CompactList}\small\item\em stash global error counts to use with \hyperlink{LCBT_8h_a46}{LCBT\_\-print\-Error\-Deltas()} \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a46}{LCBT\_\-print\-Error\-Deltas} (char $\ast$title)
\begin{CompactList}\small\item\em print the delta error counts since \hyperlink{LCBT_8h_a45}{LCBT\_\-save\-Error\-For\-Deltas()} \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a47}{LCBT\_\-get\-Error\-Totals} (int $\ast$num\-Access, int $\ast$r\-Err, int $\ast$w\-Err, int $\ast$c\-Err)
\begin{CompactList}\small\item\em get the global error counts \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a48}{LCBT\_\-event\-Recv} (int num\-Recv, int ccsds)
\begin{CompactList}\small\item\em Setup to receive and compare data from \hyperlink{LCBT__event_8c_a8}{LCBT\_\-event\-Send()}. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a49}{LCBT\_\-event\-Send} (int num\-Events, int max\-Evt\-Size, int latp\-Addr, int random\-Len, int ccsds, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} test\-Type, unsigned int test\-Parm)
\begin{CompactList}\small\item\em Send out test event data to be received by \hyperlink{LCBT__event_8c_a7}{LCBT\_\-event\-Recv()}. \item\end{CompactList}\item 
int \hyperlink{LCBT_8h_a50}{LCBT\_\-event\-Send\-Delay} (int delay\-Nanosec)
\begin{CompactList}\small\item\em Set delay in nano\-Sec between event sends, can be 0. \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a51}{LCBT\_\-regs} ()
\begin{CompactList}\small\item\em print vals of all registers in LCB \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a52}{LCBT\_\-read\-Csr} ()
\begin{CompactList}\small\item\em Read CSR register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a53}{LCBT\_\-read\-Irq} ()
\begin{CompactList}\small\item\em Read IRQ register which has interrupt status. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a54}{LCBT\_\-read\-Event\-Base} ()
\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_a55}{LCBT\_\-read\-Event\-Free} ()
\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_a56}{LCBT\_\-read\-Event\-Q} ()
\begin{CompactList}\small\item\em Read event\-Queue NOTE this will pull value from queue and effect operation. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a57}{LCBT\_\-read\-Result\-Q} ()
\begin{CompactList}\small\item\em Read result\-Queue NOTE this will pull value from queue and effect operation. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a58}{LCBT\_\-read\-Request\-Q} ()
\begin{CompactList}\small\item\em Read request\-Queue, 0=not\-EMpty, not0=empty NOTE this will pull value from queue and effect operation. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a59}{LCBT\_\-read\-Latp\-Csr} ()
\begin{CompactList}\small\item\em read LATp CSR register (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a60}{LCBT\_\-read\-Fifo\-Fault} ()
\begin{CompactList}\small\item\em read Fifo Fault registers (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a61}{LCBT\_\-read\-Fabric\-Select} ()
\begin{CompactList}\small\item\em Read Fabric\-Select register which indicates primary or redundant. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a62}{LCBT\_\-read\-Stats} ()
\begin{CompactList}\small\item\em read stats register (requires a DMA) \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a63}{LCBT\_\-read\-Hw\-Info} ()
\begin{CompactList}\small\item\em Read hw\-Info register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a64}{LCBT\_\-write\-Csr} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a65}{LCBT\_\-write\-Irq} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a66}{LCBT\_\-write\-Event\-Base} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a67}{LCBT\_\-write\-Event\-Free} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a68}{LCBT\_\-write\-Fabric\-Select} (unsigned int data)
\begin{CompactList}\small\item\em Write given value to register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a69}{LCBT\_\-write\-Latp\-Csr} (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_a70}{LCBT\_\-write\-Fifo\-Fault} (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_a71}{LCBT\_\-write\-Stats} (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_a72}{LCBT\_\-lat\-Reset} (unsigned int stall)
\begin{CompactList}\small\item\em sends LAT reset (requires a DMA) \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a73}{LCBT\_\-set\-Watermark} (unsigned int val)
\begin{CompactList}\small\item\em Write the watermark field in the CSR. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a74}{LCBT\_\-read\-Reg} (int latp\-Addr, int block, int reg, unsigned int $\ast$value)
\begin{CompactList}\small\item\em read a single register over the cmd\-Response fabric \item\end{CompactList}\item 
unsigned int \hyperlink{LCBT_8h_a75}{LCBT\_\-write\-Reg} (int latp\-Addr, int block, int reg, unsigned int value, int broadcast)
\begin{CompactList}\small\item\em write to single register over the cmd\-Response fabric \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a76}{LCBT\_\-stats} (int mask)
\begin{CompactList}\small\item\em print stats for LCB driver \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a77}{LCBT\_\-clear\-Stats} ()
\begin{CompactList}\small\item\em clear stats for LCB driver \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a78}{LCBT\_\-reset\-Test} (int num\-Req\-Per)
\begin{CompactList}\small\item\em special test for reset fix on Fpga\-Lat=0x5d \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a79}{LCBT\_\-print\-Alloc\-Buffs} (int num\-Err\-Lines, int num\-Prnt\-Lines, int wrap)
\begin{CompactList}\small\item\em allocates buffers for PRINTF and EPRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a80}{LCBT\_\-print\-Release\-Buffs} ()
\begin{CompactList}\small\item\em releases buffers for PRINTF and EPRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a81}{LCBT\_\-print\-Clear\-Buffs} ()
\begin{CompactList}\small\item\em clear buffers for PRINTF and EPRINTF, i.e. no text \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a82}{LCBT\_\-print\-Get\-Err\-Buff} (char $\ast$err\-Buff, int max\-Len)
\begin{CompactList}\small\item\em fills buffers for EPRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a83}{LCBT\_\-print\-Get\-Prnt\-Buff} (char $\ast$prnt\-Buff, int max\-Len)
\begin{CompactList}\small\item\em fills buffers for PRINTF \item\end{CompactList}\item 
void \hyperlink{LCBT_8h_a84}{LCBT\_\-print\-Shell\-Disable} (int disable)
\begin{CompactList}\small\item\em set disable flag to stop PRINTF and EPRINTF to Vx\-SHell \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.33 2005/07/11 21:31:28 ebacho Exp $
\end{verbatim}
\normalsize


\subsection{Enumeration Type Documentation}
\hypertarget{LCBT_8h_a86}{
\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 \hyperlink{LCBT_8h_a86}{\_\-LCBT\_\-AVAIL}}}
\label{LCBT_8h_a86}


\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_a86a12}{
LCBT\_\-GASU\_\-AVAIL}
\label{LCBT_8h_a86a12}
}]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_a86a13}{
LCBT\_\-MASK\_\-VALID}
\label{LCBT_8h_a86a13}
}]GASU(EBM) connected to LCB \end{description}
\end{Desc}

\hypertarget{LCBT_8h_a85}{
\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 \hyperlink{LCBT_8h_a85}{\_\-LCBT\_\-OPTION}}}
\label{LCBT_8h_a85}


\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_a85a3}{
LCBT\_\-OPTION\_\-BUSYPRINT}
\label{LCBT_8h_a85a3}
}]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_a85a4}{
LCBT\_\-OPTION\_\-VERBOSE}
\label{LCBT_8h_a85a4}
}]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_a85a5}{
LCBT\_\-OPTION\_\-FOREVER}
\label{LCBT_8h_a85a5}
}]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_a85a6}{
LCBT\_\-OPTION\_\-INCTESTPARM}
\label{LCBT_8h_a85a6}
}]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_a85a7}{
LCBT\_\-OPTION\_\-COMPARE\_\-FOR\_\-ECHO}
\label{LCBT_8h_a85a7}
}]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_a85a8}{
LCBT\_\-OPTION\_\-RLCL\_\-ADDR}
\label{LCBT_8h_a85a8}
}]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_a85a9}{
LCBT\_\-OPTION\_\-NOWRITEOVER}
\label{LCBT_8h_a85a9}
}]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_a85a10}{
LCBT\_\-OPTION\_\-NO\_\-EVT\_\-DUMP}
\label{LCBT_8h_a85a10}
}]disable dump of event buff after error \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{LCBT_8h_a42}{
\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\_\-clear\-Error\-Totals ()}}
\label{LCBT_8h_a42}


clear the global error counts 

\begin{Desc}
\item[Returns:]total error count before clearing\end{Desc}
\hypertarget{LCBT_8h_a77}{
\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\_\-clear\-Stats ()}}
\label{LCBT_8h_a77}


clear stats for LCB driver 

\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a26}{
\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\_\-cmd\-External\-Test (int {\em num}, int {\em single\-Access}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a26}


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 single\-Access}]1=single acess per DMA, all reg are access within single DMA \item[{\em test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs\end{Desc}
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.\hypertarget{LCBT_8h_a23}{
\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\_\-cmd\-Local\-Test (int {\em num}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a23}


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 test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs\end{Desc}
\hypertarget{LCBT_8h_a24}{
\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\_\-cmd\-Local\-Test2 (int {\em num}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a24}


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 test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs\end{Desc}
This is similar to LCBT\_\-cmd\-Local\-Test except that two tasks are spawned and do the test concurrently.\hypertarget{LCBT_8h_a25}{
\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\_\-cmd\-Local\-Test3 (int {\em num}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a25}


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 test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs\end{Desc}
This is similar to LCBT\_\-cmd\-Local\-Test except that three tasks are spawned and do the test concurrently.\hypertarget{LCBT_8h_a31}{
\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\_\-combo\-Test (int {\em num}, int {\em max\-Len}, int {\em latp\-Addr}, int {\em random\-Len}, int {\em ccsds}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a31}


2 concurrent tasks running event and local\-Cmd\-Reg test 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of events to send \item[{\em max\-Len}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latp\-Addr}]- LATp address of board to send to, 0=self \item[{\em random\-Len}]1=packet range from 4 to max\-Evt\-Size, 0=packets are max\-Evt\-Size \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
This test is intended to run when loopback cable is attached to LCB board ir the LCB is connected to a GASU. Test combines local\-Cmd\-Reg 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.\hypertarget{LCBT_8h_a35}{
\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\_\-determine\-Hw ()}}
\label{LCBT_8h_a35}


get mask determined by \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw()} for use in LCBT\_\-determine\-Hw () determine which HW is connected to the LCB 

This routine is used to determine what HW is connected to the LCB so that the \hyperlink{LCBT_8h_a26}{LCBT\_\-cmd\-External\-Test()} 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_a38}{LCBT\_\-set\-Cfg()} call to setup. Configuration is essentially only for \hyperlink{LCBT_8h_a19}{LCBT\_\-test\-All()} as it choose the tests to run. If tests withint \hyperlink{LCBT_8h_a19}{LCBT\_\-test\-All()} are called directly they will not consider the configuration setting.\hypertarget{LCBT_8h_a34}{
\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\_\-event\-Fill\-Test (int {\em num}, int {\em latp\-Addr}, int {\em buff\-Size32}, int {\em print\-Info})}}
\label{LCBT_8h_a34}


Check for proper operation circular buff\-FUll interrupt. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of times to do the test \item[{\em latp\-Addr}]- LATp address of board to send to, 0=self \item[{\em print\-Info}]print irq and other info while processing \item[{\em buff\-Size32}]buff\-Size 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\end{Desc}
This tests the circ\-Evt\-Buff 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.\hypertarget{LCBT_8h_a18}{
\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\_\-event\-Init (int {\em echo\-Fork\-Pri})}}
\label{LCBT_8h_a18}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em echo\-Fork\-Pri}]priority of forked task to send event data back \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a48}{
\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\_\-event\-Recv (int {\em num\-Recv}, int {\em ccsds})}}
\label{LCBT_8h_a48}


Setup to receive and compare data from \hyperlink{LCBT__event_8c_a8}{LCBT\_\-event\-Send()}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num\-Recv}]0=sets up and return, 1=waits for num\-Recv events \item[{\em ccsds}]1=expect CCSDS header on event data received \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
This test sets up the receive end for data from \hyperlink{LCBT__event_8c_a8}{LCBT\_\-event\-Send()}. The data received is self describing so compares can be dome on it.\hypertarget{LCBT_8h_a49}{
\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\_\-event\-Send (int {\em num\-Events}, int {\em max\-Evt\-Size}, int {\em latp\-Addr}, int {\em random\-Len}, int {\em ccsds}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a49}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num\-Events}]number of events to send \item[{\em max\-Evt\-Size}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latp\-Addr}]- LATp address of board to send to, 0=self \item[{\em random\-Len}]1=packet range from 4 to max\-Evt\-Size, 0=packets are max\-Evt\-Size \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
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\_\-event\-Recv. \hyperlink{LCBT__event_8c_a7}{LCBT\_\-event\-Recv()} sets up LCB to receive and interpret the data packets sent by \hyperlink{LCBT__event_8c_a8}{LCBT\_\-event\-Send()}\hypertarget{LCBT_8h_a50}{
\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\_\-event\-Send\-Delay (int {\em delay\-Nanosec})}}
\label{LCBT_8h_a50}


Set delay in nano\-Sec between event sends, can be 0. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em delay\-Nanosec}]delay in nano\-Sec \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]previous setting of delay\end{Desc}
Sets s delay between event\-Send's to avoid filling up queues.\hypertarget{LCBT_8h_a27}{
\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\_\-event\-Test (int {\em num}, int {\em max\-Len}, int {\em latp\-Addr}, int {\em random\-Len}, int {\em ccsds}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a27}


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 max\-Len}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latp\-Addr}]- LATp address of board to send to, 0=self \item[{\em random\-Len}]1=packet range from 4 to max\-Evt\-Size, 0=packets are max\-Evt\-Size \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
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 latp\-Addr should be the addr of the sending LCB or the address of another CPU/LCB running an echo server.\hypertarget{LCBT_8h_a28}{
\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\_\-event\-Test2 (int {\em num}, int {\em max\-Len}, int {\em latp\-Addr}, int {\em random\-Len}, int {\em ccsds}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a28}


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 max\-Len}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latp\-Addr}]- LATp address of board to send to, 0=self \item[{\em random\-Len}]1=packet range from 4 to max\-Evt\-Size, 0=packets are max\-Evt\-Size \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
Test is similar to LCBT\_\-event\-Test except two tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests.\hypertarget{LCBT_8h_a29}{
\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\_\-event\-Test3 (int {\em num}, int {\em max\-Len}, int {\em latp\-Addr}, int {\em random\-Len}, int {\em ccsds}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a29}


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 max\-Len}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latp\-Addr}]- LATp address of board to send to, 0=self \item[{\em random\-Len}]1=packet range from 4 to max\-Evt\-Size, 0=packets are max\-Evt\-Size \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
Test is similar to LCBT\_\-event\-Test except three tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests.\hypertarget{LCBT_8h_a30}{
\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\_\-event\-Test5 (int {\em num}, int {\em max\-Len}, int {\em latp\-Addr}, int {\em random\-Len}, int {\em ccsds}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a30}


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 max\-Len}]max event size in int32 (4 to 1020), 0 will set to maximum size for loopback which is 767 \item[{\em latp\-Addr}]- LATp address of board to send to, 0=self \item[{\em random\-Len}]1=packet range from 4 to max\-Evt\-Size, 0=packets are max\-Evt\-Size \item[{\em ccsds}]1=put CCSDS header on data sent out as event \item[{\em test\-Type}]Specifies the data sequence for test \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
Test is similar to LCBT\_\-event\-Test except three tasks are spawned to do the same test. Num should be set to a high value to guarantee overlap of tests.\hypertarget{LCBT_8h_a32}{
\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\_\-event\-Watermark\-Test (int {\em num}, int {\em latp\-Addr})}}
\label{LCBT_8h_a32}


Check for proper operation of watermarks on Event and Event\-Data queues. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]Number of times to do the test \item[{\em latp\-Addr}]- 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\end{Desc}
This test checks that the watermark event come when expected given the settings of the watermarks on the queues.\hypertarget{LCBT_8h_a33}{
\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\_\-fill\-Queue\-Test (int {\em num\-Loop}, int {\em disable\-Result})}}
\label{LCBT_8h_a33}


Fill request\-Q with requests to make sure it handles it properly. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num\-Loop}]Number of times to do in the test \item[{\em disable\-Result}]fill up all queues by disabling result queue \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total errs\end{Desc}
This test is used to test the HW and driver to make sure it can handle the request\-Q 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: disable\-Result=0 THis should fill up Request queue and all queues before the transfer engine. disable\-Result=1 THis should fill up Request queue all queues before and after the transfer engine, and the result queue\hypertarget{LCBT_8h_a47}{
\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\_\-get\-Error\-Totals (int $\ast$ {\em num\-Access}, int $\ast$ {\em r\-Err}, int $\ast$ {\em w\-Err}, int $\ast$ {\em c\-Err})}}
\label{LCBT_8h_a47}


get the global error counts 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num\-Access}]if not NULL, return number of R/W/Compare ops \item[{\em r\-Err}]if not NULL, return number of read errors \item[{\em w\-Err}]if not NULL, return number of write errors \item[{\em c\-Err}]if not NULL, return number of compare errors \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total error count\end{Desc}
\hypertarget{LCBT_8h_a36}{
\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\_\-hw\-Avail ()}}
\label{LCBT_8h_a36}


get mask of hw determined by \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw()} for use in \hyperlink{LCBT_8h_a26}{LCBT\_\-cmd\-External\-Test()} 

\begin{Desc}
\item[Returns:]mask of HW connected to LCB\end{Desc}
\hypertarget{LCBT_8h_a14}{
\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 latp\-Addr}, int {\em use\-Redundant\-Path}, LCBD {\em lcb})}}
\label{LCBT_8h_a14}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latp\-Addr}]LATp addr to assign to this board \item[{\em use\-Redundant\-Path}]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\end{Desc}
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.\hypertarget{LCBT_8h_a37}{
\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\_\-init\-Gasu ()}}
\label{LCBT_8h_a37}


setup registers in GASU determine which HW is connected to the LCB 

This routine is used as an alternative to PIG to init the GASU. DO NOT use if you are using PIG to setup the HW.\hypertarget{LCBT_8h_a15}{
\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\_\-is\-Init ()}}
\label{LCBT_8h_a15}


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

\begin{Desc}
\item[Returns:]0=not init, 1=been init\end{Desc}
\hypertarget{LCBT_8h_a39}{
\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 latp\-Addr})}}
\label{LCBT_8h_a39}


Send out LAM (look\-At\-Me) to specified addr. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latp\-Addr}]addr to send LAM to \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status\end{Desc}
\hypertarget{LCBT_8h_a72}{
\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\_\-lat\-Reset (unsigned int {\em stall})}}
\label{LCBT_8h_a72}


sends LAT reset (requires a DMA) 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em stall}]stall after reset in 50 n\-Sec tics \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status\end{Desc}
To be used with great discretion, i.e. in case of emergency break glass.\hypertarget{LCBT_8h_a22}{
\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\_\-local\-Reg\-Test (int {\em num}, \hyperlink{TDATA_8h_a0}{TDATA\_\-DTEST} {\em test\-Type}, unsigned int {\em test\-Parm})}}
\label{LCBT_8h_a22}


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 test\-Type}]Specified the data sequence used for test data \item[{\em test\-Parm}]Parm to use with test\-Type \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a79}{
\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\_\-print\-Alloc\-Buffs (int {\em num\-Err\-Lines}, int {\em num\-Prnt\-Lines}, int {\em wrap})}}
\label{LCBT_8h_a79}


allocates buffers for PRINTF and EPRINTF 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num\-Err\-Lines}]number of lines to be buffered \item[{\em num\-Prnt\-Lines}]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}
\hypertarget{LCBT_8h_a81}{
\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\_\-print\-Clear\-Buffs ()}}
\label{LCBT_8h_a81}


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

\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a46}{
\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\_\-print\-Error\-Deltas (char $\ast$ {\em title})}}
\label{LCBT_8h_a46}


print the delta error counts since \hyperlink{LCBT_8h_a45}{LCBT\_\-save\-Error\-For\-Deltas()} 

\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}
\hypertarget{LCBT_8h_a43}{
\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\_\-print\-Error\-Totals (char $\ast$ {\em title})}}
\label{LCBT_8h_a43}


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}
\hypertarget{LCBT_8h_a82}{
\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\_\-print\-Get\-Err\-Buff (char $\ast$ {\em err\-Buff}, int {\em max\-Len})}}
\label{LCBT_8h_a82}


fills buffers for EPRINTF 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em err\-Buff}]buffer to fill in \item[{\em max\-Len}]length of buffer to fill in \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a83}{
\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\_\-print\-Get\-Prnt\-Buff (char $\ast$ {\em prnt\-Buff}, int {\em max\-Len})}}
\label{LCBT_8h_a83}


fills buffers for PRINTF 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prnt\-Buff}]buffer to fill in \item[{\em max\-Len}]length of buffer to fill in \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a80}{
\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\_\-print\-Release\-Buffs ()}}
\label{LCBT_8h_a80}


releases buffers for PRINTF and EPRINTF 

\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a84}{
\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\_\-print\-Shell\-Disable (int {\em disable})}}
\label{LCBT_8h_a84}


set disable flag to stop PRINTF and EPRINTF to Vx\-SHell 

\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_a52}{
\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\_\-read\-Csr ()}}
\label{LCBT_8h_a52}


Read CSR register. 

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a54}{
\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\_\-read\-Event\-Base ()}}
\label{LCBT_8h_a54}


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

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a55}{
\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\_\-read\-Event\-Free ()}}
\label{LCBT_8h_a55}


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

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a56}{
\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\_\-read\-Event\-Q ()}}
\label{LCBT_8h_a56}


Read event\-Queue NOTE this will pull value from queue and effect operation. 

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a61}{
\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\_\-read\-Fabric\-Select ()}}
\label{LCBT_8h_a61}


Read Fabric\-Select register which indicates primary or redundant. 

\begin{Desc}
\item[Returns:]Value of register, 0=promary, 1=redundant\end{Desc}
\hypertarget{LCBT_8h_a60}{
\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\_\-read\-Fifo\-Fault ()}}
\label{LCBT_8h_a60}


read Fifo Fault registers (requires a DMA) 

\begin{Desc}
\item[Returns:]value in register\end{Desc}
\hypertarget{LCBT_8h_a63}{
\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\_\-read\-Hw\-Info ()}}
\label{LCBT_8h_a63}


Read hw\-Info register. 

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a53}{
\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\_\-read\-Irq ()}}
\label{LCBT_8h_a53}


Read IRQ register which has interrupt status. 

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a59}{
\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\_\-read\-Latp\-Csr ()}}
\label{LCBT_8h_a59}


read LATp CSR register (requires a DMA) 

\begin{Desc}
\item[Returns:]value in register\end{Desc}
\hypertarget{LCBT_8h_a74}{
\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\_\-read\-Reg (int {\em latp\-Addr}, int {\em block}, int {\em reg}, unsigned int $\ast$ {\em value})}}
\label{LCBT_8h_a74}


read a single register over the cmd\-Response fabric 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latp\-Addr}]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\end{Desc}
This routine does a syncronous read from a single register on HW connected thru LCB. Format of message is determined from latp\-Addr (so expects standard assignments).\hypertarget{LCBT_8h_a58}{
\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\_\-read\-Request\-Q ()}}
\label{LCBT_8h_a58}


Read request\-Queue, 0=not\-EMpty, not0=empty NOTE this will pull value from queue and effect operation. 

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a57}{
\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\_\-read\-Result\-Q ()}}
\label{LCBT_8h_a57}


Read result\-Queue NOTE this will pull value from queue and effect operation. 

\begin{Desc}
\item[Returns:]Value of register\end{Desc}
\hypertarget{LCBT_8h_a62}{
\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\_\-read\-Stats ()}}
\label{LCBT_8h_a62}


read stats register (requires a DMA) 

\begin{Desc}
\item[Returns:]value in register\end{Desc}
\hypertarget{LCBT_8h_a51}{
\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_a51}


print vals of all registers in LCB 

\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8h_a40}{
\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\_\-remote\-Latp\-Csr (int {\em latp\-Addr}, unsigned int {\em val}, unsigned int {\em mask}, int {\em broadcast})}}
\label{LCBT_8h_a40}


send value to Latp\-Csr on another CPU over Cmd\-Response 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latp\-Addr}]addr to send to, ignored if broadcast=0 \item[{\em val}]value to write to Latp\-Csr \item[{\em mask}]mask on register,if =0 will assume 0xfffffff (all bits) \item[{\em broadcast}]send out as broadcast (needed to set board\-ID) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status\end{Desc}
\hypertarget{LCBT_8h_a78}{
\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\_\-reset\-Test (int {\em num\-Req\-Per})}}
\label{LCBT_8h_a78}


special test for reset fix on Fpga\-Lat=0x5d 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num\-Req\-Per}]num of read for each of 4 part test \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]nothing\end{Desc}
This test was developed to reproduce a problem seen with Lat\-Fpga $<$ 0x5d on the c\-Pci 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).

This test requires USER INTERACTION to turn off/on the 20 MHz clock (usually by powering the GASU on and off).

The fix in Lat\-Fpga=0x5d allows this test to run sucessfully without errors.\hypertarget{LCBT_8h_a45}{
\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\_\-save\-Error\-For\-Deltas ()}}
\label{LCBT_8h_a45}


stash global error counts to use with \hyperlink{LCBT_8h_a46}{LCBT\_\-print\-Error\-Deltas()} 

\begin{Desc}
\item[Returns:]total error count\end{Desc}
\hypertarget{LCBT_8h_a38}{
\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\_\-set\-Cfg (int {\em have\-Gasu}, int {\em have\-Tem})}}
\label{LCBT_8h_a38}


get mask determined by \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw()} for use in \hyperlink{LCBT_8h_a26}{LCBT\_\-cmd\-External\-Test()} 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em have\-Gasu}]1=have GASU/EBM \item[{\em have\-Tem}]1=have TEM either thru GASU or Transition Board \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]mask of HW connected to LCB\end{Desc}
This routine is used instead of LCNT\_\-determine\-Hw() when the HW configuration is already known. Configuration is essentially only for \hyperlink{LCBT_8h_a19}{LCBT\_\-test\-All()} as it choose the tests to run. If tests withint \hyperlink{LCBT_8h_a19}{LCBT\_\-test\-All()} are called directly they will not consider the configuration setting.\hypertarget{LCBT_8h_a17}{
\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\_\-set\-Epu (int {\em idx})}}
\label{LCBT_8h_a17}


Set board\-ID 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}
\hypertarget{LCBT_8h_a21}{
\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\_\-set\-Option (unsigned int {\em mask})}}
\label{LCBT_8h_a21}


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_a41}{
\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\_\-set\-Remote\-Board\-Id (int {\em latp\-Addr})}}
\label{LCBT_8h_a41}


set board ID to latp\-Addr on CPU determined by CRU 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latp\-Addr}]addr to send to, ignored if broadcast=0 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status\end{Desc}
This routine sets up CRU to enable one path to a CPU (determined by latp\-Addr) and then sets the CPU on that path for board\-Id=latp\-Addr. This function is normally done by PIG so this routine should be used with CAUTION.\hypertarget{LCBT_8h_a16}{
\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\_\-set\-Siu (int {\em idx})}}
\label{LCBT_8h_a16}


Set board\-ID 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}
\hypertarget{LCBT_8h_a73}{
\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\_\-set\-Watermark (unsigned int {\em val})}}
\label{LCBT_8h_a73}


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=not\-Empty \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Value of csr register\end{Desc}
\hypertarget{LCBT_8h_a76}{
\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_a76}


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_a19}{
\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\_\-test\-All (int {\em num}, int {\em n\-Loops}, int {\em latp\-Addr}, int {\em loopback\-Cable})}}
\label{LCBT_8h_a19}


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 n\-Loops}]number of times thru all tests test \item[{\em latp\-Addr}]0=route event tests back to self, else route event test to echo server at this addr \item[{\em loopback\-Cable}]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\end{Desc}
This routine does all the regression tests for an LCB board. The routines uses the configuration set thru \hyperlink{LCBT_8h_a35}{LCBT\_\-determine\-Hw()} or \hyperlink{LCBT_8h_a38}{LCBT\_\-set\-Cfg()} to determine which tests are appropriate to run. It keeps a sum of total accesses and errors over all the tests.

The events test run can be looped back thru a loopback cable, a GASU, or another CPU (running echo server) connected to the GASU.\hypertarget{LCBT_8h_a20}{
\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\_\-test\-All\-Epu (int {\em num}, int {\em n\-Loops}, int {\em latp\-Addr}, int {\em loopback\-Cable})}}
\label{LCBT_8h_a20}


overall test for EPU, does complete regression test of LCB minus cmd\-Resp test 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num}]number of accesses to board per test \item[{\em n\-Loops}]number of times thru all tests test \item[{\em latp\-Addr}]0=route event tests back to self, else route event test to echo server at this addr \item[{\em loopback\-Cable}]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\end{Desc}
Same as \hyperlink{LCBT_8h_a19}{LCBT\_\-test\-All()} except will not do cmd\-Response tests since can only be done from a commander.\hypertarget{LCBT_8h_a44}{
\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\_\-update\-Error\-Totals (int {\em num\-Access}, int {\em r\-Err}, int {\em w\-Err}, int {\em c\-Err})}}
\label{LCBT_8h_a44}


update the global error counts 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em num\-Access}]Number of R/W/Compare ops \item[{\em r\-Err}]number of read errors \item[{\em w\-Err}]number of write errors \item[{\em c\-Err}]number of compare errors \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]total error count g\end{Desc}
\hypertarget{LCBT_8h_a64}{
\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\_\-write\-Csr (unsigned int {\em data})}}
\label{LCBT_8h_a64}


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_a66}{
\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\_\-write\-Event\-Base (unsigned int {\em data})}}
\label{LCBT_8h_a66}


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_a67}{
\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\_\-write\-Event\-Free (unsigned int {\em data})}}
\label{LCBT_8h_a67}


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_a68}{
\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\_\-write\-Fabric\-Select (unsigned int {\em data})}}
\label{LCBT_8h_a68}


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_a70}{
\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\_\-write\-Fifo\-Fault (unsigned int {\em data}, unsigned int {\em mask})}}
\label{LCBT_8h_a70}


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}
\hypertarget{LCBT_8h_a65}{
\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\_\-write\-Irq (unsigned int {\em data})}}
\label{LCBT_8h_a65}


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_a69}{
\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\_\-write\-Latp\-Csr (unsigned int {\em data}, unsigned int {\em mask})}}
\label{LCBT_8h_a69}


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}
\hypertarget{LCBT_8h_a75}{
\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\_\-write\-Reg (int {\em latp\-Addr}, int {\em block}, int {\em reg}, unsigned int {\em value}, int {\em broadcast})}}
\label{LCBT_8h_a75}


write to single register over the cmd\-Response fabric 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em latp\-Addr}]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\end{Desc}
This routine does a syncronous write to a single register on HW connected thru LCB. Format of message is determined from latp\-Addr (so expects standard assignments).\hypertarget{LCBT_8h_a71}{
\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\_\-write\-Stats (unsigned int {\em data}, unsigned int {\em mask})}}
\label{LCBT_8h_a71}


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}
