pub struct SocketInterruptMask(/* private fields */);
Expand description

Socket Interrupt Mask Register (Sn_IMR).

This is used by the Registers::sn_imr and Registers::set_sn_imr methods.

See the SocketInterrupt structure for more information about the individual interrupts.

Implementations§

source§

impl SocketInterruptMask

source

pub const RESET: u8 = 255u8

Socket interrupt mask register (Sn_IMR) reset value.

source

pub const DEFAULT: Self = _

Default value.

This is the same as default, but as a const value.

Example
use w5500_ll::SocketInterruptMask;

assert_eq!(SocketInterruptMask::DEFAULT, SocketInterruptMask::default());
source

pub const ALL_MASKED: SocketInterruptMask = _

Mask all socket interrupts.

Example
use w5500_ll::SocketInterruptMask;

assert!(SocketInterruptMask::ALL_MASKED.con_masked());
assert!(SocketInterruptMask::ALL_MASKED.discon_masked());
assert!(SocketInterruptMask::ALL_MASKED.recv_masked());
assert!(SocketInterruptMask::ALL_MASKED.timeout_masked());
assert!(SocketInterruptMask::ALL_MASKED.sendok_masked());
source

pub const fn con_masked(&self) -> bool

Check if the CON interrupt is masked.

Example
use w5500_ll::SocketInterruptMask;

let simr: SocketInterruptMask = SocketInterruptMask::DEFAULT;
assert!(!simr.con_masked());
let simr: SocketInterruptMask = simr.mask_con();
assert!(simr.con_masked());
let simr: SocketInterruptMask = simr.unmask_con();
assert!(!simr.con_masked());
source

pub const fn unmask_con(self) -> Self

Unmask the CON interrupt.

source

pub const fn mask_con(self) -> Self

Mask the CON interrupt.

source

pub const fn discon_masked(&self) -> bool

Check if the DISCON interrupt is masked.

Example
use w5500_ll::SocketInterruptMask;

let simr: SocketInterruptMask = SocketInterruptMask::DEFAULT;
assert!(!simr.discon_masked());
let simr: SocketInterruptMask = simr.mask_discon();
assert!(simr.discon_masked());
let simr: SocketInterruptMask = simr.unmask_discon();
assert!(!simr.discon_masked());
source

pub const fn unmask_discon(self) -> Self

Unmask the DISCON interrupt.

source

pub const fn mask_discon(self) -> Self

Mask the DISCON interrupt.

source

pub const fn recv_masked(&self) -> bool

Check if the RECV interrupt is masked.

Example
use w5500_ll::SocketInterruptMask;

let simr: SocketInterruptMask = SocketInterruptMask::DEFAULT;
assert!(!simr.recv_masked());
let simr: SocketInterruptMask = simr.mask_recv();
assert!(simr.recv_masked());
let simr: SocketInterruptMask = simr.unmask_recv();
assert!(!simr.recv_masked());
source

pub const fn unmask_recv(self) -> Self

Unmask the RECV interrupt.

source

pub const fn mask_recv(self) -> Self

Mask the RECV interrupt.

source

pub const fn timeout_masked(&self) -> bool

Check if the TIMEOUT interrupt is masked.

Example
use w5500_ll::SocketInterruptMask;

let simr: SocketInterruptMask = SocketInterruptMask::DEFAULT;
assert!(!simr.timeout_masked());
let simr: SocketInterruptMask = simr.mask_timeout();
assert!(simr.timeout_masked());
let simr: SocketInterruptMask = simr.unmask_timeout();
assert!(!simr.timeout_masked());
source

pub const fn unmask_timeout(self) -> Self

Unmask the TIMEOUT interrupt.

source

pub const fn mask_timeout(self) -> Self

Mask the TIMEOUT interrupt.

source

pub const fn sendok_masked(&self) -> bool

Check if the SENDOK interrupt is masked.

Example
use w5500_ll::SocketInterruptMask;

let simr: SocketInterruptMask = SocketInterruptMask::DEFAULT;
assert!(!simr.sendok_masked());
let simr: SocketInterruptMask = simr.mask_sendok();
assert!(simr.sendok_masked());
let simr: SocketInterruptMask = simr.unmask_sendok();
assert!(!simr.sendok_masked());
source

pub const fn unmask_sendok(self) -> Self

Unmask the SENDOK interrupt.

source

pub const fn mask_sendok(self) -> Self

Mask the SENDOK interrupt.

Trait Implementations§

source§

impl Clone for SocketInterruptMask

source§

fn clone(&self) -> SocketInterruptMask

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 SocketInterruptMask

source§

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

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

impl Default for SocketInterruptMask

source§

fn default() -> Self

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

impl Display for SocketInterruptMask

source§

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

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

impl Format for SocketInterruptMask

Available on crate feature defmt only.
source§

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

Writes the defmt representation of self to fmt.
source§

impl From<SocketInterruptMask> for u8

source§

fn from(val: SocketInterruptMask) -> u8

Converts to this type from the input type.
source§

impl From<u8> for SocketInterruptMask

source§

fn from(val: u8) -> Self

Converts to this type from the input type.
source§

impl PartialEq for SocketInterruptMask

source§

fn eq(&self, other: &SocketInterruptMask) -> 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 SocketInterruptMask

source§

impl Eq for SocketInterruptMask

source§

impl StructuralEq for SocketInterruptMask

source§

impl StructuralPartialEq for SocketInterruptMask

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.