#[doc = "Register `INITIAL_SPCIF_TRIM_M1_DAC0` reader"]
pub struct R(crate::R<INITIAL_SPCIF_TRIM_M1_DAC0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<INITIAL_SPCIF_TRIM_M1_DAC0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<INITIAL_SPCIF_TRIM_M1_DAC0_SPEC>> for R {
    fn from(reader: crate::R<INITIAL_SPCIF_TRIM_M1_DAC0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `INITIAL_SPCIF_TRIM_M1_DAC0` writer"]
pub struct W(crate::W<INITIAL_SPCIF_TRIM_M1_DAC0_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<INITIAL_SPCIF_TRIM_M1_DAC0_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 core::convert::From<crate::W<INITIAL_SPCIF_TRIM_M1_DAC0_SPEC>> for W {
    fn from(writer: crate::W<INITIAL_SPCIF_TRIM_M1_DAC0_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `IDAC` reader - See SPCIF_TRIM1"]
pub struct IDAC_R(crate::FieldReader<u8, u8>);
impl IDAC_R {
    pub(crate) fn new(bits: u8) -> Self {
        IDAC_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for IDAC_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `IDAC` writer - See SPCIF_TRIM1"]
pub struct IDAC_W<'a> {
    w: &'a mut W,
}
impl<'a> IDAC_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x1f) | (value as u8 & 0x1f);
        self.w
    }
}
#[doc = "Field `SLOPE` reader - See SPCIF_TRIM1"]
pub struct SLOPE_R(crate::FieldReader<u8, u8>);
impl SLOPE_R {
    pub(crate) fn new(bits: u8) -> Self {
        SLOPE_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for SLOPE_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `SLOPE` writer - See SPCIF_TRIM1"]
pub struct SLOPE_W<'a> {
    w: &'a mut W,
}
impl<'a> SLOPE_W<'a> {
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x07 << 5)) | ((value as u8 & 0x07) << 5);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:4 - See SPCIF_TRIM1"]
    #[inline(always)]
    pub fn idac(&self) -> IDAC_R {
        IDAC_R::new((self.bits & 0x1f) as u8)
    }
    #[doc = "Bits 5:7 - See SPCIF_TRIM1"]
    #[inline(always)]
    pub fn slope(&self) -> SLOPE_R {
        SLOPE_R::new(((self.bits >> 5) & 0x07) as u8)
    }
}
impl W {
    #[doc = "Bits 0:4 - See SPCIF_TRIM1"]
    #[inline(always)]
    pub fn idac(&mut self) -> IDAC_W {
        IDAC_W { w: self }
    }
    #[doc = "Bits 5:7 - See SPCIF_TRIM1"]
    #[inline(always)]
    pub fn slope(&mut self) -> SLOPE_W {
        SLOPE_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "FLASH IDAC trim used during boot\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 [initial_spcif_trim_m1_dac0](index.html) module"]
pub struct INITIAL_SPCIF_TRIM_M1_DAC0_SPEC;
impl crate::RegisterSpec for INITIAL_SPCIF_TRIM_M1_DAC0_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [initial_spcif_trim_m1_dac0::R](R) reader structure"]
impl crate::Readable for INITIAL_SPCIF_TRIM_M1_DAC0_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [initial_spcif_trim_m1_dac0::W](W) writer structure"]
impl crate::Writable for INITIAL_SPCIF_TRIM_M1_DAC0_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets INITIAL_SPCIF_TRIM_M1_DAC0 to value 0"]
impl crate::Resettable for INITIAL_SPCIF_TRIM_M1_DAC0_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
