\hypertarget{decode_8ih}{
\section{decode.ih File Reference}
\label{decode_8ih}\index{decode.ih@{decode.ih}}
}
Unpack the payload of a result item.  


{\tt \#include \char`\"{}PBS/PARITY.ih\char`\"{}}\par
{\tt \#include $<$stdio.h$>$}\par


Include dependency graph for decode.ih:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{decode_8ih__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=45pt]{decode_8ih__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{decode_8ih_a0}{decode\_\-ul} (const unsigned short $\ast$pkt, unsigned short n\-Words, unsigned $\ast$value)
\begin{CompactList}\small\item\em Unpacks the result of a read. \item\end{CompactList}\item 
void \hyperlink{decode_8ih_a1}{decode\_\-cal} (const unsigned short $\ast$pkt, \hyperlink{unionCAL__rsp}{CAL\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copies the response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8ih_a2}{decode\_\-tkr} (const unsigned short $\ast$pkt, \hyperlink{structTKR__rsp}{TKR\_\-rsp} $\ast$rsp)
\item 
void \hyperlink{decode_8ih_a3}{decode\_\-acd} (const unsigned short $\ast$pkt, \hyperlink{unionACD__rsp}{ACD\_\-rsp} $\ast$rsp)
\end{CompactItemize}


\subsection{Detailed Description}
Unpack the payload of a result item. 

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


\subsection{Function Documentation}
\hypertarget{decode_8ih_a3}{
\index{decode.ih@{decode.ih}!decode_acd@{decode\_\-acd}}
\index{decode_acd@{decode\_\-acd}!decode.ih@{decode.ih}}
\subsubsection[decode\_\-acd]{\setlength{\rightskip}{0pt plus 5cm}void decode\_\-acd (const unsigned short $\ast$ {\em pkt}, \hyperlink{unionACD__rsp}{ACD\_\-rsp} $\ast$ {\em rsp})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8ih_a3}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]pointer to response payload data \item[{\em rsp}]pointer to memory to hold off board GARC/GAFE response data \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void\end{Desc}
format of GARC response in 16-bit chunks

-------------------------------- 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -------------------------------- 0000 (0000) A B C C C C C D E F F F F G H H 0001 (0000) H H H H H H H H H H H H H H I J

where,

A - 1 bit. Start bit B - 1 bit. Copy of write command field ( 0 for GARC, 1 for GAFE ). C - 5 bits. Copy of write command field ( GARC func block, or GAFE address). D - 1 bit. Read/Write bit. Always 1 for read. E - 1 bit. Data/Dataless, always 1. F - 4 bits. Copy of write command field ( GARC func code or GAFE register). G - 1 bit. Odd parity over previous 12 bits. H - 16 bits. Data payload, MSB first. I - 1 bit. Summary error detected. J - 1 bit. Odd parity over previous 17 bits. \hypertarget{decode_8ih_a1}{
\index{decode.ih@{decode.ih}!decode_cal@{decode\_\-cal}}
\index{decode_cal@{decode\_\-cal}!decode.ih@{decode.ih}}
\subsubsection[decode\_\-cal]{\setlength{\rightskip}{0pt plus 5cm}void decode\_\-cal (const unsigned short $\ast$ {\em pkt}, \hyperlink{unionCAL__rsp}{CAL\_\-rsp} $\ast$ {\em rsp})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8ih_a1}


Copies the response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload \item[{\em rsp}]Pointer to memory to hold decoded payload \end{description}
\end{Desc}
\hypertarget{decode_8ih_a2}{
\index{decode.ih@{decode.ih}!decode_tkr@{decode\_\-tkr}}
\index{decode_tkr@{decode\_\-tkr}!decode.ih@{decode.ih}}
\subsubsection[decode\_\-tkr]{\setlength{\rightskip}{0pt plus 5cm}void decode\_\-tkr (const unsigned short $\ast$ {\em pkt}, \hyperlink{structTKR__rsp}{TKR\_\-rsp} $\ast$ {\em rsp})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8ih_a2}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]pointer to response payload data \item[{\em rsp}]Pointer to structure holding TKR 64-bit response data and TKR response flags \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void\end{Desc}
Format of off-board tracker response in 16-bit chunks

-------------------------------- 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -------------------------------- 0000 (0000) A A A A A A A A A A A A A A A A 0001 (0000) 1 D D D D D D D D D D D D D D D 0002 (0000) D 1 D D D D D D D D D D D D D D 0003 (0000) D D 1 D D D D D D D D D D D D D 0004 (0000) D D D 1 D D D D D D D D D D D D 0005 (0000) D D D D E P \mbox{[}$<$---- MBZ ------$>$\mbox{]}

meaning ------------------------------- A -- access descriptor, 16 bits D -- response data, 64 bits with a \char`\"{}1\char`\"{} preceeding each 16-bit chunk E -- error summary, 1 bit P -- parity, 1 bit \hypertarget{decode_8ih_a0}{
\index{decode.ih@{decode.ih}!decode_ul@{decode\_\-ul}}
\index{decode_ul@{decode\_\-ul}!decode.ih@{decode.ih}}
\subsubsection[decode\_\-ul]{\setlength{\rightskip}{0pt plus 5cm}void decode\_\-ul (const unsigned short $\ast$ {\em pkt}, unsigned short {\em n\-Words}, unsigned $\ast$ {\em value})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8ih_a0}


Unpacks the result of a read. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Payload from a result item \item[{\em n\-Words}]Number of 32-bit words in the response \item[{\em value}]Pointer to location to copy repsonse to \end{description}
\end{Desc}
