pub struct IrqFlags(/* private fields */);Expand description
A set of SX127x LoRa interrupts, in the layout of RegIrqFlags.
§Examples
use pamoja_radios::sx127x::irq::IrqFlags;
// RegIrqFlags read 0x70: a packet arrived with a valid header but a bad payload CRC.
let raised = IrqFlags::from_bits(0x70);
assert!(raised.contains(IrqFlags::RX_DONE | IrqFlags::PAYLOAD_CRC_ERROR));
assert!(!raised.contains(IrqFlags::TX_DONE));Implementations§
Source§impl IrqFlags
impl IrqFlags
Sourcepub const CAD_DETECTED: IrqFlags
pub const CAD_DETECTED: IrqFlags
Bit 0: channel activity detection heard a LoRa signal.
Sourcepub const FHSS_CHANGE_CHANNEL: IrqFlags
pub const FHSS_CHANGE_CHANNEL: IrqFlags
Bit 1: frequency hopping moved to the next channel.
Sourcepub const VALID_HEADER: IrqFlags
pub const VALID_HEADER: IrqFlags
Bit 4: a valid header was received.
Sourcepub const PAYLOAD_CRC_ERROR: IrqFlags
pub const PAYLOAD_CRC_ERROR: IrqFlags
Bit 5: the payload failed its CRC.
Sourcepub const RX_TIMEOUT: IrqFlags
pub const RX_TIMEOUT: IrqFlags
Bit 7: a single reception timed out before a preamble arrived.
Sourcepub const fn bits(self) -> u8
pub const fn bits(self) -> u8
Returns the register’s bits.
§Returns
The RegIrqFlags value, which written back clears exactly these interrupts.
Sourcepub const fn intersects(self, other: IrqFlags) -> bool
pub const fn intersects(self, other: IrqFlags) -> bool
Trait Implementations§
Source§impl BitOrAssign for IrqFlags
impl BitOrAssign for IrqFlags
Source§fn bitor_assign(&mut self, rhs: IrqFlags)
fn bitor_assign(&mut self, rhs: IrqFlags)
Performs the
|= operation. Read moreimpl Copy for IrqFlags
impl Eq for IrqFlags
impl StructuralPartialEq for IrqFlags
Auto Trait Implementations§
impl Freeze for IrqFlags
impl RefUnwindSafe for IrqFlags
impl Send for IrqFlags
impl Sync for IrqFlags
impl Unpin for IrqFlags
impl UnsafeUnpin for IrqFlags
impl UnwindSafe for IrqFlags
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