pub enum Mode {
StandbyRc,
StandbyXosc,
FrequencySynthesis,
Receiving,
Transmitting,
}Expand description
What the radio is doing, from the middle bits of a status byte.
Variants§
StandbyRc
Parked on its own oscillator.
StandbyXosc
Parked on the crystal.
FrequencySynthesis
On frequency, neither receiving nor transmitting.
Receiving
Receiving.
Transmitting
Transmitting.
Implementations§
Source§impl Mode
impl Mode
Sourcepub const fn of(status: u8) -> Option<Mode>
pub const fn of(status: u8) -> Option<Mode>
Reads the mode out of a status byte.
§Arguments
status- the byte the radio answered with.
§Returns
The mode, or None for a value the datasheet does not give one for.
§Examples
use pamoja_radios::sx1302::sx1261::{Mode, STANDBY_READY};
assert_eq!(Mode::of(STANDBY_READY), Some(Mode::StandbyRc));
assert_eq!(Mode::of(0x00), None);Trait Implementations§
impl Copy for Mode
impl Eq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
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