termios.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /******************************************************************************
  2. * *
  3. * License Agreement *
  4. * *
  5. * Copyright (c) 2004 Altera Corporation, San Jose, California, USA. *
  6. * All rights reserved. *
  7. * *
  8. * Permission is hereby granted, free of charge, to any person obtaining a *
  9. * copy of this software and associated documentation files (the "Software"), *
  10. * to deal in the Software without restriction, including without limitation *
  11. * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  12. * and/or sell copies of the Software, and to permit persons to whom the *
  13. * Software is furnished to do so, subject to the following conditions: *
  14. * *
  15. * The above copyright notice and this permission notice shall be included in *
  16. * all copies or substantial portions of the Software. *
  17. * *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  23. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  24. * DEALINGS IN THE SOFTWARE. *
  25. * *
  26. * This agreement shall be governed in all respects by the laws of the State *
  27. * of California and by the laws of the United States of America. *
  28. * *
  29. * Altera does not recommend, suggest or require that this reference design *
  30. * file be used in conjunction or combination with any other product. *
  31. ******************************************************************************/
  32. /******************************************************************************
  33. * *
  34. * THIS IS A LIBRARY READ-ONLY SOURCE FILE. DO NOT EDIT. *
  35. * *
  36. ******************************************************************************/
  37. /*
  38. * This is the termios.h file provided with newlib. The only modification has
  39. * been to the baud rate macro definitions, and an increase in the size of the
  40. * termios structure to accomodate this.
  41. */
  42. #ifndef _SYS_TERMIOS_H
  43. # define _SYS_TERMIOS_H
  44. #ifdef __cplusplus
  45. extern "C"
  46. {
  47. #endif /* __cplusplus */
  48. # define _XCGETA (('x'<<8)|1)
  49. # define _XCSETA (('x'<<8)|2)
  50. # define _XCSETAW (('x'<<8)|3)
  51. # define _XCSETAF (('x'<<8)|4)
  52. # define _TCSBRK (('T'<<8)|5)
  53. # define _TCFLSH (('T'<<8)|7)
  54. # define _TCXONC (('T'<<8)|6)
  55. # define TCOOFF 0
  56. # define TCOON 1
  57. # define TCIOFF 2
  58. # define TCION 3
  59. # define TCIFLUSH 0
  60. # define TCOFLUSH 1
  61. # define TCIOFLUSH 2
  62. # define NCCS 13
  63. # define TCSAFLUSH _XCSETAF
  64. # define TCSANOW _XCSETA
  65. # define TCSADRAIN _XCSETAW
  66. # define TCSADFLUSH _XCSETAF
  67. # define IGNBRK 000001
  68. # define BRKINT 000002
  69. # define IGNPAR 000004
  70. # define INPCK 000020
  71. # define ISTRIP 000040
  72. # define INLCR 000100
  73. # define IGNCR 000200
  74. # define ICRNL 000400
  75. # define IXON 002000
  76. # define IXOFF 010000
  77. # define OPOST 000001
  78. # define OCRNL 000004
  79. # define ONLCR 000010
  80. # define ONOCR 000020
  81. # define TAB3 014000
  82. # define CLOCAL 004000
  83. # define CREAD 000200
  84. # define CSIZE 000060
  85. # define CS5 0
  86. # define CS6 020
  87. # define CS7 040
  88. # define CS8 060
  89. # define CSTOPB 000100
  90. # define HUPCL 002000
  91. # define PARENB 000400
  92. # define PAODD 001000
  93. #define CCTS_OFLOW 010000
  94. #define CRTS_IFLOW 020000
  95. #define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW)
  96. # define ECHO 0000010
  97. # define ECHOE 0000020
  98. # define ECHOK 0000040
  99. # define ECHONL 0000100
  100. # define ICANON 0000002
  101. # define IEXTEN 0000400 /* anybody know *what* this does?! */
  102. # define ISIG 0000001
  103. # define NOFLSH 0000200
  104. # define TOSTOP 0001000
  105. # define VEOF 4 /* also VMIN -- thanks, AT&T */
  106. # define VEOL 5 /* also VTIME -- thanks again */
  107. # define VERASE 2
  108. # define VINTR 0
  109. # define VKILL 3
  110. # define VMIN 4 /* also VEOF */
  111. # define VQUIT 1
  112. # define VSUSP 10
  113. # define VTIME 5 /* also VEOL */
  114. # define VSTART 11
  115. # define VSTOP 12
  116. # define B0 0
  117. # define B50 50
  118. # define B75 75
  119. # define B110 110
  120. # define B134 134
  121. # define B150 150
  122. # define B200 200
  123. # define B300 300
  124. # define B600 600
  125. # define B1200 1200
  126. # define B1800 1800
  127. # define B2400 2400
  128. # define B4800 4800
  129. # define B9600 9600
  130. # define B19200 19200
  131. # define B38400 38400
  132. # define B57600 57600
  133. # define B115200 115200
  134. typedef unsigned char cc_t;
  135. typedef unsigned short tcflag_t;
  136. typedef unsigned long speed_t;
  137. struct termios {
  138. tcflag_t c_iflag;
  139. tcflag_t c_oflag;
  140. tcflag_t c_cflag;
  141. tcflag_t c_lflag;
  142. char c_line;
  143. cc_t c_cc[NCCS];
  144. speed_t c_ispeed;
  145. speed_t c_ospeed;
  146. };
  147. # ifndef _NO_MACROS
  148. # define cfgetospeed(tp) ((tp)->c_ospeed)
  149. # define cfgetispeed(tp) ((tp)->c_ispeed)
  150. # define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0)
  151. # define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0)
  152. # define tcdrain(fd) _ioctl (fd, _TCSBRK, 1)
  153. # endif /* _NO_MACROS */
  154. #ifdef __cplusplus
  155. }
  156. #endif
  157. #endif /* _SYS_TERMIOS_H */