Struct stm32wlxx_hal::subghz::FskBitrate
source · pub struct FskBitrate { /* private fields */ }
Expand description
Bitrate argument for FskModParams::set_bitrate
and
BpskModParams::set_bitrate
.
Implementations§
source§impl FskBitrate
impl FskBitrate
sourcepub const fn from_bps(bps: u32) -> Self
pub const fn from_bps(bps: u32) -> Self
Create a new FskBitrate
from a bitrate in bits per second.
This the resulting value will be rounded down, and will saturate if
bps
is outside of the theoretical limits.
Example
use stm32wlxx_hal::subghz::FskBitrate;
const BITRATE: FskBitrate = FskBitrate::from_bps(9600);
assert_eq!(BITRATE.as_bps(), 9600);
sourcepub const fn from_raw(bits: u32) -> Self
pub const fn from_raw(bits: u32) -> Self
Create a new FskBitrate
from a raw bit value.
bits = 32 × 32 MHz / bitrate
Note: Only the first 24 bits of the u32
are used, the bits
argument will be masked.
Example
use stm32wlxx_hal::subghz::FskBitrate;
const BITRATE: FskBitrate = FskBitrate::from_raw(0x7D00);
assert_eq!(BITRATE.as_bps(), 32_000);
Trait Implementations§
source§impl Clone for FskBitrate
impl Clone for FskBitrate
source§fn clone(&self) -> FskBitrate
fn clone(&self) -> FskBitrate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FskBitrate
impl Debug for FskBitrate
source§impl Ord for FskBitrate
impl Ord for FskBitrate
source§impl PartialEq for FskBitrate
impl PartialEq for FskBitrate
source§fn eq(&self, other: &FskBitrate) -> bool
fn eq(&self, other: &FskBitrate) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FskBitrate
impl PartialOrd for FskBitrate
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 FskBitrate
impl Eq for FskBitrate
impl StructuralEq for FskBitrate
impl StructuralPartialEq for FskBitrate
Auto Trait Implementations§
impl RefUnwindSafe for FskBitrate
impl Send for FskBitrate
impl Sync for FskBitrate
impl Unpin for FskBitrate
impl UnwindSafe for FskBitrate
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