1
0

uart 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 d n
  39. Set DTR if
  40. .I n
  41. is non-zero;
  42. else clear it.
  43. .TP
  44. .BI k n
  45. Send a break lasting
  46. .I n
  47. milliseconds.
  48. .TP
  49. .BI r n
  50. Set RTS if
  51. .I n
  52. is non-zero;
  53. else clear it.
  54. .TP
  55. .BI m n
  56. Obey modem CTS signal if
  57. .I n
  58. is non-zero;
  59. else clear it.
  60. .TP
  61. .BI i n
  62. Enable/disable the FIFOs.
  63. If
  64. .I n
  65. is zero the FIFOs are disabled;
  66. otherwise
  67. .I n
  68. is taken as a trigger level for the FIFOs.
  69. The trigger levels supported are device dependant,
  70. but usually include 1, 4 and 8.
  71. An unrecognised,
  72. but non-zero,
  73. value of
  74. .I n
  75. causes the maximum-supported trigger level to be set.
  76. .TP
  77. .BI p c
  78. Set parity to odd if
  79. .I c
  80. is
  81. .BR o ,
  82. to even if
  83. .I c
  84. is
  85. .BR e ;
  86. else set no parity.
  87. .TP
  88. .BI s n
  89. Set number of stop bits to
  90. .IR n .
  91. Legal values are 1 or 2.
  92. .TP
  93. .BI l n
  94. Set number of bits per byte to
  95. .IR n .
  96. Legal values are 5, 6, 7, or 8.
  97. .PP
  98. The status
  99. files contain a textual representation of the status of the line, in the format of the
  100. commands used on the
  101. control
  102. file.
  103. .SH SOURCE
  104. .B /sys/src/9/port/devuart.c
  105. .br
  106. .B /sys/src/9/*/uart*.c