Nut/OS  4.10.3
API Reference
ace.h
Go to the documentation of this file.
00001 #ifndef _DEV_ACE_H
00002 #define _DEV_ACE_H
00003 
00004 /*
00005  * Copyright (C) 2001-2003 by Cyber Integration, LLC. 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 CYBER INTEGRATION, LLC 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 CYBER
00024  * INTEGRATION, LLC 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  *
00034  */
00035 
00036 /*
00037  * $Log$
00038  * Revision 1.4  2008/08/11 06:59:59  haraldkipp
00039  * BSD types replaced by stdint types (feature request #1282721).
00040  *
00041  * Revision 1.3  2007/08/29 07:43:53  haraldkipp
00042  * Documentation updated and corrected.
00043  *
00044  * Revision 1.2  2006/05/25 09:09:57  haraldkipp
00045  * API documentation updated and corrected.
00046  *
00047  * Revision 1.1  2005/11/24 11:24:06  haraldkipp
00048  * Initial check-in.
00049  * Many thanks to William Basser for this code and also to Przemyslaw Rudy
00050  * for several enhancements.
00051  *
00052  */
00053 
00054 #include <sys/device.h>
00055 
00077 
00083 #define ACE_SETSPEED           0x0101
00084 
00090 #define ACE_GETSPEED           0x0102
00091 
00097 #define ACE_SETDATABITS        0x0103
00098 
00104 #define ACE_GETDATABITS        0x0104
00105 
00111 #define ACE_SETPARITY          0x0105
00112 
00118 #define ACE_GETPARITY          0x0106
00119 
00124 #define ACE_SETSTOPBITS        0x0107
00125 
00130 #define ACE_GETSTOPBITS        0x0108
00131 
00136 #define ACE_SETSTATUS          0x0109
00137 
00142 #define ACE_GETSTATUS          0x010a
00143 
00149 #define ACE_SETREADTIMEOUT     0x010b
00150 
00156 #define ACE_GETREADTIMEOUT     0x010c
00157 
00163 #define ACE_SETWRITETIMEOUT    0x010d
00164 
00170 #define ACE_GETWRITETIMEOUT    0x010e
00171 
00177 #define ACE_SETLOCALECHO       0x010f
00178 
00184 #define ACE_GETLOCALECHO       0x0110
00185 
00190 #define ACE_SETFLOWCONTROL     0x0111
00191 
00196 #define ACE_GETFLOWCONTROL     0x0112
00197 
00203 #define ACE_SETCOOKEDMODE      0x0113
00204 
00210 #define ACE_GETCOOKEDMODE      0x0114
00211 
00216 #define ACE_SETBUFFERMODE      0x0115
00217 
00222 #define ACE_GETBUFFERMODE      0x0116
00223 
00228 #define ACE_SETTXBUFSIZ        0x011b
00229 
00234 #define ACE_GETTXBUFSIZ        0x011c
00235 
00240 #define ACE_SETRXBUFSIZ        0x011d
00241 
00246 #define ACE_GETRXBUFSIZ        0x011e
00247 
00252 #define ACE_SETTXBUFLWMARK     0x0120
00253 
00258 #define ACE_GETTXBUFLWMARK     0x0121
00259 
00264 #define ACE_SETTXBUFHWMARK     0x0122
00265 
00270 #define ACE_GETTXBUFHWMARK     0x0123
00271 
00276 #define ACE_SETRXBUFLWMARK     0x0124
00277 
00282 #define ACE_GETRXBUFLWMARK     0x0125
00283 
00288 #define ACE_SETRXBUFHWMARK     0x0126
00289 
00294 #define ACE_GETRXBUFHWMARK     0x0127
00295 
00300 #define ACE_SETBLOCKREAD                0x0128
00301 
00306 #define ACE_GETBLOCKREAD                0x0129
00307 
00312 #define ACE_SETFIFO             0x012a
00313 
00318 #define ACE_GETFIFO             0x012b
00319 
00328 
00333 #define ACE_FRAMINGERROR   0x00000001UL
00334 
00339 #define ACE_OVERRUNERROR   0x00000002UL
00340 
00345 #define ACE_PARITYERROR    0x00000004UL
00346 
00351 #define ACE_ERRORS         (ACE_FRAMINGERROR | ACE_OVERRUNERROR | ACE_PARITYERROR)
00352 
00355 #define ACE_RXBUFFEREMPTY  0x00000040UL
00356 
00362 #define ACE_TXBUFFEREMPTY  0x00000080UL
00363 
00366 #define ACE_RTSENABLED     0x00000100UL
00367 
00370 #define ACE_RTSDISABLED    0x00000200UL
00371 
00374 #define ACE_CTSENABLED     0x00000400UL
00375 
00378 #define ACE_CTSDISABLED    0x00000800UL
00379 
00382 #define ACE_DTRENABLED     0x00001000UL
00383 
00386 #define ACE_DTRDISABLED    0x00002000UL
00387 
00390 #define ACE_RXENABLED      0x00010000UL
00391 
00394 #define ACE_RXDISABLED     0x00020000UL
00395 
00398 #define ACE_TXENABLED      0x00040000UL
00399 
00402 #define ACE_TXDISABLED     0x00080000UL
00403 
00414 
00419 #define ACE_HS_RTSCTS      0x0003
00420 
00425 #define ACE_HS_MODEM       0x001F
00426 
00434 #define ACE_HS_SOFT        0x0020
00435 
00439 
00440 __BEGIN_DECLS
00441 /* */
00442 extern int AceInit(NUTDEVICE * dev);
00443 extern int AceIOCtl(NUTDEVICE * dev, int req, void *conf);
00444 extern int AceInput(NUTDEVICE * dev);
00445 extern int AceOutput(NUTDEVICE * dev);
00446 extern int AceFlush(NUTDEVICE * dev);
00447 
00448 extern int AceGetRaw(uint8_t * cp);
00449 extern int AcePutRaw(uint8_t ch);
00450 
00451 extern int AceRead(NUTFILE * fp, void *buffer, int size);
00452 extern int AceWrite(NUTFILE * fp, CONST void *buffer, int len);
00453 extern int AceWrite_P(NUTFILE * fp, PGM_P buffer, int len);
00454 extern NUTFILE *AceOpen(NUTDEVICE * dev, CONST char *name, int mode, int acc);
00455 extern long AceSize(NUTFILE * fp);
00456 extern int AceClose(NUTFILE * fp);
00457 
00458 __END_DECLS
00459 #endif