#[doc = "Register `TRIM` reader"]
pub struct R(crate::R<TRIM_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<TRIM_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<TRIM_SPEC>> for R {
    fn from(reader: crate::R<TRIM_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `TRIM` writer"]
pub struct W(crate::W<TRIM_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<TRIM_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<TRIM_SPEC>> for W {
    fn from(writer: crate::W<TRIM_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `XGM` reader - Amplifier GM setting - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode.?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
pub struct XGM_R(crate::FieldReader<u8, u8>);
impl XGM_R {
    pub(crate) fn new(bits: u8) -> Self {
        XGM_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for XGM_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `XGM` writer - Amplifier GM setting - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode.?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
pub struct XGM_W<'a> {
    w: &'a mut W,
}
impl<'a> XGM_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) | (value as u32 & 0x07);
        self.w
    }
}
#[doc = "Field `LPM_GM` reader - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode."]
pub struct LPM_GM_R(crate::FieldReader<u8, u8>);
impl LPM_GM_R {
    pub(crate) fn new(bits: u8) -> Self {
        LPM_GM_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for LPM_GM_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `LPM_GM` writer - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode."]
pub struct LPM_GM_W<'a> {
    w: &'a mut W,
}
impl<'a> LPM_GM_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
    }
}
#[doc = "Field `XGM_FOR_LPM_AUTO` reader - Amplifier GM setting - Used when WCO.LPM_AUTO=1 and in DeepSleep mode?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
pub struct XGM_FOR_LPM_AUTO_R(crate::FieldReader<u8, u8>);
impl XGM_FOR_LPM_AUTO_R {
    pub(crate) fn new(bits: u8) -> Self {
        XGM_FOR_LPM_AUTO_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for XGM_FOR_LPM_AUTO_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `XGM_FOR_LPM_AUTO` writer - Amplifier GM setting - Used when WCO.LPM_AUTO=1 and in DeepSleep mode?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
pub struct XGM_FOR_LPM_AUTO_W<'a> {
    w: &'a mut W,
}
impl<'a> XGM_FOR_LPM_AUTO_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 << 8)) | ((value as u32 & 0x07) << 8);
        self.w
    }
}
#[doc = "Field `LPM_GM_FOR_LPM_AUTO` reader - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=1 and in DeepSleep mode"]
pub struct LPM_GM_FOR_LPM_AUTO_R(crate::FieldReader<u8, u8>);
impl LPM_GM_FOR_LPM_AUTO_R {
    pub(crate) fn new(bits: u8) -> Self {
        LPM_GM_FOR_LPM_AUTO_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for LPM_GM_FOR_LPM_AUTO_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `LPM_GM_FOR_LPM_AUTO` writer - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=1 and in DeepSleep mode"]
pub struct LPM_GM_FOR_LPM_AUTO_W<'a> {
    w: &'a mut W,
}
impl<'a> LPM_GM_FOR_LPM_AUTO_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 << 12)) | ((value as u32 & 0x03) << 12);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:2 - Amplifier GM setting - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode.?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
    #[inline(always)]
    pub fn xgm(&self) -> XGM_R {
        XGM_R::new((self.bits & 0x07) as u8)
    }
    #[doc = "Bits 4:5 - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode."]
    #[inline(always)]
    pub fn lpm_gm(&self) -> LPM_GM_R {
        LPM_GM_R::new(((self.bits >> 4) & 0x03) as u8)
    }
    #[doc = "Bits 8:10 - Amplifier GM setting - Used when WCO.LPM_AUTO=1 and in DeepSleep mode?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
    #[inline(always)]
    pub fn xgm_for_lpm_auto(&self) -> XGM_FOR_LPM_AUTO_R {
        XGM_FOR_LPM_AUTO_R::new(((self.bits >> 8) & 0x07) as u8)
    }
    #[doc = "Bits 12:13 - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=1 and in DeepSleep mode"]
    #[inline(always)]
    pub fn lpm_gm_for_lpm_auto(&self) -> LPM_GM_FOR_LPM_AUTO_R {
        LPM_GM_FOR_LPM_AUTO_R::new(((self.bits >> 12) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 0:2 - Amplifier GM setting - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode.?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
    #[inline(always)]
    pub fn xgm(&mut self) -> XGM_W {
        XGM_W { w: self }
    }
    #[doc = "Bits 4:5 - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=0 or when LPM_AUTO=1 and not in DeepSleep mode."]
    #[inline(always)]
    pub fn lpm_gm(&mut self) -> LPM_GM_W {
        LPM_GM_W { w: self }
    }
    #[doc = "Bits 8:10 - Amplifier GM setting - Used when WCO.LPM_AUTO=1 and in DeepSleep mode?0x0 - 3370 nA?0x1 - 2620 nA?0x2 - 2250 nA?0x3 - 1500 nA?0x4 - 1870 nA?0x5 - 1120 nA?0x6 - 750 nA?0x7 - 0 nA"]
    #[inline(always)]
    pub fn xgm_for_lpm_auto(&mut self) -> XGM_FOR_LPM_AUTO_W {
        XGM_FOR_LPM_AUTO_W { w: self }
    }
    #[doc = "Bits 12:13 - GM setting for LPM (bandwidth = DC/ms) - Used when WCO.LPM_AUTO=1 and in DeepSleep mode"]
    #[inline(always)]
    pub fn lpm_gm_for_lpm_auto(&mut self) -> LPM_GM_FOR_LPM_AUTO_W {
        LPM_GM_FOR_LPM_AUTO_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 = "WCO Trim 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 [trim](index.html) module"]
pub struct TRIM_SPEC;
impl crate::RegisterSpec for TRIM_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [trim::R](R) reader structure"]
impl crate::Readable for TRIM_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [trim::W](W) writer structure"]
impl crate::Writable for TRIM_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets TRIM to value 0"]
impl crate::Resettable for TRIM_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
