pub type R = crate::R<LINKrs>;
pub type W = crate::W<LINKrs>;
pub type LinkmodeR = crate::BitReader;
pub type LinkR = crate::BitReader;
pub type LinkW<'a, REG> = crate::BitWriter<'a, REG>;
pub type LinkaddrR = crate::FieldReader<u32>;
pub type LinkaddrW<'a, REG> = crate::FieldWriter<'a, REG, 30, u32>;
impl R {
#[inline(always)]
pub fn linkmode(&self) -> LinkmodeR {
LinkmodeR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn link(&self) -> LinkR {
LinkR::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn linkaddr(&self) -> LinkaddrR {
LinkaddrR::new((self.bits >> 2) & 0x3fff_ffff)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LINK")
.field("linkmode", &self.linkmode())
.field("link", &self.link())
.field("linkaddr", &self.linkaddr())
.finish()
}
}
impl W {
#[inline(always)]
pub fn link(&mut self) -> LinkW<'_, LINKrs> {
LinkW::new(self, 1)
}
#[inline(always)]
pub fn linkaddr(&mut self) -> LinkaddrW<'_, LINKrs> {
LinkaddrW::new(self, 2)
}
}
pub struct LINKrs;
impl crate::RegisterSpec for LINKrs {
type Ux = u32;
}
impl crate::Readable for LINKrs {}
impl crate::Writable for LINKrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for LINKrs {}