#[doc = "Register `ECO_TRIM1` reader"]
pub struct R(crate::R<ECO_TRIM1_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<ECO_TRIM1_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<ECO_TRIM1_SPEC>> for R {
    fn from(reader: crate::R<ECO_TRIM1_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `ECO_TRIM1` writer"]
pub struct W(crate::W<ECO_TRIM1_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<ECO_TRIM1_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<ECO_TRIM1_SPEC>> for W {
    fn from(writer: crate::W<ECO_TRIM1_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `FTRIM` reader - Filter Trim - 3rd harmonic oscillation"]
pub struct FTRIM_R(crate::FieldReader<u8, u8>);
impl FTRIM_R {
    pub(crate) fn new(bits: u8) -> Self {
        FTRIM_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for FTRIM_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `FTRIM` writer - Filter Trim - 3rd harmonic oscillation"]
pub struct FTRIM_W<'a> {
    w: &'a mut W,
}
impl<'a> FTRIM_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 & !0x03) | (value as u32 & 0x03);
        self.w
    }
}
#[doc = "Field `RTRIM` reader - Feedback resistor Trim"]
pub struct RTRIM_R(crate::FieldReader<u8, u8>);
impl RTRIM_R {
    pub(crate) fn new(bits: u8) -> Self {
        RTRIM_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for RTRIM_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `RTRIM` writer - Feedback resistor Trim"]
pub struct RTRIM_W<'a> {
    w: &'a mut W,
}
impl<'a> RTRIM_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 & !(0x03 << 2)) | ((value as u32 & 0x03) << 2);
        self.w
    }
}
#[doc = "Field `GTRIM` reader - Gain Trim - Startup time"]
pub struct GTRIM_R(crate::FieldReader<u8, u8>);
impl GTRIM_R {
    pub(crate) fn new(bits: u8) -> Self {
        GTRIM_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for GTRIM_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `GTRIM` writer - Gain Trim - Startup time"]
pub struct GTRIM_W<'a> {
    w: &'a mut W,
}
impl<'a> GTRIM_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 & !(0x03 << 4)) | ((value as u32 & 0x03) << 4);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:1 - Filter Trim - 3rd harmonic oscillation"]
    #[inline(always)]
    pub fn ftrim(&self) -> FTRIM_R {
        FTRIM_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bits 2:3 - Feedback resistor Trim"]
    #[inline(always)]
    pub fn rtrim(&self) -> RTRIM_R {
        RTRIM_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bits 4:5 - Gain Trim - Startup time"]
    #[inline(always)]
    pub fn gtrim(&self) -> GTRIM_R {
        GTRIM_R::new(((self.bits >> 4) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1 - Filter Trim - 3rd harmonic oscillation"]
    #[inline(always)]
    pub fn ftrim(&mut self) -> FTRIM_W {
        FTRIM_W { w: self }
    }
    #[doc = "Bits 2:3 - Feedback resistor Trim"]
    #[inline(always)]
    pub fn rtrim(&mut self) -> RTRIM_W {
        RTRIM_W { w: self }
    }
    #[doc = "Bits 4:5 - Gain Trim - Startup time"]
    #[inline(always)]
    pub fn gtrim(&mut self) -> GTRIM_W {
        GTRIM_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "ECO Trim1 Register\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 [eco_trim1](index.html) module"]
pub struct ECO_TRIM1_SPEC;
impl crate::RegisterSpec for ECO_TRIM1_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [eco_trim1::R](R) reader structure"]
impl crate::Readable for ECO_TRIM1_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [eco_trim1::W](W) writer structure"]
impl crate::Writable for ECO_TRIM1_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets ECO_TRIM1 to value 0"]
impl crate::Resettable for ECO_TRIM1_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
