#[doc = "Register `IPR0` reader"]
pub struct R(crate::R<IPR0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<IPR0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<IPR0_SPEC>> for R {
    fn from(reader: crate::R<IPR0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `IPR0` writer"]
pub struct W(crate::W<IPR0_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<IPR0_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<IPR0_SPEC>> for W {
    fn from(writer: crate::W<IPR0_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `PRI_N0` reader - Priority of interrupt number N."]
pub struct PRI_N0_R(crate::FieldReader<u8, u8>);
impl PRI_N0_R {
    pub(crate) fn new(bits: u8) -> Self {
        PRI_N0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PRI_N0_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PRI_N0` writer - Priority of interrupt number N."]
pub struct PRI_N0_W<'a> {
    w: &'a mut W,
}
impl<'a> PRI_N0_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 & !(0x03 << 6)) | ((value as u32 & 0x03) << 6);
        self.w
    }
}
#[doc = "Field `PRI_N1` reader - Priority of interrupt number N+1."]
pub struct PRI_N1_R(crate::FieldReader<u8, u8>);
impl PRI_N1_R {
    pub(crate) fn new(bits: u8) -> Self {
        PRI_N1_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PRI_N1_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PRI_N1` writer - Priority of interrupt number N+1."]
pub struct PRI_N1_W<'a> {
    w: &'a mut W,
}
impl<'a> PRI_N1_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 & !(0x03 << 14)) | ((value as u32 & 0x03) << 14);
        self.w
    }
}
#[doc = "Field `PRI_N2` reader - Priority of interrupt number N+2."]
pub struct PRI_N2_R(crate::FieldReader<u8, u8>);
impl PRI_N2_R {
    pub(crate) fn new(bits: u8) -> Self {
        PRI_N2_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PRI_N2_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PRI_N2` writer - Priority of interrupt number N+2."]
pub struct PRI_N2_W<'a> {
    w: &'a mut W,
}
impl<'a> PRI_N2_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 & !(0x03 << 22)) | ((value as u32 & 0x03) << 22);
        self.w
    }
}
#[doc = "Field `PRI_N3` reader - Priority of interrupt number N+3."]
pub struct PRI_N3_R(crate::FieldReader<u8, u8>);
impl PRI_N3_R {
    pub(crate) fn new(bits: u8) -> Self {
        PRI_N3_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for PRI_N3_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `PRI_N3` writer - Priority of interrupt number N+3."]
pub struct PRI_N3_W<'a> {
    w: &'a mut W,
}
impl<'a> PRI_N3_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 & !(0x03 << 30)) | ((value as u32 & 0x03) << 30);
        self.w
    }
}
impl R {
    #[doc = "Bits 6:7 - Priority of interrupt number N."]
    #[inline(always)]
    pub fn pri_n0(&self) -> PRI_N0_R {
        PRI_N0_R::new(((self.bits >> 6) & 0x03) as u8)
    }
    #[doc = "Bits 14:15 - Priority of interrupt number N+1."]
    #[inline(always)]
    pub fn pri_n1(&self) -> PRI_N1_R {
        PRI_N1_R::new(((self.bits >> 14) & 0x03) as u8)
    }
    #[doc = "Bits 22:23 - Priority of interrupt number N+2."]
    #[inline(always)]
    pub fn pri_n2(&self) -> PRI_N2_R {
        PRI_N2_R::new(((self.bits >> 22) & 0x03) as u8)
    }
    #[doc = "Bits 30:31 - Priority of interrupt number N+3."]
    #[inline(always)]
    pub fn pri_n3(&self) -> PRI_N3_R {
        PRI_N3_R::new(((self.bits >> 30) & 0x03) as u8)
    }
}
impl W {
    #[doc = "Bits 6:7 - Priority of interrupt number N."]
    #[inline(always)]
    pub fn pri_n0(&mut self) -> PRI_N0_W {
        PRI_N0_W { w: self }
    }
    #[doc = "Bits 14:15 - Priority of interrupt number N+1."]
    #[inline(always)]
    pub fn pri_n1(&mut self) -> PRI_N1_W {
        PRI_N1_W { w: self }
    }
    #[doc = "Bits 22:23 - Priority of interrupt number N+2."]
    #[inline(always)]
    pub fn pri_n2(&mut self) -> PRI_N2_W {
        PRI_N2_W { w: self }
    }
    #[doc = "Bits 30:31 - Priority of interrupt number N+3."]
    #[inline(always)]
    pub fn pri_n3(&mut self) -> PRI_N3_W {
        PRI_N3_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 Priority Registers\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 [ipr0](index.html) module"]
pub struct IPR0_SPEC;
impl crate::RegisterSpec for IPR0_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [ipr0::R](R) reader structure"]
impl crate::Readable for IPR0_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ipr0::W](W) writer structure"]
impl crate::Writable for IPR0_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets IPR0 to value 0"]
impl crate::Resettable for IPR0_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
