atsamv71n21/matrix/
matrix_mcfg.rs

1#[doc = "Register `MATRIX_MCFG[%s]` reader"]
2pub struct R(crate::R<MATRIX_MCFG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MATRIX_MCFG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MATRIX_MCFG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MATRIX_MCFG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MATRIX_MCFG[%s]` writer"]
17pub struct W(crate::W<MATRIX_MCFG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MATRIX_MCFG_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_MCFG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MATRIX_MCFG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Undefined Length Burst Type\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum ULBT_A {
41    #[doc = "0: Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1-Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave."]
42    UNLTD_LENGTH = 0,
43    #[doc = "1: Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence."]
44    SINGLE_ACCESS = 1,
45    #[doc = "2: 4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats."]
46    _4BEAT_BURST = 2,
47    #[doc = "3: 8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats."]
48    _8BEAT_BURST = 3,
49    #[doc = "4: 16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats."]
50    _16BEAT_BURST = 4,
51    #[doc = "5: 32-beat Burst -The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats."]
52    _32BEAT_BURST = 5,
53    #[doc = "6: 64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats."]
54    _64BEAT_BURST = 6,
55    #[doc = "7: 128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats."]
56    _128BEAT_BURST = 7,
57}
58impl From<ULBT_A> for u8 {
59    #[inline(always)]
60    fn from(variant: ULBT_A) -> Self {
61        variant as _
62    }
63}
64#[doc = "Field `ULBT` reader - Undefined Length Burst Type"]
65pub struct ULBT_R(crate::FieldReader<u8, ULBT_A>);
66impl ULBT_R {
67    #[inline(always)]
68    pub(crate) fn new(bits: u8) -> Self {
69        ULBT_R(crate::FieldReader::new(bits))
70    }
71    #[doc = r"Get enumerated values variant"]
72    #[inline(always)]
73    pub fn variant(&self) -> ULBT_A {
74        match self.bits {
75            0 => ULBT_A::UNLTD_LENGTH,
76            1 => ULBT_A::SINGLE_ACCESS,
77            2 => ULBT_A::_4BEAT_BURST,
78            3 => ULBT_A::_8BEAT_BURST,
79            4 => ULBT_A::_16BEAT_BURST,
80            5 => ULBT_A::_32BEAT_BURST,
81            6 => ULBT_A::_64BEAT_BURST,
82            7 => ULBT_A::_128BEAT_BURST,
83            _ => unreachable!(),
84        }
85    }
86    #[doc = "Checks if the value of the field is `UNLTD_LENGTH`"]
87    #[inline(always)]
88    pub fn is_unltd_length(&self) -> bool {
89        **self == ULBT_A::UNLTD_LENGTH
90    }
91    #[doc = "Checks if the value of the field is `SINGLE_ACCESS`"]
92    #[inline(always)]
93    pub fn is_single_access(&self) -> bool {
94        **self == ULBT_A::SINGLE_ACCESS
95    }
96    #[doc = "Checks if the value of the field is `_4BEAT_BURST`"]
97    #[inline(always)]
98    pub fn is_4beat_burst(&self) -> bool {
99        **self == ULBT_A::_4BEAT_BURST
100    }
101    #[doc = "Checks if the value of the field is `_8BEAT_BURST`"]
102    #[inline(always)]
103    pub fn is_8beat_burst(&self) -> bool {
104        **self == ULBT_A::_8BEAT_BURST
105    }
106    #[doc = "Checks if the value of the field is `_16BEAT_BURST`"]
107    #[inline(always)]
108    pub fn is_16beat_burst(&self) -> bool {
109        **self == ULBT_A::_16BEAT_BURST
110    }
111    #[doc = "Checks if the value of the field is `_32BEAT_BURST`"]
112    #[inline(always)]
113    pub fn is_32beat_burst(&self) -> bool {
114        **self == ULBT_A::_32BEAT_BURST
115    }
116    #[doc = "Checks if the value of the field is `_64BEAT_BURST`"]
117    #[inline(always)]
118    pub fn is_64beat_burst(&self) -> bool {
119        **self == ULBT_A::_64BEAT_BURST
120    }
121    #[doc = "Checks if the value of the field is `_128BEAT_BURST`"]
122    #[inline(always)]
123    pub fn is_128beat_burst(&self) -> bool {
124        **self == ULBT_A::_128BEAT_BURST
125    }
126}
127impl core::ops::Deref for ULBT_R {
128    type Target = crate::FieldReader<u8, ULBT_A>;
129    #[inline(always)]
130    fn deref(&self) -> &Self::Target {
131        &self.0
132    }
133}
134#[doc = "Field `ULBT` writer - Undefined Length Burst Type"]
135pub struct ULBT_W<'a> {
136    w: &'a mut W,
137}
138impl<'a> ULBT_W<'a> {
139    #[doc = r"Writes `variant` to the field"]
140    #[inline(always)]
141    pub fn variant(self, variant: ULBT_A) -> &'a mut W {
142        self.bits(variant.into())
143    }
144    #[doc = "Unlimited Length Burst-No predicted end of burst is generated, therefore INCR bursts coming from this master can only be broken if the Slave Slot Cycle Limit is reached. If the Slot Cycle Limit is not reached, the burst is normally completed by the master, at the latest, on the next AHB 1-Kbyte address boundary, allowing up to 256-beat word bursts or 128-beat double-word bursts.This value should not be used in the very particular case of a master capable of performing back-to-back undefined length bursts on a single slave, since this could indefinitely freeze the slave arbitration and thus prevent another master from accessing this slave."]
145    #[inline(always)]
146    pub fn unltd_length(self) -> &'a mut W {
147        self.variant(ULBT_A::UNLTD_LENGTH)
148    }
149    #[doc = "Single Access-The undefined length burst is treated as a succession of single accesses, allowing re-arbitration at each beat of the INCR burst or bursts sequence."]
150    #[inline(always)]
151    pub fn single_access(self) -> &'a mut W {
152        self.variant(ULBT_A::SINGLE_ACCESS)
153    }
154    #[doc = "4-beat Burst-The undefined length burst or bursts sequence is split into 4-beat bursts or less, allowing re-arbitration every 4 beats."]
155    #[inline(always)]
156    pub fn _4beat_burst(self) -> &'a mut W {
157        self.variant(ULBT_A::_4BEAT_BURST)
158    }
159    #[doc = "8-beat Burst-The undefined length burst or bursts sequence is split into 8-beat bursts or less, allowing re-arbitration every 8 beats."]
160    #[inline(always)]
161    pub fn _8beat_burst(self) -> &'a mut W {
162        self.variant(ULBT_A::_8BEAT_BURST)
163    }
164    #[doc = "16-beat Burst-The undefined length burst or bursts sequence is split into 16-beat bursts or less, allowing re-arbitration every 16 beats."]
165    #[inline(always)]
166    pub fn _16beat_burst(self) -> &'a mut W {
167        self.variant(ULBT_A::_16BEAT_BURST)
168    }
169    #[doc = "32-beat Burst -The undefined length burst or bursts sequence is split into 32-beat bursts or less, allowing re-arbitration every 32 beats."]
170    #[inline(always)]
171    pub fn _32beat_burst(self) -> &'a mut W {
172        self.variant(ULBT_A::_32BEAT_BURST)
173    }
174    #[doc = "64-beat Burst-The undefined length burst or bursts sequence is split into 64-beat bursts or less, allowing re-arbitration every 64 beats."]
175    #[inline(always)]
176    pub fn _64beat_burst(self) -> &'a mut W {
177        self.variant(ULBT_A::_64BEAT_BURST)
178    }
179    #[doc = "128-beat Burst-The undefined length burst or bursts sequence is split into 128-beat bursts or less, allowing re-arbitration every 128 beats."]
180    #[inline(always)]
181    pub fn _128beat_burst(self) -> &'a mut W {
182        self.variant(ULBT_A::_128BEAT_BURST)
183    }
184    #[doc = r"Writes raw bits to the field"]
185    #[inline(always)]
186    pub fn bits(self, value: u8) -> &'a mut W {
187        self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07);
188        self.w
189    }
190}
191impl R {
192    #[doc = "Bits 0:2 - Undefined Length Burst Type"]
193    #[inline(always)]
194    pub fn ulbt(&self) -> ULBT_R {
195        ULBT_R::new((self.bits & 0x07) as u8)
196    }
197}
198impl W {
199    #[doc = "Bits 0:2 - Undefined Length Burst Type"]
200    #[inline(always)]
201    pub fn ulbt(&mut self) -> ULBT_W {
202        ULBT_W { w: self }
203    }
204    #[doc = "Writes raw bits to the register."]
205    #[inline(always)]
206    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
207        self.0.bits(bits);
208        self
209    }
210}
211#[doc = "Master Configuration Register 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_mcfg](index.html) module"]
212pub struct MATRIX_MCFG_SPEC;
213impl crate::RegisterSpec for MATRIX_MCFG_SPEC {
214    type Ux = u32;
215}
216#[doc = "`read()` method returns [matrix_mcfg::R](R) reader structure"]
217impl crate::Readable for MATRIX_MCFG_SPEC {
218    type Reader = R;
219}
220#[doc = "`write(|w| ..)` method takes [matrix_mcfg::W](W) writer structure"]
221impl crate::Writable for MATRIX_MCFG_SPEC {
222    type Writer = W;
223}
224#[doc = "`reset()` method sets MATRIX_MCFG[%s]
225to value 0"]
226impl crate::Resettable for MATRIX_MCFG_SPEC {
227    #[inline(always)]
228    fn reset_value() -> Self::Ux {
229        0
230    }
231}