\hypertarget{LCBR_8h}{
\section{LCBR.h File Reference}
\label{LCBR_8h}\index{LCBR.h@{LCBR.h}}
}
Definitions of the LCB response structures.  


{\tt \#include \char`\"{}LCBD/LATP.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBD/LCB\_\-cr.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBD/LCB.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Attribute.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Inline.h\char`\"{}}\par


Include dependency graph for LCBR.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=210pt]{LCBR_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=76pt]{LCBR_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{LCBR_8h_a0}{LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}
\begin{CompactList}\small\item\em Defines a 32-bit integer that functions as a map of the response type indexed by opcode. \item\end{CompactList}\item 
\#define \hyperlink{LCBR_8h_a1}{LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL}(\_\-map, \_\-opcode)\ (((unsigned int)\_\-map $>$$>$ (2 $\ast$ (\_\-opcode))) \& 0x3)
\begin{CompactList}\small\item\em Maps an opcode to a result item type. \item\end{CompactList}\item 
\#define \hyperlink{LCBR_8h_a2}{LCBR\_\-TYPE\_\-BY\_\-OPCODE}(\_\-opcode)\ LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL(LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE, \_\-opcode)
\begin{CompactList}\small\item\em Maps an opcode to a result item type. \item\end{CompactList}\item 
\#define \hyperlink{LCBR_8h_a3}{LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE}
\begin{CompactList}\small\item\em Defines a 32-bit integer that functions as a map of the response item size indexed by opcode. \item\end{CompactList}\item 
\#define \hyperlink{LCBR_8h_a4}{LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL}(\_\-map, \_\-opcode)\ (((unsigned int)\_\-map $>$$>$ (2 $\ast$ (\_\-opcode))) \& 0x3)
\begin{CompactList}\small\item\em Maps an opcode to a response item size in units of 8 byte cells. \item\end{CompactList}\item 
\#define \hyperlink{LCBR_8h_a5}{LCBR\_\-N8BYTES\_\-BY\_\-OPCODE}(\_\-opcode)\ LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL(LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE, \_\-opcode)
\begin{CompactList}\small\item\em Maps an opcode to a response item size in units of 8 byte cells. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{LCBR_8h_a6}{
typedef enum \hyperlink{LCBR_8h_a19}{\_\-LCBR\_\-TYPE} \hyperlink{LCBR_8h_a6}{LCBR\_\-TYPE}}
\label{LCBR_8h_a6}

\begin{CompactList}\small\item\em Typedef for enum \_\-LCBR\_\-TYPE. \item\end{CompactList}\item 
typedef unsigned int \hyperlink{LCBR_8h_a7}{LCBR\_\-processor} (void $\ast$prm, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri)
\begin{CompactList}\small\item\em Callback routine for LCBR\_\-process. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{LCBR_8h_a19}{\_\-LCBR\_\-TYPE} \{ \par
\hyperlink{LCBR_8h_a19a8}{LCBR\_\-TYPE\_\-UNDEFINED} =  0, 
\par
\hyperlink{LCBR_8h_a19a9}{LCBR\_\-TYPE\_\-RESPONSE} =  1, 
\par
\hyperlink{LCBR_8h_a19a10}{LCBR\_\-TYPE\_\-REGISTER} =  2, 
\par
\hyperlink{LCBR_8h_a19a11}{LCBR\_\-TYPE\_\-COMMAND} =  3
 \}
\begin{CompactList}\small\item\em Enumerates the three defined result item types + one undefined type. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
LCBR\_\-\_\-EXP\_\-PROTO const void $\ast$ \hyperlink{LCBR_8h_a12}{LCBR\_\-\_\-advance} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri, int nbytes) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Advances the pointer {\em ri\/} by the specified number of bytes. \item\end{CompactList}\item 
LCBR\_\-\_\-EXP\_\-PROTO const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ \hyperlink{LCBR_8h_a13}{LCBR\_\-\_\-next} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Advances the pointer {\em ri\/} to the next result item. \item\end{CompactList}\item 
LCBR\_\-\_\-EXP\_\-PROTO unsigned int \hyperlink{LCBR_8h_a14}{LCBR\_\-\_\-data32\_\-get} (unsigned short $\ast$payload) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Returns the first 32-bit word of the payload of {\em ri\/}. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBR_8h_a15}{LCBR\_\-process} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end, \hyperlink{LCBR_8h_a7}{LCBR\_\-processor} rtn, void $\ast$prm)
\begin{CompactList}\small\item\em Executes the user specified handler for each result item in the range {\em ri\/} to {\em end\/}. \item\end{CompactList}\item 
const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ \hyperlink{LCBR_8h_a16}{LCBR\_\-check} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end)
\begin{CompactList}\small\item\em Checks the specified range of result items for errors. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBR_8h_a17}{LCBR\_\-error\_\-get} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri)
\begin{CompactList}\small\item\em Returns the 16-bit error word of {\em ri\/}. \item\end{CompactList}\item 
void \hyperlink{LCBR_8h_a18}{LCBR\_\-show} (unsigned int options, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$beg, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end)
\begin{CompactList}\small\item\em Dumps the result items to stdout. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Definitions of the LCB response structures. 

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

JJRussell -- \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu} \end{Desc}


\footnotesize\begin{verbatim}
  CVS $Id
\end{verbatim}\normalsize


These map out the data structure of response items. See chapter 3 \& 4 of Mike Huffer's \char`\"{}LAT Communications Board -- Design Specification\char`\"{} for more details.

\subsection{Define Documentation}
\hypertarget{LCBR_8h_a3}{
\index{LCBR.h@{LCBR.h}!LCBR_MAP_N8BYTES_BY_OPCODE@{LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE}}
\index{LCBR_MAP_N8BYTES_BY_OPCODE@{LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE}}
\label{LCBR_8h_a3}


{\bf Value:}

\footnotesize\begin{verbatim}(                                                                        \
   (LCB_RI_N8BYTES_CMD         << (2 *  LCB_OPCODE_CMD        )) |        \
   (LCB_RI_N8BYTES_MARK_TIME   << (2 *  LCB_OPCODE_MARK_TIME  )) |        \
   (LCB_RI_N8BYTES_EVENT       << (2 *  LCB_OPCODE_EVENT      )) |        \
   (LCB_RI_N8BYTES_LAT_RESET   << (2 *  LCB_OPCODE_LAT_RESET  )) |        \
   (LCB_RI_N8BYTES_CMDR        << (2 *  LCB_OPCODE_CMDR       )) |        \
   (LCB_RI_N8BYTES_CSR         << (2 *  LCB_OPCODE_CSR        )) |        \
   (0                          << (2 *  LCB_OPCODE_6          )) |        \
   (LCB_RI_N8BYTES_FAULTS      << (2 *  LCB_OPCODE_FAULTS     )) |        \
   (0                          << (2 *  LCB_OPCODE_8          )) |        \
   (LCB_RI_N8BYTES_RXSTATS     << (2 *  LCB_OPCODE_RXSTATS    )) |        \
   (0                          << (2 *  LCB_OPCODE_A          )) |        \
   (0                          << (2 *  LCB_OPCODE_B          )) |        \
   (0                          << (2 *  LCB_OPCODE_C          )) |        \
   (0                          << (2 *  LCB_OPCODE_D          )) |        \
   (0                          << (2 *  LCB_OPCODE_E          )) |        \
   (0                          << (2 *  LCB_OPCODE_F          ))          \
)
\end{verbatim}\normalsize 
Defines a 32-bit integer that functions as a map of the response item size indexed by opcode. 

The 32-bit integer functions as a map of the response item size, in 8 bytes cells, indexed by opcode. Since response items have sizes, in 8 byte cells, of 1, 2 or 3 it takes 2 bits to represent the size. A value of 0 acts as a flag value for unknown types. Thus with each response item size consuming 2 bits, the 16 opcodes take 32 bits. \hypertarget{LCBR_8h_a0}{
\index{LCBR.h@{LCBR.h}!LCBR_MAP_TYPE_BY_OPCODE@{LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}}
\index{LCBR_MAP_TYPE_BY_OPCODE@{LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}}
\label{LCBR_8h_a0}


{\bf Value:}

\footnotesize\begin{verbatim}(                                                                       \
   (LCBR_TYPE_RESPONSE     << (2 *  LCB_OPCODE_CMD        )) |            \
   (LCBR_TYPE_RESPONSE     << (2 *  LCB_OPCODE_MARK_TIME  )) |            \
   (LCBR_TYPE_RESPONSE     << (2 *  LCB_OPCODE_EVENT      )) |            \
   (LCBR_TYPE_RESPONSE     << (2 *  LCB_OPCODE_LAT_RESET  )) |            \
   (LCBR_TYPE_COMMAND      << (2 *  LCB_OPCODE_CMDR       )) |            \
   (LCBR_TYPE_REGISTER     << (2 *  LCB_OPCODE_CSR        )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_6          )) |            \
   (LCBR_TYPE_REGISTER     << (2 *  LCB_OPCODE_FAULTS     )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_8          )) |            \
   (LCBR_TYPE_REGISTER     << (2 *  LCB_OPCODE_RXSTATS    )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_A          )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_B          )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_C          )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_D          )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_E          )) |            \
   (LCBR_TYPE_UNDEFINED    << (2 *  LCB_OPCODE_F          ))              \
   )
\end{verbatim}\normalsize 
Defines a 32-bit integer that functions as a map of the response type indexed by opcode. 

The 32-bit integer functions as a map of the response type indexed by opcode. Each response type consumes 2 bits. Given that there are 16 potential opcodes, it takes 32 bits to define the map. The map is indexed by shifing the map by 2 $\ast$ {\em opcode\/} and masking off the low 2 bits. Once the 32-bit value is loaded into a register (2 instructions), onthe Power\-PC this should be two instructions.



\footnotesize\begin{verbatim}     type = ((LCBR_MAP_TYPE_BY_OPCODE >> (2 * opcode)) & 0x3);
\end{verbatim}\normalsize


There are 16 opcodes, that map to 4 descriptor types Size Cells Bytes 0 LCB\_\-OPCODE\_\-CMD = LCBR\_\-TYPE\_\-RESPONSE 1 16 1 LCB\_\-OPCODE\_\-MARK\_\-TIME = LCBR\_\-TYPE\_\-RESPONSE 1 8 2 LCB\_\-OPCODE\_\-EVENT = LCBR\_\-TYPE\_\-RESPONSE 1 8 3 LCB\_\-OPCODE\_\-LAT\_\-RESET = LCBR\_\-TYPE\_\-RESPONSE 1 8 4 LCB\_\-OPCODE\_\-CMDW = LCBR\_\-TYPE\_\-COMMAND 3 0 5 LCB\_\-OPCODE\_\-CSR = LCBR\_\-TYPE\_\-REGISTER 2 16 6 LCB\_\-OPCODE\_\-6 = LCBR\_\-TYPE\_\-UNDEFINED 0 0 7 LCB\_\-OPCODE\_\-FAULTS = LCBR\_\-TYPE\_\-REGISTER 2 16 8 LCB\_\-OPCODE\_\-8 = LCBR\_\-TYPE\_\-UNDEFINED 0 0 9 LCB\_\-OPCODE\_\-RXSTATS = LCBR\_\-TYPE\_\-REGISTER 2 16 A LCB\_\-OPCODE\_\-A = LCBR\_\-TYPE\_\-UNDEFINED 0 0 B LCB\_\-OPCODE\_\-B = LCBR\_\-TYPE\_\-UNDEFINED 0 0 C LCB\_\-OPCODE\_\-C = LCBR\_\-TYPE\_\-UNDEFINED 0 0 D LCB\_\-OPCODE\_\-D = LCBR\_\-TYPE\_\-UNDEFINED 0 0 E LCB\_\-OPCODE\_\-E = LCBR\_\-TYPE\_\-UNDEFINED 0 0 F LCB\_\-PPCODE\_\-F = LCBR\_\-TYPE\_\-UNDEFINED 0 0 \hypertarget{LCBR_8h_a5}{
\index{LCBR.h@{LCBR.h}!LCBR_N8BYTES_BY_OPCODE@{LCBR\_\-N8BYTES\_\-BY\_\-OPCODE}}
\index{LCBR_N8BYTES_BY_OPCODE@{LCBR\_\-N8BYTES\_\-BY\_\-OPCODE}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-N8BYTES\_\-BY\_\-OPCODE]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-N8BYTES\_\-BY\_\-OPCODE(\_\-opcode)\ LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL(LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE, \_\-opcode)}}
\label{LCBR_8h_a5}


Maps an opcode to a response item size in units of 8 byte cells. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-opcode}]The opcode to map \end{description}
\end{Desc}
\hypertarget{LCBR_8h_a4}{
\index{LCBR.h@{LCBR.h}!LCBR_N8BYTES_BY_OPCODE_FULL@{LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL}}
\index{LCBR_N8BYTES_BY_OPCODE_FULL@{LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL(\_\-map, \_\-opcode)\ (((unsigned int)\_\-map $>$$>$ (2 $\ast$ (\_\-opcode))) \& 0x3)}}
\label{LCBR_8h_a4}


Maps an opcode to a response item size in units of 8 byte cells. 

\begin{Desc}
\item[Returns:]The response type\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-map}]The mapping word. \item[{\em \_\-opcode}]The opcode to map\end{description}
\end{Desc}
The {\em \_\-map\/} must have the value {\em LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE\/}. This form may be more efficient than LCBR\_\-TYPE\_\-BY\_\-OPCODE, since the mapping word may be already in a register, saving (on the Power\-PC) the two instructions to load it. For those instances when this is macro is only being used once within a function, LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE is simpler. \hypertarget{LCBR_8h_a2}{
\index{LCBR.h@{LCBR.h}!LCBR_TYPE_BY_OPCODE@{LCBR\_\-TYPE\_\-BY\_\-OPCODE}}
\index{LCBR_TYPE_BY_OPCODE@{LCBR\_\-TYPE\_\-BY\_\-OPCODE}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-TYPE\_\-BY\_\-OPCODE]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-TYPE\_\-BY\_\-OPCODE(\_\-opcode)\ LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL(LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE, \_\-opcode)}}
\label{LCBR_8h_a2}


Maps an opcode to a result item type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-opcode}]The opcode to map \end{description}
\end{Desc}
\hypertarget{LCBR_8h_a1}{
\index{LCBR.h@{LCBR.h}!LCBR_TYPE_BY_OPCODE_FULL@{LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL}}
\index{LCBR_TYPE_BY_OPCODE_FULL@{LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL(\_\-map, \_\-opcode)\ (((unsigned int)\_\-map $>$$>$ (2 $\ast$ (\_\-opcode))) \& 0x3)}}
\label{LCBR_8h_a1}


Maps an opcode to a result item type. 

\begin{Desc}
\item[Returns:]The result type\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-map}]The mapping word. \item[{\em \_\-opcode}]The opcode to map\end{description}
\end{Desc}
The {\em \_\-map\/} must have the value {\em LCBR\_\-TYPE\_\-MAP\_\-BY\_\-OPCODE\/}. This form may be more efficient than LCBR\_\-TYPE\_\-BY\_\-OPCODE, since the mapping word may be already in a register, saving (on the Power\-PC) the two instructions to load it. For those instances when this is macro is only being used once within a function, LCBR\_\-TYPE\_\-BY\_\-OPCODE is is simpler. 

\subsection{Typedef Documentation}
\hypertarget{LCBR_8h_a7}{
\index{LCBR.h@{LCBR.h}!LCBR_processor@{LCBR\_\-processor}}
\index{LCBR_processor@{LCBR\_\-processor}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-processor]{\setlength{\rightskip}{0pt plus 5cm}unsigned int \hyperlink{LCBR_8h_a7}{LCBR\_\-processor}}}
\label{LCBR_8h_a7}


Callback routine for LCBR\_\-process. 

\begin{Desc}
\item[Returns:]Status, an non-zero status will cause LCBR\_\-process to quit processing items\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prm}]Arbitrary user parameter passed to this routine \item[{\em ri}]The result item to process\end{description}
\end{Desc}
This routine gets called by LCBR\_\-process once for each result item. The routine processes the result item and then may return either 0, indicating to continue or non-zero, indicating to stop processing 

\subsection{Enumeration Type Documentation}
\hypertarget{LCBR_8h_a19}{
\index{LCBR.h@{LCBR.h}!_LCBR_TYPE@{\_\-LCBR\_\-TYPE}}
\index{_LCBR_TYPE@{\_\-LCBR\_\-TYPE}!LCBR.h@{LCBR.h}}
\subsubsection[\_\-LCBR\_\-TYPE]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{LCBR_8h_a19}{\_\-LCBR\_\-TYPE}}}
\label{LCBR_8h_a19}


Enumerates the three defined result item types + one undefined type. 

\begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{LCBR_TYPE_UNDEFINED@{LCBR\_\-TYPE\_\-UNDEFINED}!LCBR.h@{LCBR.h}}\index{LCBR.h@{LCBR.h}!LCBR_TYPE_UNDEFINED@{LCBR\_\-TYPE\_\-UNDEFINED}}\item[{\em 
\hypertarget{LCBR_8h_a19a8}{
{\em LCBR\_\-TYPE\_\-UNDEFINED}}
\label{LCBR_8h_a19a8}
}]Type is undefined \index{LCBR_TYPE_RESPONSE@{LCBR\_\-TYPE\_\-RESPONSE}!LCBR.h@{LCBR.h}}\index{LCBR.h@{LCBR.h}!LCBR_TYPE_RESPONSE@{LCBR\_\-TYPE\_\-RESPONSE}}\item[{\em 
\hypertarget{LCBR_8h_a19a9}{
{\em LCBR\_\-TYPE\_\-RESPONSE}}
\label{LCBR_8h_a19a9}
}]Type is of a simple response \index{LCBR_TYPE_REGISTER@{LCBR\_\-TYPE\_\-REGISTER}!LCBR.h@{LCBR.h}}\index{LCBR.h@{LCBR.h}!LCBR_TYPE_REGISTER@{LCBR\_\-TYPE\_\-REGISTER}}\item[{\em 
\hypertarget{LCBR_8h_a19a10}{
{\em LCBR\_\-TYPE\_\-REGISTER}}
\label{LCBR_8h_a19a10}
}]Type is a register response \index{LCBR_TYPE_COMMAND@{LCBR\_\-TYPE\_\-COMMAND}!LCBR.h@{LCBR.h}}\index{LCBR.h@{LCBR.h}!LCBR_TYPE_COMMAND@{LCBR\_\-TYPE\_\-COMMAND}}\item[{\em 
\hypertarget{LCBR_8h_a19a11}{
{\em LCBR\_\-TYPE\_\-COMMAND}}
\label{LCBR_8h_a19a11}
}]Type is a command response \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{LCBR_8h_a12}{
\index{LCBR.h@{LCBR.h}!LCBR__advance@{LCBR\_\-\_\-advance}}
\index{LCBR__advance@{LCBR\_\-\_\-advance}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-\_\-advance]{\setlength{\rightskip}{0pt plus 5cm}LCBR\_\-\_\-EXP\_\-FNC const void $\ast$ LCBR\_\-\_\-advance (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri}, int {\em nbytes})}}
\label{LCBR_8h_a12}


Advances the pointer {\em ri\/} by the specified number of bytes. 

\begin{Desc}
\item[Returns:]The advanced pointer\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ri}]The result item pointer to advance \item[{\em nbytes}]The number of bytes to advance the pointer \end{description}
\end{Desc}
\hypertarget{LCBR_8h_a14}{
\index{LCBR.h@{LCBR.h}!LCBR__data32_get@{LCBR\_\-\_\-data32\_\-get}}
\index{LCBR__data32_get@{LCBR\_\-\_\-data32\_\-get}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-\_\-data32\_\-get]{\setlength{\rightskip}{0pt plus 5cm}LCBR\_\-\_\-EXP\_\-FNC unsigned int LCBR\_\-\_\-data32\_\-get (unsigned short $\ast$ {\em payload})}}
\label{LCBR_8h_a14}


Returns the first 32-bit word of the payload of {\em ri\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em payload}]Pointer to payload \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]LCBR\_\-header\-Get(), LCBR\_\-payload\-Locate ()\end{Desc}
This is a convience method that returns the first 32-bits of the payload. It is assumed that {\em payload\/} points a valid payload. For example, calling LCBR\_\-payload\-Locate and properly checking the returned pointer will fulfill this constraint. \hypertarget{LCBR_8h_a13}{
\index{LCBR.h@{LCBR.h}!LCBR__next@{LCBR\_\-\_\-next}}
\index{LCBR__next@{LCBR\_\-\_\-next}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-\_\-next]{\setlength{\rightskip}{0pt plus 5cm}LCBR\_\-\_\-EXP\_\-FNC const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ LCBR\_\-\_\-next (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri})}}
\label{LCBR_8h_a13}


Advances the pointer {\em ri\/} to the next result item. 

\begin{Desc}
\item[Returns:]A pointer to the next result item\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ri}]The result item\end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]It is the responsibility of the user to verify that the {\em ri\/} has a valid opcode. If the opcode is invalid, the returned pointer will have the same value as the input pointer. \end{Desc}
\hypertarget{LCBR_8h_a16}{
\index{LCBR.h@{LCBR.h}!LCBR_check@{LCBR\_\-check}}
\index{LCBR_check@{LCBR\_\-check}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-check]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ LCBR\_\-check (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8h_a16}


Checks the specified range of result items for errors. 

\begin{Desc}
\item[Returns:]Pointer to the last item successfully checked. If successful, end should be returned. \end{Desc}
A convience method to quickly scan a result list for any errors. If any result item has an error, a pointer to that result item is returned.

If anything of than a pointer to {\em end\/} is returned, then an error in the result list has occurred. There are two offending conditions

\begin{enumerate}
\item The error code in the result item is anything but successful\item A result item has an undefined OPCODE making it impossible to advance.\end{enumerate}


The low 2 bits of the returned pointer contain the error syndrome. Currently only these two cases are defined

\begin{itemize}
\item low 2 bits 0, error is from the error field in the result item\item low 2 bits 1, error is because of a bad opcode. \end{itemize}
\hypertarget{LCBR_8h_a17}{
\index{LCBR.h@{LCBR.h}!LCBR_error_get@{LCBR\_\-error\_\-get}}
\index{LCBR_error_get@{LCBR\_\-error\_\-get}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-error\_\-get]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-error\_\-get (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri})}}
\label{LCBR_8h_a17}


Returns the 16-bit error word of {\em ri\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ri}]Pointer to result item structure \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The error code. If the opcode is not recognized, the value LCB\_\-RCV\_\-ERR\_\-UNDEFINED\_\-7 is returned. \end{Desc}
\hypertarget{LCBR_8h_a15}{
\index{LCBR.h@{LCBR.h}!LCBR_process@{LCBR\_\-process}}
\index{LCBR_process@{LCBR\_\-process}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-process]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-process (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em ri}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em end}, \hyperlink{LCBR_8h_a7}{LCBR\_\-processor} {\em rtn}, void $\ast$ {\em prm})}}
\label{LCBR_8h_a15}


Executes the user specified handler for each result item in the range {\em ri\/} to {\em end\/}. 

\begin{Desc}
\item[Returns:]The status of the last processing call\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ri}]The first result item to process \item[{\em end}]One past the last result item to process \item[{\em rtn}]User provided callback routine to process one item \item[{\em prm}]User provided parameter passed to {\em rtn\/} \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=125pt]{LCBR_8h_a15_cgraph}
\end{center}
\end{figure}
\hypertarget{LCBR_8h_a18}{
\index{LCBR.h@{LCBR.h}!LCBR_show@{LCBR\_\-show}}
\index{LCBR_show@{LCBR\_\-show}!LCBR.h@{LCBR.h}}
\subsubsection[LCBR\_\-show]{\setlength{\rightskip}{0pt plus 5cm}void LCBR\_\-show (unsigned int {\em options}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em beg}, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8h_a18}


Dumps the result items to stdout. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em options}]Show options \item[{\em beg}]Pointer to the first result descriptor to show \item[{\em end}]Pointer to one past the lst result descriptor to show \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=190pt]{LCBR_8h_a18_cgraph}
\end{center}
\end{figure}
