\hypertarget{gGARC_8c}{
\section{g\-GARC.c File Reference}
\label{gGARC_8c}\index{gGARC.c@{gGARC.c}}
}
Implements command/response for the GARC.  


{\tt \#include \char`\"{}ga\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-AEM\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}g\-ACD\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}GAEM/g\-GARC.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gGARC_8c_a0}{g\-GARCcmd} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short garc\-Addr, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the destination. \item\end{CompactList}\item 
int \hyperlink{gGARC_8c_a1}{g\-GARCload} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short garc\-Addr, unsigned short reg, unsigned int value)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gGARC_8c_a2}{g\-GARCread} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short garc\-Addr, unsigned short reg, unsigned int $\ast$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 GARC. 

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


\subsection{Function Documentation}
\hypertarget{gGARC_8c_a0}{
\index{gGARC.c@{g\-GARC.c}!gGARCcmd@{gGARCcmd}}
\index{gGARCcmd@{gGARCcmd}!gGARC.c@{g\-GARC.c}}
\subsubsection[gGARCcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-GARCcmd (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em garc\-Addr}, unsigned short {\em opcode})}}
\label{gGARC_8c_a0}


Sends a dataless command to the destination. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em garc\-Addr}]GARC address \item[{\em opcode}]opcode of command to send \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success \end{Desc}
\hypertarget{gGARC_8c_a1}{
\index{gGARC.c@{g\-GARC.c}!gGARCload@{gGARCload}}
\index{gGARCload@{gGARCload}!gGARC.c@{g\-GARC.c}}
\subsubsection[gGARCload]{\setlength{\rightskip}{0pt plus 5cm}int g\-GARCload (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em garc\-Addr}, unsigned short {\em reg}, unsigned int {\em value})}}
\label{gGARC_8c_a1}


Loads a register with value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em garc\-Addr}]GARC address \item[{\em reg}]register of GARC to load \item[{\em value}]16-bit value to load into GARC register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Loads the GARC register specified by {\em reg\/} with {\em value\/} \hypertarget{gGARC_8c_a2}{
\index{gGARC.c@{g\-GARC.c}!gGARCread@{gGARCread}}
\index{gGARCread@{gGARCread}!gGARC.c@{g\-GARC.c}}
\subsubsection[gGARCread]{\setlength{\rightskip}{0pt plus 5cm}int g\-GARCread (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em garc\-Addr}, unsigned short {\em reg}, unsigned int $\ast$ {\em val})}}
\label{gGARC_8c_a2}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for TEM \item[{\em garc\-Addr}]GARC address \item[{\em reg}]register of GARC 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 GARC register specified by {\em reg\/}. {\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}
