\hypertarget{LCBT_8c}{
\section{LCBT.c File Reference}
\label{LCBT_8c}\index{LCBT.c@{LCBT.c}}
}
Basic init and misc public funcs for LCBT module. 

{\tt \#include \char`\"{}PBS/PBS.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/CACHE.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBT/LCBT\_\-init\-Board.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBT/LCBT.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBT\_\-printf.h\char`\"{}}\par
{\tt \#include \char`\"{}trace.h\char`\"{}}\par


Include dependency graph for LCBT.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=288pt]{LCBT_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{LCBT_8c_a0}{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_8c_a1}{LCBT\_\-is\-Init} ()
\begin{CompactList}\small\item\em indicates if LCBT\_\-init has been run ok \item\end{CompactList}\item 
void \hyperlink{LCBT_8c_a2}{LCBT\_\-set\-Option} (unsigned int mask)
\begin{CompactList}\small\item\em set test option mask, see \hyperlink{LCBT_8h}{LCBT.h} for values \item\end{CompactList}\item 
void \hyperlink{LCBT_8c_a3}{LCBT\_\-stats} (int mask)
\begin{CompactList}\small\item\em print stats for LCB driver \item\end{CompactList}\item 
void \hyperlink{LCBT_8c_a4}{LCBT\_\-clear\-Stats} ()
\begin{CompactList}\small\item\em clear stats for LCB driver \item\end{CompactList}\item 
void \hyperlink{LCBT_8c_a5}{LCBT\_\-reset\-Test} (int num\-Req\-Per)
\begin{CompactList}\small\item\em special test for reset fix on Fpga\-Lat=0x5d \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Basic init and misc public funcs for LCBT module. 

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


\subsection{Function Documentation}
\hypertarget{LCBT_8c_a4}{
\index{LCBT.c@{LCBT.c}!LCBT_clearStats@{LCBT\_\-clearStats}}
\index{LCBT_clearStats@{LCBT\_\-clearStats}!LCBT.c@{LCBT.c}}
\subsubsection[LCBT\_\-clearStats]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-clear\-Stats ()}}
\label{LCBT_8c_a4}


clear stats for LCB driver 

\begin{Desc}
\item[Returns:]none\end{Desc}
\hypertarget{LCBT_8c_a0}{
\index{LCBT.c@{LCBT.c}!LCBT_init@{LCBT\_\-init}}
\index{LCBT_init@{LCBT\_\-init}!LCBT.c@{LCBT.c}}
\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_8c_a0}


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_8c_a1}{
\index{LCBT.c@{LCBT.c}!LCBT_isInit@{LCBT\_\-isInit}}
\index{LCBT_isInit@{LCBT\_\-isInit}!LCBT.c@{LCBT.c}}
\subsubsection[LCBT\_\-isInit]{\setlength{\rightskip}{0pt plus 5cm}int LCBT\_\-is\-Init ()}}
\label{LCBT_8c_a1}


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

\begin{Desc}
\item[Returns:]0=not init, 1=been init\end{Desc}
\hypertarget{LCBT_8c_a5}{
\index{LCBT.c@{LCBT.c}!LCBT_resetTest@{LCBT\_\-resetTest}}
\index{LCBT_resetTest@{LCBT\_\-resetTest}!LCBT.c@{LCBT.c}}
\subsubsection[LCBT\_\-resetTest]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-reset\-Test (int {\em num\-Req\-Per})}}
\label{LCBT_8c_a5}


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_8c_a2}{
\index{LCBT.c@{LCBT.c}!LCBT_setOption@{LCBT\_\-setOption}}
\index{LCBT_setOption@{LCBT\_\-setOption}!LCBT.c@{LCBT.c}}
\subsubsection[LCBT\_\-setOption]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-set\-Option (unsigned int {\em mask})}}
\label{LCBT_8c_a2}


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_8c_a3}{
\index{LCBT.c@{LCBT.c}!LCBT_stats@{LCBT\_\-stats}}
\index{LCBT_stats@{LCBT\_\-stats}!LCBT.c@{LCBT.c}}
\subsubsection[LCBT\_\-stats]{\setlength{\rightskip}{0pt plus 5cm}void LCBT\_\-stats (int {\em mask})}}
\label{LCBT_8c_a3}


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}
