s32k142_pac/dma/
dma_tcd7_nbytes_mloffno.rs1#[doc = "Register `TCD7_NBYTES_MLOFFNO` reader"]
2pub struct R(crate::R<DMA_TCD7_NBYTES_MLOFFNO_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<DMA_TCD7_NBYTES_MLOFFNO_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<DMA_TCD7_NBYTES_MLOFFNO_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<DMA_TCD7_NBYTES_MLOFFNO_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `TCD7_NBYTES_MLOFFNO` writer"]
17pub struct W(crate::W<DMA_TCD7_NBYTES_MLOFFNO_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<DMA_TCD7_NBYTES_MLOFFNO_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<DMA_TCD7_NBYTES_MLOFFNO_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<DMA_TCD7_NBYTES_MLOFFNO_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `NBYTES` reader - Minor Byte Transfer Count"]
38pub struct NBYTES_R(crate::FieldReader<u32, u32>);
39impl NBYTES_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: u32) -> Self {
42 NBYTES_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for NBYTES_R {
46 type Target = crate::FieldReader<u32, u32>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `NBYTES` writer - Minor Byte Transfer Count"]
53pub struct NBYTES_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> NBYTES_W<'a> {
57 #[doc = r"Writes raw bits to the field"]
58 #[inline(always)]
59 pub unsafe fn bits(self, value: u32) -> &'a mut W {
60 self.w.bits = (self.w.bits & !0x3fff_ffff) | (value as u32 & 0x3fff_ffff);
61 self.w
62 }
63}
64#[doc = "Destination Minor Loop Offset enable\n\nValue on reset: 0"]
65#[derive(Clone, Copy, Debug, PartialEq)]
66pub enum DMLOE_A {
67 #[doc = "0: The minor loop offset is not applied to the DADDR"]
68 _0 = 0,
69 #[doc = "1: The minor loop offset is applied to the DADDR"]
70 _1 = 1,
71}
72impl From<DMLOE_A> for bool {
73 #[inline(always)]
74 fn from(variant: DMLOE_A) -> Self {
75 variant as u8 != 0
76 }
77}
78#[doc = "Field `DMLOE` reader - Destination Minor Loop Offset enable"]
79pub struct DMLOE_R(crate::FieldReader<bool, DMLOE_A>);
80impl DMLOE_R {
81 #[inline(always)]
82 pub(crate) fn new(bits: bool) -> Self {
83 DMLOE_R(crate::FieldReader::new(bits))
84 }
85 #[doc = r"Get enumerated values variant"]
86 #[inline(always)]
87 pub fn variant(&self) -> DMLOE_A {
88 match self.bits {
89 false => DMLOE_A::_0,
90 true => DMLOE_A::_1,
91 }
92 }
93 #[doc = "Checks if the value of the field is `_0`"]
94 #[inline(always)]
95 pub fn is_0(&self) -> bool {
96 **self == DMLOE_A::_0
97 }
98 #[doc = "Checks if the value of the field is `_1`"]
99 #[inline(always)]
100 pub fn is_1(&self) -> bool {
101 **self == DMLOE_A::_1
102 }
103}
104impl core::ops::Deref for DMLOE_R {
105 type Target = crate::FieldReader<bool, DMLOE_A>;
106 #[inline(always)]
107 fn deref(&self) -> &Self::Target {
108 &self.0
109 }
110}
111#[doc = "Field `DMLOE` writer - Destination Minor Loop Offset enable"]
112pub struct DMLOE_W<'a> {
113 w: &'a mut W,
114}
115impl<'a> DMLOE_W<'a> {
116 #[doc = r"Writes `variant` to the field"]
117 #[inline(always)]
118 pub fn variant(self, variant: DMLOE_A) -> &'a mut W {
119 self.bit(variant.into())
120 }
121 #[doc = "The minor loop offset is not applied to the DADDR"]
122 #[inline(always)]
123 pub fn _0(self) -> &'a mut W {
124 self.variant(DMLOE_A::_0)
125 }
126 #[doc = "The minor loop offset is applied to the DADDR"]
127 #[inline(always)]
128 pub fn _1(self) -> &'a mut W {
129 self.variant(DMLOE_A::_1)
130 }
131 #[doc = r"Sets the field bit"]
132 #[inline(always)]
133 pub fn set_bit(self) -> &'a mut W {
134 self.bit(true)
135 }
136 #[doc = r"Clears the field bit"]
137 #[inline(always)]
138 pub fn clear_bit(self) -> &'a mut W {
139 self.bit(false)
140 }
141 #[doc = r"Writes raw bits to the field"]
142 #[inline(always)]
143 pub fn bit(self, value: bool) -> &'a mut W {
144 self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30);
145 self.w
146 }
147}
148#[doc = "Source Minor Loop Offset Enable\n\nValue on reset: 0"]
149#[derive(Clone, Copy, Debug, PartialEq)]
150pub enum SMLOE_A {
151 #[doc = "0: The minor loop offset is not applied to the SADDR"]
152 _0 = 0,
153 #[doc = "1: The minor loop offset is applied to the SADDR"]
154 _1 = 1,
155}
156impl From<SMLOE_A> for bool {
157 #[inline(always)]
158 fn from(variant: SMLOE_A) -> Self {
159 variant as u8 != 0
160 }
161}
162#[doc = "Field `SMLOE` reader - Source Minor Loop Offset Enable"]
163pub struct SMLOE_R(crate::FieldReader<bool, SMLOE_A>);
164impl SMLOE_R {
165 #[inline(always)]
166 pub(crate) fn new(bits: bool) -> Self {
167 SMLOE_R(crate::FieldReader::new(bits))
168 }
169 #[doc = r"Get enumerated values variant"]
170 #[inline(always)]
171 pub fn variant(&self) -> SMLOE_A {
172 match self.bits {
173 false => SMLOE_A::_0,
174 true => SMLOE_A::_1,
175 }
176 }
177 #[doc = "Checks if the value of the field is `_0`"]
178 #[inline(always)]
179 pub fn is_0(&self) -> bool {
180 **self == SMLOE_A::_0
181 }
182 #[doc = "Checks if the value of the field is `_1`"]
183 #[inline(always)]
184 pub fn is_1(&self) -> bool {
185 **self == SMLOE_A::_1
186 }
187}
188impl core::ops::Deref for SMLOE_R {
189 type Target = crate::FieldReader<bool, SMLOE_A>;
190 #[inline(always)]
191 fn deref(&self) -> &Self::Target {
192 &self.0
193 }
194}
195#[doc = "Field `SMLOE` writer - Source Minor Loop Offset Enable"]
196pub struct SMLOE_W<'a> {
197 w: &'a mut W,
198}
199impl<'a> SMLOE_W<'a> {
200 #[doc = r"Writes `variant` to the field"]
201 #[inline(always)]
202 pub fn variant(self, variant: SMLOE_A) -> &'a mut W {
203 self.bit(variant.into())
204 }
205 #[doc = "The minor loop offset is not applied to the SADDR"]
206 #[inline(always)]
207 pub fn _0(self) -> &'a mut W {
208 self.variant(SMLOE_A::_0)
209 }
210 #[doc = "The minor loop offset is applied to the SADDR"]
211 #[inline(always)]
212 pub fn _1(self) -> &'a mut W {
213 self.variant(SMLOE_A::_1)
214 }
215 #[doc = r"Sets the field bit"]
216 #[inline(always)]
217 pub fn set_bit(self) -> &'a mut W {
218 self.bit(true)
219 }
220 #[doc = r"Clears the field bit"]
221 #[inline(always)]
222 pub fn clear_bit(self) -> &'a mut W {
223 self.bit(false)
224 }
225 #[doc = r"Writes raw bits to the field"]
226 #[inline(always)]
227 pub fn bit(self, value: bool) -> &'a mut W {
228 self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31);
229 self.w
230 }
231}
232impl R {
233 #[doc = "Bits 0:29 - Minor Byte Transfer Count"]
234 #[inline(always)]
235 pub fn nbytes(&self) -> NBYTES_R {
236 NBYTES_R::new((self.bits & 0x3fff_ffff) as u32)
237 }
238 #[doc = "Bit 30 - Destination Minor Loop Offset enable"]
239 #[inline(always)]
240 pub fn dmloe(&self) -> DMLOE_R {
241 DMLOE_R::new(((self.bits >> 30) & 0x01) != 0)
242 }
243 #[doc = "Bit 31 - Source Minor Loop Offset Enable"]
244 #[inline(always)]
245 pub fn smloe(&self) -> SMLOE_R {
246 SMLOE_R::new(((self.bits >> 31) & 0x01) != 0)
247 }
248}
249impl W {
250 #[doc = "Bits 0:29 - Minor Byte Transfer Count"]
251 #[inline(always)]
252 pub fn nbytes(&mut self) -> NBYTES_W {
253 NBYTES_W { w: self }
254 }
255 #[doc = "Bit 30 - Destination Minor Loop Offset enable"]
256 #[inline(always)]
257 pub fn dmloe(&mut self) -> DMLOE_W {
258 DMLOE_W { w: self }
259 }
260 #[doc = "Bit 31 - Source Minor Loop Offset Enable"]
261 #[inline(always)]
262 pub fn smloe(&mut self) -> SMLOE_W {
263 SMLOE_W { w: self }
264 }
265 #[doc = "Writes raw bits to the register."]
266 #[inline(always)]
267 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
268 self.0.bits(bits);
269 self
270 }
271}
272#[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)\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 [dma_tcd7_nbytes_mloffno](index.html) module"]
273pub struct DMA_TCD7_NBYTES_MLOFFNO_SPEC;
274impl crate::RegisterSpec for DMA_TCD7_NBYTES_MLOFFNO_SPEC {
275 type Ux = u32;
276}
277#[doc = "`read()` method returns [dma_tcd7_nbytes_mloffno::R](R) reader structure"]
278impl crate::Readable for DMA_TCD7_NBYTES_MLOFFNO_SPEC {
279 type Reader = R;
280}
281#[doc = "`write(|w| ..)` method takes [dma_tcd7_nbytes_mloffno::W](W) writer structure"]
282impl crate::Writable for DMA_TCD7_NBYTES_MLOFFNO_SPEC {
283 type Writer = W;
284}
285#[doc = "`reset()` method sets TCD7_NBYTES_MLOFFNO to value 0"]
286impl crate::Resettable for DMA_TCD7_NBYTES_MLOFFNO_SPEC {
287 #[inline(always)]
288 fn reset_value() -> Self::Ux {
289 0
290 }
291}