Trait lc3_ensemble::sim::io::IODevice

source ·
pub trait IODevice {
    // Required methods
    fn io_read(&self, addr: u16) -> Option<u16>;
    fn io_write(&self, addr: u16, data: u16) -> bool;
    fn close(self);
}
Expand description

An IO device that can be read/written to.

Required Methods§

source

fn io_read(&self, addr: u16) -> Option<u16>

Reads the data at the given memory-mapped address.

If successful, this returns the value returned from that address. If unsuccessful, this returns None.

source

fn io_write(&self, addr: u16, data: u16) -> bool

Writes the data to the given memory-mapped address.

This returns whether the write was successful or not.

source

fn close(self)

Tries to close this IO device.

Implementors§