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




This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=41pt]{tpg_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{tpg_8h_a0}{
typedef \hyperlink{struct__TPG}{\_\-TPG} \hyperlink{tpg_8h_a0}{TPG}}
\label{tpg_8h_a0}

\begin{CompactList}\small\item\em typedef for the TPG structure containing pattern buffers and gnat\-Handles for the COMM boards \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{struct__TPG}{TPG} $\ast$ \hyperlink{tpg_8h_a7}{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_8h_a8}{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_8h_a9}{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_8h_a10}{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_8h_a11}{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_8h_a12}{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_8h_a13}{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_8h_a14}{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_8h_a15}{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 
unsigned \hyperlink{tpg_8h_a16}{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_8h_a17}{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_8h_a18}{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_8h_a19}{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_8h_a20}{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_8h_a21}{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 
unsigned \hyperlink{tpg_8h_a22}{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_8h_a23}{TPGstart} (\hyperlink{struct__TPG}{TPG} $\ast$this)
\begin{CompactList}\small\item\em Start the playback. \item\end{CompactList}\item 
unsigned \hyperlink{tpg_8h_a24}{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_8h_a25}{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_8h_a26}{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_8h_a27}{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 
int \hyperlink{tpg_8h_a28}{TPGmsg\-Init} (void)
\begin{CompactList}\small\item\em Starts a simple printf MSG processor. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
unsigned \hyperlink{tpg_8h_a1}{TPG\_\-BUSY}
\item 
unsigned \hyperlink{tpg_8h_a2}{TPG\_\-TIAR}
\item 
unsigned \hyperlink{tpg_8h_a3}{TPG\_\-CALHI}
\item 
unsigned \hyperlink{tpg_8h_a4}{TPG\_\-CALLO}
\item 
unsigned \hyperlink{tpg_8h_a5}{TPG\_\-N\_\-TRG}
\item 
unsigned \hyperlink{tpg_8h_a6}{TPG\_\-LASTWORD}
\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_8h_a8}{
\index{tpg.h@{tpg.h}!TPGclear@{TPGclear}}
\index{TPGclear@{TPGclear}!tpg.h@{tpg.h}}
\subsubsection[TPGclear]{\setlength{\rightskip}{0pt plus 5cm}void TPGclear (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this})}}
\label{tpg_8h_a8}


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_8h_a9}{
\index{tpg.h@{tpg.h}!TPGclearBuf@{TPGclearBuf}}
\index{TPGclearBuf@{TPGclearBuf}!tpg.h@{tpg.h}}
\subsubsection[TPGclearBuf]{\setlength{\rightskip}{0pt plus 5cm}void TPGclear\-Buf (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em buffer\-Id})}}
\label{tpg_8h_a9}


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_8h_a21}{
\index{tpg.h@{tpg.h}!TPGclrCNOsticky@{TPGclrCNOsticky}}
\index{TPGclrCNOsticky@{TPGclrCNOsticky}!tpg.h@{tpg.h}}
\subsubsection[TPGclrCNOsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGclr\-CNOsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id})}}
\label{tpg_8h_a21}


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_8h_a21_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a19}{
\index{tpg.h@{tpg.h}!TPGclrTEMsticky@{TPGclrTEMsticky}}
\index{TPGclrTEMsticky@{TPGclrTEMsticky}!tpg.h@{tpg.h}}
\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_8h_a19}


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_8h_a19_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a20}{
\index{tpg.h@{tpg.h}!TPGclrVETOsticky@{TPGclrVETOsticky}}
\index{TPGclrVETOsticky@{TPGclrVETOsticky}!tpg.h@{tpg.h}}
\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_8h_a20}


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_8h_a20_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a27}{
\index{tpg.h@{tpg.h}!TPGdump@{TPGdump}}
\index{TPGdump@{TPGdump}!tpg.h@{tpg.h}}
\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_8h_a27}


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_8h_a25}{
\index{tpg.h@{tpg.h}!TPGdumpCNO@{TPGdumpCNO}}
\index{TPGdumpCNO@{TPGdumpCNO}!tpg.h@{tpg.h}}
\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_8h_a25}


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_8h_a25_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a24}{
\index{tpg.h@{tpg.h}!TPGdumpFREE@{TPGdumpFREE}}
\index{TPGdumpFREE@{TPGdumpFREE}!tpg.h@{tpg.h}}
\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_8h_a24}


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_8h_a24_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a26}{
\index{tpg.h@{tpg.h}!TPGdumpTEM@{TPGdumpTEM}}
\index{TPGdumpTEM@{TPGdumpTEM}!tpg.h@{tpg.h}}
\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_8h_a26}


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_8h_a26_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a22}{
\index{tpg.h@{tpg.h}!TPGload@{TPGload}}
\index{TPGload@{TPGload}!tpg.h@{tpg.h}}
\subsubsection[TPGload]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGload (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned char $\ast$ {\em clk\-Delay})}}
\label{tpg_8h_a22}


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_8h_a22_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a28}{
\index{tpg.h@{tpg.h}!TPGmsgInit@{TPGmsgInit}}
\index{TPGmsgInit@{TPGmsgInit}!tpg.h@{tpg.h}}
\subsubsection[TPGmsgInit]{\setlength{\rightskip}{0pt plus 5cm}int TPGmsg\-Init (void)}}
\label{tpg_8h_a28}


Starts a simple printf MSG processor. 

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


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_8h_a7_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a12}{
\index{tpg.h@{tpg.h}!TPGsetCNO@{TPGsetCNO}}
\index{TPGsetCNO@{TPGsetCNO}!tpg.h@{tpg.h}}
\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_8h_a12}


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_8h_a12_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a18}{
\index{tpg.h@{tpg.h}!TPGsetCNOsticky@{TPGsetCNOsticky}}
\index{TPGsetCNOsticky@{TPGsetCNOsticky}!tpg.h@{tpg.h}}
\subsubsection[TPGsetCNOsticky]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGset\-CNOsticky (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this}, unsigned {\em free\_\-id})}}
\label{tpg_8h_a18}


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_8h_a18_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a15}{
\index{tpg.h@{tpg.h}!TPGsetCNOv@{TPGsetCNOv}}
\index{TPGsetCNOv@{TPGsetCNOv}!tpg.h@{tpg.h}}
\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_8h_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$\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_8h_a15_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a10}{
\index{tpg.h@{tpg.h}!TPGsetTEM@{TPGsetTEM}}
\index{TPGsetTEM@{TPGsetTEM}!tpg.h@{tpg.h}}
\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_8h_a10}


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_8h_a10_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a16}{
\index{tpg.h@{tpg.h}!TPGsetTEMsticky@{TPGsetTEMsticky}}
\index{TPGsetTEMsticky@{TPGsetTEMsticky}!tpg.h@{tpg.h}}
\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_8h_a16}


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_8h_a16_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a13}{
\index{tpg.h@{tpg.h}!TPGsetTEMv@{TPGsetTEMv}}
\index{TPGsetTEMv@{TPGsetTEMv}!tpg.h@{tpg.h}}
\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_8h_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$\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_8h_a13_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a11}{
\index{tpg.h@{tpg.h}!TPGsetVETO@{TPGsetVETO}}
\index{TPGsetVETO@{TPGsetVETO}!tpg.h@{tpg.h}}
\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_8h_a11}


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_8h_a11_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a17}{
\index{tpg.h@{tpg.h}!TPGsetVETOsticky@{TPGsetVETOsticky}}
\index{TPGsetVETOsticky@{TPGsetVETOsticky}!tpg.h@{tpg.h}}
\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_8h_a17}


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_8h_a17_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a14}{
\index{tpg.h@{tpg.h}!TPGsetVETOv@{TPGsetVETOv}}
\index{TPGsetVETOv@{TPGsetVETOv}!tpg.h@{tpg.h}}
\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_8h_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$\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_8h_a14_cgraph}
\end{center}
\end{figure}
\hypertarget{tpg_8h_a23}{
\index{tpg.h@{tpg.h}!TPGstart@{TPGstart}}
\index{TPGstart@{TPGstart}!tpg.h@{tpg.h}}
\subsubsection[TPGstart]{\setlength{\rightskip}{0pt plus 5cm}unsigned TPGstart (\hyperlink{struct__TPG}{TPG} $\ast$ {\em this})}}
\label{tpg_8h_a23}


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_8h_a23_cgraph}
\end{center}
\end{figure}


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


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


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


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


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


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


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