pub type R = crate::R<SHHRrs>;
pub type W = crate::W<SHHRrs>;
pub type THOLD_R = crate::FieldReader<u16>;
pub type THOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16, crate::Safe>;
impl R {
#[inline(always)]
pub fn thold(&self, n: u8) -> THOLD_R {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
THOLD_R::new(((self.bits >> (n * 16)) & 0x03ff) as u16)
}
#[inline(always)]
pub fn thold_iter(&self) -> impl Iterator<Item = THOLD_R> + '_ {
(0..2).map(move |n| THOLD_R::new(((self.bits >> (n * 16)) & 0x03ff) as u16))
}
#[inline(always)]
pub fn thold1(&self) -> THOLD_R {
THOLD_R::new((self.bits & 0x03ff) as u16)
}
#[inline(always)]
pub fn thold2(&self) -> THOLD_R {
THOLD_R::new(((self.bits >> 16) & 0x03ff) as u16)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SHHR")
.field("thold1", &self.thold1())
.field("thold2", &self.thold2())
.finish()
}
}
impl W {
#[inline(always)]
pub fn thold(&mut self, n: u8) -> THOLD_W<SHHRrs> {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
THOLD_W::new(self, n * 16)
}
#[inline(always)]
pub fn thold1(&mut self) -> THOLD_W<SHHRrs> {
THOLD_W::new(self, 0)
}
#[inline(always)]
pub fn thold2(&mut self) -> THOLD_W<SHHRrs> {
THOLD_W::new(self, 16)
}
}
pub struct SHHRrs;
impl crate::RegisterSpec for SHHRrs {
type Ux = u32;
}
impl crate::Readable for SHHRrs {}
impl crate::Writable for SHHRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SHHRrs {
const RESET_VALUE: u32 = 0x0001_0001;
}