\section{aversive\_\-10-03-12/modules/comm/uart/uart\_\-setconf.c File Reference}
\label{uart__setconf_8c}\index{aversive\_\-10-03-12/modules/comm/uart/uart\_\-setconf.c@{aversive\_\-10-03-12/modules/comm/uart/uart\_\-setconf.c}}
{\tt \#include $<$uart.h$>$}\par
{\tt \#include $<$uart\_\-defs.h$>$}\par
{\tt \#include $<$uart\_\-private.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf UART\_\-SET\_\-STATICCONF}(x)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int8\_\-t {\bf uart\_\-setconf} (uint8\_\-t num, struct {\bf uart\_\-config} $\ast$u)
\end{CompactItemize}


\subsection{Define Documentation}
\index{uart\_\-setconf.c@{uart\_\-setconf.c}!UART\_\-SET\_\-STATICCONF@{UART\_\-SET\_\-STATICCONF}}
\index{UART\_\-SET\_\-STATICCONF@{UART\_\-SET\_\-STATICCONF}!uart_setconf.c@{uart\_\-setconf.c}}
\subsubsection[UART\_\-SET\_\-STATICCONF]{\setlength{\rightskip}{0pt plus 5cm}\#define UART\_\-SET\_\-STATICCONF(x)}\label{uart__setconf_8c_271b20d3b9a7081edbd2f064df094e3b}


\textbf{Value:}

\begin{Code}\begin{verbatim}u->enabled = UART##x##_ENABLED;                                 \
        u->intr_enabled = UART##x##_INTERRUPT_ENABLED;                  \
        u->use_double_speed = UART##x##_USE_DOUBLE_SPEED;               \
        u->parity =  UART##x##_PARITY;                                  \
        u->stop_bits = UART##x##_STOP_BIT;                              \
        u->nbits = UART##x##_NBITS;                                     \
        u->baudrate = UART##x##_BAUDRATE;                               \
        break
\end{verbatim}
\end{Code}


Definition at line 156 of file uart\_\-setconf.c.

Referenced by uart\_\-setconf().

\subsection{Function Documentation}
\index{uart\_\-setconf.c@{uart\_\-setconf.c}!uart\_\-setconf@{uart\_\-setconf}}
\index{uart\_\-setconf@{uart\_\-setconf}!uart_setconf.c@{uart\_\-setconf.c}}
\subsubsection[uart\_\-setconf]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t uart\_\-setconf (uint8\_\-t {\em num}, \/  struct {\bf uart\_\-config} $\ast$ {\em u})}\label{uart__setconf_8c_b6107b6bd3a29f6c8d7da52da726ea27}


Configure the uart 'num' with the given configuration. Returns 0 on success. 

Definition at line 166 of file uart\_\-setconf.c.

References uart\_\-config::baudrate, cirbuf\_\-init(), EINVAL, uart\_\-config::enabled, ENOTSUP, ESUCCESS, F\_\-CPU, g\_\-rx\_\-fifo, g\_\-tx\_\-fifo, uart\_\-config::intr\_\-enabled, IRQ\_\-LOCK, IRQ\_\-UNLOCK, parse\_\-symbols::l, RXCIE, RXEN, TXEN, U2X, UART\_\-HAS\_\-U2X, uart\_\-regs, UART\_\-SET\_\-STATICCONF, regs::ucsra, regs::ucsrb, UDRE, and uart\_\-config::use\_\-double\_\-speed.

Referenced by uart\_\-init().