Trait emulator_hal::Step

source ·
pub trait Step<Address, Bus>
where Address: Copy, Bus: BusAccess<Address>,
{ type Error; // Required methods fn is_running(&mut self) -> bool; fn reset( &mut self, now: Bus::Instant, bus: &mut Bus ) -> Result<(), Self::Error>; fn step( &mut self, now: Bus::Instant, bus: &mut Bus ) -> Result<Bus::Instant, Self::Error>; }
Expand description

Represents a device that can change state with the passage of a clock signal

Typically this would represent both CPU devices and peripheral devices that use a clock signal to advance some internal process, such as a timer or state machine

Required Associated Types§

source

type Error

A type that is return if the step cannot be performed

Note: this is not the same as BusAccess::Error

Required Methods§

source

fn is_running(&mut self) -> bool

Returns true if this device is still running. This can be used to detect a stop or halt condition

source

fn reset(&mut self, now: Bus::Instant, bus: &mut Bus) -> Result<(), Self::Error>

Reset the device to its initial state, as if the device’s reset signal was asserted

source

fn step( &mut self, now: Bus::Instant, bus: &mut Bus ) -> Result<Bus::Instant, Self::Error>

Step the process by one unit of time, and return the time at which this function should be called again

The given Instant is the time at which this step occurs, and the returned Instant is the time that the next step should occur, according to the device itself. The given bus can be used to access the system during this step of execution

Implementors§