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

{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$aversive.h$>$}\par
{\tt \#include $<$uart\_\-config.h$>$}\par
{\tt \#include $<$cirbuf.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf uart\_\-config}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf uart\_\-init} (void)
\item 
int8\_\-t {\bf uart\_\-setconf} (uint8\_\-t num, struct {\bf uart\_\-config} $\ast$u)
\item 
void {\bf uart\_\-getconf} (uint8\_\-t num, struct {\bf uart\_\-config} $\ast$u)
\item 
int {\bf uart\_\-recv} (uint8\_\-t num)
\item 
int {\bf uart\_\-recv\_\-nowait} (uint8\_\-t num)
\item 
int {\bf uart\_\-9bits\_\-recv} (uint8\_\-t num)
\item 
int {\bf uart\_\-9bits\_\-recv\_\-nowait} (uint8\_\-t num)
\item 
int {\bf uart\_\-send\_\-nowait} (uint8\_\-t num, char c)
\item 
int {\bf uart\_\-send} (uint8\_\-t num, char c)
\item 
int {\bf uart\_\-send\_\-9bits\_\-nowait} (uint8\_\-t num, int c)
\item 
int {\bf uart\_\-send\_\-9bits} (uint8\_\-t num, int c)
\item 
void {\bf uart\_\-register\_\-tx\_\-event} (uint8\_\-t num, void($\ast$f)(char))
\item 
void {\bf uart\_\-register\_\-rx\_\-event} (uint8\_\-t num, void($\ast$f)(char))
\item 
void {\bf uart\_\-register\_\-tx\_\-9bits\_\-event} (uint8\_\-t num, void($\ast$f)(int))
\item 
void {\bf uart\_\-register\_\-rx\_\-9bits\_\-event} (uint8\_\-t num, void($\ast$f)(int))
\item 
int {\bf uart0\_\-dev\_\-send\_\-nowait} (char c, FILE $\ast$f)
\item 
int {\bf uart0\_\-dev\_\-send} (char c, FILE $\ast$f)
\item 
int {\bf uart0\_\-dev\_\-recv\_\-nowait} (FILE $\ast$f)
\item 
int {\bf uart0\_\-dev\_\-recv} (FILE $\ast$f)
\item 
int {\bf uart1\_\-dev\_\-send\_\-nowait} (char c, FILE $\ast$f)
\item 
int {\bf uart1\_\-dev\_\-send} (char c, FILE $\ast$f)
\item 
int {\bf uart1\_\-dev\_\-recv\_\-nowait} (FILE $\ast$f)
\item 
int {\bf uart1\_\-dev\_\-recv} (FILE $\ast$f)
\item 
int {\bf uart2\_\-dev\_\-send\_\-nowait} (char c, FILE $\ast$f)
\item 
int {\bf uart2\_\-dev\_\-send} (char c, FILE $\ast$f)
\item 
int {\bf uart2\_\-dev\_\-recv\_\-nowait} (FILE $\ast$f)
\item 
int {\bf uart2\_\-dev\_\-recv} (FILE $\ast$f)
\item 
int {\bf uart3\_\-dev\_\-send\_\-nowait} (char c, FILE $\ast$f)
\item 
int {\bf uart3\_\-dev\_\-send} (char c, FILE $\ast$f)
\item 
int {\bf uart3\_\-dev\_\-recv\_\-nowait} (FILE $\ast$f)
\item 
int {\bf uart3\_\-dev\_\-recv} (FILE $\ast$f)
\end{CompactItemize}


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

This module provides :\begin{itemize}
\item Tx and Rx with fifo\item Speed selection\item Parity selection (if the uC support it)\item 5 to 8 data bits (if the uC support it).\item 1 or 2 stop bits (if the uC support it).\item up to 4 UARTs (if the uC support it).\end{itemize}


Number of bits in frame, parity, stop bits are the same for tx and rx. TX fifo is useless if interrupts are disabled because the uart wait that all bytes are transmitted before returning.

It doesn't support some USART capabilities :\begin{itemize}
\item Synchronous mode\item Multiprocessor communication \end{itemize}


Definition in file {\bf uart.h}.

\subsection{Function Documentation}
\index{uart.h@{uart.h}!uart0\_\-dev\_\-recv@{uart0\_\-dev\_\-recv}}
\index{uart0\_\-dev\_\-recv@{uart0\_\-dev\_\-recv}!uart.h@{uart.h}}
\subsubsection[uart0\_\-dev\_\-recv]{\setlength{\rightskip}{0pt plus 5cm}int uart0\_\-dev\_\-recv (FILE $\ast$ {\em f})}\label{uart_8h_baaca1c36849c925a31167971cf68582}




Referenced by main().\index{uart.h@{uart.h}!uart0\_\-dev\_\-recv\_\-nowait@{uart0\_\-dev\_\-recv\_\-nowait}}
\index{uart0\_\-dev\_\-recv\_\-nowait@{uart0\_\-dev\_\-recv\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart0\_\-dev\_\-recv\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart0\_\-dev\_\-recv\_\-nowait (FILE $\ast$ {\em f})}\label{uart_8h_2c6a14e9b59ed3bf3ea737572187f3bb}


\index{uart.h@{uart.h}!uart0\_\-dev\_\-send@{uart0\_\-dev\_\-send}}
\index{uart0\_\-dev\_\-send@{uart0\_\-dev\_\-send}!uart.h@{uart.h}}
\subsubsection[uart0\_\-dev\_\-send]{\setlength{\rightskip}{0pt plus 5cm}int uart0\_\-dev\_\-send (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_14616f76781c4a4893ca60607e8f44c6}




Referenced by main().\index{uart.h@{uart.h}!uart0\_\-dev\_\-send\_\-nowait@{uart0\_\-dev\_\-send\_\-nowait}}
\index{uart0\_\-dev\_\-send\_\-nowait@{uart0\_\-dev\_\-send\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart0\_\-dev\_\-send\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart0\_\-dev\_\-send\_\-nowait (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_890327864adeb5dddb9029265c55be09}


\index{uart.h@{uart.h}!uart1\_\-dev\_\-recv@{uart1\_\-dev\_\-recv}}
\index{uart1\_\-dev\_\-recv@{uart1\_\-dev\_\-recv}!uart.h@{uart.h}}
\subsubsection[uart1\_\-dev\_\-recv]{\setlength{\rightskip}{0pt plus 5cm}int uart1\_\-dev\_\-recv (FILE $\ast$ {\em f})}\label{uart_8h_9de7ff68ea6cc1b97db73071bbf60a1d}




Referenced by main().\index{uart.h@{uart.h}!uart1\_\-dev\_\-recv\_\-nowait@{uart1\_\-dev\_\-recv\_\-nowait}}
\index{uart1\_\-dev\_\-recv\_\-nowait@{uart1\_\-dev\_\-recv\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart1\_\-dev\_\-recv\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart1\_\-dev\_\-recv\_\-nowait (FILE $\ast$ {\em f})}\label{uart_8h_c66cd460db8e17763b32f758379598d3}


\index{uart.h@{uart.h}!uart1\_\-dev\_\-send@{uart1\_\-dev\_\-send}}
\index{uart1\_\-dev\_\-send@{uart1\_\-dev\_\-send}!uart.h@{uart.h}}
\subsubsection[uart1\_\-dev\_\-send]{\setlength{\rightskip}{0pt plus 5cm}int uart1\_\-dev\_\-send (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_f8f12272b41087d843614469d3e5b583}




Referenced by main().\index{uart.h@{uart.h}!uart1\_\-dev\_\-send\_\-nowait@{uart1\_\-dev\_\-send\_\-nowait}}
\index{uart1\_\-dev\_\-send\_\-nowait@{uart1\_\-dev\_\-send\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart1\_\-dev\_\-send\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart1\_\-dev\_\-send\_\-nowait (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_8686cbb9b483993604399790459ecca3}


\index{uart.h@{uart.h}!uart2\_\-dev\_\-recv@{uart2\_\-dev\_\-recv}}
\index{uart2\_\-dev\_\-recv@{uart2\_\-dev\_\-recv}!uart.h@{uart.h}}
\subsubsection[uart2\_\-dev\_\-recv]{\setlength{\rightskip}{0pt plus 5cm}int uart2\_\-dev\_\-recv (FILE $\ast$ {\em f})}\label{uart_8h_3957c24acfe946aa0806852d1681bb55}


\index{uart.h@{uart.h}!uart2\_\-dev\_\-recv\_\-nowait@{uart2\_\-dev\_\-recv\_\-nowait}}
\index{uart2\_\-dev\_\-recv\_\-nowait@{uart2\_\-dev\_\-recv\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart2\_\-dev\_\-recv\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart2\_\-dev\_\-recv\_\-nowait (FILE $\ast$ {\em f})}\label{uart_8h_db3f62f4bb432502fe585845f875918a}


\index{uart.h@{uart.h}!uart2\_\-dev\_\-send@{uart2\_\-dev\_\-send}}
\index{uart2\_\-dev\_\-send@{uart2\_\-dev\_\-send}!uart.h@{uart.h}}
\subsubsection[uart2\_\-dev\_\-send]{\setlength{\rightskip}{0pt plus 5cm}int uart2\_\-dev\_\-send (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_e20c9891afdc97e4f058ae70733799ff}


\index{uart.h@{uart.h}!uart2\_\-dev\_\-send\_\-nowait@{uart2\_\-dev\_\-send\_\-nowait}}
\index{uart2\_\-dev\_\-send\_\-nowait@{uart2\_\-dev\_\-send\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart2\_\-dev\_\-send\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart2\_\-dev\_\-send\_\-nowait (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_fdd0ef295712736e097164c90d1f1006}


\index{uart.h@{uart.h}!uart3\_\-dev\_\-recv@{uart3\_\-dev\_\-recv}}
\index{uart3\_\-dev\_\-recv@{uart3\_\-dev\_\-recv}!uart.h@{uart.h}}
\subsubsection[uart3\_\-dev\_\-recv]{\setlength{\rightskip}{0pt plus 5cm}int uart3\_\-dev\_\-recv (FILE $\ast$ {\em f})}\label{uart_8h_50060d5310acc8d773b4371efdf050b1}


\index{uart.h@{uart.h}!uart3\_\-dev\_\-recv\_\-nowait@{uart3\_\-dev\_\-recv\_\-nowait}}
\index{uart3\_\-dev\_\-recv\_\-nowait@{uart3\_\-dev\_\-recv\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart3\_\-dev\_\-recv\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart3\_\-dev\_\-recv\_\-nowait (FILE $\ast$ {\em f})}\label{uart_8h_3c12d05336a738271b236347f7ae8665}


\index{uart.h@{uart.h}!uart3\_\-dev\_\-send@{uart3\_\-dev\_\-send}}
\index{uart3\_\-dev\_\-send@{uart3\_\-dev\_\-send}!uart.h@{uart.h}}
\subsubsection[uart3\_\-dev\_\-send]{\setlength{\rightskip}{0pt plus 5cm}int uart3\_\-dev\_\-send (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_d4ca9e396696d8410e1daab54d1571d1}


\index{uart.h@{uart.h}!uart3\_\-dev\_\-send\_\-nowait@{uart3\_\-dev\_\-send\_\-nowait}}
\index{uart3\_\-dev\_\-send\_\-nowait@{uart3\_\-dev\_\-send\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart3\_\-dev\_\-send\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart3\_\-dev\_\-send\_\-nowait (char {\em c}, \/  FILE $\ast$ {\em f})}\label{uart_8h_eecf6a95bcda696ba36c3e18b6c93604}


\index{uart.h@{uart.h}!uart\_\-9bits\_\-recv@{uart\_\-9bits\_\-recv}}
\index{uart\_\-9bits\_\-recv@{uart\_\-9bits\_\-recv}!uart.h@{uart.h}}
\subsubsection[uart\_\-9bits\_\-recv]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-9bits\_\-recv (uint8\_\-t {\em num})}\label{uart_8h_e843402902d2797c2b107b22cb971730}


same than uart\_\-recv with 9 bits. 

Definition at line 29 of file uart\_\-recv9.c.

References parse\_\-doc::elt, and uart\_\-9bits\_\-recv\_\-nowait().\index{uart.h@{uart.h}!uart\_\-9bits\_\-recv\_\-nowait@{uart\_\-9bits\_\-recv\_\-nowait}}
\index{uart\_\-9bits\_\-recv\_\-nowait@{uart\_\-9bits\_\-recv\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart\_\-9bits\_\-recv\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-9bits\_\-recv\_\-nowait (uint8\_\-t {\em num})}\label{uart_8h_13a97908b3f8a9da18316e605daf1e4b}


same than \doxyref{uart\_\-recv\_\-nowait()}{p.}{uart_8h_11af1765bcbdcd9cb2b0b17ce9cbdc11} with 9 bits. 

Definition at line 29 of file uart\_\-recv9\_\-nowait.c.

References cirbuf\_\-del\_\-buf\_\-tail(), cirbuf\_\-get\_\-buf\_\-tail(), CIRBUF\_\-GET\_\-LEN, parse\_\-doc::elt, g\_\-rx\_\-fifo, IRQ\_\-LOCK, and IRQ\_\-UNLOCK.

Referenced by uart\_\-9bits\_\-recv().\index{uart.h@{uart.h}!uart\_\-getconf@{uart\_\-getconf}}
\index{uart\_\-getconf@{uart\_\-getconf}!uart.h@{uart.h}}
\subsubsection[uart\_\-getconf]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-getconf (uint8\_\-t {\em num}, \/  struct {\bf uart\_\-config} $\ast$ {\em u})}\label{uart_8h_8b254078fe61199632993cbeabd12023}


Get the current configuration of the uart 'num' 

Definition at line 123 of file uart\_\-getconf.c.

References uart\_\-config::baudrate, uart\_\-config::enabled, F\_\-CPU, uart\_\-config::intr\_\-enabled, IRQ\_\-LOCK, IRQ\_\-UNLOCK, uart\_\-config::nbits, uart\_\-config::parity, RXCIE, RXEN, uart\_\-config::stop\_\-bits, U2X, uart\_\-getconf\_\-nbits(), UART\_\-HAS\_\-U2X, UART\_\-IS\_\-USART, UART\_\-PARTITY\_\-EVEN, UART\_\-PARTITY\_\-NONE, UART\_\-PARTITY\_\-ODD, uart\_\-regs, UART\_\-STOP\_\-BITS\_\-1, UART\_\-STOP\_\-BITS\_\-2, UPM0, UPM1, USBS, and uart\_\-config::use\_\-double\_\-speed.\index{uart.h@{uart.h}!uart\_\-init@{uart\_\-init}}
\index{uart\_\-init@{uart\_\-init}!uart.h@{uart.h}}
\subsubsection[uart\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-init (void)}\label{uart_8h_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.

References uart\_\-setconf().

Referenced by main().\index{uart.h@{uart.h}!uart\_\-recv@{uart\_\-recv}}
\index{uart\_\-recv@{uart\_\-recv}!uart.h@{uart.h}}
\subsubsection[uart\_\-recv]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-recv (uint8\_\-t {\em num})}\label{uart_8h_f2868eb5b1a02c5fa1ecee7bab7f2dc6}


uart\_\-recv returns the next character, taken from the fifo (if any). If there is nothing to read, the function waits until something come on the uart. 

Definition at line 47 of file uart\_\-host.c.

References parse\_\-doc::elt, and uart\_\-recv\_\-nowait().\index{uart.h@{uart.h}!uart\_\-recv\_\-nowait@{uart\_\-recv\_\-nowait}}
\index{uart\_\-recv\_\-nowait@{uart\_\-recv\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart\_\-recv\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-recv\_\-nowait (uint8\_\-t {\em num})}\label{uart_8h_11af1765bcbdcd9cb2b0b17ce9cbdc11}


uart\_\-recv returns the next character, taken from the fifo (if any). If there is nothing to read, the function returns -1. 

Definition at line 29 of file uart\_\-recv\_\-nowait.c.

References cirbuf\_\-del\_\-tail(), cirbuf\_\-get\_\-tail(), CIRBUF\_\-IS\_\-EMPTY, parse\_\-doc::elt, g\_\-rx\_\-fifo, IRQ\_\-LOCK, and IRQ\_\-UNLOCK.

Referenced by uart\_\-recv().\index{uart.h@{uart.h}!uart\_\-register\_\-rx\_\-9bits\_\-event@{uart\_\-register\_\-rx\_\-9bits\_\-event}}
\index{uart\_\-register\_\-rx\_\-9bits\_\-event@{uart\_\-register\_\-rx\_\-9bits\_\-event}!uart.h@{uart.h}}
\subsubsection[uart\_\-register\_\-rx\_\-9bits\_\-event]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-register\_\-rx\_\-9bits\_\-event (uint8\_\-t {\em num}, \/  void($\ast$)(int) {\em f})}\label{uart_8h_4cfa05ab63523ad219bc4ceeaa57b28f}


This function is used to register another function which will be executed at each 9 bits reception. WARNING : it uses the same internal pointer that the 8 bits event, so be carreful to unregister 8 bits events when doing 9 bits and vice versa. \index{uart.h@{uart.h}!uart\_\-register\_\-rx\_\-event@{uart\_\-register\_\-rx\_\-event}}
\index{uart\_\-register\_\-rx\_\-event@{uart\_\-register\_\-rx\_\-event}!uart.h@{uart.h}}
\subsubsection[uart\_\-register\_\-rx\_\-event]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-register\_\-rx\_\-event (uint8\_\-t {\em num}, \/  void($\ast$)(char) {\em f})}\label{uart_8h_cf2c6bdeda5b85cd4555024655834278}


This function is used to register another function which will be executed at each byte reception (5, 6 ,7 ,8 bits) 

Definition at line 42 of file uart\_\-events.c.

References parse\_\-symbols::f, IRQ\_\-LOCK, IRQ\_\-UNLOCK, rx\_\-event, and UART\_\-HW\_\-NUM.\index{uart.h@{uart.h}!uart\_\-register\_\-tx\_\-9bits\_\-event@{uart\_\-register\_\-tx\_\-9bits\_\-event}}
\index{uart\_\-register\_\-tx\_\-9bits\_\-event@{uart\_\-register\_\-tx\_\-9bits\_\-event}!uart.h@{uart.h}}
\subsubsection[uart\_\-register\_\-tx\_\-9bits\_\-event]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-register\_\-tx\_\-9bits\_\-event (uint8\_\-t {\em num}, \/  void($\ast$)(int) {\em f})}\label{uart_8h_5a86ad66839f47979affde6f25adf634}


This function is used to register another function which will be executed at each 9 bits frame transmission. WARNING : it uses the same internal pointer that the 8 bits event, so be carreful to unregister 8 bits events when doing 9 bits and vice versa. \index{uart.h@{uart.h}!uart\_\-register\_\-tx\_\-event@{uart\_\-register\_\-tx\_\-event}}
\index{uart\_\-register\_\-tx\_\-event@{uart\_\-register\_\-tx\_\-event}!uart.h@{uart.h}}
\subsubsection[uart\_\-register\_\-tx\_\-event]{\setlength{\rightskip}{0pt plus 5cm}void uart\_\-register\_\-tx\_\-event (uint8\_\-t {\em num}, \/  void($\ast$)(char) {\em f})}\label{uart_8h_d9aeffe9f0d6629d5967dc4651e9eb06}


This function is used to register another function which will be executed at each byte transmission (5, 6 ,7 ,8 bits) 

Definition at line 30 of file uart\_\-events.c.

References parse\_\-symbols::f, IRQ\_\-LOCK, IRQ\_\-UNLOCK, tx\_\-event, and UART\_\-HW\_\-NUM.\index{uart.h@{uart.h}!uart\_\-send@{uart\_\-send}}
\index{uart\_\-send@{uart\_\-send}!uart.h@{uart.h}}
\subsubsection[uart\_\-send]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-send (uint8\_\-t {\em num}, \/  char {\em c})}\label{uart_8h_d703d5aa05cbfeadc6d2499aefb2cc92}


uart\_\-send is used to send data to the uart 'num'. The data is first stored in the FIFO before beeing sent. If the FIFO is full, the function wait until the uart is ready. The function returns c. 

Definition at line 57 of file uart\_\-host.c.

References cirbuf\_\-add\_\-head(), g\_\-tx\_\-fifo, GLOBAL\_\-IRQ\_\-ARE\_\-MASKED, RXCIE, uart\_\-regs, uart\_\-send\_\-next\_\-char(), uart\_\-send\_\-nowait(), and UDRE.\index{uart.h@{uart.h}!uart\_\-send\_\-9bits@{uart\_\-send\_\-9bits}}
\index{uart\_\-send\_\-9bits@{uart\_\-send\_\-9bits}!uart.h@{uart.h}}
\subsubsection[uart\_\-send\_\-9bits]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-send\_\-9bits (uint8\_\-t {\em num}, \/  int {\em c})}\label{uart_8h_d09189fd3b9f8cf8af601244d5e04682}




Definition at line 28 of file uart\_\-send9.c.

References cirbuf\_\-add\_\-buf\_\-head(), g\_\-tx\_\-fifo, GLOBAL\_\-IRQ\_\-ARE\_\-MASKED, RXCIE, uart\_\-regs, uart\_\-send\_\-9bits\_\-nowait(), uart\_\-send\_\-next\_\-char(), and UDRE.\index{uart.h@{uart.h}!uart\_\-send\_\-9bits\_\-nowait@{uart\_\-send\_\-9bits\_\-nowait}}
\index{uart\_\-send\_\-9bits\_\-nowait@{uart\_\-send\_\-9bits\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart\_\-send\_\-9bits\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-send\_\-9bits\_\-nowait (uint8\_\-t {\em num}, \/  int {\em c})}\label{uart_8h_a479644260fdb236b591af3571405c91}


uart\_\-send\_\-9bits is the same that uart\_\-send but arg is 16 bits so data can be 9 bits wide. 

Referenced by uart\_\-send\_\-9bits().\index{uart.h@{uart.h}!uart\_\-send\_\-nowait@{uart\_\-send\_\-nowait}}
\index{uart\_\-send\_\-nowait@{uart\_\-send\_\-nowait}!uart.h@{uart.h}}
\subsubsection[uart\_\-send\_\-nowait]{\setlength{\rightskip}{0pt plus 5cm}int uart\_\-send\_\-nowait (uint8\_\-t {\em num}, \/  char {\em c})}\label{uart_8h_ecd7c63e7c51ee5922ceb6229354b895}


uart\_\-send\_\-nowait is used to send data to the uart 'num'. The data is first stored in the FIFO before beeing sent. If the FIFO is full, data is dropped and the function returns -1, else it returns the character c. 

Definition at line 52 of file uart\_\-host.c.

References cirbuf\_\-add\_\-head(), CIRBUF\_\-IS\_\-EMPTY, CIRBUF\_\-IS\_\-FULL, g\_\-tx\_\-fifo, IRQ\_\-LOCK, IRQ\_\-UNLOCK, RXCIE, sbi, uart\_\-regs, UDRE, and UDRIE.

Referenced by uart\_\-send().\index{uart.h@{uart.h}!uart\_\-setconf@{uart\_\-setconf}}
\index{uart\_\-setconf@{uart\_\-setconf}!uart.h@{uart.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_8h_b6107b6bd3a29f6c8d7da52da726ea27}


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

Definition at line 38 of file uart\_\-host.c.

Referenced by uart\_\-init().