Skip to main content

Module time

Module time 

Source
Expand description

Typed units for frequencies and durations, aliased from fugit.

This module names the u32 instances of fugit; u64 is not aliased.

The generic Duration and Rate are re-exported for signatures that stay open to any scale, as are the suffix traits: ExtU32 for durations and RateExtU32 for frequencies, joined by BpsExtU32 for bit rates, which fugit has no suffix for. The whole crate is re-exported too, so Instant, the tick-based TimerDuration and the u64 widths are reachable without adding a matching dependency downstream.

ⓘ
use gd32e2_hal::time::ExtU32;
let period = 5.secs();

Re-exports§

pub use fugit;

Structs§

Duration
Represents a duration of time.
Rate
Represents a frequency.

Traits§

BpsExtU32
Suffix for bit rates: 115_200.bps().
ExtU32
Extension trait for simple short-hands for u32 Durations
RateExtU32
Extension trait for simple short-hands for u32 Rate

Type Aliases§

Bps
Bit rate in symbols per second.
Gigahertz
Frequency in gigahertz.
Hertz
Frequency in hertz.
HoursDuration
Duration in hours.
Kilohertz
Frequency in kilohertz.
Megahertz
Frequency in megahertz.
MicrosDuration
Duration in microseconds.
MillisDuration
Duration in milliseconds.
MinutesDuration
Duration in minutes.
NanosDuration
Duration in nanoseconds.
PicosDuration
Duration in picoseconds.
SecsDuration
Duration in seconds.