rp2040_pac/ppb/
nvic_ipr2.rs

1#[doc = "Register `NVIC_IPR2` reader"]
2pub type R = crate::R<NVIC_IPR2_SPEC>;
3#[doc = "Register `NVIC_IPR2` writer"]
4pub type W = crate::W<NVIC_IPR2_SPEC>;
5#[doc = "Field `IP_8` reader - Priority of interrupt 8"]
6pub type IP_8_R = crate::FieldReader;
7#[doc = "Field `IP_8` writer - Priority of interrupt 8"]
8pub type IP_8_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `IP_9` reader - Priority of interrupt 9"]
10pub type IP_9_R = crate::FieldReader;
11#[doc = "Field `IP_9` writer - Priority of interrupt 9"]
12pub type IP_9_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `IP_10` reader - Priority of interrupt 10"]
14pub type IP_10_R = crate::FieldReader;
15#[doc = "Field `IP_10` writer - Priority of interrupt 10"]
16pub type IP_10_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17#[doc = "Field `IP_11` reader - Priority of interrupt 11"]
18pub type IP_11_R = crate::FieldReader;
19#[doc = "Field `IP_11` writer - Priority of interrupt 11"]
20pub type IP_11_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
21impl R {
22    #[doc = "Bits 6:7 - Priority of interrupt 8"]
23    #[inline(always)]
24    pub fn ip_8(&self) -> IP_8_R {
25        IP_8_R::new(((self.bits >> 6) & 3) as u8)
26    }
27    #[doc = "Bits 14:15 - Priority of interrupt 9"]
28    #[inline(always)]
29    pub fn ip_9(&self) -> IP_9_R {
30        IP_9_R::new(((self.bits >> 14) & 3) as u8)
31    }
32    #[doc = "Bits 22:23 - Priority of interrupt 10"]
33    #[inline(always)]
34    pub fn ip_10(&self) -> IP_10_R {
35        IP_10_R::new(((self.bits >> 22) & 3) as u8)
36    }
37    #[doc = "Bits 30:31 - Priority of interrupt 11"]
38    #[inline(always)]
39    pub fn ip_11(&self) -> IP_11_R {
40        IP_11_R::new(((self.bits >> 30) & 3) as u8)
41    }
42}
43impl W {
44    #[doc = "Bits 6:7 - Priority of interrupt 8"]
45    #[inline(always)]
46    #[must_use]
47    pub fn ip_8(&mut self) -> IP_8_W<NVIC_IPR2_SPEC> {
48        IP_8_W::new(self, 6)
49    }
50    #[doc = "Bits 14:15 - Priority of interrupt 9"]
51    #[inline(always)]
52    #[must_use]
53    pub fn ip_9(&mut self) -> IP_9_W<NVIC_IPR2_SPEC> {
54        IP_9_W::new(self, 14)
55    }
56    #[doc = "Bits 22:23 - Priority of interrupt 10"]
57    #[inline(always)]
58    #[must_use]
59    pub fn ip_10(&mut self) -> IP_10_W<NVIC_IPR2_SPEC> {
60        IP_10_W::new(self, 22)
61    }
62    #[doc = "Bits 30:31 - Priority of interrupt 11"]
63    #[inline(always)]
64    #[must_use]
65    pub fn ip_11(&mut self) -> IP_11_W<NVIC_IPR2_SPEC> {
66        IP_11_W::new(self, 30)
67    }
68    #[doc = r" Writes raw bits to the register."]
69    #[doc = r""]
70    #[doc = r" # Safety"]
71    #[doc = r""]
72    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
73    #[inline(always)]
74    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
75        self.bits = bits;
76        self
77    }
78}
79#[doc = "Use the Interrupt Priority Registers to assign a priority from 0 to 3 to each of the available interrupts. 0 is the highest priority, and 3 is the lowest.  
80
81You can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr2::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
82pub struct NVIC_IPR2_SPEC;
83impl crate::RegisterSpec for NVIC_IPR2_SPEC {
84    type Ux = u32;
85}
86#[doc = "`read()` method returns [`nvic_ipr2::R`](R) reader structure"]
87impl crate::Readable for NVIC_IPR2_SPEC {}
88#[doc = "`write(|w| ..)` method takes [`nvic_ipr2::W`](W) writer structure"]
89impl crate::Writable for NVIC_IPR2_SPEC {
90    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
91    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
92}
93#[doc = "`reset()` method sets NVIC_IPR2 to value 0"]
94impl crate::Resettable for NVIC_IPR2_SPEC {
95    const RESET_VALUE: u32 = 0;
96}