Nut/OS  4.10.3
API Reference
uart.h
Go to the documentation of this file.
00001 #ifndef _DEV_UART_H
00002 #define _DEV_UART_H
00003 
00004 /*
00005  * Copyright (C) 2001-2004 by egnite Software GmbH. All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00024  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  *
00035  */
00036 
00037 /*
00038  * $Log$
00039  * Revision 1.5  2008/08/11 06:59:59  haraldkipp
00040  * BSD types replaced by stdint types (feature request #1282721).
00041  *
00042  * Revision 1.4  2005/06/26 12:40:59  chaac
00043  * Added support for raw mode to AHDLC driver.
00044  *
00045  * Revision 1.3  2004/11/12 11:14:32  freckle
00046  * added UART_GETBLOCKREAD & UART_SETBLOCKREAD defines
00047  *
00048  * Revision 1.2  2004/05/24 20:19:08  drsung
00049  * Added function UartAvrSize to return number of chars in input buffer.
00050  *
00051  * Revision 1.1  2004/03/16 16:48:28  haraldkipp
00052  * Added Jan Dubiec's H8/300 port.
00053  *
00054  * Revision 1.2  2003/12/15 19:29:18  haraldkipp
00055  * USART driver support added
00056  *
00057  * Revision 1.1.1.1  2003/05/09 14:41:23  haraldkipp
00058  * Initial using 3.2.1
00059  *
00060  * Revision 1.11  2003/05/06 17:58:28  harald
00061  * Handshakes added
00062  *
00063  * Revision 1.10  2003/03/31 14:53:25  harald
00064  * Prepare release 3.1
00065  *
00066  * Revision 1.9  2003/02/04 18:00:54  harald
00067  * Version 3 released
00068  *
00069  * Revision 1.8  2003/01/14 16:35:24  harald
00070  * Definitions moved
00071  *
00072  * Revision 1.7  2002/11/02 15:17:01  harald
00073  * Library dependencies moved to compiler.h
00074  *
00075  * Revision 1.6  2002/06/26 17:29:30  harald
00076  * First pre-release with 2.4 stack
00077  *
00078  */
00079 
00080 #include <sys/device.h>
00081 
00103 
00109 #define UART_SETSPEED           0x0101
00110 
00116 #define UART_GETSPEED           0x0102
00117 
00123 #define UART_SETDATABITS        0x0103
00124 
00130 #define UART_GETDATABITS        0x0104
00131 
00137 #define UART_SETPARITY          0x0105
00138 
00144 #define UART_GETPARITY          0x0106
00145 
00150 #define UART_SETSTOPBITS        0x0107
00151 
00156 #define UART_GETSTOPBITS        0x0108
00157 
00162 #define UART_SETSTATUS          0x0109
00163 
00168 #define UART_GETSTATUS          0x010a
00169 
00175 #define UART_SETREADTIMEOUT     0x010b
00176 
00182 #define UART_GETREADTIMEOUT     0x010c
00183 
00189 #define UART_SETWRITETIMEOUT    0x010d
00190 
00196 #define UART_GETWRITETIMEOUT    0x010e
00197 
00203 #define UART_SETLOCALECHO       0x010f
00204 
00210 #define UART_GETLOCALECHO       0x0110
00211 
00216 #define UART_SETFLOWCONTROL     0x0111
00217 
00222 #define UART_GETFLOWCONTROL     0x0112
00223 
00229 #define UART_SETCOOKEDMODE      0x0113
00230 
00236 #define UART_GETCOOKEDMODE      0x0114
00237 
00242 #define UART_SETBUFFERMODE      0x0115
00243 
00248 #define UART_GETBUFFERMODE      0x0116
00249 
00254 #define HDLC_SETIFNET           0x0117
00255 
00260 #define HDLC_GETIFNET           0x0118
00261 
00266 #define UART_SETCLOCKMODE       0x0119
00267 
00272 #define UART_GETCLOCKMODE       0x011a
00273 
00278 #define UART_SETTXBUFSIZ        0x011b
00279 
00284 #define UART_GETTXBUFSIZ        0x011c
00285 
00290 #define UART_SETRXBUFSIZ        0x011d
00291 
00296 #define UART_GETRXBUFSIZ        0x011e
00297 
00302 #define UART_SETTXBUFLWMARK     0x0120
00303 
00308 #define UART_GETTXBUFLWMARK     0x0121
00309 
00314 #define UART_SETTXBUFHWMARK     0x0122
00315 
00320 #define UART_GETTXBUFHWMARK     0x0123
00321 
00326 #define UART_SETRXBUFLWMARK     0x0124
00327 
00332 #define UART_GETRXBUFLWMARK     0x0125
00333 
00338 #define UART_SETRXBUFHWMARK     0x0126
00339 
00344 #define UART_GETRXBUFHWMARK     0x0127
00345 
00350 #define UART_SETBLOCKREAD       0x0128
00351 
00356 #define UART_GETBLOCKREAD       0x0129
00357 
00364 #define UART_SETRAWMODE         0x012a
00365 
00370 #define UART_GETRAWMODE         0x012b
00371 
00379 #define HDLC_SETTXACCM          0x012c
00380 
00385 #define HDLC_GETTXACCM          0x012d
00386 
00391 #define UART_SETHDPXMODE        0x012c
00392 
00396 #define UART_GETHDPXMODE        0x012d
00397 
00406 
00411 #define UART_FRAMINGERROR   0x00000001UL
00412 
00417 #define UART_OVERRUNERROR   0x00000002UL
00418 
00423 #define UART_PARITYERROR    0x00000004UL
00424 
00429 #define UART_ERRORS         (UART_FRAMINGERROR | UART_OVERRUNERROR | UART_PARITYERROR)
00430 
00433 #define UART_RXBUFFEREMPTY  0x00000040UL
00434 
00440 #define UART_TXBUFFEREMPTY  0x00000080UL
00441 
00444 #define UART_RTSENABLED     0x00000100UL
00445 
00448 #define UART_RTSDISABLED    0x00000200UL
00449 
00452 #define UART_CTSENABLED     0x00000400UL
00453 
00456 #define UART_CTSDISABLED    0x00000800UL
00457 
00460 #define UART_DTRENABLED     0x00001000UL
00461 
00464 #define UART_DTRDISABLED    0x00002000UL
00465 
00468 #define UART_RXENABLED      0x00010000UL
00469 
00472 #define UART_RXDISABLED     0x00020000UL
00473 
00476 #define UART_TXENABLED      0x00040000UL
00477 
00480 #define UART_TXDISABLED     0x00080000UL
00481 
00487 #define UART_RXADDRFRAME    0x00100000UL
00488 
00493 #define UART_RXNORMFRAME    0x00200000UL
00494 
00500 #define UART_TXADDRFRAME    0x00400000UL
00501 
00506 #define UART_TXNORMFRAME    0x00800000UL
00507 
00508 
00519 
00524 #define UART_HS_RTSCTS      0x0003
00525 
00530 #define UART_HS_MODEM       0x001F
00531 
00539 #define UART_HS_SOFT        0x0020
00540 
00543 #define UART_HS_HALFDUPLEX  0x0400
00544 
00561 
00562 #define UART_SYNC           0x01
00563 #define UART_MASTER         0x02
00564 #define UART_NCLOCK         0x04
00565 #define UART_HIGHSPEED      0x20
00566 
00569 #define UART_ASYNC          0x00
00570 
00576 #define UART_SYNCSLAVE     UART_SYNC
00577 
00583 #define UART_SYNCMASTER    (UART_SYNC | UART_MASTER)
00584 
00590 #define UART_NSYNCSLAVE    (UART_SYNC | UART_NCLOCK)
00591 
00597 #define UART_NSYNCMASTER   (UART_SYNC | UART_NCLOCK | UART_MASTER)
00598 
00603 #define UART_ASYNC_HS      UART_HIGHSPEED
00604 
00608 
00609 #endif