\hypertarget{gPDUC_8h}{
\section{g\-PDUC.h File Reference}
\label{gPDUC_8h}\index{gPDUC.h@{gPDUC.h}}
}
command/response methods for the PDU Controller register block  


{\tt \#include \char`\"{}GDAB/gdab.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{gPDUC_8h_a0}{g\-PDUCcmd} (\hyperlink{struct__gdab}{gdab\-Handle} gdab, unsigned short pdu\-Addr, unsigned short opcode)
\begin{CompactList}\small\item\em Sends a dataless command to the PDU. \item\end{CompactList}\item 
int \hyperlink{gPDUC_8h_a1}{g\-PDUCload} (\hyperlink{struct__gdab}{gdab\-Handle} gdab, unsigned short pdu\-Addr, unsigned short reg\-Id, unsigned int value)
\begin{CompactList}\small\item\em Loads a register with value. \item\end{CompactList}\item 
int \hyperlink{gPDUC_8h_a2}{g\-PDUCread} (\hyperlink{struct__gdab}{gdab\-Handle} gdab, unsigned short pdu\-Addr, unsigned short reg\-Id, unsigned int $\ast$value)
\begin{CompactList}\small\item\em Reads a register returing value in {\em val\/}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
command/response methods for the PDU Controller 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{gPDUC_8h_a0}{
\index{gPDUC.h@{g\-PDUC.h}!gPDUCcmd@{gPDUCcmd}}
\index{gPDUCcmd@{gPDUCcmd}!gPDUC.h@{g\-PDUC.h}}
\subsubsection[gPDUCcmd]{\setlength{\rightskip}{0pt plus 5cm}int g\-PDUCcmd (\hyperlink{struct__gdab}{gdab\-Handle} {\em gdab}, unsigned short {\em pdu\-Addr}, unsigned short {\em opcode})}}
\label{gPDUC_8h_a0}


Sends a dataless command to the PDU. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gdab}]gdab\-Handle containing the COM I/O (gnat) handle \item[{\em pdu\-Addr}]PDU address of command \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 PDU address specified by {\em pdu\-Addr\/}. \hypertarget{gPDUC_8h_a1}{
\index{gPDUC.h@{g\-PDUC.h}!gPDUCload@{gPDUCload}}
\index{gPDUCload@{gPDUCload}!gPDUC.h@{g\-PDUC.h}}
\subsubsection[gPDUCload]{\setlength{\rightskip}{0pt plus 5cm}int g\-PDUCload (\hyperlink{struct__gdab}{gdab\-Handle} {\em gdab}, unsigned short {\em pdu\-Addr}, unsigned short {\em reg}, unsigned int {\em value})}}
\label{gPDUC_8h_a1}


Loads a register with value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gdab}]gdab\-Handle containing the COM I/O (gnat) handle \item[{\em pdu\-Addr}]PDU address of command \item[{\em reg}]register to load \item[{\em value}]32-bit value to load \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]G\_\-OK on success\end{Desc}
Loads the PDU Control register specified by {\em reg\/} with {\em value\/} \hypertarget{gPDUC_8h_a2}{
\index{gPDUC.h@{g\-PDUC.h}!gPDUCread@{gPDUCread}}
\index{gPDUCread@{gPDUCread}!gPDUC.h@{g\-PDUC.h}}
\subsubsection[gPDUCread]{\setlength{\rightskip}{0pt plus 5cm}int g\-PDUCread (\hyperlink{struct__gdab}{gdab\-Handle} {\em gdab}, unsigned short {\em pdu\-Addr}, unsigned short {\em reg}, unsigned int $\ast$ {\em val})}}
\label{gPDUC_8h_a2}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em gdab}]gdab\-Handle containing the COM I/O (gant) handle. \item[{\em pdu\-Addr}]PDU address of command \item[{\em reg}]register to read \item[{\em val}]pointer t 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 PDU Control 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}
