Struct gd32f1x0_hal::time::MegaHertz
source · [−]pub struct MegaHertz(pub u32);
Expand description
Megahertz
Create a frequency specified in megahertz.
See also Hertz
and KiloHertz
for semantically correct ways of creating lower
frequencies.
Examples
Create a an 8 MHz frequency
This example creates an 8 MHz frequency that could be used to configure an SPI peripheral, etc.
use stm32f1xx_hal::time::Hertz;
let freq = 8.mhz();
Tuple Fields
0: u32
Trait Implementations
sourceimpl DivAssign<u32> for MegaHertz
impl DivAssign<u32> for MegaHertz
sourcefn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
Performs the /=
operation. Read more
sourceimpl MulAssign<u32> for MegaHertz
impl MulAssign<u32> for MegaHertz
sourcefn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
Performs the *=
operation. Read more
impl Copy for MegaHertz
impl StructuralPartialEq for MegaHertz
Auto Trait Implementations
impl RefUnwindSafe for MegaHertz
impl Send for MegaHertz
impl Sync for MegaHertz
impl Unpin for MegaHertz
impl UnwindSafe for MegaHertz
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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