\hypertarget{gGEMSt_8c}{
\section{g\-GEMSt.c File Reference}
\label{gGEMSt_8c}\index{gGEMSt.c@{gGEMSt.c}}
}
Implements command/response for the GEM Statistics register block.  


{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}GDAB/g\-GEMSt.h\char`\"{}}\par
{\tt \#include \char`\"{}GDAB/g\-DAB.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-GEM\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-DAB\_\-p.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gGEMSt_8c_a0}{g\-GEMStcmd} (\hyperlink{struct__gdab}{gdab\-Handle} gdab, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the GEM Statistics register block. \item\end{CompactList}\item 
int \hyperlink{gGEMSt_8c_a1}{g\-GEMStread} (\hyperlink{struct__gdab}{gdab\-Handle} gdab, unsigned short reg, \hyperlink{struct__gemStats}{gem\-Stats\-Handle} val)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implements command/response for the GEM Statistics register block. 

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


\subsection{Function Documentation}
\hypertarget{gGEMSt_8c_a0}{
\index{gGEMSt.c@{g\-GEMSt.c}!gGEMStcmd@{gGEMStcmd}}
\index{gGEMStcmd@{gGEMStcmd}!gGEMSt.c@{g\-GEMSt.c}}
\subsubsection[gGEMStcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-GEMStcmd (\hyperlink{struct__gdab}{gdab\-Handle} {\em gdab}, unsigned short {\em opcode})}}
\label{gGEMSt_8c_a0}


Sends a dataless command to the GEM Statistics register block. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gdab}]gdab\-Handle containing the COM I/O (gnat) handle \item[{\em opcode}]opcode of command to send \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Sends the dataless command specified by {\em opcode\/} to the GEM. \hypertarget{gGEMSt_8c_a1}{
\index{gGEMSt.c@{g\-GEMSt.c}!gGEMStread@{gGEMStread}}
\index{gGEMStread@{gGEMStread}!gGEMSt.c@{g\-GEMSt.c}}
\subsubsection[gGEMStread]{\setlength{\rightskip}{0pt plus 5cm}int g\-GEMStread (\hyperlink{struct__gdab}{gdab\-Handle} {\em gdab}, unsigned short {\em reg}, \hyperlink{struct__gemStats}{gem\-Stats\-Handle} {\em val})}}
\label{gGEMSt_8c_a1}


Reads a register returing value in {\em val\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gdab}]gdab\-Handle containing the COM I/O (gnat) handle \item[{\em reg}]register to read \item[{\em val}]pointer to storage to hold the response of the read command \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Reads the {\em reg\/} from the GEM Statistics register block. {\em val\/} is filled on return.

The following error codes are returned when LATp errors occur:

\begin{itemize}
\item GERR\_\-LATP\_\-HEADER\_\-PARITY \item GERR\_\-LATP\_\-CELL\_\-PARITY \item GERR\_\-LATP\_\-TRUNCATE \end{itemize}
