Struct w5500_ll::Interrupt [−][src]
pub struct Interrupt(_);
Expand description
Interrupt and interrupt mask register (IR and IMR).
When used for interrupt masking:
false
= Interrupt is disabled.true
= Interrupt is enabled.
When used for reading interrupt status:
false
= Interrupt is not raised.true
= Interrupt is raised.
This is used by these methods:
Implementations
Default value.
This is the same as default
, but as a const
value.
Example
use w5500_ll::Interrupt;
assert_eq!(Interrupt::DEFAULT, Interrupt::default());
Bit offset for the CONFLICT
field.
Bit offset for the UNREACH
field.
Bit offset for the PPPoE
field.
Bit mask for the CONFLICT
field.
Bit mask for the UNREACH
field.
Bit mask for the PPPoE
field.
Get the value of the IP conflict interrupt.
This interrupt is set when our source IP is the same as the sender IP in the received ARP request.
Example
use w5500_ll::Interrupt;
let ir: Interrupt = Interrupt::DEFAULT;
assert!(!ir.conflict());
let ir: Interrupt = ir.set_conflict();
assert!(ir.conflict());
let ir: Interrupt = ir.clear_conflict();
assert!(!ir.conflict());
Set the IP conflict bit.
Clear the IP conflict bit.
Get the destination unreachable interrupt.
This interrupt is set when receiving the ICMP (destination port unreachable) packet.
When this interrupt is set destination information such as the IP address and port number may be checked with the corresponding UIPR and UPORTR registers.
Example
use w5500_ll::Interrupt;
let ir: Interrupt = Interrupt::DEFAULT;
assert!(!ir.unreach());
let ir: Interrupt = ir.set_unreach();
assert!(ir.unreach());
let ir: Interrupt = ir.clear_unreach();
assert!(!ir.unreach());
Set the destination unreachable bit.
Clear the destination unreachable bit.
Get the PPPoE connection close interrupt.
This interrupt is set when PPPoE is disconnected during PPPoE.
Example
use w5500_ll::Interrupt;
let ir: Interrupt = Interrupt::DEFAULT;
assert!(!ir.pppoe());
let ir: Interrupt = ir.set_pppoe();
assert!(ir.pppoe());
let ir: Interrupt = ir.clear_pppoe();
assert!(!ir.pppoe());
Clear the PPPoE connection close bit.
Get the magic packet interrupt.
This interrupt is set when wake on LAN is enabled, and the magic packet is received.
Example
use w5500_ll::Interrupt;
let ir: Interrupt = Interrupt::DEFAULT;
assert!(!ir.mp());
let ir: Interrupt = ir.set_mp();
assert!(ir.mp());
let ir: Interrupt = ir.clear_mp();
assert!(!ir.mp());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Interrupt
impl UnwindSafe for Interrupt
Blanket Implementations
Mutably borrows from an owned value. Read more