Struct stm32wlxx_hal::subghz::HseTrim
source · pub struct HseTrim { /* private fields */ }
Expand description
HSE32 load capacitor trimming.
Argument of set_hse_in_trim
and set_hse_out_trim
.
Implementations§
source§impl HseTrim
impl HseTrim
sourcepub const POR: HseTrim = _
pub const POR: HseTrim = _
Power-on-reset capacitor value, ~20.3 pF
This is the same as default
.
Example
use stm32wlxx_hal::subghz::HseTrim;
assert_eq!(HseTrim::POR, HseTrim::default());
sourcepub const fn from_raw(raw: u8) -> HseTrim
pub const fn from_raw(raw: u8) -> HseTrim
Create a new HseTrim
structure from a raw value.
Values greater than the maximum of 0x2F
will be set to the maximum.
Example
use stm32wlxx_hal::subghz::HseTrim;
assert_eq!(HseTrim::from_raw(0xFF), HseTrim::MAX);
assert_eq!(HseTrim::from_raw(0x2F), HseTrim::MAX);
assert_eq!(HseTrim::from_raw(0x00), HseTrim::MIN);
sourcepub fn from_farads(farads: f32) -> Result<HseTrim, ValueError<f32>>
pub fn from_farads(farads: f32) -> Result<HseTrim, ValueError<f32>>
Create a HSE trim value from farads.
Values greater than the maximum of 33.4 pF will be set to the maximum. Values less than the minimum of 11.3 pF will be set to the minimum.
Example
use stm32wlxx_hal::subghz::HseTrim;
assert!(HseTrim::from_farads(1.0).is_err());
assert!(HseTrim::from_farads(1e-12).is_err());
assert_eq!(HseTrim::from_farads(20.2e-12), Ok(HseTrim::default()));
Trait Implementations§
source§impl Ord for HseTrim
impl Ord for HseTrim
source§impl PartialEq for HseTrim
impl PartialEq for HseTrim
source§impl PartialOrd for HseTrim
impl PartialOrd for HseTrim
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for HseTrim
impl Eq for HseTrim
impl StructuralEq for HseTrim
impl StructuralPartialEq for HseTrim
Auto Trait Implementations§
impl RefUnwindSafe for HseTrim
impl Send for HseTrim
impl Sync for HseTrim
impl Unpin for HseTrim
impl UnwindSafe for HseTrim
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more