termbits.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:4k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id: termbits.h,v 1.1 2000/07/10 16:32:31 bjornw Exp $ */
  2. #ifndef __ARCH_ETRAX100_TERMBITS_H__
  3. #define __ARCH_ETRAX100_TERMBITS_H__
  4. #include <linux/posix_types.h>
  5. typedef unsigned char cc_t;
  6. typedef unsigned int speed_t;
  7. typedef unsigned int tcflag_t;
  8. #define NCCS 19
  9. struct termios {
  10. tcflag_t c_iflag; /* input mode flags */
  11. tcflag_t c_oflag; /* output mode flags */
  12. tcflag_t c_cflag; /* control mode flags */
  13. tcflag_t c_lflag; /* local mode flags */
  14. cc_t c_line; /* line discipline */
  15. cc_t c_cc[NCCS]; /* control characters */
  16. };
  17. /* c_cc characters */
  18. #define VINTR 0
  19. #define VQUIT 1
  20. #define VERASE 2
  21. #define VKILL 3
  22. #define VEOF 4
  23. #define VTIME 5
  24. #define VMIN 6
  25. #define VSWTC 7
  26. #define VSTART 8
  27. #define VSTOP 9
  28. #define VSUSP 10
  29. #define VEOL 11
  30. #define VREPRINT 12
  31. #define VDISCARD 13
  32. #define VWERASE 14
  33. #define VLNEXT 15
  34. #define VEOL2 16
  35. /* c_iflag bits */
  36. #define IGNBRK 0000001
  37. #define BRKINT 0000002
  38. #define IGNPAR 0000004
  39. #define PARMRK 0000010
  40. #define INPCK 0000020
  41. #define ISTRIP 0000040
  42. #define INLCR 0000100
  43. #define IGNCR 0000200
  44. #define ICRNL 0000400
  45. #define IUCLC 0001000
  46. #define IXON 0002000
  47. #define IXANY 0004000
  48. #define IXOFF 0010000
  49. #define IMAXBEL 0020000
  50. /* c_oflag bits */
  51. #define OPOST 0000001
  52. #define OLCUC 0000002
  53. #define ONLCR 0000004
  54. #define OCRNL 0000010
  55. #define ONOCR 0000020
  56. #define ONLRET 0000040
  57. #define OFILL 0000100
  58. #define OFDEL 0000200
  59. #define NLDLY 0000400
  60. #define   NL0 0000000
  61. #define   NL1 0000400
  62. #define CRDLY 0003000
  63. #define   CR0 0000000
  64. #define   CR1 0001000
  65. #define   CR2 0002000
  66. #define   CR3 0003000
  67. #define TABDLY 0014000
  68. #define   TAB0 0000000
  69. #define   TAB1 0004000
  70. #define   TAB2 0010000
  71. #define   TAB3 0014000
  72. #define   XTABS 0014000
  73. #define BSDLY 0020000
  74. #define   BS0 0000000
  75. #define   BS1 0020000
  76. #define VTDLY 0040000
  77. #define   VT0 0000000
  78. #define   VT1 0040000
  79. #define FFDLY 0100000
  80. #define   FF0 0000000
  81. #define   FF1 0100000
  82. /* c_cflag bit meaning */
  83. #define CBAUD 0010017
  84. #define  B0 0000000 /* hang up */
  85. #define  B50 0000001
  86. #define  B75 0000002
  87. #define  B110 0000003
  88. #define  B134 0000004
  89. #define  B150 0000005
  90. #define  B200 0000006
  91. #define  B300 0000007
  92. #define  B600 0000010
  93. #define  B1200 0000011
  94. #define  B1800 0000012
  95. #define  B2400 0000013
  96. #define  B4800 0000014
  97. #define  B9600 0000015
  98. #define  B19200 0000016
  99. #define  B38400 0000017
  100. #define EXTA B19200
  101. #define EXTB B38400
  102. #define CSIZE 0000060
  103. #define   CS5 0000000
  104. #define   CS6 0000020
  105. #define   CS7 0000040
  106. #define   CS8 0000060
  107. #define CSTOPB 0000100
  108. #define CREAD 0000200
  109. #define PARENB 0000400
  110. #define PARODD 0001000
  111. #define HUPCL 0002000
  112. #define CLOCAL 0004000
  113. #define CBAUDEX 0010000
  114. #define  B57600  0010001
  115. #define  B115200 0010002
  116. #define  B230400 0010003
  117. #define  B460800 0010004
  118. /* etrax100 supports these additional three baud rates */
  119. #define  B921600 0010005
  120. #define  B1843200 0010006
  121. #define  B6250000 0010007
  122. #define CIBAUD   002003600000 /* input baud rate (not used) */
  123. #define CRTSCTS   020000000000 /* flow control */
  124. /* c_lflag bits */
  125. #define ISIG 0000001
  126. #define ICANON 0000002
  127. #define XCASE 0000004
  128. #define ECHO 0000010
  129. #define ECHOE 0000020
  130. #define ECHOK 0000040
  131. #define ECHONL 0000100
  132. #define NOFLSH 0000200
  133. #define TOSTOP 0000400
  134. #define ECHOCTL 0001000
  135. #define ECHOPRT 0002000
  136. #define ECHOKE 0004000
  137. #define FLUSHO 0010000
  138. #define PENDIN 0040000
  139. #define IEXTEN 0100000
  140. /* tcflow() and TCXONC use these */
  141. #define TCOOFF 0
  142. #define TCOON 1
  143. #define TCIOFF 2
  144. #define TCION 3
  145. /* tcflush() and TCFLSH use these */
  146. #define TCIFLUSH 0
  147. #define TCOFLUSH 1
  148. #define TCIOFLUSH 2
  149. /* tcsetattr uses these */
  150. #define TCSANOW 0
  151. #define TCSADRAIN 1
  152. #define TCSAFLUSH 2
  153. #endif