\hypertarget{gtrg_8h}{
\section{gtrg.h File Reference}
\label{gtrg_8h}\index{gtrg.h@{gtrg.h}}
}
Defines public structs and methods for trigger messaging.  




This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=37pt]{gtrg_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__BFtrgMsg}{\_\-BFtrg\-Msg}
\begin{CompactList}\small\item\em Bit field definitions for a 32-bit trigger message. \item\end{CompactList}\item 
union \hyperlink{union__trgMsg}{\_\-trg\-Msg}
\begin{CompactList}\small\item\em union for 32-bit trigger message \item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{gtrg_8h_a0}{
\#define \hyperlink{gtrg_8h_a0}{TRG\_\-DISABLE\_\-THROTTLE}\ ((unsigned short)(1$<$$<$5))}
\label{gtrg_8h_a0}

\begin{CompactList}\small\item\em mask enable bit of the trg\-Mask\-Cfg register for the trigger throttle \item\end{CompactList}\item 
\hypertarget{gtrg_8h_a1}{
\#define \hyperlink{gtrg_8h_a1}{TRG\_\-DISABLE\_\-3\_\-IN\_\-A\_\-ROW}\ ((unsigned short)(1$<$$<$4))}
\label{gtrg_8h_a1}

\begin{CompactList}\small\item\em mask enable bit of the trg\-Mask\-Cfg register for the 3-in-a-row trigger source. \item\end{CompactList}\item 
\hypertarget{gtrg_8h_a2}{
\#define \hyperlink{gtrg_8h_a2}{TRG\_\-DISABLE\_\-CAL\_\-HIGH}\ ((unsigned short)(1$<$$<$3))}
\label{gtrg_8h_a2}

\begin{CompactList}\small\item\em mask enable bit of the trg\-Mask\-Cfg register for the CAL\_\-high trigger source. \item\end{CompactList}\item 
\hypertarget{gtrg_8h_a3}{
\#define \hyperlink{gtrg_8h_a3}{TRG\_\-DISABLE\_\-CAL\_\-LOW}\ ((unsigned short)(1$<$$<$2))}
\label{gtrg_8h_a3}

\begin{CompactList}\small\item\em mask enable bit of the trg\-Mask\-Cfg register for the CAL\_\-low trigger source. \item\end{CompactList}\item 
\hypertarget{gtrg_8h_a4}{
\#define \hyperlink{gtrg_8h_a4}{TRG\_\-DISABLE\_\-EXT\_\-TRG}\ ((unsigned short)(1$<$$<$1))}
\label{gtrg_8h_a4}

\begin{CompactList}\small\item\em mask enable bit of the trg\-Mask\-Cfg register for the external trigger source. \item\end{CompactList}\item 
\hypertarget{gtrg_8h_a5}{
\#define \hyperlink{gtrg_8h_a5}{TRG\_\-DISABLE\_\-INT\_\-TRG}\ ((unsigned short)1)}
\label{gtrg_8h_a5}

\begin{CompactList}\small\item\em mask enable bit of the trg\-Mask\-Cfg register for the internal trigger source. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{gtrg_8h_a6}{
typedef \hyperlink{union__trgMsg}{\_\-trg\-Msg} \hyperlink{gtrg_8h_a6}{trg\-Msg}}
\label{gtrg_8h_a6}

\begin{CompactList}\small\item\em typedef for union \hyperlink{union__trgMsg}{\_\-trg\-Msg} \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gtrg_8h_a7}{g\-Get\-Trg\-Mask\-Cfg\-Reg} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int $\ast$val)
\begin{CompactList}\small\item\em returns the contents of the trigger mask / config register \item\end{CompactList}\item 
int \hyperlink{gtrg_8h_a8}{g\-Set\-Trg\-Mask\-Cfg\-Reg} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int val)
\begin{CompactList}\small\item\em sets the contents of the trigger mask / config register \item\end{CompactList}\item 
int \hyperlink{gtrg_8h_a9}{g\-Get\-Trg\-Opt\-Reg} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int $\ast$val)
\begin{CompactList}\small\item\em returns the contents of the trigger options register \item\end{CompactList}\item 
int \hyperlink{gtrg_8h_a10}{g\-Set\-Trg\-Opt\-Reg} (\hyperlink{struct__gnat}{gnat\-Handle} gh, unsigned int val)
\begin{CompactList}\small\item\em sets the contents of the trigger options register \item\end{CompactList}\item 
int \hyperlink{gtrg_8h_a11}{g\-Set\-Trg\-Self\-Trg} (\hyperlink{struct__gnat}{gnat\-Handle} gh)
\begin{CompactList}\small\item\em Creates a self trigger signal. \item\end{CompactList}\item 
int \hyperlink{gtrg_8h_a12}{g\-Read\-Trg\-Msg} (\hyperlink{struct__gnat}{gnat\-Handle} gh, \hyperlink{struct__gResponse}{g\-Response} $\ast$rsp)
\begin{CompactList}\small\item\em Attempts to read a trigger message from record FIFO. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Defines public structs and methods for trigger messaging. 

\begin{Desc}
\item[Author:]Curt Brune -- \href{mailto:curt@slac.stanford.edu}{\tt curt@slac.stanford.edu}\end{Desc}


\subsection{Function Documentation}
\hypertarget{gtrg_8h_a7}{
\index{gtrg.h@{gtrg.h}!gGetTrgMaskCfgReg@{gGetTrgMaskCfgReg}}
\index{gGetTrgMaskCfgReg@{gGetTrgMaskCfgReg}!gtrg.h@{gtrg.h}}
\subsubsection[gGetTrgMaskCfgReg]{\setlength{\rightskip}{0pt plus 5cm}int g\-Get\-Trg\-Mask\-Cfg\-Reg (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int $\ast$ {\em val})}}
\label{gtrg_8h_a7}


returns the contents of the trigger mask / config register 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]pointer to storage to hold register on return \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gtrg_8c_a1}{g\-Set\-Trg\-Mask\-Cfg\-Reg()} \end{Desc}
\hypertarget{gtrg_8h_a9}{
\index{gtrg.h@{gtrg.h}!gGetTrgOptReg@{gGetTrgOptReg}}
\index{gGetTrgOptReg@{gGetTrgOptReg}!gtrg.h@{gtrg.h}}
\subsubsection[gGetTrgOptReg]{\setlength{\rightskip}{0pt plus 5cm}int g\-Get\-Trg\-Opt\-Reg (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int $\ast$ {\em val})}}
\label{gtrg_8h_a9}


returns the contents of the trigger options register 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]pointer to storage to hold register on return \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gtrg_8c_a3}{g\-Set\-Trg\-Opt\-Reg()} \end{Desc}
\hypertarget{gtrg_8h_a12}{
\index{gtrg.h@{gtrg.h}!gReadTrgMsg@{gReadTrgMsg}}
\index{gReadTrgMsg@{gReadTrgMsg}!gtrg.h@{gtrg.h}}
\subsubsection[gReadTrgMsg]{\setlength{\rightskip}{0pt plus 5cm}int g\-Read\-Trg\-Msg (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, \hyperlink{struct__gResponse}{g\-Response} $\ast$ {\em rsp})}}
\label{gtrg_8h_a12}


Attempts to read a trigger message from record FIFO. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em rsp}]pointer to response structure to hold the result \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}


The trigger message is 32 bits long and looks like this in the record FIFO (18 bits wide).

\small\begin{alltt}
        -----------------------------------
        1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
        7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
        -----------------------------------
Word 1  1 M M M M M M M M M M M M M M M M M
Word 2  D D M M M M M M M M M M M M M M Z Z
Word 3  D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z
Word 4  D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z
Word 5  D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z
Word 6  D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z
Word 7  D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z
Word 8  D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z
Word 9  D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z
Word 10 D D Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z Z\end{alltt}\normalsize 


\small\begin{alltt}  Legend:\end{alltt}\normalsize 


\small\begin{alltt}      1  --  Start Bit, first bit of trigger message
      M  --  Message bit, 31 in all
      D  --  Do not care, ignored
      Z  --  Zero
  \end{alltt}\normalsize 


I want to return the start bit plus the 31 message bits. 

Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=119pt]{gtrg_8h_a12_cgraph}
\end{center}
\end{figure}
\hypertarget{gtrg_8h_a8}{
\index{gtrg.h@{gtrg.h}!gSetTrgMaskCfgReg@{gSetTrgMaskCfgReg}}
\index{gSetTrgMaskCfgReg@{gSetTrgMaskCfgReg}!gtrg.h@{gtrg.h}}
\subsubsection[gSetTrgMaskCfgReg]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Trg\-Mask\-Cfg\-Reg (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em val})}}
\label{gtrg_8h_a8}


sets the contents of the trigger mask / config register 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]value to put in register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gtrg_8c_a0}{g\-Get\-Trg\-Mask\-Cfg\-Reg()} \end{Desc}
\hypertarget{gtrg_8h_a10}{
\index{gtrg.h@{gtrg.h}!gSetTrgOptReg@{gSetTrgOptReg}}
\index{gSetTrgOptReg@{gSetTrgOptReg}!gtrg.h@{gtrg.h}}
\subsubsection[gSetTrgOptReg]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Trg\-Opt\-Reg (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh}, unsigned int {\em val})}}
\label{gtrg_8h_a10}


sets the contents of the trigger options register 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \item[{\em val}]value to put in register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gtrg_8c_a2}{g\-Get\-Trg\-Opt\-Reg()} \end{Desc}
\hypertarget{gtrg_8h_a11}{
\index{gtrg.h@{gtrg.h}!gSetTrgSelfTrg@{gSetTrgSelfTrg}}
\index{gSetTrgSelfTrg@{gSetTrgSelfTrg}!gtrg.h@{gtrg.h}}
\subsubsection[gSetTrgSelfTrg]{\setlength{\rightskip}{0pt plus 5cm}int g\-Set\-Trg\-Self\-Trg (\hyperlink{struct__gnat}{gnat\-Handle} {\em gh})}}
\label{gtrg_8h_a11}


Creates a self trigger signal. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gh}]handle of device \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]OK on success\end{Desc}


Raises the self trigger signal -- the COMM board may ignore this signal if the internal trigger is disable (see g\-Set\-Trg\-Mask() ). 