pub struct Strobe<const N: usize> {
pub enable: Signal<In, Bit>,
pub strobe: Signal<Out, Bit>,
pub clock: Signal<In, Clock>,
/* private fields */
}
Expand description
A Strobe generates a periodic pulse train, with a single clock-cycle wide pulse
at the prescribed frequency. The argument [N] of the generic Strobe
Fields
enable: Signal<In, Bit>
Set this to true to enable the pulse train.
strobe: Signal<Out, Bit>
This is the strobing signal - it will fire for 1 clock cycle such that the strobe frequency is generated.
clock: Signal<In, Clock>
The clock that drives the Strobe. All signals are synchronous to this clock.
Implementations
sourceimpl<const N: usize> Strobe<N>
impl<const N: usize> Strobe<N>
sourcepub fn new(frequency: u64, strobe_freq_hz: f64) -> Self
pub fn new(frequency: u64, strobe_freq_hz: f64) -> Self
Generate a Strobe widget that can be used in a RustHDL circuit.
Arguments
frequency
: The frequency (in Hz) of the clock signal driving the circuit.strobe_freq_hz
: The desired frequency in Hz of the output strobe. Note that the strobe frequency will be rounded to something that can be obtained by dividing the input clock by an integer. As such, it may not produce exactly the desired frequency, unlessfrequency
/strobe_freq_hz
is an integer.
returns: Strobe<{ N }>
Examples
See [BlinkExample] for an example.
Trait Implementations
sourceimpl<const N: usize> Block for Strobe<N>
impl<const N: usize> Block for Strobe<N>
sourcefn connect_all(&mut self)
fn connect_all(&mut self)
Connects the internal signals of the circuit - used to initialize the circuit
sourcefn update_all(&mut self)
fn update_all(&mut self)
Propogate changes from inputs to outputs within the circuit
sourcefn has_changed(&self) -> bool
fn has_changed(&self) -> bool
Returns true
if anything in the circuit has changed (outputs or internal state)
Auto Trait Implementations
impl<const N: usize> RefUnwindSafe for Strobe<N>
impl<const N: usize> Send for Strobe<N>
impl<const N: usize> Sync for Strobe<N>
impl<const N: usize> Unpin for Strobe<N>
impl<const N: usize> UnwindSafe for Strobe<N>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more