atsamv71q21/matrix/matrix_pr/
matrix_prbs.rs

1#[doc = "Register `MATRIX_PRBS` reader"]
2pub struct R(crate::R<MATRIX_PRBS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MATRIX_PRBS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MATRIX_PRBS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MATRIX_PRBS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MATRIX_PRBS` writer"]
17pub struct W(crate::W<MATRIX_PRBS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MATRIX_PRBS_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_PRBS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MATRIX_PRBS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `M8PR` reader - Master 8 Priority"]
38pub struct M8PR_R(crate::FieldReader<u8, u8>);
39impl M8PR_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u8) -> Self {
42        M8PR_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for M8PR_R {
46    type Target = crate::FieldReader<u8, u8>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `M8PR` writer - Master 8 Priority"]
53pub struct M8PR_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> M8PR_W<'a> {
57    #[doc = r"Writes raw bits to the field"]
58    #[inline(always)]
59    pub unsafe fn bits(self, value: u8) -> &'a mut W {
60        self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03);
61        self.w
62    }
63}
64#[doc = "Field `M9PR` reader - Master 9 Priority"]
65pub struct M9PR_R(crate::FieldReader<u8, u8>);
66impl M9PR_R {
67    #[inline(always)]
68    pub(crate) fn new(bits: u8) -> Self {
69        M9PR_R(crate::FieldReader::new(bits))
70    }
71}
72impl core::ops::Deref for M9PR_R {
73    type Target = crate::FieldReader<u8, u8>;
74    #[inline(always)]
75    fn deref(&self) -> &Self::Target {
76        &self.0
77    }
78}
79#[doc = "Field `M9PR` writer - Master 9 Priority"]
80pub struct M9PR_W<'a> {
81    w: &'a mut W,
82}
83impl<'a> M9PR_W<'a> {
84    #[doc = r"Writes raw bits to the field"]
85    #[inline(always)]
86    pub unsafe fn bits(self, value: u8) -> &'a mut W {
87        self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4);
88        self.w
89    }
90}
91#[doc = "Field `M10PR` reader - Master 10 Priority"]
92pub struct M10PR_R(crate::FieldReader<u8, u8>);
93impl M10PR_R {
94    #[inline(always)]
95    pub(crate) fn new(bits: u8) -> Self {
96        M10PR_R(crate::FieldReader::new(bits))
97    }
98}
99impl core::ops::Deref for M10PR_R {
100    type Target = crate::FieldReader<u8, u8>;
101    #[inline(always)]
102    fn deref(&self) -> &Self::Target {
103        &self.0
104    }
105}
106#[doc = "Field `M10PR` writer - Master 10 Priority"]
107pub struct M10PR_W<'a> {
108    w: &'a mut W,
109}
110impl<'a> M10PR_W<'a> {
111    #[doc = r"Writes raw bits to the field"]
112    #[inline(always)]
113    pub unsafe fn bits(self, value: u8) -> &'a mut W {
114        self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8);
115        self.w
116    }
117}
118#[doc = "Field `M11PR` reader - Master 11 Priority"]
119pub struct M11PR_R(crate::FieldReader<u8, u8>);
120impl M11PR_R {
121    #[inline(always)]
122    pub(crate) fn new(bits: u8) -> Self {
123        M11PR_R(crate::FieldReader::new(bits))
124    }
125}
126impl core::ops::Deref for M11PR_R {
127    type Target = crate::FieldReader<u8, u8>;
128    #[inline(always)]
129    fn deref(&self) -> &Self::Target {
130        &self.0
131    }
132}
133#[doc = "Field `M11PR` writer - Master 11 Priority"]
134pub struct M11PR_W<'a> {
135    w: &'a mut W,
136}
137impl<'a> M11PR_W<'a> {
138    #[doc = r"Writes raw bits to the field"]
139    #[inline(always)]
140    pub unsafe fn bits(self, value: u8) -> &'a mut W {
141        self.w.bits = (self.w.bits & !(0x03 << 12)) | ((value as u32 & 0x03) << 12);
142        self.w
143    }
144}
145impl R {
146    #[doc = "Bits 0:1 - Master 8 Priority"]
147    #[inline(always)]
148    pub fn m8pr(&self) -> M8PR_R {
149        M8PR_R::new((self.bits & 0x03) as u8)
150    }
151    #[doc = "Bits 4:5 - Master 9 Priority"]
152    #[inline(always)]
153    pub fn m9pr(&self) -> M9PR_R {
154        M9PR_R::new(((self.bits >> 4) & 0x03) as u8)
155    }
156    #[doc = "Bits 8:9 - Master 10 Priority"]
157    #[inline(always)]
158    pub fn m10pr(&self) -> M10PR_R {
159        M10PR_R::new(((self.bits >> 8) & 0x03) as u8)
160    }
161    #[doc = "Bits 12:13 - Master 11 Priority"]
162    #[inline(always)]
163    pub fn m11pr(&self) -> M11PR_R {
164        M11PR_R::new(((self.bits >> 12) & 0x03) as u8)
165    }
166}
167impl W {
168    #[doc = "Bits 0:1 - Master 8 Priority"]
169    #[inline(always)]
170    pub fn m8pr(&mut self) -> M8PR_W {
171        M8PR_W { w: self }
172    }
173    #[doc = "Bits 4:5 - Master 9 Priority"]
174    #[inline(always)]
175    pub fn m9pr(&mut self) -> M9PR_W {
176        M9PR_W { w: self }
177    }
178    #[doc = "Bits 8:9 - Master 10 Priority"]
179    #[inline(always)]
180    pub fn m10pr(&mut self) -> M10PR_W {
181        M10PR_W { w: self }
182    }
183    #[doc = "Bits 12:13 - Master 11 Priority"]
184    #[inline(always)]
185    pub fn m11pr(&mut self) -> M11PR_W {
186        M11PR_W { w: self }
187    }
188    #[doc = "Writes raw bits to the register."]
189    #[inline(always)]
190    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
191        self.0.bits(bits);
192        self
193    }
194}
195#[doc = "Priority Register B 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_prbs](index.html) module"]
196pub struct MATRIX_PRBS_SPEC;
197impl crate::RegisterSpec for MATRIX_PRBS_SPEC {
198    type Ux = u32;
199}
200#[doc = "`read()` method returns [matrix_prbs::R](R) reader structure"]
201impl crate::Readable for MATRIX_PRBS_SPEC {
202    type Reader = R;
203}
204#[doc = "`write(|w| ..)` method takes [matrix_prbs::W](W) writer structure"]
205impl crate::Writable for MATRIX_PRBS_SPEC {
206    type Writer = W;
207}
208#[doc = "`reset()` method sets MATRIX_PRBS to value 0"]
209impl crate::Resettable for MATRIX_PRBS_SPEC {
210    #[inline(always)]
211    fn reset_value() -> Self::Ux {
212        0
213    }
214}