Struct cpuio::Port
[−]
[src]
pub struct Port<T: InOut> { /* fields omitted */ }
An I/O port over an arbitrary type supporting the InOut
interface.
This version of Port
has safe read
and write
functions, and it's
appropriate for communicating with hardware that can't violate Rust's
safety guarantees.
Methods
impl<T: InOut> Port<T>
[src]
const unsafe fn new(port: u16) -> Port<T>
Create a new I/O port.
fn read(&mut self) -> T
Read data from the port. This is nominally safe, because you shouldn't be able to get hold of a port object unless somebody thinks it's safe to give you one.
fn write(&mut self, value: T)
Write data to the port.