\hypertarget{tpg_8c}{
\section{tpg.c File Reference}
\label{tpg_8c}\index{tpg.c@{tpg.c}}
}
Trigger Pattern Generator command-line user interface.  


{\tt \#include \char`\"{}TPG/TPG\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}tpg\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}GNAT/ginit.h\char`\"{}}\par
{\tt \#include \char`\"{}GNAT/gio.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-print\-Proc.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/PBS.h\char`\"{}}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$stddef.h$>$}\par
{\tt \#include $<$string.h$>$}\par


Include dependency graph for tpg.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=124pt]{tpg_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned \hyperlink{tpg_8c_a7}{TPGcom\-Present} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned board\-Id)
\begin{CompactList}\small\item\em Test for board presence. \item\end{CompactList}\item 
\hypertarget{tpg_8c_a8}{
unsigned {\bf TPGusing\-PTEM} (\hyperlink{struct__TPG}{TPG} $\ast$this)}
\label{tpg_8c_a8}

\item 
\hypertarget{tpg_8c_a9}{
unsigned {\bf TPGusing\-RTEM} (\hyperlink{struct__TPG}{TPG} $\ast$this)}
\label{tpg_8c_a9}

\item 
\hyperlink{struct__TPG}{TPG} $\ast$ \hyperlink{tpg_8c_a10}{TPGnew} (unsigned $\ast$comm\-Addr)
\begin{CompactList}\small\item\em Calls calloc to allocate memory for the struct and associated buffers then sets the buffer pointers to the correct offsets. \item\end{CompactList}\item 
void \hyperlink{tpg_8c_a11}{TPGclear} (\hyperlink{struct__TPG}{TPG} $\ast$this)
\begin{CompactList}\small\item\em Sets all the buffers to 0. \item\end{CompactList}\item 
void \hyperlink{tpg_8c_a12}{TPGclear\-Buf} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned buffer\-Id)
\begin{CompactList}\small\item\em Sets the buffer indicated by {\em buffer\-Id\/} to 0. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a13}{TPGset\-TEM} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned tem\_\-id, unsigned trg, unsigned start, unsigned pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em tem\_\-id\/} and {\em trg\/}. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a14}{TPGset\-VETO} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id, unsigned veto\_\-id, unsigned start, unsigned pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a15}{TPGset\-CNO} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id, unsigned start, unsigned pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a16}{TPGset\-TEMv} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned tem\_\-id, unsigned trg, unsigned start, unsigned $\ast$pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em tem\_\-id\/} and {\em trg\/}. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a17}{TPGset\-VETOv} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id, unsigned veto\_\-id, unsigned start, unsigned $\ast$pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a18}{TPGset\-CNOv} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id, unsigned start, unsigned $\ast$pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. \item\end{CompactList}\item 
\hypertarget{tpg_8c_a19}{
unsigned {\bf TPGdelay} (\hyperlink{struct__TPG}{TPG} $\ast$this, int com\-Board, int clk\-Delay)}
\label{tpg_8c_a19}

\item 
unsigned \hyperlink{tpg_8c_a20}{TPGload} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned char $\ast$clk\-Delay)
\begin{CompactList}\small\item\em Use Programmed I/O to fill the COMM board FIFOs. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a21}{TPGstart} (\hyperlink{struct__TPG}{TPG} $\ast$this)
\begin{CompactList}\small\item\em Start the playback. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a22}{TPGdump\-FREE} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id, unsigned start, unsigned len)
\begin{CompactList}\small\item\em Print out the bit patterns in the free board. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a23}{TPGdump\-CNO} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned start, unsigned len)
\begin{CompactList}\small\item\em Print out the bit patterns in the CNO buffer. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a24}{TPGdump\-TEM} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned start, unsigned len)
\begin{CompactList}\small\item\em Print out the bit patterns in the TEM buffer. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a25}{TPGdump} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned board\-Id, unsigned start, unsigned len)
\begin{CompactList}\small\item\em Print out the bit patterns in the requested board. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a26}{\_\-check\-Bounds} (unsigned start, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Checks that the requested addition to the buffer does not exceed the boundaries. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a27}{\_\-check\-TEM} (unsigned tem\_\-id, unsigned trg)
\begin{CompactList}\small\item\em Checks that the {\em tem\_\-id\/} and {\em trg\/} are valid. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a28}{\_\-check\-FREE} (unsigned free\_\-id, unsigned veto\_\-id)
\begin{CompactList}\small\item\em Checks that the {\em free\_\-id\/} and {\em veto\_\-id\/} are valid. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a29}{\_\-check\-CNO} (unsigned free\_\-id)
\begin{CompactList}\small\item\em Checks that the {\em free\_\-id\/} is valid. \item\end{CompactList}\item 
void \hyperlink{tpg_8c_a30}{\_\-set\-Bits} (unsigned $\ast$fifo, unsigned channel, unsigned start, unsigned pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into {\em channel\/} and in buffer indicated by {\em board\/}. \item\end{CompactList}\item 
void \hyperlink{tpg_8c_a31}{\_\-set\-Sticky} (unsigned $\ast$fifo, unsigned channel)
\begin{CompactList}\small\item\em Sets the last bit of {\em channel\/} in {\em fifo\/}. \item\end{CompactList}\item 
void \hyperlink{tpg_8c_a32}{\_\-clr\-Sticky} (unsigned $\ast$fifo, unsigned channel)
\begin{CompactList}\small\item\em Clears the last bit of {\em channel\/} in {\em fifo\/}. \item\end{CompactList}\item 
void \hyperlink{tpg_8c_a33}{\_\-set\-Bitsv} (unsigned $\ast$fifo, unsigned channel, unsigned start, unsigned $\ast$pattern, unsigned pat\_\-len, unsigned repetitions)
\begin{CompactList}\small\item\em Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into {\em channel\/} and in buffer indicated by {\em board\/}. \item\end{CompactList}\item 
int \hyperlink{tpg_8c_a34}{TPGmsg\-Init} (void)
\begin{CompactList}\small\item\em Starts a simple printf MSG processor. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a35}{TPGset\-TEMsticky} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned tem\_\-id, unsigned trg)
\begin{CompactList}\small\item\em Sets the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a36}{TPGclr\-TEMsticky} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned tem\_\-id, unsigned trg)
\begin{CompactList}\small\item\em Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a37}{TPGset\-VETOsticky} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id, unsigned veto\_\-id)
\begin{CompactList}\small\item\em Sets the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a38}{TPGclr\-VETOsticky} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id, unsigned veto\_\-id)
\begin{CompactList}\small\item\em Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a39}{TPGset\-CNOsticky} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id)
\begin{CompactList}\small\item\em Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8c_a40}{TPGclr\-CNOsticky} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned free\_\-id)
\begin{CompactList}\small\item\em Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. \item\end{CompactList}\item 
\hypertarget{tpg_8c_a41}{
void {\bf TPGcomm\-Setup\-Show} (\hyperlink{struct__TPG}{TPG} $\ast$this)}
\label{tpg_8c_a41}

\item 
\hypertarget{tpg_8c_a42}{
void {\bf TPGshow} (\hyperlink{struct__TPG}{TPG} $\ast$this, unsigned detail)}
\label{tpg_8c_a42}

\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
unsigned \hyperlink{tpg_8c_a0}{TPG\_\-BUSY} = 0
\item 
unsigned \hyperlink{tpg_8c_a1}{TPG\_\-TIAR} = 1
\item 
unsigned \hyperlink{tpg_8c_a2}{TPG\_\-CALHI} = 2
\item 
unsigned \hyperlink{tpg_8c_a3}{TPG\_\-CALLO} = 3
\item 
unsigned \hyperlink{tpg_8c_a4}{TPG\_\-N\_\-TRG} = 4
\item 
\hypertarget{tpg_8c_a5}{
unsigned {\bf TPG\_\-TEM\_\-BOARD} = -1}
\label{tpg_8c_a5}

\item 
unsigned \hyperlink{tpg_8c_a6}{TPG\_\-LASTWORD} = TPG\_\-BUFFER\_\-DEPTH - sizeof(unsigned)
\end{CompactItemize}


\subsection{Detailed Description}
Trigger Pattern Generator command-line user interface. 

\begin{Desc}
\item[Author:]James Swain -- \href{mailto:jswain@slac.stanford.edu}{\tt jswain@slac.stanford.edu} \end{Desc}


\subsection{Function Documentation}
\hypertarget{tpg_8c_a26}{
\index{tpg.c@{tpg.c}!_checkBounds@{\_\-checkBounds}}
\index{_checkBounds@{\_\-checkBounds}!tpg.c@{tpg.c}}
\subsubsection[\_\-checkBounds]{\setlength{\rightskip}{0pt plus 5cm}unsigned \_\-check\-Bounds (unsigned {\em start}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a26}


Checks that the requested addition to the buffer does not exceed the boundaries. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em start}]Bit that this pattern begins at \item[{\em pat\_\-len}]length of pattern \item[{\em repetitions}]Number of times to repeat the pattern in the buffer \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS when all is well \end{Desc}
\hypertarget{tpg_8c_a29}{
\index{tpg.c@{tpg.c}!_checkCNO@{\_\-checkCNO}}
\index{_checkCNO@{\_\-checkCNO}!tpg.c@{tpg.c}}
\subsubsection[\_\-checkCNO]{\setlength{\rightskip}{0pt plus 5cm}unsigned \_\-check\-CNO (unsigned {\em free\_\-id})}}
\label{tpg_8c_a29}


Checks that the {\em free\_\-id\/} is valid. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em free\_\-id}]ID of the FREE board \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS when all is well \end{Desc}
\hypertarget{tpg_8c_a28}{
\index{tpg.c@{tpg.c}!_checkFREE@{\_\-checkFREE}}
\index{_checkFREE@{\_\-checkFREE}!tpg.c@{tpg.c}}
\subsubsection[\_\-checkFREE]{\setlength{\rightskip}{0pt plus 5cm}unsigned \_\-check\-FREE (unsigned {\em free\_\-id}, unsigned {\em veto\_\-id})}}
\label{tpg_8c_a28}


Checks that the {\em free\_\-id\/} and {\em veto\_\-id\/} are valid. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em free\_\-id}]ID of the FREE board \item[{\em veto\_\-id}]ID of the VETO line \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS when all is well \end{Desc}
\hypertarget{tpg_8c_a27}{
\index{tpg.c@{tpg.c}!_checkTEM@{\_\-checkTEM}}
\index{_checkTEM@{\_\-checkTEM}!tpg.c@{tpg.c}}
\subsubsection[\_\-checkTEM]{\setlength{\rightskip}{0pt plus 5cm}unsigned \_\-check\-TEM (unsigned {\em tem\_\-id}, unsigned {\em trg})}}
\label{tpg_8c_a27}


Checks that the {\em tem\_\-id\/} and {\em trg\/} are valid. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tem\_\-id}]ID of the TEM \item[{\em trg}]Trg of the TEM \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS when all is well \end{Desc}
\hypertarget{tpg_8c_a32}{
\index{tpg.c@{tpg.c}!_clrSticky@{\_\-clrSticky}}
\index{_clrSticky@{\_\-clrSticky}!tpg.c@{tpg.c}}
\subsubsection[\_\-clrSticky]{\setlength{\rightskip}{0pt plus 5cm}void \_\-clr\-Sticky (unsigned $\ast$ {\em fifo}, unsigned {\em channel})}}
\label{tpg_8c_a32}


Clears the last bit of {\em channel\/} in {\em fifo\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fifo}]Array of unsigned representing the Playback FIFO of one COMM I/O board \item[{\em channel}]Channel this pattern is destined for \end{description}
\end{Desc}
\hypertarget{tpg_8c_a30}{
\index{tpg.c@{tpg.c}!_setBits@{\_\-setBits}}
\index{_setBits@{\_\-setBits}!tpg.c@{tpg.c}}
\subsubsection[\_\-setBits]{\setlength{\rightskip}{0pt plus 5cm}void \_\-set\-Bits (unsigned $\ast$ {\em fifo}, unsigned {\em channel}, unsigned {\em start}, unsigned {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a30}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into {\em channel\/} and in buffer indicated by {\em board\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fifo}]Array of unsigned representing the Playback FIFO of one COMM I/O board \item[{\em channel}]Channel this pattern is destined for \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... 32 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\hypertarget{tpg_8c_a33}{
\index{tpg.c@{tpg.c}!_setBitsv@{\_\-setBitsv}}
\index{_setBitsv@{\_\-setBitsv}!tpg.c@{tpg.c}}
\subsubsection[\_\-setBitsv]{\setlength{\rightskip}{0pt plus 5cm}void \_\-set\-Bitsv (unsigned $\ast$ {\em fifo}, unsigned {\em channel}, unsigned {\em start}, unsigned $\ast$ {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a33}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into {\em channel\/} and in buffer indicated by {\em board\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fifo}]Array of unsigned representing the Playback FIFO of one COMM I/O board \item[{\em channel}]Channel this pattern is destined for \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... (32$\ast$1024)-1 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\hypertarget{tpg_8c_a31}{
\index{tpg.c@{tpg.c}!_setSticky@{\_\-setSticky}}
\index{_setSticky@{\_\-setSticky}!tpg.c@{tpg.c}}
\subsubsection[\_\-setSticky]{\setlength{\rightskip}{0pt plus 5cm}void \_\-set\-Sticky (unsigned $\ast$ {\em fifo}, unsigned {\em channel})}}
\label{tpg_8c_a31}


Sets the last bit of {\em channel\/} in {\em fifo\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fifo}]Array of unsigned representing the Playback FIFO of one COMM I/O board \item[{\em channel}]Channel this pattern is destined for \end{description}
\end{Desc}
\hypertarget{tpg_8c_a11}{
\index{tpg.c@{tpg.c}!TPGclear@{TPGclear}}
\index{TPGclear@{TPGclear}!tpg.c@{tpg.c}}
\subsubsection[TPGclear]{\setlength{\rightskip}{0pt plus 5cm}void TPGclear (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this})}}
\label{tpg_8c_a11}


Sets all the buffers to 0. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure to clear \end{description}
\end{Desc}
\hypertarget{tpg_8c_a12}{
\index{tpg.c@{tpg.c}!TPGclearBuf@{TPGclearBuf}}
\index{TPGclearBuf@{TPGclearBuf}!tpg.c@{tpg.c}}
\subsubsection[TPGclearBuf]{\setlength{\rightskip}{0pt plus 5cm}void TPGclear\-Buf (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em buffer\-Id})}}
\label{tpg_8c_a12}


Sets the buffer indicated by {\em buffer\-Id\/} to 0. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure containing buffer to clear \item[{\em buffer\-Id}]ID of the buffer to clear \end{description}
\end{Desc}
\hypertarget{tpg_8c_a40}{
\index{tpg.c@{tpg.c}!TPGclrCNOsticky@{TPGclrCNOsticky}}
\index{TPGclrCNOsticky@{TPGclrCNOsticky}!tpg.c@{tpg.c}}
\subsubsection[TPGclrCNOsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGclr\-CNOsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id})}}
\label{tpg_8c_a40}


Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=131pt]{tpg_8c_a40_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a36}{
\index{tpg.c@{tpg.c}!TPGclrTEMsticky@{TPGclrTEMsticky}}
\index{TPGclrTEMsticky@{TPGclrTEMsticky}!tpg.c@{tpg.c}}
\subsubsection[TPGclrTEMsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGclr\-TEMsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em tem\_\-id}, unsigned {\em trg})}}
\label{tpg_8c_a36}


Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em tem\_\-id}]TEM being targeted (gives channel range), 0 ... 3 \item[{\em trg}]TEM trg being targeted, (gives channel number), 0 ... 3 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=130pt]{tpg_8c_a36_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a38}{
\index{tpg.c@{tpg.c}!TPGclrVETOsticky@{TPGclrVETOsticky}}
\index{TPGclrVETOsticky@{TPGclrVETOsticky}!tpg.c@{tpg.c}}
\subsubsection[TPGclrVETOsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGclr\-VETOsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id}, unsigned {\em veto\_\-id})}}
\label{tpg_8c_a38}


Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \item[{\em veto\_\-id}]VETO bit being targeted, (gives channel number), 0 ... 17 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=136pt]{tpg_8c_a38_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a7}{
\index{tpg.c@{tpg.c}!TPGcomPresent@{TPGcomPresent}}
\index{TPGcomPresent@{TPGcomPresent}!tpg.c@{tpg.c}}
\subsubsection[TPGcomPresent]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGcom\-Present (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em board\-Id})}}
\label{tpg_8c_a7}


Test for board presence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG struct to use to configure COMM I/O boards \item[{\em board\-Id}]0 ... N\_\-TPG\_\-BOARDS \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]O if board is not present, 1 if board is present. \end{Desc}
\hypertarget{tpg_8c_a25}{
\index{tpg.c@{tpg.c}!TPGdump@{TPGdump}}
\index{TPGdump@{TPGdump}!tpg.c@{tpg.c}}
\subsubsection[TPGdump]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGdump (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em board\-Id}, unsigned {\em start}, unsigned {\em len})}}
\label{tpg_8c_a25}


Print out the bit patterns in the requested board. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG struct to use to configure COMM I/O boards \item[{\em board\-Id}]0 ... N\_\-TPG\_\-BOARDS \item[{\em start}]Line of the buffer to start dump \item[{\em len}]Number of lines to dump \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}
\hypertarget{tpg_8c_a23}{
\index{tpg.c@{tpg.c}!TPGdumpCNO@{TPGdumpCNO}}
\index{TPGdumpCNO@{TPGdumpCNO}!tpg.c@{tpg.c}}
\subsubsection[TPGdumpCNO]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGdump\-CNO (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em start}, unsigned {\em len})}}
\label{tpg_8c_a23}


Print out the bit patterns in the CNO buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG struct to use to configure COMM I/O boards \item[{\em start}]Line of the buffer to start dump \item[{\em len}]Number of lines to dump \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=120pt]{tpg_8c_a23_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a22}{
\index{tpg.c@{tpg.c}!TPGdumpFREE@{TPGdumpFREE}}
\index{TPGdumpFREE@{TPGdumpFREE}!tpg.c@{tpg.c}}
\subsubsection[TPGdumpFREE]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGdump\-FREE (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id}, unsigned {\em start}, unsigned {\em len})}}
\label{tpg_8c_a22}


Print out the bit patterns in the free board. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG struct to use to configure COMM I/O boards \item[{\em free\_\-id}]FREE ID \item[{\em start}]Line of the buffer to start dump \item[{\em len}]Number of lines to dump \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=122pt]{tpg_8c_a22_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a24}{
\index{tpg.c@{tpg.c}!TPGdumpTEM@{TPGdumpTEM}}
\index{TPGdumpTEM@{TPGdumpTEM}!tpg.c@{tpg.c}}
\subsubsection[TPGdumpTEM]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGdump\-TEM (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em start}, unsigned {\em len})}}
\label{tpg_8c_a24}


Print out the bit patterns in the TEM buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG struct to use to configure COMM I/O boards \item[{\em start}]Line of the buffer to start dump \item[{\em len}]Number of lines to dump \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=120pt]{tpg_8c_a24_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a20}{
\index{tpg.c@{tpg.c}!TPGload@{TPGload}}
\index{TPGload@{TPGload}!tpg.c@{tpg.c}}
\subsubsection[TPGload]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGload (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned char $\ast$ {\em clk\-Delay})}}
\label{tpg_8c_a20}


Use Programmed I/O to fill the COMM board FIFOs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG struct to use to configure COMM I/O boards \item[{\em clk\-Delay}]Array of (6 bit) clock delays (TPG\_\-N\_\-BOARDS long) for the COMM I/O boards, to remove clock skew. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=116pt]{tpg_8c_a20_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a34}{
\index{tpg.c@{tpg.c}!TPGmsgInit@{TPGmsgInit}}
\index{TPGmsgInit@{TPGmsgInit}!tpg.c@{tpg.c}}
\subsubsection[TPGmsgInit]{\setlength{\rightskip}{0pt plus 5cm}int TPGmsg\-Init (void)}}
\label{tpg_8c_a34}


Starts a simple printf MSG processor. 

\begin{Desc}
\item[Returns:]0 on success, -1 on failure \end{Desc}
\hypertarget{tpg_8c_a10}{
\index{tpg.c@{tpg.c}!TPGnew@{TPGnew}}
\index{TPGnew@{TPGnew}!tpg.c@{tpg.c}}
\subsubsection[TPGnew]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__TPG}{TPG}$\ast$ TPGnew (unsigned $\ast$ {\em comm\-Addr})}}
\label{tpg_8c_a10}


Calls calloc to allocate memory for the struct and associated buffers then sets the buffer pointers to the correct offsets. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em comm\-Addr}]Array of addresses (TPG\_\-N\_\-BOARDS long) of the COMM I/O boards \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Ptr to a new TPG structure containing ptrs to buffers and gnat\-Handles \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=116pt]{tpg_8c_a10_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a15}{
\index{tpg.c@{tpg.c}!TPGsetCNO@{TPGsetCNO}}
\index{TPGsetCNO@{TPGsetCNO}!tpg.c@{tpg.c}}
\subsubsection[TPGsetCNO]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-CNO (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id}, unsigned {\em start}, unsigned {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a15}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... 32 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=122pt]{tpg_8c_a15_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a39}{
\index{tpg.c@{tpg.c}!TPGsetCNOsticky@{TPGsetCNOsticky}}
\index{TPGsetCNOsticky@{TPGsetCNOsticky}!tpg.c@{tpg.c}}
\subsubsection[TPGsetCNOsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-CNOsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id})}}
\label{tpg_8c_a39}


Clears the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=131pt]{tpg_8c_a39_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a18}{
\index{tpg.c@{tpg.c}!TPGsetCNOv@{TPGsetCNOv}}
\index{TPGsetCNOv@{TPGsetCNOv}!tpg.c@{tpg.c}}
\subsubsection[TPGsetCNOv]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-CNOv (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id}, unsigned {\em start}, unsigned $\ast$ {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a18}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... (32$\ast$1024) - 1 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=125pt]{tpg_8c_a18_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a13}{
\index{tpg.c@{tpg.c}!TPGsetTEM@{TPGsetTEM}}
\index{TPGsetTEM@{TPGsetTEM}!tpg.c@{tpg.c}}
\subsubsection[TPGsetTEM]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-TEM (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em tem\_\-id}, unsigned {\em trg}, unsigned {\em start}, unsigned {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a13}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em tem\_\-id\/} and {\em trg\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em tem\_\-id}]TEM being targeted (gives channel range), 0 ... 3 \item[{\em trg}]TEM trg being targeted, (gives channel number), 0 ... 3 \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... 32 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=122pt]{tpg_8c_a13_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a35}{
\index{tpg.c@{tpg.c}!TPGsetTEMsticky@{TPGsetTEMsticky}}
\index{TPGsetTEMsticky@{TPGsetTEMsticky}!tpg.c@{tpg.c}}
\subsubsection[TPGsetTEMsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-TEMsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em tem\_\-id}, unsigned {\em trg})}}
\label{tpg_8c_a35}


Sets the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em tem\_\-id}]TEM being targeted (gives channel range), 0 ... 3 \item[{\em trg}]TEM trg being targeted, (gives channel number), 0 ... 3 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=131pt]{tpg_8c_a35_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a16}{
\index{tpg.c@{tpg.c}!TPGsetTEMv@{TPGsetTEMv}}
\index{TPGsetTEMv@{TPGsetTEMv}!tpg.c@{tpg.c}}
\subsubsection[TPGsetTEMv]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-TEMv (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em tem\_\-id}, unsigned {\em trg}, unsigned {\em start}, unsigned $\ast$ {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a16}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em tem\_\-id\/} and {\em trg\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em tem\_\-id}]TEM being targeted (gives channel range), 0 ... 3 \item[{\em trg}]TEM trg being targeted, (gives channel number), 0 ... 3 \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... (32$\ast$1024) - 1 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=125pt]{tpg_8c_a16_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a14}{
\index{tpg.c@{tpg.c}!TPGsetVETO@{TPGsetVETO}}
\index{TPGsetVETO@{TPGsetVETO}!tpg.c@{tpg.c}}
\subsubsection[TPGsetVETO]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-VETO (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id}, unsigned {\em veto\_\-id}, unsigned {\em start}, unsigned {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a14}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \item[{\em veto\_\-id}]VETO bit being targeted, (gives channel number), 0 ... 17 \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... 32 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=126pt]{tpg_8c_a14_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a37}{
\index{tpg.c@{tpg.c}!TPGsetVETOsticky@{TPGsetVETOsticky}}
\index{TPGsetVETOsticky@{TPGsetVETOsticky}!tpg.c@{tpg.c}}
\subsubsection[TPGsetVETOsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-VETOsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id}, unsigned {\em veto\_\-id})}}
\label{tpg_8c_a37}


Sets the last bit of the buffer, which will \char`\"{}stick\char`\"{} on the COMM I/O outputs. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \item[{\em veto\_\-id}]VETO bit being targeted, (gives channel number), 0 ... 17 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=136pt]{tpg_8c_a37_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a17}{
\index{tpg.c@{tpg.c}!TPGsetVETOv@{TPGsetVETOv}}
\index{TPGsetVETOv@{TPGsetVETOv}!tpg.c@{tpg.c}}
\subsubsection[TPGsetVETOv]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-VETOv (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id}, unsigned {\em veto\_\-id}, unsigned {\em start}, unsigned $\ast$ {\em pattern}, unsigned {\em pat\_\-len}, unsigned {\em repetitions})}}
\label{tpg_8c_a17}


Places the {\em pat\_\-len\/} LSBs of {\em pattern\/} into the channel and buffer indicated by {\em free\_\-id\/} and {\em veto\_\-id\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG structure being modified \item[{\em free\_\-id}]FREE being targeted (gives tgt board), 0 ... 3 \item[{\em veto\_\-id}]VETO bit being targeted, (gives channel number), 0 ... 17 \item[{\em start}]Start bit for the pattern, 0 ... (32$\ast$1024)-1 \item[{\em pattern}]Up to 32 bit pattern to use (LSB first) \item[{\em pat\_\-len}]Pattern length 1 ... (32$\ast$1024) - 1 \item[{\em repetitions}]Number of times to repeat the same pattern on this channel, use 0 to request as many reps as will fit in remaining FIFO depth \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=129pt]{tpg_8c_a17_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8c_a21}{
\index{tpg.c@{tpg.c}!TPGstart@{TPGstart}}
\index{TPGstart@{TPGstart}!tpg.c@{tpg.c}}
\subsubsection[TPGstart]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGstart (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this})}}
\label{tpg_8c_a21}


Start the playback. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em this}]TPG struct to use to configure COMM I/O boards \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]One of TPG\_\-msgs, TPG\_\-SUCCESS if all goes well. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=116pt]{tpg_8c_a21_cgraph}
\end{center}
\end{figure}


\subsection{Variable Documentation}
\hypertarget{tpg_8c_a0}{
\index{tpg.c@{tpg.c}!TPG_BUSY@{TPG\_\-BUSY}}
\index{TPG_BUSY@{TPG\_\-BUSY}!tpg.c@{tpg.c}}
\subsubsection[TPG\_\-BUSY]{\setlength{\rightskip}{0pt plus 5cm}unsigned \hyperlink{tpg_8c_a0}{TPG\_\-BUSY} = 0}}
\label{tpg_8c_a0}


Channel number for the TEM BUSY signal \hypertarget{tpg_8c_a2}{
\index{tpg.c@{tpg.c}!TPG_CALHI@{TPG\_\-CALHI}}
\index{TPG_CALHI@{TPG\_\-CALHI}!tpg.c@{tpg.c}}
\subsubsection[TPG\_\-CALHI]{\setlength{\rightskip}{0pt plus 5cm}unsigned \hyperlink{tpg_8c_a2}{TPG\_\-CALHI} = 2}}
\label{tpg_8c_a2}


Channel number for the TEM CAL HE signal \hypertarget{tpg_8c_a3}{
\index{tpg.c@{tpg.c}!TPG_CALLO@{TPG\_\-CALLO}}
\index{TPG_CALLO@{TPG\_\-CALLO}!tpg.c@{tpg.c}}
\subsubsection[TPG\_\-CALLO]{\setlength{\rightskip}{0pt plus 5cm}unsigned \hyperlink{tpg_8c_a3}{TPG\_\-CALLO} = 3}}
\label{tpg_8c_a3}


Channel number for the TEM CAL LE signal \hypertarget{tpg_8c_a6}{
\index{tpg.c@{tpg.c}!TPG_LASTWORD@{TPG\_\-LASTWORD}}
\index{TPG_LASTWORD@{TPG\_\-LASTWORD}!tpg.c@{tpg.c}}
\subsubsection[TPG\_\-LASTWORD]{\setlength{\rightskip}{0pt plus 5cm}unsigned \hyperlink{tpg_8c_a6}{TPG\_\-LASTWORD} = TPG\_\-BUFFER\_\-DEPTH - sizeof(unsigned)}}
\label{tpg_8c_a6}


first bit of last word of a pattern \hypertarget{tpg_8c_a4}{
\index{tpg.c@{tpg.c}!TPG_N_TRG@{TPG\_\-N\_\-TRG}}
\index{TPG_N_TRG@{TPG\_\-N\_\-TRG}!tpg.c@{tpg.c}}
\subsubsection[TPG\_\-N\_\-TRG]{\setlength{\rightskip}{0pt plus 5cm}unsigned \hyperlink{tpg_8c_a4}{TPG\_\-N\_\-TRG} = 4}}
\label{tpg_8c_a4}


Total number of TEM triggers \hypertarget{tpg_8c_a1}{
\index{tpg.c@{tpg.c}!TPG_TIAR@{TPG\_\-TIAR}}
\index{TPG_TIAR@{TPG\_\-TIAR}!tpg.c@{tpg.c}}
\subsubsection[TPG\_\-TIAR]{\setlength{\rightskip}{0pt plus 5cm}unsigned \hyperlink{tpg_8c_a1}{TPG\_\-TIAR} = 1}}
\label{tpg_8c_a1}


Channel number for the TEM Three-in-a-row signal 