uart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 input FIFO if
  63. .I n
  64. is non-zero;
  65. else disable.
  66. .TP
  67. .BI p c
  68. Set parity to odd if
  69. .I c
  70. is
  71. .BR o ,
  72. to even if
  73. .I c
  74. is
  75. .BR e ;
  76. else set no parity.
  77. .TP
  78. .BI s n
  79. Set number of stop bits to
  80. .IR n .
  81. Legal values are 1 or 2.
  82. .TP
  83. .BI l n
  84. Set number of bits per byte to
  85. .IR n .
  86. Legal values are 5, 6, 7, or 8.
  87. .PP
  88. The status
  89. files contain a textual representation of the status of the line, in the format of the
  90. commands used on the
  91. control
  92. file.
  93. .SH SOURCE
  94. .B /sys/src/9/port/devuart.c
  95. .br
  96. .B /sys/src/9/*/uart*.c