atsam4e8e_pac/matrix/
matrix_pras0.rs

1#[doc = "Register `MATRIX_PRAS0` reader"]
2pub struct R(crate::R<MATRIX_PRAS0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MATRIX_PRAS0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MATRIX_PRAS0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MATRIX_PRAS0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MATRIX_PRAS0` writer"]
17pub struct W(crate::W<MATRIX_PRAS0_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MATRIX_PRAS0_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<MATRIX_PRAS0_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MATRIX_PRAS0_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, MATRIX_PRAS0_SPEC, u8, u8, 2, 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, MATRIX_PRAS0_SPEC, u8, u8, 2, 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, MATRIX_PRAS0_SPEC, u8, u8, 2, 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, MATRIX_PRAS0_SPEC, u8, u8, 2, 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, MATRIX_PRAS0_SPEC, u8, u8, 2, 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, MATRIX_PRAS0_SPEC, u8, u8, 2, 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, MATRIX_PRAS0_SPEC, u8, u8, 2, O>;
65impl R {
66    #[doc = "Bits 0:1 - Master 0 Priority"]
67    #[inline(always)]
68    pub fn m0pr(&self) -> M0PR_R {
69        M0PR_R::new((self.bits & 3) as u8)
70    }
71    #[doc = "Bits 4:5 - Master 1 Priority"]
72    #[inline(always)]
73    pub fn m1pr(&self) -> M1PR_R {
74        M1PR_R::new(((self.bits >> 4) & 3) as u8)
75    }
76    #[doc = "Bits 8:9 - Master 2 Priority"]
77    #[inline(always)]
78    pub fn m2pr(&self) -> M2PR_R {
79        M2PR_R::new(((self.bits >> 8) & 3) as u8)
80    }
81    #[doc = "Bits 12:13 - Master 3 Priority"]
82    #[inline(always)]
83    pub fn m3pr(&self) -> M3PR_R {
84        M3PR_R::new(((self.bits >> 12) & 3) as u8)
85    }
86    #[doc = "Bits 16:17 - Master 4 Priority"]
87    #[inline(always)]
88    pub fn m4pr(&self) -> M4PR_R {
89        M4PR_R::new(((self.bits >> 16) & 3) as u8)
90    }
91    #[doc = "Bits 20:21 - Master 5 Priority"]
92    #[inline(always)]
93    pub fn m5pr(&self) -> M5PR_R {
94        M5PR_R::new(((self.bits >> 20) & 3) as u8)
95    }
96    #[doc = "Bits 24:25 - Master 6 Priority"]
97    #[inline(always)]
98    pub fn m6pr(&self) -> M6PR_R {
99        M6PR_R::new(((self.bits >> 24) & 3) as u8)
100    }
101}
102impl W {
103    #[doc = "Bits 0:1 - Master 0 Priority"]
104    #[inline(always)]
105    #[must_use]
106    pub fn m0pr(&mut self) -> M0PR_W<0> {
107        M0PR_W::new(self)
108    }
109    #[doc = "Bits 4:5 - Master 1 Priority"]
110    #[inline(always)]
111    #[must_use]
112    pub fn m1pr(&mut self) -> M1PR_W<4> {
113        M1PR_W::new(self)
114    }
115    #[doc = "Bits 8:9 - Master 2 Priority"]
116    #[inline(always)]
117    #[must_use]
118    pub fn m2pr(&mut self) -> M2PR_W<8> {
119        M2PR_W::new(self)
120    }
121    #[doc = "Bits 12:13 - Master 3 Priority"]
122    #[inline(always)]
123    #[must_use]
124    pub fn m3pr(&mut self) -> M3PR_W<12> {
125        M3PR_W::new(self)
126    }
127    #[doc = "Bits 16:17 - Master 4 Priority"]
128    #[inline(always)]
129    #[must_use]
130    pub fn m4pr(&mut self) -> M4PR_W<16> {
131        M4PR_W::new(self)
132    }
133    #[doc = "Bits 20:21 - Master 5 Priority"]
134    #[inline(always)]
135    #[must_use]
136    pub fn m5pr(&mut self) -> M5PR_W<20> {
137        M5PR_W::new(self)
138    }
139    #[doc = "Bits 24:25 - Master 6 Priority"]
140    #[inline(always)]
141    #[must_use]
142    pub fn m6pr(&mut self) -> M6PR_W<24> {
143        M6PR_W::new(self)
144    }
145    #[doc = "Writes raw bits to the register."]
146    #[inline(always)]
147    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
148        self.0.bits(bits);
149        self
150    }
151}
152#[doc = "Priority Register A for Slave 0\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 [matrix_pras0](index.html) module"]
153pub struct MATRIX_PRAS0_SPEC;
154impl crate::RegisterSpec for MATRIX_PRAS0_SPEC {
155    type Ux = u32;
156}
157#[doc = "`read()` method returns [matrix_pras0::R](R) reader structure"]
158impl crate::Readable for MATRIX_PRAS0_SPEC {
159    type Reader = R;
160}
161#[doc = "`write(|w| ..)` method takes [matrix_pras0::W](W) writer structure"]
162impl crate::Writable for MATRIX_PRAS0_SPEC {
163    type Writer = W;
164    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
165    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
166}
167#[doc = "`reset()` method sets MATRIX_PRAS0 to value 0x3333_3333"]
168impl crate::Resettable for MATRIX_PRAS0_SPEC {
169    const RESET_VALUE: Self::Ux = 0x3333_3333;
170}