PY32f072xx-pac 0.1.0

Peripheral Access Crate for Puya's PY32f072xx microcontroller
Documentation
#[doc = "Register `SMPR3` reader"]
pub struct R(crate::R<SMPR3_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SMPR3_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SMPR3_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SMPR3_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `SMPR3` writer"]
pub struct W(crate::W<SMPR3_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SMPR3_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<SMPR3_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<SMPR3_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `SMP0` reader - desc SMP0"]
pub type SMP0_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP0` writer - desc SMP0"]
pub type SMP0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP1` reader - desc SMP1"]
pub type SMP1_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP1` writer - desc SMP1"]
pub type SMP1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP2` reader - desc SMP2"]
pub type SMP2_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP2` writer - desc SMP2"]
pub type SMP2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP3` reader - desc SMP3"]
pub type SMP3_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP3` writer - desc SMP3"]
pub type SMP3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP4` reader - desc SMP4"]
pub type SMP4_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP4` writer - desc SMP4"]
pub type SMP4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP5` reader - desc SMP5"]
pub type SMP5_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP5` writer - desc SMP5"]
pub type SMP5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP6` reader - desc SMP6"]
pub type SMP6_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP6` writer - desc SMP6"]
pub type SMP6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP7` reader - desc SMP7"]
pub type SMP7_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP7` writer - desc SMP7"]
pub type SMP7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP8` reader - desc SMP8"]
pub type SMP8_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP8` writer - desc SMP8"]
pub type SMP8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
#[doc = "Field `SMP9` reader - desc SMP9"]
pub type SMP9_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SMP9` writer - desc SMP9"]
pub type SMP9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SMPR3_SPEC, u8, u8, 3, O>;
impl R {
    #[doc = "Bits 0:2 - desc SMP0"]
    #[inline(always)]
    pub fn smp0(&self) -> SMP0_R {
        SMP0_R::new((self.bits & 7) as u8)
    }
    #[doc = "Bits 3:5 - desc SMP1"]
    #[inline(always)]
    pub fn smp1(&self) -> SMP1_R {
        SMP1_R::new(((self.bits >> 3) & 7) as u8)
    }
    #[doc = "Bits 6:8 - desc SMP2"]
    #[inline(always)]
    pub fn smp2(&self) -> SMP2_R {
        SMP2_R::new(((self.bits >> 6) & 7) as u8)
    }
    #[doc = "Bits 9:11 - desc SMP3"]
    #[inline(always)]
    pub fn smp3(&self) -> SMP3_R {
        SMP3_R::new(((self.bits >> 9) & 7) as u8)
    }
    #[doc = "Bits 12:14 - desc SMP4"]
    #[inline(always)]
    pub fn smp4(&self) -> SMP4_R {
        SMP4_R::new(((self.bits >> 12) & 7) as u8)
    }
    #[doc = "Bits 15:17 - desc SMP5"]
    #[inline(always)]
    pub fn smp5(&self) -> SMP5_R {
        SMP5_R::new(((self.bits >> 15) & 7) as u8)
    }
    #[doc = "Bits 18:20 - desc SMP6"]
    #[inline(always)]
    pub fn smp6(&self) -> SMP6_R {
        SMP6_R::new(((self.bits >> 18) & 7) as u8)
    }
    #[doc = "Bits 21:23 - desc SMP7"]
    #[inline(always)]
    pub fn smp7(&self) -> SMP7_R {
        SMP7_R::new(((self.bits >> 21) & 7) as u8)
    }
    #[doc = "Bits 24:26 - desc SMP8"]
    #[inline(always)]
    pub fn smp8(&self) -> SMP8_R {
        SMP8_R::new(((self.bits >> 24) & 7) as u8)
    }
    #[doc = "Bits 27:29 - desc SMP9"]
    #[inline(always)]
    pub fn smp9(&self) -> SMP9_R {
        SMP9_R::new(((self.bits >> 27) & 7) as u8)
    }
}
impl W {
    #[doc = "Bits 0:2 - desc SMP0"]
    #[inline(always)]
    pub fn smp0(&mut self) -> SMP0_W<0> {
        SMP0_W::new(self)
    }
    #[doc = "Bits 3:5 - desc SMP1"]
    #[inline(always)]
    pub fn smp1(&mut self) -> SMP1_W<3> {
        SMP1_W::new(self)
    }
    #[doc = "Bits 6:8 - desc SMP2"]
    #[inline(always)]
    pub fn smp2(&mut self) -> SMP2_W<6> {
        SMP2_W::new(self)
    }
    #[doc = "Bits 9:11 - desc SMP3"]
    #[inline(always)]
    pub fn smp3(&mut self) -> SMP3_W<9> {
        SMP3_W::new(self)
    }
    #[doc = "Bits 12:14 - desc SMP4"]
    #[inline(always)]
    pub fn smp4(&mut self) -> SMP4_W<12> {
        SMP4_W::new(self)
    }
    #[doc = "Bits 15:17 - desc SMP5"]
    #[inline(always)]
    pub fn smp5(&mut self) -> SMP5_W<15> {
        SMP5_W::new(self)
    }
    #[doc = "Bits 18:20 - desc SMP6"]
    #[inline(always)]
    pub fn smp6(&mut self) -> SMP6_W<18> {
        SMP6_W::new(self)
    }
    #[doc = "Bits 21:23 - desc SMP7"]
    #[inline(always)]
    pub fn smp7(&mut self) -> SMP7_W<21> {
        SMP7_W::new(self)
    }
    #[doc = "Bits 24:26 - desc SMP8"]
    #[inline(always)]
    pub fn smp8(&mut self) -> SMP8_W<24> {
        SMP8_W::new(self)
    }
    #[doc = "Bits 27:29 - desc SMP9"]
    #[inline(always)]
    pub fn smp9(&mut self) -> SMP9_W<27> {
        SMP9_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "desc SMPR2\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [smpr3](index.html) module"]
pub struct SMPR3_SPEC;
impl crate::RegisterSpec for SMPR3_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [smpr3::R](R) reader structure"]
impl crate::Readable for SMPR3_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [smpr3::W](W) writer structure"]
impl crate::Writable for SMPR3_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets SMPR3 to value 0"]
impl crate::Resettable for SMPR3_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}