1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"Data Transfer Controller"]
28unsafe impl ::core::marker::Send for super::Dtc {}
29unsafe impl ::core::marker::Sync for super::Dtc {}
30impl super::Dtc {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "DTC Control Register"]
38 #[inline(always)]
39 pub const fn dtccr(&self) -> &'static crate::common::Reg<self::Dtccr_SPEC, crate::common::RW> {
40 unsafe {
41 crate::common::Reg::<self::Dtccr_SPEC, crate::common::RW>::from_ptr(
42 self._svd2pac_as_ptr().add(0usize),
43 )
44 }
45 }
46
47 #[doc = "DTC Vector Base Register"]
48 #[inline(always)]
49 pub const fn dtcvbr(
50 &self,
51 ) -> &'static crate::common::Reg<self::Dtcvbr_SPEC, crate::common::RW> {
52 unsafe {
53 crate::common::Reg::<self::Dtcvbr_SPEC, crate::common::RW>::from_ptr(
54 self._svd2pac_as_ptr().add(4usize),
55 )
56 }
57 }
58
59 #[doc = "DTC Module Start Register"]
60 #[inline(always)]
61 pub const fn dtcst(&self) -> &'static crate::common::Reg<self::Dtcst_SPEC, crate::common::RW> {
62 unsafe {
63 crate::common::Reg::<self::Dtcst_SPEC, crate::common::RW>::from_ptr(
64 self._svd2pac_as_ptr().add(12usize),
65 )
66 }
67 }
68
69 #[doc = "DTC Status Register"]
70 #[inline(always)]
71 pub const fn dtcsts(&self) -> &'static crate::common::Reg<self::Dtcsts_SPEC, crate::common::R> {
72 unsafe {
73 crate::common::Reg::<self::Dtcsts_SPEC, crate::common::R>::from_ptr(
74 self._svd2pac_as_ptr().add(14usize),
75 )
76 }
77 }
78}
79#[doc(hidden)]
80#[derive(Copy, Clone, Eq, PartialEq)]
81pub struct Dtccr_SPEC;
82impl crate::sealed::RegSpec for Dtccr_SPEC {
83 type DataType = u8;
84}
85
86#[doc = "DTC Control Register"]
87pub type Dtccr = crate::RegValueT<Dtccr_SPEC>;
88
89impl Dtccr {
90 #[doc = "DTC Transfer Information Read Skip Enable."]
91 #[inline(always)]
92 pub fn rrs(
93 self,
94 ) -> crate::common::RegisterField<
95 4,
96 0x1,
97 1,
98 0,
99 dtccr::Rrs,
100 dtccr::Rrs,
101 Dtccr_SPEC,
102 crate::common::RW,
103 > {
104 crate::common::RegisterField::<
105 4,
106 0x1,
107 1,
108 0,
109 dtccr::Rrs,
110 dtccr::Rrs,
111 Dtccr_SPEC,
112 crate::common::RW,
113 >::from_register(self, 0)
114 }
115
116 #[doc = "These bits are read as 000. The write value should be 000."]
117 #[inline(always)]
118 pub fn reserved(
119 self,
120 ) -> crate::common::RegisterField<0, 0x7, 1, 0, u8, u8, Dtccr_SPEC, crate::common::RW> {
121 crate::common::RegisterField::<0,0x7,1,0,u8,u8,Dtccr_SPEC,crate::common::RW>::from_register(self,0)
122 }
123}
124impl ::core::default::Default for Dtccr {
125 #[inline(always)]
126 fn default() -> Dtccr {
127 <crate::RegValueT<Dtccr_SPEC> as RegisterValue<_>>::new(8)
128 }
129}
130pub mod dtccr {
131
132 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
133 pub struct Rrs_SPEC;
134 pub type Rrs = crate::EnumBitfieldStruct<u8, Rrs_SPEC>;
135 impl Rrs {
136 #[doc = "Do not skip transfer information read"]
137 pub const _0: Self = Self::new(0);
138
139 #[doc = "Skip transfer information read when vector numbers match"]
140 pub const _1: Self = Self::new(1);
141 }
142}
143#[doc(hidden)]
144#[derive(Copy, Clone, Eq, PartialEq)]
145pub struct Dtcvbr_SPEC;
146impl crate::sealed::RegSpec for Dtcvbr_SPEC {
147 type DataType = u32;
148}
149
150#[doc = "DTC Vector Base Register"]
151pub type Dtcvbr = crate::RegValueT<Dtcvbr_SPEC>;
152
153impl Dtcvbr {
154 #[doc = "DTC Vector Base Address.Note: A value cannot be set in the lower-order 10 bits. These bits are fixed to 0."]
155 #[inline(always)]
156 pub fn dtcvbr(
157 self,
158 ) -> crate::common::RegisterField<0, 0xffffffff, 1, 0, u32, u32, Dtcvbr_SPEC, crate::common::RW>
159 {
160 crate::common::RegisterField::<0,0xffffffff,1,0,u32,u32,Dtcvbr_SPEC,crate::common::RW>::from_register(self,0)
161 }
162}
163impl ::core::default::Default for Dtcvbr {
164 #[inline(always)]
165 fn default() -> Dtcvbr {
166 <crate::RegValueT<Dtcvbr_SPEC> as RegisterValue<_>>::new(0)
167 }
168}
169
170#[doc(hidden)]
171#[derive(Copy, Clone, Eq, PartialEq)]
172pub struct Dtcst_SPEC;
173impl crate::sealed::RegSpec for Dtcst_SPEC {
174 type DataType = u8;
175}
176
177#[doc = "DTC Module Start Register"]
178pub type Dtcst = crate::RegValueT<Dtcst_SPEC>;
179
180impl Dtcst {
181 #[doc = "These bits are read as 0000000. The write value should be 0000000."]
182 #[inline(always)]
183 pub fn reserved(
184 self,
185 ) -> crate::common::RegisterField<1, 0x7f, 1, 0, u8, u8, Dtcst_SPEC, crate::common::RW> {
186 crate::common::RegisterField::<1,0x7f,1,0,u8,u8,Dtcst_SPEC,crate::common::RW>::from_register(self,0)
187 }
188
189 #[doc = "DTC Module Start"]
190 #[inline(always)]
191 pub fn dtcst(
192 self,
193 ) -> crate::common::RegisterField<
194 0,
195 0x1,
196 1,
197 0,
198 dtcst::Dtcst,
199 dtcst::Dtcst,
200 Dtcst_SPEC,
201 crate::common::RW,
202 > {
203 crate::common::RegisterField::<
204 0,
205 0x1,
206 1,
207 0,
208 dtcst::Dtcst,
209 dtcst::Dtcst,
210 Dtcst_SPEC,
211 crate::common::RW,
212 >::from_register(self, 0)
213 }
214}
215impl ::core::default::Default for Dtcst {
216 #[inline(always)]
217 fn default() -> Dtcst {
218 <crate::RegValueT<Dtcst_SPEC> as RegisterValue<_>>::new(0)
219 }
220}
221pub mod dtcst {
222
223 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
224 pub struct Dtcst_SPEC;
225 pub type Dtcst = crate::EnumBitfieldStruct<u8, Dtcst_SPEC>;
226 impl Dtcst {
227 #[doc = "DTC module stop"]
228 pub const _0: Self = Self::new(0);
229
230 #[doc = "DTC module start"]
231 pub const _1: Self = Self::new(1);
232 }
233}
234#[doc(hidden)]
235#[derive(Copy, Clone, Eq, PartialEq)]
236pub struct Dtcsts_SPEC;
237impl crate::sealed::RegSpec for Dtcsts_SPEC {
238 type DataType = u16;
239}
240
241#[doc = "DTC Status Register"]
242pub type Dtcsts = crate::RegValueT<Dtcsts_SPEC>;
243
244impl Dtcsts {
245 #[doc = "DTC Active Flag"]
246 #[inline(always)]
247 pub fn act(
248 self,
249 ) -> crate::common::RegisterField<
250 15,
251 0x1,
252 1,
253 0,
254 dtcsts::Act,
255 dtcsts::Act,
256 Dtcsts_SPEC,
257 crate::common::R,
258 > {
259 crate::common::RegisterField::<
260 15,
261 0x1,
262 1,
263 0,
264 dtcsts::Act,
265 dtcsts::Act,
266 Dtcsts_SPEC,
267 crate::common::R,
268 >::from_register(self, 0)
269 }
270
271 #[doc = "These bits are read as 0000000."]
272 #[inline(always)]
273 pub fn reserved(
274 self,
275 ) -> crate::common::RegisterField<8, 0x7f, 1, 0, u8, u8, Dtcsts_SPEC, crate::common::R> {
276 crate::common::RegisterField::<8,0x7f,1,0,u8,u8,Dtcsts_SPEC,crate::common::R>::from_register(self,0)
277 }
278
279 #[doc = "DTC-Activating Vector Number MonitoringThese bits indicate the vector number for the activating source when DTC transfer is in progress.The value is only valid if DTC transfer is in progress (the value of the ACT flag is 1)"]
280 #[inline(always)]
281 pub fn vecn(
282 self,
283 ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Dtcsts_SPEC, crate::common::R> {
284 crate::common::RegisterField::<0,0xff,1,0,u8,u8,Dtcsts_SPEC,crate::common::R>::from_register(self,0)
285 }
286}
287impl ::core::default::Default for Dtcsts {
288 #[inline(always)]
289 fn default() -> Dtcsts {
290 <crate::RegValueT<Dtcsts_SPEC> as RegisterValue<_>>::new(0)
291 }
292}
293pub mod dtcsts {
294
295 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
296 pub struct Act_SPEC;
297 pub type Act = crate::EnumBitfieldStruct<u8, Act_SPEC>;
298 impl Act {
299 #[doc = "DTC transfer operation is not in progress."]
300 pub const _0: Self = Self::new(0);
301
302 #[doc = "DTC transfer operation is in progress."]
303 pub const _1: Self = Self::new(1);
304 }
305}