atsam4ls8b_pac/hmatrix/
pras.rs

1#[doc = "Register `PRAS%s` reader"]
2pub struct R(crate::R<PRAS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PRAS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PRAS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PRAS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PRAS%s` writer"]
17pub struct W(crate::W<PRAS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PRAS_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<PRAS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PRAS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `M0PR` reader - Master 0 Priority"]
38pub type M0PR_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `M0PR` writer - Master 0 Priority"]
40pub type M0PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
41#[doc = "Field `M1PR` reader - Master 1 Priority"]
42pub type M1PR_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `M1PR` writer - Master 1 Priority"]
44pub type M1PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
45#[doc = "Field `M2PR` reader - Master 2 Priority"]
46pub type M2PR_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `M2PR` writer - Master 2 Priority"]
48pub type M2PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
49#[doc = "Field `M3PR` reader - Master 3 Priority"]
50pub type M3PR_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `M3PR` writer - Master 3 Priority"]
52pub type M3PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
53#[doc = "Field `M4PR` reader - Master 4 Priority"]
54pub type M4PR_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `M4PR` writer - Master 4 Priority"]
56pub type M4PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
57#[doc = "Field `M5PR` reader - Master 5 Priority"]
58pub type M5PR_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `M5PR` writer - Master 5 Priority"]
60pub type M5PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
61#[doc = "Field `M6PR` reader - Master 6 Priority"]
62pub type M6PR_R = crate::FieldReader<u8, u8>;
63#[doc = "Field `M6PR` writer - Master 6 Priority"]
64pub type M6PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
65#[doc = "Field `M7PR` reader - Master 7 Priority"]
66pub type M7PR_R = crate::FieldReader<u8, u8>;
67#[doc = "Field `M7PR` writer - Master 7 Priority"]
68pub type M7PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRAS_SPEC, u8, u8, 4, O>;
69impl R {
70    #[doc = "Bits 0:3 - Master 0 Priority"]
71    #[inline(always)]
72    pub fn m0pr(&self) -> M0PR_R {
73        M0PR_R::new((self.bits & 0x0f) as u8)
74    }
75    #[doc = "Bits 4:7 - Master 1 Priority"]
76    #[inline(always)]
77    pub fn m1pr(&self) -> M1PR_R {
78        M1PR_R::new(((self.bits >> 4) & 0x0f) as u8)
79    }
80    #[doc = "Bits 8:11 - Master 2 Priority"]
81    #[inline(always)]
82    pub fn m2pr(&self) -> M2PR_R {
83        M2PR_R::new(((self.bits >> 8) & 0x0f) as u8)
84    }
85    #[doc = "Bits 12:15 - Master 3 Priority"]
86    #[inline(always)]
87    pub fn m3pr(&self) -> M3PR_R {
88        M3PR_R::new(((self.bits >> 12) & 0x0f) as u8)
89    }
90    #[doc = "Bits 16:19 - Master 4 Priority"]
91    #[inline(always)]
92    pub fn m4pr(&self) -> M4PR_R {
93        M4PR_R::new(((self.bits >> 16) & 0x0f) as u8)
94    }
95    #[doc = "Bits 20:23 - Master 5 Priority"]
96    #[inline(always)]
97    pub fn m5pr(&self) -> M5PR_R {
98        M5PR_R::new(((self.bits >> 20) & 0x0f) as u8)
99    }
100    #[doc = "Bits 24:27 - Master 6 Priority"]
101    #[inline(always)]
102    pub fn m6pr(&self) -> M6PR_R {
103        M6PR_R::new(((self.bits >> 24) & 0x0f) as u8)
104    }
105    #[doc = "Bits 28:31 - Master 7 Priority"]
106    #[inline(always)]
107    pub fn m7pr(&self) -> M7PR_R {
108        M7PR_R::new(((self.bits >> 28) & 0x0f) as u8)
109    }
110}
111impl W {
112    #[doc = "Bits 0:3 - Master 0 Priority"]
113    #[inline(always)]
114    #[must_use]
115    pub fn m0pr(&mut self) -> M0PR_W<0> {
116        M0PR_W::new(self)
117    }
118    #[doc = "Bits 4:7 - Master 1 Priority"]
119    #[inline(always)]
120    #[must_use]
121    pub fn m1pr(&mut self) -> M1PR_W<4> {
122        M1PR_W::new(self)
123    }
124    #[doc = "Bits 8:11 - Master 2 Priority"]
125    #[inline(always)]
126    #[must_use]
127    pub fn m2pr(&mut self) -> M2PR_W<8> {
128        M2PR_W::new(self)
129    }
130    #[doc = "Bits 12:15 - Master 3 Priority"]
131    #[inline(always)]
132    #[must_use]
133    pub fn m3pr(&mut self) -> M3PR_W<12> {
134        M3PR_W::new(self)
135    }
136    #[doc = "Bits 16:19 - Master 4 Priority"]
137    #[inline(always)]
138    #[must_use]
139    pub fn m4pr(&mut self) -> M4PR_W<16> {
140        M4PR_W::new(self)
141    }
142    #[doc = "Bits 20:23 - Master 5 Priority"]
143    #[inline(always)]
144    #[must_use]
145    pub fn m5pr(&mut self) -> M5PR_W<20> {
146        M5PR_W::new(self)
147    }
148    #[doc = "Bits 24:27 - Master 6 Priority"]
149    #[inline(always)]
150    #[must_use]
151    pub fn m6pr(&mut self) -> M6PR_W<24> {
152        M6PR_W::new(self)
153    }
154    #[doc = "Bits 28:31 - Master 7 Priority"]
155    #[inline(always)]
156    #[must_use]
157    pub fn m7pr(&mut self) -> M7PR_W<28> {
158        M7PR_W::new(self)
159    }
160    #[doc = "Writes raw bits to the register."]
161    #[inline(always)]
162    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
163        self.0.bits(bits);
164        self
165    }
166}
167#[doc = "Priority Register A for Slave\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 [pras](index.html) module"]
168pub struct PRAS_SPEC;
169impl crate::RegisterSpec for PRAS_SPEC {
170    type Ux = u32;
171}
172#[doc = "`read()` method returns [pras::R](R) reader structure"]
173impl crate::Readable for PRAS_SPEC {
174    type Reader = R;
175}
176#[doc = "`write(|w| ..)` method takes [pras::W](W) writer structure"]
177impl crate::Writable for PRAS_SPEC {
178    type Writer = W;
179    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
180    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
181}
182#[doc = "`reset()` method sets PRAS%s to value 0"]
183impl crate::Resettable for PRAS_SPEC {
184    const RESET_VALUE: Self::Ux = 0;
185}