pub enum LoraBandwidth {
Khz7_8,
Khz10_4,
Khz15_6,
Khz20_8,
Khz31_25,
Khz41_7,
Khz62_5,
Khz125,
Khz250,
Khz500,
}Expand description
A LoRa signal bandwidth, from Table 13-48.
Variants§
Khz7_8
7.81 kHz (0x00).
Khz10_4
10.42 kHz (0x08).
Khz15_6
15.63 kHz (0x01).
Khz20_8
20.83 kHz (0x09).
Khz31_25
31.25 kHz (0x02).
Khz41_7
41.67 kHz (0x0A).
Khz62_5
62.5 kHz (0x03).
Khz125
125 kHz (0x04).
Khz250
250 kHz (0x05).
Khz500
500 kHz (0x06).
Implementations§
Source§impl LoraBandwidth
impl LoraBandwidth
Sourcepub const fn hz(self) -> u32
pub const fn hz(self) -> u32
Returns the bandwidth in hertz, rounded to the nearest hertz.
§Returns
The bandwidth: 500 kHz halved, or 125 kHz divided by 3 and halved, as many times as the setting takes.
Sourcepub fn from_hz(hz: u32) -> Option<LoraBandwidth>
pub fn from_hz(hz: u32) -> Option<LoraBandwidth>
Sourcepub fn from_code(code: u8) -> Option<LoraBandwidth>
pub fn from_code(code: u8) -> Option<LoraBandwidth>
Finds the setting a BW value of SetModulationParams names.
§Arguments
code- the parameter byte.
§Returns
The setting, or None for a byte Table 13-48 does not list.
§Examples
use pamoja_radios::sx126x::config::LoraBandwidth;
assert_eq!(LoraBandwidth::from_code(LoraBandwidth::Khz125.code()), Some(LoraBandwidth::Khz125));
assert_eq!(LoraBandwidth::from_code(0x07), None);Trait Implementations§
Source§impl Clone for LoraBandwidth
impl Clone for LoraBandwidth
Source§fn clone(&self) -> LoraBandwidth
fn clone(&self) -> LoraBandwidth
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LoraBandwidth
Source§impl Debug for LoraBandwidth
impl Debug for LoraBandwidth
impl Eq for LoraBandwidth
Source§impl Hash for LoraBandwidth
impl Hash for LoraBandwidth
Source§impl PartialEq for LoraBandwidth
impl PartialEq for LoraBandwidth
impl StructuralPartialEq for LoraBandwidth
Auto Trait Implementations§
impl Freeze for LoraBandwidth
impl RefUnwindSafe for LoraBandwidth
impl Send for LoraBandwidth
impl Sync for LoraBandwidth
impl Unpin for LoraBandwidth
impl UnsafeUnpin for LoraBandwidth
impl UnwindSafe for LoraBandwidth
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