pub enum Model {
Sx1302,
Sx1303,
Unknown(u8),
}Expand description
Which concentrator this is.
Variants§
Sx1302
An SX1302, which reports itself as either zero or two.
Sx1303
An SX1303, which adds the fine timestamping the SX1302 has not.
Unknown(u8)
A part number this build does not know, carried so the caller can report it.
Implementations§
Source§impl Model
impl Model
Sourcepub const fn of(byte: u8) -> Model
pub const fn of(byte: u8) -> Model
Reads the part number byte.
§Arguments
byte- what the one-time programmable memory answered with.
§Returns
Which concentrator it is.
§Examples
use pamoja_radios::sx1302::chip::Model;
// The SX1302 reports itself two ways, and both mean the same part.
assert_eq!(Model::of(0x00), Model::Sx1302);
assert_eq!(Model::of(0x02), Model::Sx1302);
assert_eq!(Model::of(0x03), Model::Sx1303);
assert_eq!(Model::of(0x7f), Model::Unknown(0x7f));Trait Implementations§
impl Copy for Model
impl Eq for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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