1
0

uart 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. .TH UART 3
  2. .SH NAME
  3. uart, eia \- serial communication control
  4. .SH SYNOPSIS
  5. .nf
  6. .B bind -a #t /dev
  7. .B /dev/eia0
  8. .B /dev/eia0ctl
  9. .B /dev/eia0status
  10. .B /dev/eia1
  11. .B /dev/eia1ctl
  12. .B /dev/eia1status
  13. \&...
  14. .fi
  15. .SH DESCRIPTION
  16. .PP
  17. The serial line devices serve a one-level directory,
  18. giving access to the serial ports.
  19. Device
  20. .I n
  21. is accessed through
  22. .BI eia n
  23. (the data file),
  24. .BI eia n ctl
  25. (the control file), and
  26. .BI eia n status
  27. (the read-only status file).
  28. Reads of the data file will block until at least one byte is available.
  29. The
  30. control file
  31. configures the port.
  32. It accepts the following commands:
  33. .TP
  34. .BI b n
  35. Set the baud rate to
  36. .IR n .
  37. .TP
  38. .BI c n
  39. Set hangup on DCD if
  40. .I n
  41. is non-zero; else clear it.
  42. .TP
  43. .BI d n
  44. Set DTR if
  45. .I n
  46. is non-zero;
  47. else clear it.
  48. .TP
  49. .BI e n
  50. Set hangup on DSR if
  51. .I n
  52. is non-zero; else clear it.
  53. .TP
  54. .B f
  55. Flush output queue.
  56. .TP
  57. .B h
  58. Close input and output queues.
  59. .TP
  60. .BI i n
  61. Enable/disable the FIFOs.
  62. If
  63. .I n
  64. is zero the FIFOs are disabled;
  65. otherwise
  66. .I n
  67. is taken as a trigger level for the FIFOs.
  68. The trigger levels supported are device dependant,
  69. but usually include 1, 4 and 8.
  70. An unrecognised,
  71. but non-zero,
  72. value of
  73. .I n
  74. causes the maximum-supported trigger level to be set.
  75. .TP
  76. .BI k n
  77. Send a break lasting
  78. .I n
  79. milliseconds.
  80. .TP
  81. .BI l n
  82. Set number of bits per byte to
  83. .IR n .
  84. Legal values are 5, 6, 7, or 8.
  85. .TP
  86. .BI m n
  87. Obey modem CTS signal if
  88. .I n
  89. is non-zero;
  90. else clear it.
  91. .TP
  92. .B n
  93. Make writes non-blocking.
  94. .TP
  95. .BI p c
  96. Set parity to odd if
  97. .I c
  98. is
  99. .BR o ,
  100. to even if
  101. .I c
  102. is
  103. .BR e ;
  104. else set no parity.
  105. .TP
  106. .BI q n
  107. Set input and output queue limits to
  108. .IR n .
  109. .TP
  110. .BI r n
  111. Set RTS if
  112. .I n
  113. is non-zero;
  114. else clear it.
  115. .TP
  116. .BI s n
  117. Set number of stop bits to
  118. .IR n .
  119. Legal values are 1 or 2.
  120. .TP
  121. .BI w n
  122. Set the uart clock timer to
  123. n times 100us.
  124. .IP
  125. .PP
  126. The status
  127. files contain a textual representation of the status of the line, in the format of the
  128. commands used on the
  129. control
  130. file.
  131. .SH SOURCE
  132. .B /sys/src/9/port/devuart.c
  133. .br
  134. .B /sys/src/9/*/uart*.c