You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimal support for uart_16550 serial and memory mapped I/O.
5
+
Minimal support for [serial communication](https://en.wikipedia.org/wiki/Asynchronous_serial_communication) through [UART](https://en.wikipedia.org/wiki/Universal_asynchronous_receiver-transmitter) devices, which are compatible to the [16550 UART](https://en.wikipedia.org/wiki/16550_UART). This crate supports port-mapped and memory mapped UARTS.
6
6
7
7
## Usage
8
8
9
-
### With usual serial port
9
+
Depending on the system architecture, the UART can be either accessed through [port-mapped I/O](https://wiki.osdev.org/Port_IO) or [memory-mapped I/O](https://en.wikipedia.org/wiki/Memory-mapped_I/O).
10
+
11
+
### With port-mappd I/O
12
+
13
+
The UART is accessed through port-mapped I/O on architectures such as `x86_64`. On these architectures, the [`SerialPort`](https://docs.rs/uart_16550/~0.2/uart_16550/struct.SerialPort.html) type can be used:
14
+
10
15
11
16
```rust
12
17
useuart_16550::SerialPort;
@@ -25,6 +30,8 @@ let data = serial_port.receive();
25
30
26
31
### With memory mapped serial port
27
32
33
+
Most other architectures, such as [RISC-V](https://en.wikipedia.org/wiki/RISC-V), use memory-mapped I/O for accessing the UARTs. On these architectures, the [`MmioSerialPort`](https://docs.rs/uart_16550/~0.2/uart_16550/struct.MmioSerialPort.html) type can be used:
34
+
28
35
```rust
29
36
useuart_16550::MmioSerialPort;
30
37
@@ -40,10 +47,6 @@ serial_port.send(42);
40
47
letdata=serial_port.receive();
41
48
```
42
49
43
-
## License
44
-
45
-
Licensed under the MIT license ([LICENSE](LICENSE) or <http://opensource.org/licenses/MIT>).
46
-
47
50
## Crate Feature Flags
48
51
49
52
*`nightly`: This is the default.
@@ -53,3 +56,7 @@ Licensed under the MIT license ([LICENSE](LICENSE) or <http://opensource.org/lic
53
56
54
57
This needs to have the [compile-time requirements](https://github.com/alexcrichton/cc-rs#compile-time-requirements) of the `cc` crate installed on your system.
55
58
It was currently only tested on Linux and MacOS.
59
+
60
+
## License
61
+
62
+
Licensed under the MIT license ([LICENSE](LICENSE) or <http://opensource.org/licenses/MIT>).
0 commit comments