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.