\hypertarget{gAEM_8h}{
\section{g\-AEM.h File Reference}
\label{gAEM_8h}\index{gAEM.h@{gAEM.h}}
}
defines the command and response methods for the AEM  


\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gAEM_8h_a0}{g\-AEMcmd} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the AEM. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a1}{g\-AEMload} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short reg\-Id, unsigned int val)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a2}{g\-AEMread} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short reg\-Id, unsigned int $\ast$val)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a3}{g\-AEMlam} (\hyperlink{struct__gaem}{gaem\-Handle} ga)
\begin{CompactList}\small\item\em Sends the \char`\"{}Look At Me\char`\"{} message to the AEM. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a4}{set\-Cmd\-Str\-Parity\-AEM} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short p)
\begin{CompactList}\small\item\em {\em p\/} determines if the AEM command string parity is inverted \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a5}{get\-Cmd\-Str\-Parity\-AEM} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns current AEM command string parity. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a6}{set\-Access\-Desc\-Parity\-AEM} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short p)
\begin{CompactList}\small\item\em Sets the current AEM access descriptor parity. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a7}{get\-Access\-Desc\-Parity\-AEM} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns current AEM access descriptor parity. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a8}{set\-Cmd\-Payload\-Parity\-AEM} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short p)
\begin{CompactList}\small\item\em {\em p\/} determines if the AEM command payload parity is inverted \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a9}{get\-Cmd\-Payload\-Parity\-AEM} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short $\ast$p)
\begin{CompactList}\small\item\em Returns the current AEM command payload parity. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a10}{g\-AEM\_\-Set\-Addr} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short addr)
\begin{CompactList}\small\item\em Sets system wide AEM LATp address. \item\end{CompactList}\item 
int \hyperlink{gAEM_8h_a11}{g\-AEM\_\-Get\-Addr} (\hyperlink{struct__gaem}{gaem\-Handle} ga, unsigned short $\ast$addr)
\begin{CompactList}\small\item\em Gets system wide AEM LATp address. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
defines the command and response methods for the AEM 

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


\subsection{Function Documentation}
\hypertarget{gAEM_8h_a11}{
\index{gAEM.h@{g\-AEM.h}!gAEM_GetAddr@{gAEM\_\-GetAddr}}
\index{gAEM_GetAddr@{gAEM\_\-GetAddr}!gAEM.h@{g\-AEM.h}}
\subsubsection[gAEM\_\-GetAddr]{\setlength{\rightskip}{0pt plus 5cm}int g\-AEM\_\-Get\-Addr (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short $\ast$ {\em aem\-Addr})}}
\label{gAEM_8h_a11}


Gets system wide AEM LATp address. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em aem\-Addr}]pointer to hold AEM address \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success \end{Desc}
\begin{Desc}
\item[See also:]\hyperlink{gAEM_8h_a10}{g\-AEM\_\-Set\-Addr()}\end{Desc}
Gets the system-wide AEM LATp address. \hypertarget{gAEM_8h_a10}{
\index{gAEM.h@{g\-AEM.h}!gAEM_SetAddr@{gAEM\_\-SetAddr}}
\index{gAEM_SetAddr@{gAEM\_\-SetAddr}!gAEM.h@{g\-AEM.h}}
\subsubsection[gAEM\_\-SetAddr]{\setlength{\rightskip}{0pt plus 5cm}int g\-AEM\_\-Set\-Addr (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em aem\-Addr})}}
\label{gAEM_8h_a10}


Sets system wide AEM LATp address. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em aem\-Addr}]AEM address \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Sets the system-wide AEM LATp address. This function is intended to be called once during system initialization. It might also be useful during testing. \hypertarget{gAEM_8h_a0}{
\index{gAEM.h@{g\-AEM.h}!gAEMcmd@{gAEMcmd}}
\index{gAEMcmd@{gAEMcmd}!gAEM.h@{g\-AEM.h}}
\subsubsection[gAEMcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-AEMcmd (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em opcode})}}
\label{gAEM_8h_a0}


Sends a dataless command to the AEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \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 AEM. \hypertarget{gAEM_8h_a3}{
\index{gAEM.h@{g\-AEM.h}!gAEMlam@{gAEMlam}}
\index{gAEMlam@{gAEMlam}!gAEM.h@{g\-AEM.h}}
\subsubsection[gAEMlam]{\setlength{\rightskip}{0pt plus 5cm}int g\-AEMlam (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga})}}
\label{gAEM_8h_a3}


Sends the \char`\"{}Look At Me\char`\"{} message to the AEM. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Sends the \char`\"{}Look At Me\char`\"{} message to the AEM. This is used to switch the command/response wire used by the AEM. If the AEM decodes the \char`\"{}Look At Me\char`\"{} message on either it's A or B command channel it will switch to that channel for future commanding. \hypertarget{gAEM_8h_a1}{
\index{gAEM.h@{g\-AEM.h}!gAEMload@{gAEMload}}
\index{gAEMload@{gAEMload}!gAEM.h@{g\-AEM.h}}
\subsubsection[gAEMload]{\setlength{\rightskip}{0pt plus 5cm}int g\-AEMload (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em reg}, unsigned int {\em value})}}
\label{gAEM_8h_a1}


Loads a register with value. 

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


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em reg}]register of AEM 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 AEM register specified by {\em reg\/}. {\em val\/} is filled on return. \hypertarget{gAEM_8h_a7}{
\index{gAEM.h@{g\-AEM.h}!getAccessDescParityAEM@{getAccessDescParityAEM}}
\index{getAccessDescParityAEM@{getAccessDescParityAEM}!gAEM.h@{g\-AEM.h}}
\subsubsection[getAccessDescParityAEM]{\setlength{\rightskip}{0pt plus 5cm}int get\-Access\-Desc\-Parity\-AEM (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short $\ast$ {\em p})}}
\label{gAEM_8h_a7}


Returns current AEM access descriptor parity. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em p}]pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going AEM commands will have their access descriptor parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gAEM_8h_a9}{
\index{gAEM.h@{g\-AEM.h}!getCmdPayloadParityAEM@{getCmdPayloadParityAEM}}
\index{getCmdPayloadParityAEM@{getCmdPayloadParityAEM}!gAEM.h@{g\-AEM.h}}
\subsubsection[getCmdPayloadParityAEM]{\setlength{\rightskip}{0pt plus 5cm}int get\-Cmd\-Payload\-Parity\-AEM (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short $\ast$ {\em p})}}
\label{gAEM_8h_a9}


Returns the current AEM command payload parity. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em p}]Pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going AEM commands will have their command payload parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gAEM_8h_a5}{
\index{gAEM.h@{g\-AEM.h}!getCmdStrParityAEM@{getCmdStrParityAEM}}
\index{getCmdStrParityAEM@{getCmdStrParityAEM}!gAEM.h@{g\-AEM.h}}
\subsubsection[getCmdStrParityAEM]{\setlength{\rightskip}{0pt plus 5cm}int get\-Cmd\-Str\-Parity\-AEM (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short $\ast$ {\em p})}}
\label{gAEM_8h_a5}


Returns current AEM command string parity. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em p}]pointer to hold boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going AEM commands will have their command string parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gAEM_8h_a6}{
\index{gAEM.h@{g\-AEM.h}!setAccessDescParityAEM@{setAccessDescParityAEM}}
\index{setAccessDescParityAEM@{setAccessDescParityAEM}!gAEM.h@{g\-AEM.h}}
\subsubsection[setAccessDescParityAEM]{\setlength{\rightskip}{0pt plus 5cm}int set\-Access\-Desc\-Parity\-AEM (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em p})}}
\label{gAEM_8h_a6}


Sets the current AEM access descriptor parity. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going AEM commands will have their access descriptor parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gAEM_8h_a8}{
\index{gAEM.h@{g\-AEM.h}!setCmdPayloadParityAEM@{setCmdPayloadParityAEM}}
\index{setCmdPayloadParityAEM@{setCmdPayloadParityAEM}!gAEM.h@{g\-AEM.h}}
\subsubsection[setCmdPayloadParityAEM]{\setlength{\rightskip}{0pt plus 5cm}int set\-Cmd\-Payload\-Parity\-AEM (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em p})}}
\label{gAEM_8h_a8}


{\em p\/} determines if the AEM command payload parity is inverted 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going AEM commands will have their command payload parity inverted. This is used for testing parity errors. The default value is 0. \hypertarget{gAEM_8h_a4}{
\index{gAEM.h@{g\-AEM.h}!setCmdStrParityAEM@{setCmdStrParityAEM}}
\index{setCmdStrParityAEM@{setCmdStrParityAEM}!gAEM.h@{g\-AEM.h}}
\subsubsection[setCmdStrParityAEM]{\setlength{\rightskip}{0pt plus 5cm}int set\-Cmd\-Str\-Parity\-AEM (\hyperlink{struct__gaem}{gaem\-Handle} {\em ga}, unsigned short {\em p})}}
\label{gAEM_8h_a4}


{\em p\/} determines if the AEM command string parity is inverted 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ga}]gaem\-Handle for AEM \item[{\em p}]boolean value \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]STATUS\end{Desc}
if {\em p\/} is non-zero then all out going AEM commands will have their command string parity inverted. This is used for testing parity errors. The default value is 0. 