Trait emulator_hal::Step
source · pub trait Step<Address, Bus>{
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§
Required Methods§
sourcefn is_running(&mut self) -> bool
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
sourcefn reset(&mut self, now: Bus::Instant, bus: &mut Bus) -> Result<(), Self::Error>
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
sourcefn step(
&mut self,
now: Bus::Instant,
bus: &mut Bus
) -> Result<Bus::Instant, Self::Error>
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