\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
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{LCBR_8h_3df860fb16bac7705af9d5d780352b02}{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_0fdff35b4725726cd666b5d366c7867b}{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_7db7cbce1d422b72d3c25dde4a626e6a}{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_836e58e391ff93b905151d1a352ad34d}{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_b96a237c0b8efd8630684893dfa28013}{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_c6cb154868cae947d37bc5c4e9012afc}{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_2f868eafe2d0c1ddc1c3a8e756868b99}{
typedef enum \hyperlink{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25}{\_\-LCBR\_\-TYPE} \hyperlink{LCBR_8h_2f868eafe2d0c1ddc1c3a8e756868b99}{LCBR\_\-TYPE}}
\label{LCBR_8h_2f868eafe2d0c1ddc1c3a8e756868b99}

\begin{CompactList}\small\item\em Typedef for enum \_\-LCBR\_\-TYPE. \item\end{CompactList}\item 
typedef unsigned int \hyperlink{LCBR_8h_b554bae4e2a6f51e050d24b73d31f76e}{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_bce9b6f68739ab81dfa7a23f41d5df25}{\_\-LCBR\_\-TYPE} \{ \par
\hyperlink{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df2506b2875cb8037051ca0457d9d6697ea8}{LCBR\_\-TYPE\_\-UNDEFINED} =  0, 
\par
\hyperlink{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25236db8f164884c6f2192814bcc437164}{LCBR\_\-TYPE\_\-RESPONSE} =  1, 
\par
\hyperlink{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25459bb8cd99d3e2f78b210de47bfe713f}{LCBR\_\-TYPE\_\-REGISTER} =  2, 
\par
\hyperlink{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25fae8138c3071df6ea5c0dffefee9576e}{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_5137742c40cbec181b9b802a2df07a43}{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_80b8d6296548da7021bd0057e01d1127}{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_0e35c19d0c1fec4e1ceae89d2c880328}{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_da0bf9551035dfd00933eaf3e7a314c4}{LCBR\_\-process} (const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$ri, const \hyperlink{union__LCB__ri}{LCB\_\-ri} $\ast$end, \hyperlink{LCBR_8h_b554bae4e2a6f51e050d24b73d31f76e}{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_bcb2b41ae158ad2cb5c04c3b860b784e}{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_778cc23a80af140c22f7d20e8f0e6ffb}{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_f2e1ea7c3b83f0da926a5ca308df98ea}{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_836e58e391ff93b905151d1a352ad34d}{
\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{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-MAP\_\-N8BYTES\_\-BY\_\-OPCODE}}
\label{LCBR_8h_836e58e391ff93b905151d1a352ad34d}


\textbf{Value:}

\begin{Code}\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}
\end{Code}
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_3df860fb16bac7705af9d5d780352b02}{
\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{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}}
\label{LCBR_8h_3df860fb16bac7705af9d5d780352b02}


\textbf{Value:}

\begin{Code}\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}
\end{Code}
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 PowerPC this should be two instructions.



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



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_c6cb154868cae947d37bc5c4e9012afc}{
\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{\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_c6cb154868cae947d37bc5c4e9012afc}


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_b96a237c0b8efd8630684893dfa28013}{
\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{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-N8BYTES\_\-BY\_\-OPCODE\_\-FULL(\_\-map, \_\-opcode)~(((unsigned int)\_\-map $>$$>$ (2 $\ast$ (\_\-opcode))) \& 0x3)}}
\label{LCBR_8h_b96a237c0b8efd8630684893dfa28013}


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 PowerPC) 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_7db7cbce1d422b72d3c25dde4a626e6a}{
\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{\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_7db7cbce1d422b72d3c25dde4a626e6a}


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_0fdff35b4725726cd666b5d366c7867b}{
\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{\setlength{\rightskip}{0pt plus 5cm}\#define LCBR\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL(\_\-map, \_\-opcode)~(((unsigned int)\_\-map $>$$>$ (2 $\ast$ (\_\-opcode))) \& 0x3)}}
\label{LCBR_8h_0fdff35b4725726cd666b5d366c7867b}


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 PowerPC) 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_b554bae4e2a6f51e050d24b73d31f76e}{
\index{LCBR.h@{LCBR.h}!LCBR_processor@{LCBR\_\-processor}}
\index{LCBR_processor@{LCBR\_\-processor}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int {\bf LCBR\_\-processor}}}
\label{LCBR_8h_b554bae4e2a6f51e050d24b73d31f76e}


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_bce9b6f68739ab81dfa7a23f41d5df25}{
\index{LCBR.h@{LCBR.h}!_LCBR_TYPE@{\_\-LCBR\_\-TYPE}}
\index{_LCBR_TYPE@{\_\-LCBR\_\-TYPE}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf \_\-LCBR\_\-TYPE}}}
\label{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25}


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

\begin{Desc}
\item[Enumerator: ]\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_bce9b6f68739ab81dfa7a23f41d5df2506b2875cb8037051ca0457d9d6697ea8}{
LCBR\_\-TYPE\_\-UNDEFINED}
\label{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df2506b2875cb8037051ca0457d9d6697ea8}
}]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_bce9b6f68739ab81dfa7a23f41d5df25236db8f164884c6f2192814bcc437164}{
LCBR\_\-TYPE\_\-RESPONSE}
\label{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25236db8f164884c6f2192814bcc437164}
}]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_bce9b6f68739ab81dfa7a23f41d5df25459bb8cd99d3e2f78b210de47bfe713f}{
LCBR\_\-TYPE\_\-REGISTER}
\label{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25459bb8cd99d3e2f78b210de47bfe713f}
}]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_bce9b6f68739ab81dfa7a23f41d5df25fae8138c3071df6ea5c0dffefee9576e}{
LCBR\_\-TYPE\_\-COMMAND}
\label{LCBR_8h_bce9b6f68739ab81dfa7a23f41d5df25fae8138c3071df6ea5c0dffefee9576e}
}]Type is a command response \end{description}
\end{Desc}



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


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_0e35c19d0c1fec4e1ceae89d2c880328}{
\index{LCBR.h@{LCBR.h}!LCBR__data32_get@{LCBR\_\-\_\-data32\_\-get}}
\index{LCBR__data32_get@{LCBR\_\-\_\-data32\_\-get}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}LCBR\_\-\_\-EXP\_\-FNC unsigned int LCBR\_\-\_\-data32\_\-get (unsigned short $\ast$ {\em payload})}}
\label{LCBR_8h_0e35c19d0c1fec4e1ceae89d2c880328}


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\_\-headerGet(), LCBR\_\-payloadLocate ()\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\_\-payloadLocate and properly checking the returned pointer will fulfill this constraint. \hypertarget{LCBR_8h_80b8d6296548da7021bd0057e01d1127}{
\index{LCBR.h@{LCBR.h}!LCBR__next@{LCBR\_\-\_\-next}}
\index{LCBR__next@{LCBR\_\-\_\-next}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}LCBR\_\-\_\-EXP\_\-FNC const {\bf LCB\_\-ri} $\ast$ LCBR\_\-\_\-next (const {\bf LCB\_\-ri} $\ast$ {\em ri})}}
\label{LCBR_8h_80b8d6296548da7021bd0057e01d1127}


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_bcb2b41ae158ad2cb5c04c3b860b784e}{
\index{LCBR.h@{LCBR.h}!LCBR_check@{LCBR\_\-check}}
\index{LCBR_check@{LCBR\_\-check}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf LCB\_\-ri} $\ast$ LCBR\_\-check (const {\bf LCB\_\-ri} $\ast$ {\em ri}, const {\bf LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8h_bcb2b41ae158ad2cb5c04c3b860b784e}


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_778cc23a80af140c22f7d20e8f0e6ffb}{
\index{LCBR.h@{LCBR.h}!LCBR_error_get@{LCBR\_\-error\_\-get}}
\index{LCBR_error_get@{LCBR\_\-error\_\-get}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-error\_\-get (const {\bf LCB\_\-ri} $\ast$ {\em ri})}}
\label{LCBR_8h_778cc23a80af140c22f7d20e8f0e6ffb}


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_da0bf9551035dfd00933eaf3e7a314c4}{
\index{LCBR.h@{LCBR.h}!LCBR_process@{LCBR\_\-process}}
\index{LCBR_process@{LCBR\_\-process}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBR\_\-process (const {\bf LCB\_\-ri} $\ast$ {\em ri}, const {\bf LCB\_\-ri} $\ast$ {\em end}, {\bf LCBR\_\-processor} {\em rtn}, void $\ast$ {\em prm})}}
\label{LCBR_8h_da0bf9551035dfd00933eaf3e7a314c4}


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}
\hypertarget{LCBR_8h_f2e1ea7c3b83f0da926a5ca308df98ea}{
\index{LCBR.h@{LCBR.h}!LCBR_show@{LCBR\_\-show}}
\index{LCBR_show@{LCBR\_\-show}!LCBR.h@{LCBR.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCBR\_\-show (unsigned int {\em options}, const {\bf LCB\_\-ri} $\ast$ {\em beg}, const {\bf LCB\_\-ri} $\ast$ {\em end})}}
\label{LCBR_8h_f2e1ea7c3b83f0da926a5ca308df98ea}


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}
