Struct w5500_ll::SocketInterruptMask
source · pub struct SocketInterruptMask(_);
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
impl SocketInterruptMask
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::SocketInterruptMask;
assert_eq!(SocketInterruptMask::DEFAULT, SocketInterruptMask::default());
sourcepub const ALL_MASKED: SocketInterruptMask = _
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());
sourcepub const fn con_masked(&self) -> bool
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());
sourcepub const fn unmask_con(self) -> Self
pub const fn unmask_con(self) -> Self
Unmask the CON
interrupt.
sourcepub const fn discon_masked(&self) -> bool
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());
sourcepub const fn unmask_discon(self) -> Self
pub const fn unmask_discon(self) -> Self
Unmask the DISCON
interrupt.
sourcepub const fn mask_discon(self) -> Self
pub const fn mask_discon(self) -> Self
Mask the DISCON
interrupt.
sourcepub const fn recv_masked(&self) -> bool
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());
sourcepub const fn unmask_recv(self) -> Self
pub const fn unmask_recv(self) -> Self
Unmask the RECV
interrupt.
sourcepub const fn timeout_masked(&self) -> bool
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());
sourcepub const fn unmask_timeout(self) -> Self
pub const fn unmask_timeout(self) -> Self
Unmask the TIMEOUT
interrupt.
sourcepub const fn mask_timeout(self) -> Self
pub const fn mask_timeout(self) -> Self
Mask the TIMEOUT
interrupt.
sourcepub const fn sendok_masked(&self) -> bool
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());
sourcepub const fn unmask_sendok(self) -> Self
pub const fn unmask_sendok(self) -> Self
Unmask the SENDOK
interrupt.
sourcepub const fn mask_sendok(self) -> Self
pub const fn mask_sendok(self) -> Self
Mask the SENDOK
interrupt.
Trait Implementations§
source§impl Clone for SocketInterruptMask
impl Clone for SocketInterruptMask
source§fn clone(&self) -> SocketInterruptMask
fn clone(&self) -> SocketInterruptMask
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SocketInterruptMask
impl Debug for SocketInterruptMask
source§impl Default for SocketInterruptMask
impl Default for SocketInterruptMask
source§impl Display for SocketInterruptMask
impl Display for SocketInterruptMask
source§impl Format for SocketInterruptMask
Available on crate feature defmt
only.
impl Format for SocketInterruptMask
Available on crate feature
defmt
only.source§impl From<SocketInterruptMask> for u8
impl From<SocketInterruptMask> for u8
source§fn from(val: SocketInterruptMask) -> u8
fn from(val: SocketInterruptMask) -> u8
Converts to this type from the input type.
source§impl From<u8> for SocketInterruptMask
impl From<u8> for SocketInterruptMask
source§impl PartialEq<SocketInterruptMask> for SocketInterruptMask
impl PartialEq<SocketInterruptMask> for SocketInterruptMask
source§fn eq(&self, other: &SocketInterruptMask) -> bool
fn eq(&self, other: &SocketInterruptMask) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for SocketInterruptMask
impl Eq for SocketInterruptMask
impl StructuralEq for SocketInterruptMask
impl StructuralPartialEq for SocketInterruptMask
Auto Trait Implementations§
impl RefUnwindSafe for SocketInterruptMask
impl Send for SocketInterruptMask
impl Sync for SocketInterruptMask
impl Unpin for SocketInterruptMask
impl UnwindSafe for SocketInterruptMask
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