#[doc = "Register `INT_CFG` reader"]
pub struct R(crate::R<INT_CFG_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<INT_CFG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<INT_CFG_SPEC>> for R {
    fn from(reader: crate::R<INT_CFG_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `INT_CFG` writer"]
pub struct W(crate::W<INT_CFG_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<INT_CFG_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<INT_CFG_SPEC>> for W {
    fn from(writer: crate::W<INT_CFG_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Interrupt Mode; bit position corresponds to interrupt\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u32)]
pub enum INT_MODE_CFG_A {
    #[doc = "0: No description available"]
    LEVEL = 0,
    #[doc = "1: No description available"]
    PULSE = 1,
}
impl From<INT_MODE_CFG_A> for u32 {
    #[inline(always)]
    fn from(variant: INT_MODE_CFG_A) -> Self {
        variant as _
    }
}
#[doc = "Field `INT_MODE_CFG` reader - Interrupt Mode; bit position corresponds to interrupt"]
pub struct INT_MODE_CFG_R(crate::FieldReader<u32, INT_MODE_CFG_A>);
impl INT_MODE_CFG_R {
    pub(crate) fn new(bits: u32) -> Self {
        INT_MODE_CFG_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<INT_MODE_CFG_A> {
        match self.bits {
            0 => Some(INT_MODE_CFG_A::LEVEL),
            1 => Some(INT_MODE_CFG_A::PULSE),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `LEVEL`"]
    #[inline(always)]
    pub fn is_level(&self) -> bool {
        **self == INT_MODE_CFG_A::LEVEL
    }
    #[doc = "Checks if the value of the field is `PULSE`"]
    #[inline(always)]
    pub fn is_pulse(&self) -> bool {
        **self == INT_MODE_CFG_A::PULSE
    }
}
impl core::ops::Deref for INT_MODE_CFG_R {
    type Target = crate::FieldReader<u32, INT_MODE_CFG_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `INT_MODE_CFG` writer - Interrupt Mode; bit position corresponds to interrupt"]
pub struct INT_MODE_CFG_W<'a> {
    w: &'a mut W,
}
impl<'a> INT_MODE_CFG_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: INT_MODE_CFG_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn level(self) -> &'a mut W {
        self.variant(INT_MODE_CFG_A::LEVEL)
    }
    #[doc = "No description available"]
    #[inline(always)]
    pub fn pulse(self) -> &'a mut W {
        self.variant(INT_MODE_CFG_A::PULSE)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u32) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x0001_ffff) | (value as u32 & 0x0001_ffff);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:16 - Interrupt Mode; bit position corresponds to interrupt"]
    #[inline(always)]
    pub fn int_mode_cfg(&self) -> INT_MODE_CFG_R {
        INT_MODE_CFG_R::new((self.bits & 0x0001_ffff) as u32)
    }
}
impl W {
    #[doc = "Bits 0:16 - Interrupt Mode; bit position corresponds to interrupt"]
    #[inline(always)]
    pub fn int_mode_cfg(&mut self) -> INT_MODE_CFG_W {
        INT_MODE_CFG_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 = "UDB Subsystem Interrupt Configuration\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 [int_cfg](index.html) module"]
pub struct INT_CFG_SPEC;
impl crate::RegisterSpec for INT_CFG_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [int_cfg::R](R) reader structure"]
impl crate::Readable for INT_CFG_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [int_cfg::W](W) writer structure"]
impl crate::Writable for INT_CFG_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets INT_CFG to value 0"]
impl crate::Resettable for INT_CFG_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
