stm32f4xx_hal/
time.rs

1pub use fugit::{HertzU32 as Hertz, KilohertzU32 as KiloHertz, MegahertzU32 as MegaHertz};
2
3/// Bits per second
4#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
6pub struct Bps(pub u32);
7
8/// Extension trait that adds convenience methods to the `u32` type
9pub trait U32Ext {
10    /// Wrap in `Bps`
11    fn bps(self) -> Bps;
12}
13
14impl U32Ext for u32 {
15    fn bps(self) -> Bps {
16        Bps(self)
17    }
18}