#[doc = "Register `CTRLB` reader"]
pub type R = crate::R<CtrlbSpec>;
#[doc = "Register `CTRLB` writer"]
pub type W = crate::W<CtrlbSpec>;
#[doc = "Field `BBD` reader - Bias Buffer Enable Duration"]
pub type BbdR = crate::FieldReader;
#[doc = "Field `BBD` writer - Bias Buffer Enable Duration"]
pub type BbdW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[doc = "Field `BBEN` reader - Bias Buffer Enable"]
pub type BbenR = crate::BitReader;
#[doc = "Field `BBEN` writer - Bias Buffer Enable"]
pub type BbenW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `LRD` reader - Low Resistance Enable Duration"]
pub type LrdR = crate::FieldReader;
#[doc = "Field `LRD` writer - Low Resistance Enable Duration"]
pub type LrdW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[doc = "Field `LREN` reader - Low Resistance Enable"]
pub type LrenR = crate::BitReader;
#[doc = "Field `LREN` writer - Low Resistance Enable"]
pub type LrenW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
    #[doc = "Bits 0:3 - Bias Buffer Enable Duration"]
    #[inline(always)]
    pub fn bbd(&self) -> BbdR {
        BbdR::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 7 - Bias Buffer Enable"]
    #[inline(always)]
    pub fn bben(&self) -> BbenR {
        BbenR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bits 8:11 - Low Resistance Enable Duration"]
    #[inline(always)]
    pub fn lrd(&self) -> LrdR {
        LrdR::new(((self.bits >> 8) & 0x0f) as u8)
    }
    #[doc = "Bit 15 - Low Resistance Enable"]
    #[inline(always)]
    pub fn lren(&self) -> LrenR {
        LrenR::new(((self.bits >> 15) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:3 - Bias Buffer Enable Duration"]
    #[inline(always)]
    pub fn bbd(&mut self) -> BbdW<CtrlbSpec> {
        BbdW::new(self, 0)
    }
    #[doc = "Bit 7 - Bias Buffer Enable"]
    #[inline(always)]
    pub fn bben(&mut self) -> BbenW<CtrlbSpec> {
        BbenW::new(self, 7)
    }
    #[doc = "Bits 8:11 - Low Resistance Enable Duration"]
    #[inline(always)]
    pub fn lrd(&mut self) -> LrdW<CtrlbSpec> {
        LrdW::new(self, 8)
    }
    #[doc = "Bit 15 - Low Resistance Enable"]
    #[inline(always)]
    pub fn lren(&mut self) -> LrenW<CtrlbSpec> {
        LrenW::new(self, 15)
    }
}
#[doc = "Control B\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlb::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlb::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CtrlbSpec;
impl crate::RegisterSpec for CtrlbSpec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`ctrlb::R`](R) reader structure"]
impl crate::Readable for CtrlbSpec {}
#[doc = "`write(|w| ..)` method takes [`ctrlb::W`](W) writer structure"]
impl crate::Writable for CtrlbSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
}
#[doc = "`reset()` method sets CTRLB to value 0"]
impl crate::Resettable for CtrlbSpec {
    const RESET_VALUE: u16 = 0;
}
