pub type R = crate::R<SQR1rs>;
pub type W = crate::W<SQR1rs>;
pub type L_R = crate::FieldReader;
pub type L_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type SQ_R = crate::FieldReader;
pub type SQ_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
impl R {
#[inline(always)]
pub fn l(&self) -> L_R {
L_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn sq(&self, n: u8) -> SQ_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
SQ_R::new(((self.bits >> (n * 6 + 6)) & 0x1f) as u8)
}
#[inline(always)]
pub fn sq_iter(&self) -> impl Iterator<Item = SQ_R> + '_ {
(0..4).map(move |n| SQ_R::new(((self.bits >> (n * 6 + 6)) & 0x1f) as u8))
}
#[inline(always)]
pub fn sq1(&self) -> SQ_R {
SQ_R::new(((self.bits >> 6) & 0x1f) as u8)
}
#[inline(always)]
pub fn sq2(&self) -> SQ_R {
SQ_R::new(((self.bits >> 12) & 0x1f) as u8)
}
#[inline(always)]
pub fn sq3(&self) -> SQ_R {
SQ_R::new(((self.bits >> 18) & 0x1f) as u8)
}
#[inline(always)]
pub fn sq4(&self) -> SQ_R {
SQ_R::new(((self.bits >> 24) & 0x1f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SQR1")
.field("sq1", &self.sq1())
.field("sq2", &self.sq2())
.field("sq3", &self.sq3())
.field("sq4", &self.sq4())
.field("l", &self.l())
.finish()
}
}
impl W {
#[inline(always)]
pub fn l(&mut self) -> L_W<SQR1rs> {
L_W::new(self, 0)
}
#[inline(always)]
pub fn sq(&mut self, n: u8) -> SQ_W<SQR1rs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
SQ_W::new(self, n * 6 + 6)
}
#[inline(always)]
pub fn sq1(&mut self) -> SQ_W<SQR1rs> {
SQ_W::new(self, 6)
}
#[inline(always)]
pub fn sq2(&mut self) -> SQ_W<SQR1rs> {
SQ_W::new(self, 12)
}
#[inline(always)]
pub fn sq3(&mut self) -> SQ_W<SQR1rs> {
SQ_W::new(self, 18)
}
#[inline(always)]
pub fn sq4(&mut self) -> SQ_W<SQR1rs> {
SQ_W::new(self, 24)
}
}
pub struct SQR1rs;
impl crate::RegisterSpec for SQR1rs {
type Ux = u32;
}
impl crate::Readable for SQR1rs {}
impl crate::Writable for SQR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SQR1rs {}