#[doc = "Writer for register IDR"]
pub type W = crate::W<u32, super::IDR>;

#[doc = "Register IDR `reset()`'s with value 0"]
impl crate::ResetValue for super::IDR {
    #[inline(always)]
    fn reset_value() -> Self::Ux { 0 }
}

#[doc = "Write proxy for field `RB_RISE`"]
pub struct RB_RISE_W<'a> { w: &'a mut W }

impl<'a> RB_RISE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
        self.w
    }
}

#[doc = "Write proxy for field `RB_FALL`"]
pub struct RB_FALL_W<'a> { w: &'a mut W }

impl<'a> RB_FALL_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
        self.w
    }
}

#[doc = "Write proxy for field `XFRDONE`"]
pub struct XFRDONE_W<'a> { w: &'a mut W }

impl<'a> XFRDONE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
        self.w
    }
}

#[doc = "Write proxy for field `CMDDONE`"]
pub struct CMDDONE_W<'a> { w: &'a mut W }

impl<'a> CMDDONE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
        self.w
    }
}

#[doc = "Write proxy for field `DTOE`"]
pub struct DTOE_W<'a> { w: &'a mut W }

impl<'a> DTOE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 20)) | (((value as u32) & 0x01) << 20);
        self.w
    }
}

#[doc = "Write proxy for field `UNDEF`"]
pub struct UNDEF_W<'a> { w: &'a mut W }

impl<'a> UNDEF_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 21)) | (((value as u32) & 0x01) << 21);
        self.w
    }
}

#[doc = "Write proxy for field `AWB`"]
pub struct AWB_W<'a> { w: &'a mut W }

impl<'a> AWB_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
        self.w
    }
}

#[doc = "Write proxy for field `NFCASE`"]
pub struct NFCASE_W<'a> { w: &'a mut W }

impl<'a> NFCASE_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 23)) | (((value as u32) & 0x01) << 23);
        self.w
    }
}

#[doc = "Write proxy for field `RB_EDGE0`"]
pub struct RB_EDGE0_W<'a> { w: &'a mut W }

impl<'a> RB_EDGE0_W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W { self.bit(true) }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W { self.bit(false) }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
        self.w
    }
}

impl W {
    #[doc = "Bit 4 - Ready Busy Rising Edge Detection Interrupt Disable"]
    #[inline(always)]
    pub fn rb_rise(&mut self) -> RB_RISE_W { RB_RISE_W { w: self } }
    #[doc = "Bit 5 - Ready Busy Falling Edge Detection Interrupt Disable"]
    #[inline(always)]
    pub fn rb_fall(&mut self) -> RB_FALL_W { RB_FALL_W { w: self } }
    #[doc = "Bit 16 - Transfer Done Interrupt Disable"]
    #[inline(always)]
    pub fn xfrdone(&mut self) -> XFRDONE_W { XFRDONE_W { w: self } }
    #[doc = "Bit 17 - Command Done Interrupt Disable"]
    #[inline(always)]
    pub fn cmddone(&mut self) -> CMDDONE_W { CMDDONE_W { w: self } }
    #[doc = "Bit 20 - Data Timeout Error Interrupt Disable"]
    #[inline(always)]
    pub fn dtoe(&mut self) -> DTOE_W { DTOE_W { w: self } }
    #[doc = "Bit 21 - Undefined Area Access Interrupt Disable"]
    #[inline(always)]
    pub fn undef(&mut self) -> UNDEF_W { UNDEF_W { w: self } }
    #[doc = "Bit 22 - Accessing While Busy Interrupt Disable"]
    #[inline(always)]
    pub fn awb(&mut self) -> AWB_W { AWB_W { w: self } }
    #[doc = "Bit 23 - NFC Access Size Error Interrupt Disable"]
    #[inline(always)]
    pub fn nfcase(&mut self) -> NFCASE_W { NFCASE_W { w: self } }
    #[doc = "Bit 24 - Ready/Busy Line 0 Interrupt Disable"]
    #[inline(always)]
    pub fn rb_edge0(&mut self) -> RB_EDGE0_W { RB_EDGE0_W { w: self } }
}