///Register `AWSCDR` reader
pub type R = crate::R<AWSCDRrs>;
///Register `AWSCDR` writer
pub type W = crate::W<AWSCDRrs>;
///Field `SCDT` reader - SCDT
pub type SCDT_R = crate::FieldReader;
///Field `SCDT` writer - SCDT
pub type SCDT_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
///Field `BKSCD` reader - BKSCD
pub type BKSCD_R = crate::FieldReader;
///Field `BKSCD` writer - BKSCD
pub type BKSCD_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
///Field `AWFOSR` reader - AWFOSR
pub type AWFOSR_R = crate::FieldReader;
///Field `AWFOSR` writer - AWFOSR
pub type AWFOSR_W<'a, REG> = crate::FieldWriter<'a, REG, 5, u8, crate::Safe>;
/**AWFORD

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum AWFORD {
    ///0: FastSinc filter type
    FastSinc = 0,
    ///1: Sinc1 filter type
    Sinc1 = 1,
    ///2: Sinc2 filter type
    Sinc2 = 2,
    ///3: Sinc3 filter type
    Sinc3 = 3,
}
impl From<AWFORD> for u8 {
    #[inline(always)]
    fn from(variant: AWFORD) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for AWFORD {
    type Ux = u8;
}
impl crate::IsEnum for AWFORD {}
///Field `AWFORD` reader - AWFORD
pub type AWFORD_R = crate::FieldReader<AWFORD>;
impl AWFORD_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> AWFORD {
        match self.bits {
            0 => AWFORD::FastSinc,
            1 => AWFORD::Sinc1,
            2 => AWFORD::Sinc2,
            3 => AWFORD::Sinc3,
            _ => unreachable!(),
        }
    }
    ///FastSinc filter type
    #[inline(always)]
    pub fn is_fast_sinc(&self) -> bool {
        *self == AWFORD::FastSinc
    }
    ///Sinc1 filter type
    #[inline(always)]
    pub fn is_sinc1(&self) -> bool {
        *self == AWFORD::Sinc1
    }
    ///Sinc2 filter type
    #[inline(always)]
    pub fn is_sinc2(&self) -> bool {
        *self == AWFORD::Sinc2
    }
    ///Sinc3 filter type
    #[inline(always)]
    pub fn is_sinc3(&self) -> bool {
        *self == AWFORD::Sinc3
    }
}
///Field `AWFORD` writer - AWFORD
pub type AWFORD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, AWFORD, crate::Safe>;
impl<'a, REG> AWFORD_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///FastSinc filter type
    #[inline(always)]
    pub fn fast_sinc(self) -> &'a mut crate::W<REG> {
        self.variant(AWFORD::FastSinc)
    }
    ///Sinc1 filter type
    #[inline(always)]
    pub fn sinc1(self) -> &'a mut crate::W<REG> {
        self.variant(AWFORD::Sinc1)
    }
    ///Sinc2 filter type
    #[inline(always)]
    pub fn sinc2(self) -> &'a mut crate::W<REG> {
        self.variant(AWFORD::Sinc2)
    }
    ///Sinc3 filter type
    #[inline(always)]
    pub fn sinc3(self) -> &'a mut crate::W<REG> {
        self.variant(AWFORD::Sinc3)
    }
}
impl R {
    ///Bits 0:7 - SCDT
    #[inline(always)]
    pub fn scdt(&self) -> SCDT_R {
        SCDT_R::new((self.bits & 0xff) as u8)
    }
    ///Bits 12:15 - BKSCD
    #[inline(always)]
    pub fn bkscd(&self) -> BKSCD_R {
        BKSCD_R::new(((self.bits >> 12) & 0x0f) as u8)
    }
    ///Bits 16:20 - AWFOSR
    #[inline(always)]
    pub fn awfosr(&self) -> AWFOSR_R {
        AWFOSR_R::new(((self.bits >> 16) & 0x1f) as u8)
    }
    ///Bits 22:23 - AWFORD
    #[inline(always)]
    pub fn awford(&self) -> AWFORD_R {
        AWFORD_R::new(((self.bits >> 22) & 3) as u8)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("AWSCDR")
            .field("awford", &self.awford())
            .field("awfosr", &self.awfosr())
            .field("bkscd", &self.bkscd())
            .field("scdt", &self.scdt())
            .finish()
    }
}
impl W {
    ///Bits 0:7 - SCDT
    #[inline(always)]
    pub fn scdt(&mut self) -> SCDT_W<AWSCDRrs> {
        SCDT_W::new(self, 0)
    }
    ///Bits 12:15 - BKSCD
    #[inline(always)]
    pub fn bkscd(&mut self) -> BKSCD_W<AWSCDRrs> {
        BKSCD_W::new(self, 12)
    }
    ///Bits 16:20 - AWFOSR
    #[inline(always)]
    pub fn awfosr(&mut self) -> AWFOSR_W<AWSCDRrs> {
        AWFOSR_W::new(self, 16)
    }
    ///Bits 22:23 - AWFORD
    #[inline(always)]
    pub fn awford(&mut self) -> AWFORD_W<AWSCDRrs> {
        AWFORD_W::new(self, 22)
    }
}
/**analog watchdog and short-circuit detector register

You can [`read`](crate::Reg::read) this register and get [`awscdr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`awscdr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
pub struct AWSCDRrs;
impl crate::RegisterSpec for AWSCDRrs {
    type Ux = u32;
}
///`read()` method returns [`awscdr::R`](R) reader structure
impl crate::Readable for AWSCDRrs {}
///`write(|w| ..)` method takes [`awscdr::W`](W) writer structure
impl crate::Writable for AWSCDRrs {
    type Safety = crate::Unsafe;
}
///`reset()` method sets AWSCDR to value 0
impl crate::Resettable for AWSCDRrs {}
