Struct bl702_hal::delay::McycleDelay
source · [−]pub struct McycleDelay { /* private fields */ }Expand description
Use RISCV machine-mode cycle counter (mcycle) as a delay provider.
This can be used for high resolution delays for device initialization, bit-banging protocols, etc
Implementations
sourceimpl McycleDelay
impl McycleDelay
sourcepub fn get_cycle_count() -> u64
pub fn get_cycle_count() -> u64
Retrieves the cycle count for the current HART
sourcepub fn cycles_since(previous_cycle_count: u64) -> u64
pub fn cycles_since(previous_cycle_count: u64) -> u64
Returns the number of elapsed cycles since previous_cycle_count
sourcepub fn delay_cycles(cycle_count: u64)
pub fn delay_cycles(cycle_count: u64)
Performs a busy-wait loop until the number of cycles cycle_count has elapsed
Trait Implementations
sourceimpl Clone for McycleDelay
impl Clone for McycleDelay
sourcefn clone(&self) -> McycleDelay
fn clone(&self) -> McycleDelay
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl DelayMs<u64> for McycleDelay
impl DelayMs<u64> for McycleDelay
sourcefn delay_ms(&mut self, ms: u64) -> Result<(), Infallible>
fn delay_ms(&mut self, ms: u64) -> Result<(), Infallible>
Performs a busy-wait loop until the number of milliseconds ms has elapsed
type Error = Infallible
type Error = Infallible
Enumeration of
DelayMs errorssourceimpl DelayUs<u64> for McycleDelay
impl DelayUs<u64> for McycleDelay
sourcefn delay_us(&mut self, us: u64) -> Result<(), Infallible>
fn delay_us(&mut self, us: u64) -> Result<(), Infallible>
Performs a busy-wait loop until the number of microseconds us has elapsed
type Error = Infallible
type Error = Infallible
Enumeration of
DelayMs errorsimpl Copy for McycleDelay
Auto Trait Implementations
impl RefUnwindSafe for McycleDelay
impl Send for McycleDelay
impl Sync for McycleDelay
impl Unpin for McycleDelay
impl UnwindSafe for McycleDelay
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