fix compilation with latest aversive
[protos/xbee-avr.git] / uart.h
diff --git a/uart.h b/uart.h
deleted file mode 100644 (file)
index 06ba9f0..0000000
--- a/uart.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*  \r
- *  Copyright Droids Corporation, Microb Technology, Eirbot (2005)\r
- * \r
- *  This program is free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2 of the License, or\r
- *  (at your option) any later version.\r
- *\r
- *  This program is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  You should have received a copy of the GNU General Public License\r
- *  along with this program; if not, write to the Free Software\r
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
- *\r
- *  Revision : $Id: uart.h,v 1.22.4.4 2008-12-27 16:29:07 zer0 Exp $\r
- *\r
- */\r
-\r
-/* Olivier MATZ, 2004 - 2006\r
- * Interface of the uart module\r
- */\r
-\r
-/** \file uart.h\r
- *  \brief Interface of the UART module.\r
- *\r
- * This module provides :\r
- *   - Tx and Rx with fifo\r
- *   - Speed selection\r
- *   - Parity selection (if the uC support it)\r
- *   - 5 to 8 data bits (if the uC support it).\r
- *   - 1 or 2 stop bits (if the uC support it).\r
- *   - up to 4 UARTs (if the uC support it).\r
- * \r
- * Number of bits in frame, parity, stop bits are the same for tx and\r
- * rx. TX fifo is useless if interrupts are disabled because the uart\r
- * wait that all bytes are transmitted before returning.\r
- *\r
- * It doesn't support some USART capabilities :\r
- *   - Synchronous mode\r
- *   - Multiprocessor communication\r
- */\r
-\r
-#ifndef _UART_H_\r
-#define _UART_H_\r
-\r
-#include <stdio.h>\r
-#include <aversive.h>\r
-#include <uart_config.h>\r
-#include <uart_defs.h>\r
-\r
-#include <cirbuf.h>\r
-\r
-/** this structure stores the configuration of the uart */\r
-struct uart_config {\r
-      uint8_t enabled          : 1, /**< enable or disable the uart */\r
-      intr_enabled     : 1, /**< use interruptions or not */\r
-      use_double_speed : 1, /**< less acurate, but can reach faster baudrate */\r
-      parity           : 2, /**< none, odd or even */\r
-      stop_bits        : 1, /**< 1 or 2 bits at the end of the frame */\r
-      reserved         : 1; /**< nothing for now */\r
-      uint8_t nbits;                /**< number of bits in frame, 5,6,7,8 or 9 */\r
-      uint32_t baudrate;             /**< speed of uart */\r
-};\r
-\r
-/** The emission fifo of uart */\r
-extern struct cirbuf g_tx_fifo[UART_HW_NUM];\r
-\r
-/** The reception fifo of uart  */\r
-extern struct cirbuf g_rx_fifo[UART_HW_NUM];\r
-\r
-/** \r
- * Initialisation function. This function puts the registers of the\r
- * microcontroler in a correct state in order to use the uart.  It\r
- * uses the configuration file <uart_config.h> ; this function is\r
- * equivalent to call uartX_setconf(NULL) for each uart.\r
- */\r
-void uart_init(void);\r
-\r
-/** \r
- * Configure the uart 'num' with the given configuration. Returns 0 on\r
- * success.\r
- */\r
-int8_t uart_setconf(uint8_t num, struct uart_config *u);\r
-\r
-/** Get the current configuration of the uart 'num' */\r
-void uart_getconf(uint8_t num, struct uart_config *u);\r
-\r
-/** \r
- * uart_recv returns the next character, taken from the fifo (if\r
- * any). If there is nothing to read, the function waits until\r
- * something come on the uart.\r
- */\r
-int uart_recv(uint8_t num);\r
-\r
-/** \r
- * uart_recv returns the next character, taken from the fifo (if\r
- * any). If there is nothing to read, the function returns -1.\r
- */\r
-int uart_recv_nowait(uint8_t num);\r
-\r
-/**\r
- * same than uart_recv with 9 bits.\r
- */\r
-int uart_9bits_recv(uint8_t num);\r
-\r
-/** \r
- * same than uart_recv_nowait() with 9 bits.\r
- */\r
-int uart_9bits_recv_nowait(uint8_t num);\r
-\r
-/**\r
- * uart_send_nowait is used to send data to the uart 'num'. The data\r
- * is first stored in the FIFO before beeing sent. If the FIFO is\r
- * full, data is dropped and the function returns -1, else it returns\r
- * the character c.\r
- */\r
-int uart_send_nowait(uint8_t num, char c);\r
-\r
-/**\r
- * uart_send is used to send data to the uart 'num'. The data is first\r
- * stored in the FIFO before beeing sent. If the FIFO is full, the\r
- * function wait until the uart is ready. The function returns c.\r
- */\r
-int uart_send(uint8_t num, char c);\r
-\r
-/**\r
- * uart_send_9bits is the same that uart_send but arg is 16 bits so\r
- * data can be 9 bits wide.\r
- */\r
-int uart_send_9bits_nowait(uint8_t num, int c);\r
-\r
-/* uart_send_9bits_wait is the same that uart_send_wait but arg is\r
- * 16 bits so data can be 9 bits wide.\r
- */\r
-int uart_send_9bits(uint8_t num, int c);\r
-\r
-\r
-\r
-/**\r
- * This function is used to register another function which will be\r
- * executed at each byte transmission (5, 6 ,7 ,8 bits)\r
- */\r
-void uart_register_tx_event(uint8_t num, void (*f)(char));\r
-\r
-/**\r
- * This function is used to register another function which will be\r
- * executed at each byte reception (5, 6 ,7 ,8 bits)\r
- */\r
-void uart_register_rx_event(uint8_t num, void (*f)(char));\r
-\r
-\r
-/**\r
- * This function is used to register another function which will be\r
- * executed at each 9 bits frame transmission. WARNING : it uses the\r
- * same internal pointer that the 8 bits event, so be carreful to \r
- * unregister 8 bits events when doing 9 bits and vice versa.\r
- */\r
-void uart_register_tx_9bits_event(uint8_t num, void (*f)(int));\r
-\r
-/**\r
- * This function is used to register another function which will be\r
- * executed at each 9 bits reception. WARNING : it uses the\r
- * same internal pointer that the 8 bits event, so be carreful to \r
- * unregister 8 bits events when doing 9 bits and vice versa.\r
- */\r
-void uart_register_rx_9bits_event(uint8_t num, void (*f)(int));\r
-\r
-/* funcs for use with fdevopen (avrlibc > 1.4.0) */\r
-int uart0_dev_send_nowait(char c, FILE* f);\r
-int uart0_dev_send(char c, FILE* f);\r
-int uart0_dev_recv_nowait(FILE* f);\r
-int uart0_dev_recv(FILE* f);\r
-\r
-int uart1_dev_send_nowait(char c, FILE* f);\r
-int uart1_dev_send(char c, FILE* f);\r
-int uart1_dev_recv_nowait(FILE* f);\r
-int uart1_dev_recv(FILE* f);\r
-\r
-int uart2_dev_send_nowait(char c, FILE* f);\r
-int uart2_dev_send(char c, FILE* f);\r
-int uart2_dev_recv_nowait(FILE* f);\r
-int uart2_dev_recv(FILE* f);\r
-\r
-int uart3_dev_send_nowait(char c, FILE* f);\r
-int uart3_dev_send(char c, FILE* f);\r
-int uart3_dev_recv_nowait(FILE* f);\r
-int uart3_dev_recv(FILE* f);\r
-\r
-\r
-#endif /* _UART_H_ */\r
-\r