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

source

pub const RESET: u8 = 0u8

Socket interrupt status register (Sn_IR) reset value.

source

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());
source

pub const CON_OFFSET: u8 = 0u8

Bit offset for the CON field.

source

pub const DISCON_OFFSET: u8 = 1u8

Bit offset for the DISCON field.

source

pub const RECV_OFFSET: u8 = 2u8

Bit offset for the RECV field.

source

pub const TIMEOUT_OFFSET: u8 = 3u8

Bit offset for the TIMEOUT field.

source

pub const SENDOK_OFFSET: u8 = 4u8

Bit offset for the SENDOK field.

source

pub const CON_MASK: u8 = 1u8

Bit mask for the CON field.

source

pub const DISCON_MASK: u8 = 2u8

Bit mask for the DISCON field.

source

pub const RECV_MASK: u8 = 4u8

Bit mask for the RECV field.

source

pub const TIMEOUT_MASK: u8 = 8u8

Bit mask for the TIMEOUT field.

source

pub const SENDOK_MASK: u8 = 16u8

Bit mask for the SENDOK field.

source

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());
source

pub const fn clear_con(self) -> Self

Clear the CON interrupt by writing 1.

source

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());
source

pub const fn clear_discon(self) -> Self

Clear the DISCON interrupt by writing 1.

source

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());
source

pub const fn clear_recv(self) -> Self

Clear the RECV interrupt by writing 1.

source

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());
source

pub const fn clear_timeout(self) -> Self

Clear the TIMEOUT interrupt by writing 1.

source

pub const fn sendok_raised(&self) -> bool

Get the value of the SENDOK interrupt.

This is issued when SEND command is completed.

Example
use w5500_ll::SocketInterrupt;

let sir: SocketInterrupt = SocketInterrupt::DEFAULT;
assert!(!sir.sendok_raised());
source

pub const fn clear_sendok(self) -> Self

Clear the SENDOK interrupt by writing 1.

source

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

source§

fn clone(&self) -> SocketInterrupt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SocketInterrupt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SocketInterrupt

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for SocketInterrupt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Format for SocketInterrupt

Available on crate feature defmt only.
source§

fn format(&self, fmt: Formatter<'_>)

Writes the defmt representation of self to fmt.
source§

impl From<SocketInterrupt> for u8

source§

fn from(val: SocketInterrupt) -> u8

Converts to this type from the input type.
source§

impl From<u8> for SocketInterrupt

source§

fn from(val: u8) -> Self

Converts to this type from the input type.
source§

impl PartialEq for SocketInterrupt

source§

fn eq(&self, other: &SocketInterrupt) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for SocketInterrupt

source§

impl Eq for SocketInterrupt

source§

impl StructuralEq for SocketInterrupt

source§

impl StructuralPartialEq for SocketInterrupt

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.