\doxysection{src/core/prbs.c File Reference}
\label{prbs_8c}\index{src/core/prbs.c@{src/core/prbs.c}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include $<$osmocom/core/bits.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/prbs.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ osmo\+\_\+prbs\+\_\+state\+\_\+init} (struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$st, const struct \textbf{ osmo\+\_\+prbs} $\ast$prbs)
\begin{DoxyCompactList}\small\item\em Initialize the given caller-\/allocated PRBS state. \end{DoxyCompactList}\item 
static void \textbf{ osmo\+\_\+prbs\+\_\+process\+\_\+bit} (struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$state, \textbf{ ubit\+\_\+t} bit)
\item 
\textbf{ ubit\+\_\+t} \textbf{ osmo\+\_\+prbs\+\_\+get\+\_\+ubit} (struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$state)
\begin{DoxyCompactList}\small\item\em Get the next bit out of given PRBS instance. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+prbs\+\_\+get\+\_\+ubits} (\textbf{ ubit\+\_\+t} $\ast$out, unsigned int out\+\_\+len, struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$state)
\begin{DoxyCompactList}\small\item\em Fill buffer of unpacked bits with next bits out of given PRBS instance. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ osmo\+\_\+prbs} \textbf{ osmo\+\_\+prbs7}
\begin{DoxyCompactList}\small\item\em PRBS-\/7 according ITU-\/T O.\+150. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+prbs} \textbf{ osmo\+\_\+prbs9}
\begin{DoxyCompactList}\small\item\em PRBS-\/9 according ITU-\/T O.\+150. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+prbs} \textbf{ osmo\+\_\+prbs11}
\begin{DoxyCompactList}\small\item\em PRBS-\/11 according ITU-\/T O.\+150. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+prbs} \textbf{ osmo\+\_\+prbs15}
\begin{DoxyCompactList}\small\item\em PRBS-\/15 according ITU-\/T O.\+150. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\label{prbs_8c_a525d10aa4287f6da7f1fe62f0482f7e2}} 
\index{prbs.c@{prbs.c}!osmo\_prbs\_get\_ubit@{osmo\_prbs\_get\_ubit}}
\index{osmo\_prbs\_get\_ubit@{osmo\_prbs\_get\_ubit}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs\_get\_ubit()}
{\footnotesize\ttfamily \textbf{ ubit\+\_\+t} osmo\+\_\+prbs\+\_\+get\+\_\+ubit (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$}]{state }\end{DoxyParamCaption})}



Get the next bit out of given PRBS instance. 



References \textbf{ osmo\+\_\+prbs\+\_\+process\+\_\+bit()}, and \textbf{ osmo\+\_\+prbs\+\_\+state\+::state}.



Referenced by \textbf{ osmo\+\_\+prbs\+\_\+get\+\_\+ubits()}.

\mbox{\label{prbs_8c_a6f0f56ecec20b7c1dde8e4eb2886572d}} 
\index{prbs.c@{prbs.c}!osmo\_prbs\_get\_ubits@{osmo\_prbs\_get\_ubits}}
\index{osmo\_prbs\_get\_ubits@{osmo\_prbs\_get\_ubits}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs\_get\_ubits()}
{\footnotesize\ttfamily int osmo\+\_\+prbs\+\_\+get\+\_\+ubits (\begin{DoxyParamCaption}\item[{\textbf{ ubit\+\_\+t} $\ast$}]{out,  }\item[{unsigned int}]{out\+\_\+len,  }\item[{struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$}]{state }\end{DoxyParamCaption})}



Fill buffer of unpacked bits with next bits out of given PRBS instance. 



References \textbf{ osmo\+\_\+prbs\+\_\+get\+\_\+ubit()}.

\mbox{\label{prbs_8c_ac6c89dbce782ac51b8e51ec0a9736bcc}} 
\index{prbs.c@{prbs.c}!osmo\_prbs\_process\_bit@{osmo\_prbs\_process\_bit}}
\index{osmo\_prbs\_process\_bit@{osmo\_prbs\_process\_bit}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs\_process\_bit()}
{\footnotesize\ttfamily static void osmo\+\_\+prbs\+\_\+process\+\_\+bit (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$}]{state,  }\item[{\textbf{ ubit\+\_\+t}}]{bit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+prbs\+::coeff}, \textbf{ osmo\+\_\+prbs\+\_\+state\+::prbs}, and \textbf{ osmo\+\_\+prbs\+\_\+state\+::state}.



Referenced by \textbf{ osmo\+\_\+prbs\+\_\+get\+\_\+ubit()}.

\mbox{\label{prbs_8c_a20d9d984ba6af30a2550950cb3134c63}} 
\index{prbs.c@{prbs.c}!osmo\_prbs\_state\_init@{osmo\_prbs\_state\_init}}
\index{osmo\_prbs\_state\_init@{osmo\_prbs\_state\_init}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs\_state\_init()}
{\footnotesize\ttfamily void osmo\+\_\+prbs\+\_\+state\+\_\+init (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+prbs\+\_\+state} $\ast$}]{st,  }\item[{const struct \textbf{ osmo\+\_\+prbs} $\ast$}]{prbs }\end{DoxyParamCaption})}



Initialize the given caller-\/allocated PRBS state. 



References \textbf{ osmo\+\_\+prbs\+\_\+state\+::prbs}, and \textbf{ osmo\+\_\+prbs\+\_\+state\+::state}.



\doxysubsection{Variable Documentation}
\mbox{\label{prbs_8c_a7ad14c2c22b4b92a3e176f9d1bd51701}} 
\index{prbs.c@{prbs.c}!osmo\_prbs11@{osmo\_prbs11}}
\index{osmo\_prbs11@{osmo\_prbs11}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs11}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+prbs} osmo\+\_\+prbs11}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        }
\DoxyCodeLine{        .name = \textcolor{stringliteral}{"{}PRBS-\/11"{}},}
\DoxyCodeLine{        .len = 11,}
\DoxyCodeLine{        .coeff = (1<<10) | (1<<8),}
\DoxyCodeLine{\}}

\end{DoxyCode}


PRBS-\/11 according ITU-\/T O.\+150. 

\mbox{\label{prbs_8c_a3c3d26cc5c9bba987b72d0d05a06a8ba}} 
\index{prbs.c@{prbs.c}!osmo\_prbs15@{osmo\_prbs15}}
\index{osmo\_prbs15@{osmo\_prbs15}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs15}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+prbs} osmo\+\_\+prbs15}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        }
\DoxyCodeLine{        .name = \textcolor{stringliteral}{"{}PRBS-\/15"{}},}
\DoxyCodeLine{        .len = 15,}
\DoxyCodeLine{        .coeff = (1<<14) | (1<<13),}
\DoxyCodeLine{\}}

\end{DoxyCode}


PRBS-\/15 according ITU-\/T O.\+150. 

\mbox{\label{prbs_8c_a0a484b320cfb1d0000ac78d4e7467565}} 
\index{prbs.c@{prbs.c}!osmo\_prbs7@{osmo\_prbs7}}
\index{osmo\_prbs7@{osmo\_prbs7}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs7}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+prbs} osmo\+\_\+prbs7}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        }
\DoxyCodeLine{        .name = \textcolor{stringliteral}{"{}PRBS-\/7"{}},}
\DoxyCodeLine{        .len = 7,}
\DoxyCodeLine{        .coeff = (1<<6) | (1<<5),}
\DoxyCodeLine{\}}

\end{DoxyCode}


PRBS-\/7 according ITU-\/T O.\+150. 

\mbox{\label{prbs_8c_a592a20b5fc9dfe64a63059737234ca3f}} 
\index{prbs.c@{prbs.c}!osmo\_prbs9@{osmo\_prbs9}}
\index{osmo\_prbs9@{osmo\_prbs9}!prbs.c@{prbs.c}}
\doxysubsubsection{osmo\_prbs9}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+prbs} osmo\+\_\+prbs9}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        }
\DoxyCodeLine{        .name = \textcolor{stringliteral}{"{}PRBS-\/9"{}},}
\DoxyCodeLine{        .len = 9,}
\DoxyCodeLine{        .coeff = (1<<8) | (1<<4),}
\DoxyCodeLine{\}}

\end{DoxyCode}


PRBS-\/9 according ITU-\/T O.\+150. 

