pub struct Irq(/* private fields */);Expand description
A set of SX126x interrupts, in the layout of the IRQ register.
§Examples
use pamoja_radios::sx126x::irq::Irq;
// GetIrqStatus answered 0x0202: a timeout and a received packet.
let pending = Irq::from_bytes([0x02, 0x02]);
assert!(pending.contains(Irq::RX_DONE | Irq::TIMEOUT));
assert!(!pending.contains(Irq::CRC_ERROR));Implementations§
Source§impl Irq
impl Irq
Sourcepub const PREAMBLE_DETECTED: Irq
pub const PREAMBLE_DETECTED: Irq
Bit 2: a preamble was detected.
Sourcepub const SYNC_WORD_VALID: Irq
pub const SYNC_WORD_VALID: Irq
Bit 3: a valid sync word was detected, in FSK.
Sourcepub const HEADER_VALID: Irq
pub const HEADER_VALID: Irq
Bit 4: a valid LoRa header was received.
Sourcepub const HEADER_ERROR: Irq
pub const HEADER_ERROR: Irq
Bit 5: a LoRa header failed its CRC.
Sourcepub const CAD_DETECTED: Irq
pub const CAD_DETECTED: Irq
Bit 8: channel activity was detected, in LoRa.
Sourcepub const LR_FHSS_HOP: Irq
pub const LR_FHSS_HOP: Irq
Bit 14: a hop in LR-FHSS, after the power amplifier ramped up again.
Sourcepub const fn from_bytes(bytes: [u8; 2]) -> Irq
pub const fn from_bytes(bytes: [u8; 2]) -> Irq
Sourcepub const fn to_bytes(self) -> [u8; 2]
pub const fn to_bytes(self) -> [u8; 2]
Returns the two bytes a command carries for this set, most significant first.
§Returns
The mask as it goes on the wire.
Sourcepub const fn intersects(self, other: Irq) -> bool
pub const fn intersects(self, other: Irq) -> bool
Trait Implementations§
Source§impl BitOrAssign for Irq
impl BitOrAssign for Irq
Source§fn bitor_assign(&mut self, rhs: Irq)
fn bitor_assign(&mut self, rhs: Irq)
Performs the
|= operation. Read moreimpl Copy for Irq
impl Eq for Irq
impl StructuralPartialEq for Irq
Auto Trait Implementations§
impl Freeze for Irq
impl RefUnwindSafe for Irq
impl Send for Irq
impl Sync for Irq
impl Unpin for Irq
impl UnsafeUnpin for Irq
impl UnwindSafe for Irq
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