\doxysection{osmo\+\_\+soft\+\_\+uart\+\_\+cfg Struct Reference}
\label{structosmo__soft__uart__cfg}\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}


Configuration for a soft-\/\+UART.  




{\ttfamily \#include $<$soft\+\_\+uart.\+h$>$}

\doxysubsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
uint8\+\_\+t \textbf{ num\+\_\+data\+\_\+bits}
\begin{DoxyCompactList}\small\item\em Number of data bits (typically 5, 6, 7 or 8). \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ num\+\_\+stop\+\_\+bits}
\begin{DoxyCompactList}\small\item\em Number of stop bits (typically 1 or 2). \end{DoxyCompactList}\item 
enum \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+parity\+\_\+mode} \textbf{ parity\+\_\+mode}
\begin{DoxyCompactList}\small\item\em Parity mode (none, even, odd, space, mark). \end{DoxyCompactList}\item 
unsigned int \textbf{ rx\+\_\+buf\+\_\+size}
\begin{DoxyCompactList}\small\item\em Size of the receive buffer; UART will buffer up to that number of characters before calling the receive call-\/back. \end{DoxyCompactList}\item 
unsigned int \textbf{ rx\+\_\+timeout\+\_\+ms}
\begin{DoxyCompactList}\small\item\em Receive timeout; UART will flush the receive buffer via the receive call-\/back after indicated number of milliseconds, even if it is not full yet. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ priv}
\begin{DoxyCompactList}\small\item\em Opaque application-\/private data; passed to call-\/backs. \end{DoxyCompactList}\item 
void($\ast$ \textbf{ rx\+\_\+cb} )(void $\ast$\textbf{ priv}, struct \textbf{ msgb} $\ast$rx\+\_\+data, unsigned int \textbf{ flags})
\begin{DoxyCompactList}\small\item\em Receive call-\/back of the application. \end{DoxyCompactList}\item 
void($\ast$ \textbf{ tx\+\_\+cb} )(void $\ast$\textbf{ priv}, struct \textbf{ msgb} $\ast$tx\+\_\+data)
\begin{DoxyCompactList}\small\item\em Transmit call-\/back of the application. \end{DoxyCompactList}\item 
void($\ast$ \textbf{ status\+\_\+change\+\_\+cb} )(void $\ast$\textbf{ priv}, unsigned int status)
\begin{DoxyCompactList}\small\item\em Modem status line change call-\/back. \end{DoxyCompactList}\item 
enum \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+flow\+\_\+ctrl\+\_\+mode} \textbf{ flow\+\_\+ctrl\+\_\+mode}
\begin{DoxyCompactList}\small\item\em \char`\"{}\+Hardware\char`\"{} flow control mode. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Configuration for a soft-\/\+UART. 

\doxysubsection{Field Documentation}
\mbox{\label{structosmo__soft__uart__cfg_a829845181355393fe89d4a54b6ea04f1}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!flow\_ctrl\_mode@{flow\_ctrl\_mode}}
\index{flow\_ctrl\_mode@{flow\_ctrl\_mode}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{flow\_ctrl\_mode}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+flow\+\_\+ctrl\+\_\+mode} osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::flow\+\_\+ctrl\+\_\+mode}



\char`\"{}\+Hardware\char`\"{} flow control mode. 



Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+tx\+\_\+ubits()}.

\mbox{\label{structosmo__soft__uart__cfg_a7abd5686b130f67adbd1fec476fe425f}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!num\_data\_bits@{num\_data\_bits}}
\index{num\_data\_bits@{num\_data\_bits}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{num\_data\_bits}
{\footnotesize\ttfamily uint8\+\_\+t osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::num\+\_\+data\+\_\+bits}



Number of data bits (typically 5, 6, 7 or 8). 



Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+configure()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+tx\+\_\+ubits()}, \textbf{ suart\+\_\+rx\+\_\+bit()}, and \textbf{ suart\+\_\+tx\+\_\+bit()}.

\mbox{\label{structosmo__soft__uart__cfg_a1d1dda885179f384535ddbbbfe660759}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!num\_stop\_bits@{num\_stop\_bits}}
\index{num\_stop\_bits@{num\_stop\_bits}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{num\_stop\_bits}
{\footnotesize\ttfamily uint8\+\_\+t osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::num\+\_\+stop\+\_\+bits}



Number of stop bits (typically 1 or 2). 



Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+configure()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+tx\+\_\+ubits()}, \textbf{ suart\+\_\+rx\+\_\+bit()}, and \textbf{ suart\+\_\+tx\+\_\+bit()}.

\mbox{\label{structosmo__soft__uart__cfg_a3cc2efc803a6306918169ebdc3133248}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!parity\_mode@{parity\_mode}}
\index{parity\_mode@{parity\_mode}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{parity\_mode}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+parity\+\_\+mode} osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::parity\+\_\+mode}



Parity mode (none, even, odd, space, mark). 



Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+configure()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+tx\+\_\+ubits()}, \textbf{ suart\+\_\+rx\+\_\+bit()}, and \textbf{ suart\+\_\+tx\+\_\+bit()}.

\mbox{\label{structosmo__soft__uart__cfg_ace69ad9e7afdcd0bdb51ccd7a4eb889a}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!priv@{priv}}
\index{priv@{priv}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{priv}
{\footnotesize\ttfamily void$\ast$ osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::priv}



Opaque application-\/private data; passed to call-\/backs. 



Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+flush\+\_\+rx()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+set\+\_\+status()}, and \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+tx\+\_\+ubits()}.

\mbox{\label{structosmo__soft__uart__cfg_ac396e846c13c8534559c2845dfa7a58b}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!rx\_buf\_size@{rx\_buf\_size}}
\index{rx\_buf\_size@{rx\_buf\_size}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{rx\_buf\_size}
{\footnotesize\ttfamily unsigned int osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::rx\+\_\+buf\+\_\+size}



Size of the receive buffer; UART will buffer up to that number of characters before calling the receive call-\/back. 



Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+configure()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+flush\+\_\+rx()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+set\+\_\+rx()}, and \textbf{ suart\+\_\+rx\+\_\+ch()}.

\mbox{\label{structosmo__soft__uart__cfg_abf5897765015de53fb28e910c4d7c926}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!rx\_cb@{rx\_cb}}
\index{rx\_cb@{rx\_cb}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{rx\_cb}
{\footnotesize\ttfamily void($\ast$ osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::rx\+\_\+cb) (void $\ast$\textbf{ priv}, struct \textbf{ msgb} $\ast$rx\+\_\+data, unsigned int \textbf{ flags})}



Receive call-\/back of the application. 

Called if at least one of the following conditions is met\+: a) rx\+\_\+buf\+\_\+size characters were received (Rx buffer is full); b) rx\+\_\+timeout\+\_\+ms expired and Rx buffer is not empty; c) a parity or framing error is occurred.


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em priv} & opaque application-\/private data. \\
\hline
\mbox{\texttt{ in}}  & {\em rx\+\_\+data} & msgb holding the received data. Must be free()ed by the application. \\
\hline
\mbox{\texttt{ in}}  & {\em flags} & bit-\/mask of OSMO\+\_\+\+SUART\+\_\+\+F\+\_\+$\ast$. \\
\hline
\end{DoxyParams}


Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+flush\+\_\+rx()}.

\mbox{\label{structosmo__soft__uart__cfg_ad564a39787155ae795f4399b9b8e16c8}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!rx\_timeout\_ms@{rx\_timeout\_ms}}
\index{rx\_timeout\_ms@{rx\_timeout\_ms}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{rx\_timeout\_ms}
{\footnotesize\ttfamily unsigned int osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::rx\+\_\+timeout\+\_\+ms}



Receive timeout; UART will flush the receive buffer via the receive call-\/back after indicated number of milliseconds, even if it is not full yet. 



Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+configure()}, and \textbf{ suart\+\_\+rx\+\_\+ch()}.

\mbox{\label{structosmo__soft__uart__cfg_afb9119466330ad2e1aaaffe6d5bb2ddb}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!status\_change\_cb@{status\_change\_cb}}
\index{status\_change\_cb@{status\_change\_cb}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{status\_change\_cb}
{\footnotesize\ttfamily void($\ast$ osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::status\+\_\+change\+\_\+cb) (void $\ast$\textbf{ priv}, unsigned int status)}



Modem status line change call-\/back. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em priv} & opaque application-\/private data. \\
\hline
\mbox{\texttt{ in}}  & {\em status} & updated status; bit-\/mask of OSMO\+\_\+\+SUART\+\_\+\+STATUS\+\_\+\+F\+\_\+$\ast$. \\
\hline
\end{DoxyParams}


Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+set\+\_\+status()}.

\mbox{\label{structosmo__soft__uart__cfg_a70ff964fa736f14166e618e3572466a3}} 
\index{osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}!tx\_cb@{tx\_cb}}
\index{tx\_cb@{tx\_cb}!osmo\_soft\_uart\_cfg@{osmo\_soft\_uart\_cfg}}
\doxysubsubsection{tx\_cb}
{\footnotesize\ttfamily void($\ast$ osmo\+\_\+soft\+\_\+uart\+\_\+cfg\+::tx\+\_\+cb) (void $\ast$\textbf{ priv}, struct \textbf{ msgb} $\ast$tx\+\_\+data)}



Transmit call-\/back of the application. 

The implementation is expected to provide at most tx\+\_\+data-\/$>$data\+\_\+len characters (the actual amount is determined by the number of requested bits and the effective UART configuration).


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em priv} & opaque application-\/private data. \\
\hline
\mbox{\texttt{ in,out}}  & {\em tx\+\_\+data} & msgb for writing to be transmitted data. \\
\hline
\end{DoxyParams}


Referenced by \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+tx\+\_\+ubits()}.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/osmocom/core/\textbf{ soft\+\_\+uart.\+h}\end{DoxyCompactItemize}
