\section{aversive\_\-10-03-12/modules/comm/uart/uart.c File Reference}
\label{uart_8c}\index{aversive\_\-10-03-12/modules/comm/uart/uart.c@{aversive\_\-10-03-12/modules/comm/uart/uart.c}}
Errors of the UART module. 

{\tt \#include $<$aversive.h$>$}\par
{\tt \#include $<$aversive/list.h$>$}\par
{\tt \#include $<$uart.h$>$}\par
{\tt \#include $<$uart\_\-defs.h$>$}\par
{\tt \#include $<$uart\_\-private.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf uart\_\-send\_\-next\_\-char} (uint8\_\-t num)
\item 
void {\bf uart\_\-init} (void)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
struct {\bf cirbuf} {\bf g\_\-tx\_\-fifo} [UART\_\-HW\_\-NUM]
\item 
struct {\bf cirbuf} {\bf g\_\-rx\_\-fifo} [UART\_\-HW\_\-NUM]
\item 
{\bf event} $\ast$ {\bf rx\_\-event} [UART\_\-HW\_\-NUM]
\item 
{\bf event} $\ast$ {\bf tx\_\-event} [UART\_\-HW\_\-NUM]
\item 
struct {\bf regs} {\bf uart\_\-regs} [UART\_\-HW\_\-NUM]
\end{CompactItemize}


\subsection{Detailed Description}
Errors of the UART module. 

\begin{Desc}
\item[{\bf Todo}]None\end{Desc}
\begin{Desc}
\item[{\bf Test}]None \end{Desc}


Definition in file {\bf uart.c}.

\subsection{Function Documentation}
\index{uart.c@{uart.c}!uart\_\-init@{uart\_\-init}}
\index{uart\_\-init@{uart\_\-init}!uart.c@{uart.c}}
\subsubsection[uart\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-init (void)}\label{uart_8c_0c0ca72359ddf28dcd15900dfba19343}


Initialisation function. This function puts the registers of the microcontroler in a correct state in order to use the uart. It uses the configuration file $<$uart\_\-config.h$>$ ; this function is equivalent to call uartX\_\-setconf(NULL) for each uart. 

Definition at line 239 of file uart.c.

Referenced by main().\index{uart.c@{uart.c}!uart\_\-send\_\-next\_\-char@{uart\_\-send\_\-next\_\-char}}
\index{uart\_\-send\_\-next\_\-char@{uart\_\-send\_\-next\_\-char}!uart.c@{uart.c}}
\subsubsection[uart\_\-send\_\-next\_\-char]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-send\_\-next\_\-char (uint8\_\-t {\em num})}\label{uart_8c_bfa755fcafa538f23db2c03e8b067897}


This is the interruption function which occurs when there is a new unread data in the reception buffer. transmit next character of fifo if any, and call the event function. This function is executed with intr locked. 

Definition at line 171 of file uart.c.

References cbi, cirbuf\_\-del\_\-buf\_\-tail(), cirbuf\_\-del\_\-tail(), cirbuf\_\-get\_\-buf\_\-tail(), CIRBUF\_\-GET\_\-LEN, cirbuf\_\-get\_\-tail(), CIRBUF\_\-IS\_\-EMPTY, parse\_\-doc::elt, g\_\-tx\_\-fifo, sbi, uart\_\-getconf\_\-nbits(), regs::ucsrb, and UDRIE.

Referenced by uart\_\-send(), and uart\_\-send\_\-9bits().

\subsection{Variable Documentation}
\index{uart.c@{uart.c}!g\_\-rx\_\-fifo@{g\_\-rx\_\-fifo}}
\index{g\_\-rx\_\-fifo@{g\_\-rx\_\-fifo}!uart.c@{uart.c}}
\subsubsection[g\_\-rx\_\-fifo]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf cirbuf} {\bf g\_\-rx\_\-fifo}[UART\_\-HW\_\-NUM]}\label{uart_8c_3ddd2ef85d5999f4ac9fbc9e66a565a4}


The reception fifo of uart 

Definition at line 32 of file uart.c.

Referenced by uart\_\-9bits\_\-recv\_\-nowait(), uart\_\-recv\_\-nowait(), and uart\_\-setconf().\index{uart.c@{uart.c}!g\_\-tx\_\-fifo@{g\_\-tx\_\-fifo}}
\index{g\_\-tx\_\-fifo@{g\_\-tx\_\-fifo}!uart.c@{uart.c}}
\subsubsection[g\_\-tx\_\-fifo]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf cirbuf} {\bf g\_\-tx\_\-fifo}[UART\_\-HW\_\-NUM]}\label{uart_8c_ad4a2ec40d08b241d875fccf52ea674d}


The emission fifo of uart 

Definition at line 31 of file uart.c.

Referenced by uart\_\-send(), uart\_\-send\_\-9bits(), uart\_\-send\_\-9bits\_\-nowait(), uart\_\-send\_\-next\_\-char(), uart\_\-send\_\-nowait(), and uart\_\-setconf().\index{uart.c@{uart.c}!rx\_\-event@{rx\_\-event}}
\index{rx\_\-event@{rx\_\-event}!uart.c@{uart.c}}
\subsubsection[rx\_\-event]{\setlength{\rightskip}{0pt plus 5cm}{\bf event}$\ast$ {\bf rx\_\-event}[UART\_\-HW\_\-NUM]}\label{uart_8c_f7d146cd775aa8ee3d58d56dc007c15d}




Definition at line 35 of file uart.c.

Referenced by mf2\_\-client\_\-register\_\-rx\_\-event(), mf2\_\-server\_\-register\_\-rx\_\-event(), mf2\_\-server\_\-timer\_\-cb(), SIGNAL(), and uart\_\-register\_\-rx\_\-event().\index{uart.c@{uart.c}!tx\_\-event@{tx\_\-event}}
\index{tx\_\-event@{tx\_\-event}!uart.c@{uart.c}}
\subsubsection[tx\_\-event]{\setlength{\rightskip}{0pt plus 5cm}{\bf event}$\ast$ {\bf tx\_\-event}[UART\_\-HW\_\-NUM]}\label{uart_8c_81015e0afbe262f229d5bc46c7720791}




Definition at line 36 of file uart.c.

Referenced by mf2\_\-client\_\-register\_\-tx\_\-event(), mf2\_\-server\_\-register\_\-tx\_\-event(), SIGNAL(), and uart\_\-register\_\-tx\_\-event().\index{uart.c@{uart.c}!uart\_\-regs@{uart\_\-regs}}
\index{uart\_\-regs@{uart\_\-regs}!uart.c@{uart.c}}
\subsubsection[uart\_\-regs]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf regs} {\bf uart\_\-regs}[UART\_\-HW\_\-NUM]}\label{uart_8c_b436abb78ac4e84b334303c9375beacf}




Definition at line 38 of file uart.c.

Referenced by uart\_\-getconf(), uart\_\-getconf\_\-nbits(), uart\_\-send(), uart\_\-send\_\-9bits(), uart\_\-send\_\-9bits\_\-nowait(), uart\_\-send\_\-nowait(), and uart\_\-setconf().