pub struct SocketInterrupt(/* private fields */);Expand description
Socket Interrupt Register (Sn_IR).
Indicated the socket status, such as connection, termination, receiving data, and timeout.
This is used by the Registers::sn_ir and
Registers::set_sn_ir methods.
Implementations§
Source§impl SocketInterrupt
impl SocketInterrupt
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
Default value.
This is the same as default, but as a const value.
§Example
use w5500_ll::SocketInterrupt;
assert_eq!(SocketInterrupt::DEFAULT, SocketInterrupt::default());Sourcepub const CON_OFFSET: u8 = 0u8
pub const CON_OFFSET: u8 = 0u8
Bit offset for the CON field.
Sourcepub const DISCON_OFFSET: u8 = 1u8
pub const DISCON_OFFSET: u8 = 1u8
Bit offset for the DISCON field.
Sourcepub const RECV_OFFSET: u8 = 2u8
pub const RECV_OFFSET: u8 = 2u8
Bit offset for the RECV field.
Sourcepub const TIMEOUT_OFFSET: u8 = 3u8
pub const TIMEOUT_OFFSET: u8 = 3u8
Bit offset for the TIMEOUT field.
Sourcepub const SENDOK_OFFSET: u8 = 4u8
pub const SENDOK_OFFSET: u8 = 4u8
Bit offset for the SENDOK field.
Sourcepub const DISCON_MASK: u8 = 2u8
pub const DISCON_MASK: u8 = 2u8
Bit mask for the DISCON field.
Sourcepub const TIMEOUT_MASK: u8 = 8u8
pub const TIMEOUT_MASK: u8 = 8u8
Bit mask for the TIMEOUT field.
Sourcepub const SENDOK_MASK: u8 = 16u8
pub const SENDOK_MASK: u8 = 16u8
Bit mask for the SENDOK field.
Sourcepub const fn con_raised(&self) -> bool
pub const fn con_raised(&self) -> bool
Get the value of the CON interrupt.
This is issued once when the connection with the peer is successful.
§Example
use w5500_ll::SocketInterrupt;
let sir: SocketInterrupt = SocketInterrupt::DEFAULT;
assert!(!sir.con_raised());Sourcepub const fn discon_raised(&self) -> bool
pub const fn discon_raised(&self) -> bool
Get the value of the DISCON interrupt.
This is issued when FIN or FIN/ACK packet is received from a peer.
§Example
use w5500_ll::SocketInterrupt;
let sir: SocketInterrupt = SocketInterrupt::DEFAULT;
assert!(!sir.discon_raised());Sourcepub const fn clear_discon(self) -> Self
pub const fn clear_discon(self) -> Self
Clear the DISCON interrupt by writing 1.
Sourcepub const fn recv_raised(&self) -> bool
pub const fn recv_raised(&self) -> bool
Get the value of the RECV interrupt.
This is issued whenever data is received from a peer.
§Example
use w5500_ll::SocketInterrupt;
let sir: SocketInterrupt = SocketInterrupt::DEFAULT;
assert!(!sir.recv_raised());Sourcepub const fn clear_recv(self) -> Self
pub const fn clear_recv(self) -> Self
Clear the RECV interrupt by writing 1.
Sourcepub const fn timeout_raised(&self) -> bool
pub const fn timeout_raised(&self) -> bool
Get the value of the TIMEOUT interrupt.
This is issued when ARPTO or TCPTO occurs.
§Example
use w5500_ll::SocketInterrupt;
let sir: SocketInterrupt = SocketInterrupt::DEFAULT;
assert!(!sir.timeout_raised());Sourcepub const fn clear_timeout(self) -> Self
pub const fn clear_timeout(self) -> Self
Clear the TIMEOUT interrupt by writing 1.
Sourcepub const fn sendok_raised(&self) -> bool
pub const fn sendok_raised(&self) -> bool
Sourcepub const fn clear_sendok(self) -> Self
pub const fn clear_sendok(self) -> Self
Clear the SENDOK interrupt by writing 1.
Sourcepub const fn any_raised(&self) -> bool
pub const fn any_raised(&self) -> bool
Returns true if any interrupt is raised.
§Example
use w5500_ll::SocketInterrupt;
assert!(!SocketInterrupt::DEFAULT.any_raised());Trait Implementations§
Source§impl Clone for SocketInterrupt
impl Clone for SocketInterrupt
Source§fn clone(&self) -> SocketInterrupt
fn clone(&self) -> SocketInterrupt
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SocketInterrupt
impl Debug for SocketInterrupt
Source§impl Default for SocketInterrupt
impl Default for SocketInterrupt
Source§impl Display for SocketInterrupt
impl Display for SocketInterrupt
Source§impl Format for SocketInterrupt
Available on crate feature defmt only.
impl Format for SocketInterrupt
defmt only.