Struct rust_hdl_widgets::strobe::Strobe
source · 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§
source§impl<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§
source§impl<const N: usize> Block for Strobe<N>
impl<const N: usize> Block for Strobe<N>
source§fn connect_all(&mut self)
fn connect_all(&mut self)
source§fn update_all(&mut self)
fn update_all(&mut self)
source§fn has_changed(&self) -> bool
fn has_changed(&self) -> bool
true
if anything in the circuit has changed (outputs or internal state)