\section{aversive\_\-10-03-12/modules/comm/uart/uart\_\-private.h File Reference}
\label{uart__private_8h}\index{aversive\_\-10-03-12/modules/comm/uart/uart\_\-private.h@{aversive\_\-10-03-12/modules/comm/uart/uart\_\-private.h}}
{\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\_\-config.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf regs}
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef volatile uint8\_\-t $\ast$ {\bf uart\_\-reg\_\-t}
\item 
typedef void( {\bf event} )(char)
\item 
typedef void( {\bf event\_\-9bits} )(int)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf uart\_\-send\_\-next\_\-char} (uint8\_\-t num)
\item 
int8\_\-t {\bf uart\_\-setconf} (uint8\_\-t num, struct {\bf uart\_\-config} $\ast$u)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
struct {\bf regs} {\bf uart\_\-regs} [UART\_\-HW\_\-NUM]
\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]
\end{CompactItemize}


\subsection{Typedef Documentation}
\index{uart\_\-private.h@{uart\_\-private.h}!event@{event}}
\index{event@{event}!uart_private.h@{uart\_\-private.h}}
\subsubsection[event]{\setlength{\rightskip}{0pt plus 5cm}typedef void( {\bf event})(char)}\label{uart__private_8h_c002e5ef6b25541b21fa588f567903fa}




Definition at line 47 of file uart\_\-private.h.\index{uart\_\-private.h@{uart\_\-private.h}!event\_\-9bits@{event\_\-9bits}}
\index{event\_\-9bits@{event\_\-9bits}!uart_private.h@{uart\_\-private.h}}
\subsubsection[event\_\-9bits]{\setlength{\rightskip}{0pt plus 5cm}typedef void( {\bf event\_\-9bits})(int)}\label{uart__private_8h_2cebc11d525eba4f2659159986c7c874}




Definition at line 48 of file uart\_\-private.h.\index{uart\_\-private.h@{uart\_\-private.h}!uart\_\-reg\_\-t@{uart\_\-reg\_\-t}}
\index{uart\_\-reg\_\-t@{uart\_\-reg\_\-t}!uart_private.h@{uart\_\-private.h}}
\subsubsection[uart\_\-reg\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef volatile uint8\_\-t$\ast$ {\bf uart\_\-reg\_\-t}}\label{uart__private_8h_b752dbe2a7d661710f26da8533f39e0a}




Definition at line 34 of file uart\_\-private.h.

\subsection{Function Documentation}
\index{uart\_\-private.h@{uart\_\-private.h}!uart\_\-send\_\-next\_\-char@{uart\_\-send\_\-next\_\-char}}
\index{uart\_\-send\_\-next\_\-char@{uart\_\-send\_\-next\_\-char}!uart_private.h@{uart\_\-private.h}}
\subsubsection[uart\_\-send\_\-next\_\-char]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-send\_\-next\_\-char (uint8\_\-t {\em num})}\label{uart__private_8h_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().\index{uart\_\-private.h@{uart\_\-private.h}!uart\_\-setconf@{uart\_\-setconf}}
\index{uart\_\-setconf@{uart\_\-setconf}!uart_private.h@{uart\_\-private.h}}
\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__private_8h_b6107b6bd3a29f6c8d7da52da726ea27}


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

Definition at line 38 of file uart\_\-host.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.

\subsection{Variable Documentation}
\index{uart\_\-private.h@{uart\_\-private.h}!g\_\-rx\_\-fifo@{g\_\-rx\_\-fifo}}
\index{g\_\-rx\_\-fifo@{g\_\-rx\_\-fifo}!uart_private.h@{uart\_\-private.h}}
\subsubsection[g\_\-rx\_\-fifo]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf cirbuf} {\bf g\_\-rx\_\-fifo}[UART\_\-HW\_\-NUM]}\label{uart__private_8h_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\_\-private.h@{uart\_\-private.h}!g\_\-tx\_\-fifo@{g\_\-tx\_\-fifo}}
\index{g\_\-tx\_\-fifo@{g\_\-tx\_\-fifo}!uart_private.h@{uart\_\-private.h}}
\subsubsection[g\_\-tx\_\-fifo]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf cirbuf} {\bf g\_\-tx\_\-fifo}[UART\_\-HW\_\-NUM]}\label{uart__private_8h_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\_\-private.h@{uart\_\-private.h}!rx\_\-event@{rx\_\-event}}
\index{rx\_\-event@{rx\_\-event}!uart_private.h@{uart\_\-private.h}}
\subsubsection[rx\_\-event]{\setlength{\rightskip}{0pt plus 5cm}{\bf event}$\ast$ {\bf rx\_\-event}[UART\_\-HW\_\-NUM]}\label{uart__private_8h_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\_\-private.h@{uart\_\-private.h}!tx\_\-event@{tx\_\-event}}
\index{tx\_\-event@{tx\_\-event}!uart_private.h@{uart\_\-private.h}}
\subsubsection[tx\_\-event]{\setlength{\rightskip}{0pt plus 5cm}{\bf event}$\ast$ {\bf tx\_\-event}[UART\_\-HW\_\-NUM]}\label{uart__private_8h_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\_\-private.h@{uart\_\-private.h}!uart\_\-regs@{uart\_\-regs}}
\index{uart\_\-regs@{uart\_\-regs}!uart_private.h@{uart\_\-private.h}}
\subsubsection[uart\_\-regs]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf regs} {\bf uart\_\-regs}[UART\_\-HW\_\-NUM]}\label{uart__private_8h_b436abb78ac4e84b334303c9375beacf}




Definition at line 45 of file uart\_\-private.h.