Bus

Trait Bus 

Source
pub trait Bus {
    // Required methods
    fn read(&mut self, address: u32, pins: &mut Pins) -> u8;
    fn write(&mut self, address: u32, value: u8, pins: &mut Pins);

    // Provided method
    fn idle(&mut self, address: Option<u32>, pins: &mut Pins) { ... }
}
Expand description

The host’s side of the bus: exactly one call per cycle, in the chip’s order, with 21-bit physical addresses.

Each call also gets the CPU’s Pins, so a device can change an interrupt line during the cycle it happens in (the poll then decides whether that was in time), and read the cycle’s kind and the clock speed it runs at.

Required Methods§

Source

fn read(&mut self, address: u32, pins: &mut Pins) -> u8

Source

fn write(&mut self, address: u32, value: u8, pins: &mut Pins)

Provided Methods§

Source

fn idle(&mut self, address: Option<u32>, pins: &mut Pins)

A cycle with no data transfer: Some(address) is the dummy read the chip makes (the byte after the opcode of an implied instruction), None an internal cycle. The default touches nothing (the reference’s _no_idle).

Implementors§