#[doc = "Register `MSK2` reader"]
pub struct R(crate::R<MSK2_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<MSK2_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<MSK2_SPEC>> for R {
    fn from(reader: crate::R<MSK2_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `MSK2` writer"]
pub struct W(crate::W<MSK2_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<MSK2_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<MSK2_SPEC>> for W {
    fn from(writer: crate::W<MSK2_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `MSK_0` reader - Interrupt Mask Register"]
pub struct MSK_0_R(crate::FieldReader<u8, u8>);
impl MSK_0_R {
    pub(crate) fn new(bits: u8) -> Self {
        MSK_0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for MSK_0_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `MSK_0` writer - Interrupt Mask Register"]
pub struct MSK_0_W<'a> {
    w: &'a mut W,
}
impl<'a> MSK_0_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 & !0x7f) | (value as u32 & 0x7f);
        self.w
    }
}
#[doc = "Field `MSK_1` reader - Interrupt Mask Register"]
pub struct MSK_1_R(crate::FieldReader<u8, u8>);
impl MSK_1_R {
    pub(crate) fn new(bits: u8) -> Self {
        MSK_1_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for MSK_1_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `MSK_1` writer - Interrupt Mask Register"]
pub struct MSK_1_W<'a> {
    w: &'a mut W,
}
impl<'a> MSK_1_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 & !(0x7f << 8)) | ((value as u32 & 0x7f) << 8);
        self.w
    }
}
#[doc = "Field `MSK_2` reader - Interrupt Mask Register"]
pub struct MSK_2_R(crate::FieldReader<u8, u8>);
impl MSK_2_R {
    pub(crate) fn new(bits: u8) -> Self {
        MSK_2_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for MSK_2_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `MSK_2` writer - Interrupt Mask Register"]
pub struct MSK_2_W<'a> {
    w: &'a mut W,
}
impl<'a> MSK_2_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 & !(0x7f << 16)) | ((value as u32 & 0x7f) << 16);
        self.w
    }
}
#[doc = "Field `MSK_3` reader - Interrupt Mask Register"]
pub struct MSK_3_R(crate::FieldReader<u8, u8>);
impl MSK_3_R {
    pub(crate) fn new(bits: u8) -> Self {
        MSK_3_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for MSK_3_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `MSK_3` writer - Interrupt Mask Register"]
pub struct MSK_3_W<'a> {
    w: &'a mut W,
}
impl<'a> MSK_3_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 & !(0x7f << 24)) | ((value as u32 & 0x7f) << 24);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:6 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_0(&self) -> MSK_0_R {
        MSK_0_R::new((self.bits & 0x7f) as u8)
    }
    #[doc = "Bits 8:14 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_1(&self) -> MSK_1_R {
        MSK_1_R::new(((self.bits >> 8) & 0x7f) as u8)
    }
    #[doc = "Bits 16:22 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_2(&self) -> MSK_2_R {
        MSK_2_R::new(((self.bits >> 16) & 0x7f) as u8)
    }
    #[doc = "Bits 24:30 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_3(&self) -> MSK_3_R {
        MSK_3_R::new(((self.bits >> 24) & 0x7f) as u8)
    }
}
impl W {
    #[doc = "Bits 0:6 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_0(&mut self) -> MSK_0_W {
        MSK_0_W { w: self }
    }
    #[doc = "Bits 8:14 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_1(&mut self) -> MSK_1_W {
        MSK_1_W { w: self }
    }
    #[doc = "Bits 16:22 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_2(&mut self) -> MSK_2_W {
        MSK_2_W { w: self }
    }
    #[doc = "Bits 24:30 - Interrupt Mask Register"]
    #[inline(always)]
    pub fn msk_3(&mut self) -> MSK_3_W {
        MSK_3_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 = "Interrupt Mask\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 [msk2](index.html) module"]
pub struct MSK2_SPEC;
impl crate::RegisterSpec for MSK2_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [msk2::R](R) reader structure"]
impl crate::Readable for MSK2_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [msk2::W](W) writer structure"]
impl crate::Writable for MSK2_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets MSK2 to value 0"]
impl crate::Resettable for MSK2_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
