📄 uart.h
字号:
#ifndef _DEV_UART_H#define _DEV_UART_H/* * Copyright (C) 2001-2004 by egnite Software GmbH. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * For additional information see http://www.ethernut.de/ * *//* * $Log: uart.h,v $ * Revision 1.4 2005/06/26 12:40:59 chaac * Added support for raw mode to AHDLC driver. * * Revision 1.3 2004/11/12 11:14:32 freckle * added UART_GETBLOCKREAD & UART_SETBLOCKREAD defines * * Revision 1.2 2004/05/24 20:19:08 drsung * Added function UartAvrSize to return number of chars in input buffer. * * Revision 1.1 2004/03/16 16:48:28 haraldkipp * Added Jan Dubiec's H8/300 port. * * Revision 1.2 2003/12/15 19:29:18 haraldkipp * USART driver support added * * Revision 1.1.1.1 2003/05/09 14:41:23 haraldkipp * Initial using 3.2.1 * * Revision 1.11 2003/05/06 17:58:28 harald * Handshakes added * * Revision 1.10 2003/03/31 14:53:25 harald * Prepare release 3.1 * * Revision 1.9 2003/02/04 18:00:54 harald * Version 3 released * * Revision 1.8 2003/01/14 16:35:24 harald * Definitions moved * * Revision 1.7 2002/11/02 15:17:01 harald * Library dependencies moved to compiler.h * * Revision 1.6 2002/06/26 17:29:30 harald * First pre-release with 2.4 stack * */#include <sys/device.h>/*! * \file dev/uart.h * \brief UART I/O function prototypes. *//*! * \addtogroup xgUARTIOCTL * * \brief UART _ioctl() commands. * * These commands are used to control and retrieve hardware specific * configurations. The definitions are kept independent from the * underlying hardware, but not all commands may be fully implemented * in each UART driver. * * The _ioctl() function expects three parameters: * - A device descriptor. * - A command code, any of the UART_... commands listed below. * - A pointer to a configuration parameter, in most cases an unsigned long. *//*@{*//*! \brief UART _ioctl() command code to set the line speed. * * The configuration parameter specifies the input and output bit rate * per second. */#define UART_SETSPEED 0x0101/*! \brief UART _ioctl() command code to query the line speed. * * The configuration parameter is set to the input and output bit rate * per second. */#define UART_GETSPEED 0x0102/*! \brief UART _ioctl() command code to set the number of data bits. * * The configuration parameter specifies the number of data bits, 5, 6, * 7, 8 or 9. */#define UART_SETDATABITS 0x0103/*! \brief UART _ioctl() command code to query the number of data bits. * * The configuration parameter is set to the number of data bits, 5, 6, * 7, 8 or 9. */#define UART_GETDATABITS 0x0104/*! \brief UART _ioctl() command code to set the parity mode. * * The configuration parameter specifies the type of the parity bit, * 0 (none), 1 (odd) or 2 (even). */#define UART_SETPARITY 0x0105/*! \brief UART _ioctl() command code to query the parity mode. * * The configuration parameter is set to the type of the parity bit, * 0 (none), 1 (odd) or 2 (even). */#define UART_GETPARITY 0x0106/*! \brief UART _ioctl() command code to set the number of stop bits. * * The configuration parameter specifies the number of stop bits, 1 or 2. */#define UART_SETSTOPBITS 0x0107/*! \brief UART _ioctl() command code to query the number of stop bits. * * The configuration parameter is set to the number of stop bits, 1 or 2. */#define UART_GETSTOPBITS 0x0108/*! \brief UART _ioctl() command code to set the status. * * The configuration parameter specifies the status to set. */#define UART_SETSTATUS 0x0109/*! \brief UART _ioctl() command code to query the status. * * The configuration parameter is set to the current status. */#define UART_GETSTATUS 0x010a/*! \brief UART _ioctl() command code to set the read timeout. * * The configuration parameter specifies the read timeout in * milliseconds. */#define UART_SETREADTIMEOUT 0x010b/*! \brief UART _ioctl() command code to query the read timeout. * * The configuration parameter is set to the read timeout in * milliseconds. */#define UART_GETREADTIMEOUT 0x010c/*! \brief UART _ioctl() command code to set the write timeout. * * The configuration parameter specifies the write timeout in * milliseconds. */#define UART_SETWRITETIMEOUT 0x010d/*! \brief UART _ioctl() command code to query the write timeout. * * The configuration parameter is set to the write timeout in * milliseconds. */#define UART_GETWRITETIMEOUT 0x010e/*! \brief UART _ioctl() command code to set the local echo mode. * * The configuration parameter specifies the local echo mode, * 0 (off) or 1 (on). */#define UART_SETLOCALECHO 0x010f/*! \brief UART _ioctl() command code to query the local echo mode. * * The configuration parameter is set to the local echo mode, * 0 (off) or 1 (on). */#define UART_GETLOCALECHO 0x0110/*! \brief UART _ioctl() command code to set the flow control mode. * * The configuration parameter specifies the flow control mode. */#define UART_SETFLOWCONTROL 0x0111/*! \brief UART _ioctl() command code to query the flow control mode. * * The configuration parameter is set to the flow control mode. */#define UART_GETFLOWCONTROL 0x0112/*! \brief UART _ioctl() command code to set the cooking mode. * * The configuration parameter specifies the character cooking mode, * 0 (raw) or 1 (EOL translation). */#define UART_SETCOOKEDMODE 0x0113/*! \brief UART _ioctl() command code to query the cooking mode. * * The configuration parameter is set to the character cooking mode, * 0 (raw) or 1 (EOL translation). */#define UART_GETCOOKEDMODE 0x0114/*! \brief UART _ioctl() command code to set the buffering mode. * * The configuration parameter specifies the buffering mode. */#define UART_SETBUFFERMODE 0x0115/*! \brief UART _ioctl() command code to query the buffering mode. * * The configuration parameter is set to the buffering mode. */#define UART_GETBUFFERMODE 0x0116/*! \brief UART _ioctl() command code to set the network interface mode. * * The configuration parameter specifies the network interface mode. */#define HDLC_SETIFNET 0x0117/*! \brief UART _ioctl() command code to query the network interface mode. * * The configuration parameter is set to the network interface mode. */#define HDLC_GETIFNET 0x0118/*! \brief UART _ioctl() command code to set the clock mode. * * The configuration parameter specifies the clock mode. */#define UART_SETCLOCKMODE 0x0119/*! \brief UART _ioctl() command code to query the clock mode. * * The configuration parameter is set to the clock mode. */#define UART_GETCLOCKMODE 0x011a/*! \brief UART _ioctl() command code to set the transmit buffer size. * * The configuration parameter specifies the number of bytes. */#define UART_SETTXBUFSIZ 0x011b/*! \brief UART _ioctl() command code to query the transmit buffer size. * * The configuration parameter specifies the number of bytes. */#define UART_GETTXBUFSIZ 0x011c/*! \brief UART _ioctl() command code to set the receive buffer size. * * The configuration parameter specifies the number of bytes. */#define UART_SETRXBUFSIZ 0x011d/*! \brief UART _ioctl() command code to query the receive buffer size. * * The configuration parameter specifies the number of bytes. */#define UART_GETRXBUFSIZ 0x011e/*! \brief UART _ioctl() command code to set the transmit buffer low watermark. * * The configuration parameter specifies the number of bytes. */#define UART_SETTXBUFLWMARK 0x0120/*! \brief UART _ioctl() command code to query the transmit buffer low watermark. * * The configuration parameter specifies the number of bytes.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -