uart.h
Go to the documentation of this file.00001 #ifndef _DEV_UART_H
00002 #define _DEV_UART_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
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
00380
00385 #define UART_FRAMINGERROR 0x00000001UL
00386
00391 #define UART_OVERRUNERROR 0x00000002UL
00392
00397 #define UART_PARITYERROR 0x00000004UL
00398
00403 #define UART_ERRORS (UART_FRAMINGERROR | UART_OVERRUNERROR | UART_PARITYERROR)
00404
00407 #define UART_RXBUFFEREMPTY 0x00000040UL
00408
00414 #define UART_TXBUFFEREMPTY 0x00000080UL
00415
00418 #define UART_RTSENABLED 0x00000100UL
00419
00422 #define UART_RTSDISABLED 0x00000200UL
00423
00426 #define UART_CTSENABLED 0x00000400UL
00427
00430 #define UART_CTSDISABLED 0x00000800UL
00431
00434 #define UART_DTRENABLED 0x00001000UL
00435
00438 #define UART_DTRDISABLED 0x00002000UL
00439
00442 #define UART_RXENABLED 0x00010000UL
00443
00446 #define UART_RXDISABLED 0x00020000UL
00447
00450 #define UART_TXENABLED 0x00040000UL
00451
00454 #define UART_TXDISABLED 0x00080000UL
00455
00461 #define UART_RXADDRFRAME 0x00100000UL
00462
00467 #define UART_RXNORMFRAME 0x00200000UL
00468
00474 #define UART_TXADDRFRAME 0x00400000UL
00475
00480 #define UART_TXNORMFRAME 0x00800000UL
00481
00482
00493
00498 #define UART_HS_RTSCTS 0x0003
00499
00504 #define UART_HS_MODEM 0x001F
00505
00513 #define UART_HS_SOFT 0x0020
00514
00531
00532 #define UART_SYNC 0x01
00533 #define UART_MASTER 0x02
00534 #define UART_NCLOCK 0x04
00535 #define UART_HIGHSPEED 0x20
00536
00539 #define UART_ASYNC 0x00
00540
00546 #define UART_SYNCSLAVE UART_SYNC
00547
00553 #define UART_SYNCMASTER (UART_SYNC | UART_MASTER)
00554
00560 #define UART_NSYNCSLAVE (UART_SYNC | UART_NCLOCK)
00561
00567 #define UART_NSYNCMASTER (UART_SYNC | UART_NCLOCK | UART_MASTER)
00568
00573 #define UART_ASYNC_HS UART_HIGHSPEED
00574
00578
00579 __BEGIN_DECLS
00580
00581
00582
00583
00584
00585
00586
00587
00588 extern int UartAvrInit(NUTDEVICE * dev);
00589 extern int UartAvrIOCtl(NUTDEVICE * dev, int req, void *conf);
00590 extern int UartAvrInput(NUTDEVICE * dev);
00591 extern int UartAvrOutput(NUTDEVICE * dev);
00592 extern int UartAvrFlush(NUTDEVICE * dev);
00593
00594 extern int UartAvrGetRaw(uint8_t * cp);
00595 extern int UartAvrPutRaw(uint8_t ch);
00596
00597 extern int UartAvrRead(NUTFILE * fp, void *buffer, int size);
00598 extern int UartAvrWrite(NUTFILE * fp, CONST void *buffer, int len);
00599 #ifdef __HARVARD_ARCH__
00600 extern int UartAvrWrite_P(NUTFILE * fp, PGM_P buffer, int len);
00601 #endif
00602 extern NUTFILE *UartAvrOpen(NUTDEVICE * dev, CONST char *name, int mode, int acc);
00603 extern long UartAvrSize(NUTFILE * fp);
00604 extern int UartAvrClose(NUTFILE * fp);
00605
00606 __END_DECLS
00607 #endif