\hypertarget{gGAFE_8c}{
\section{g\-GAFE.c File Reference}
\label{gGAFE_8c}\index{gGAFE.c@{gGAFE.c}}
}
Implements command/response for the GAFE.  


{\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\-GAFE.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gGAFE_8c_a0}{g\-GAFEcmd} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short garc\-Addr, unsigned short gafe\-Addr, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the destination GAFE. \item\end{CompactList}\item 
int \hyperlink{gGAFE_8c_a1}{g\-GAFEload} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short garc\-Addr, unsigned short gafe\-Addr, unsigned short reg, unsigned int value)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gGAFE_8c_a2}{g\-GAFEread} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short garc\-Addr, unsigned short gafe\-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 GAFE. 

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


\subsection{Function Documentation}
\hypertarget{gGAFE_8c_a0}{
\index{gGAFE.c@{g\-GAFE.c}!gGAFEcmd@{gGAFEcmd}}
\index{gGAFEcmd@{gGAFEcmd}!gGAFE.c@{g\-GAFE.c}}
\subsubsection[gGAFEcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-GAFEcmd (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em garc\-Addr}, unsigned short {\em gafe\-Addr}, unsigned short {\em opcode})}}
\label{gGAFE_8c_a0}


Sends a dataless command to the destination GAFE. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em garc\-Addr}]GARC address \item[{\em gafe\-Addr}]GAFE address \item[{\em opcode}]opcode of command to send \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success \end{Desc}
\hypertarget{gGAFE_8c_a1}{
\index{gGAFE.c@{g\-GAFE.c}!gGAFEload@{gGAFEload}}
\index{gGAFEload@{gGAFEload}!gGAFE.c@{g\-GAFE.c}}
\subsubsection[gGAFEload]{\setlength{\rightskip}{0pt plus 5cm}int g\-GAFEload (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em garc\-Addr}, unsigned short {\em gafe\-Addr}, unsigned short {\em reg}, unsigned int {\em value})}}
\label{gGAFE_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 gafe\-Addr}]GAFE address \item[{\em reg}]register of GAFE to load \item[{\em value}]16-bit value to load into GAFE register \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Loads the GAFE register specified by {\em reg\/} with {\em value\/} \hypertarget{gGAFE_8c_a2}{
\index{gGAFE.c@{g\-GAFE.c}!gGAFEread@{gGAFEread}}
\index{gGAFEread@{gGAFEread}!gGAFE.c@{g\-GAFE.c}}
\subsubsection[gGAFEread]{\setlength{\rightskip}{0pt plus 5cm}int g\-GAFEread (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em garc\-Addr}, unsigned short {\em gafe\-Addr}, unsigned short {\em reg}, unsigned int $\ast$ {\em val})}}
\label{gGAFE_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 gafe\-Addr}]GAFE address \item[{\em reg}]register of GAFE 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 GAFE register specified by {\em reg\/}. {\em val\/} is filled on return. 