1#[doc = r" Value read from the register"]
2pub struct R {
3 bits: u8,
4}
5impl super::SRS1 {
6 #[doc = r" Reads the contents of the register"]
7 #[inline]
8 pub fn read(&self) -> R {
9 R {
10 bits: self.register.get(),
11 }
12 }
13}
14#[doc = "Possible values of the field `JTAG`"]
15#[derive(Clone, Copy, Debug, PartialEq)]
16pub enum JTAGR {
17 #[doc = "Reset not caused by JTAG"]
18 _0,
19 #[doc = "Reset caused by JTAG"]
20 _1,
21}
22impl JTAGR {
23 #[doc = r" Returns `true` if the bit is clear (0)"]
24 #[inline]
25 pub fn bit_is_clear(&self) -> bool {
26 !self.bit()
27 }
28 #[doc = r" Returns `true` if the bit is set (1)"]
29 #[inline]
30 pub fn bit_is_set(&self) -> bool {
31 self.bit()
32 }
33 #[doc = r" Value of the field as raw bits"]
34 #[inline]
35 pub fn bit(&self) -> bool {
36 match *self {
37 JTAGR::_0 => false,
38 JTAGR::_1 => true,
39 }
40 }
41 #[allow(missing_docs)]
42 #[doc(hidden)]
43 #[inline]
44 pub fn _from(value: bool) -> JTAGR {
45 match value {
46 false => JTAGR::_0,
47 true => JTAGR::_1,
48 }
49 }
50 #[doc = "Checks if the value of the field is `_0`"]
51 #[inline]
52 pub fn is_0(&self) -> bool {
53 *self == JTAGR::_0
54 }
55 #[doc = "Checks if the value of the field is `_1`"]
56 #[inline]
57 pub fn is_1(&self) -> bool {
58 *self == JTAGR::_1
59 }
60}
61#[doc = "Possible values of the field `LOCKUP`"]
62#[derive(Clone, Copy, Debug, PartialEq)]
63pub enum LOCKUPR {
64 #[doc = "Reset not caused by core LOCKUP event"]
65 _0,
66 #[doc = "Reset caused by core LOCKUP event"]
67 _1,
68}
69impl LOCKUPR {
70 #[doc = r" Returns `true` if the bit is clear (0)"]
71 #[inline]
72 pub fn bit_is_clear(&self) -> bool {
73 !self.bit()
74 }
75 #[doc = r" Returns `true` if the bit is set (1)"]
76 #[inline]
77 pub fn bit_is_set(&self) -> bool {
78 self.bit()
79 }
80 #[doc = r" Value of the field as raw bits"]
81 #[inline]
82 pub fn bit(&self) -> bool {
83 match *self {
84 LOCKUPR::_0 => false,
85 LOCKUPR::_1 => true,
86 }
87 }
88 #[allow(missing_docs)]
89 #[doc(hidden)]
90 #[inline]
91 pub fn _from(value: bool) -> LOCKUPR {
92 match value {
93 false => LOCKUPR::_0,
94 true => LOCKUPR::_1,
95 }
96 }
97 #[doc = "Checks if the value of the field is `_0`"]
98 #[inline]
99 pub fn is_0(&self) -> bool {
100 *self == LOCKUPR::_0
101 }
102 #[doc = "Checks if the value of the field is `_1`"]
103 #[inline]
104 pub fn is_1(&self) -> bool {
105 *self == LOCKUPR::_1
106 }
107}
108#[doc = "Possible values of the field `SW`"]
109#[derive(Clone, Copy, Debug, PartialEq)]
110pub enum SWR {
111 #[doc = "Reset not caused by software setting of SYSRESETREQ bit"]
112 _0,
113 #[doc = "Reset caused by software setting of SYSRESETREQ bit"]
114 _1,
115}
116impl SWR {
117 #[doc = r" Returns `true` if the bit is clear (0)"]
118 #[inline]
119 pub fn bit_is_clear(&self) -> bool {
120 !self.bit()
121 }
122 #[doc = r" Returns `true` if the bit is set (1)"]
123 #[inline]
124 pub fn bit_is_set(&self) -> bool {
125 self.bit()
126 }
127 #[doc = r" Value of the field as raw bits"]
128 #[inline]
129 pub fn bit(&self) -> bool {
130 match *self {
131 SWR::_0 => false,
132 SWR::_1 => true,
133 }
134 }
135 #[allow(missing_docs)]
136 #[doc(hidden)]
137 #[inline]
138 pub fn _from(value: bool) -> SWR {
139 match value {
140 false => SWR::_0,
141 true => SWR::_1,
142 }
143 }
144 #[doc = "Checks if the value of the field is `_0`"]
145 #[inline]
146 pub fn is_0(&self) -> bool {
147 *self == SWR::_0
148 }
149 #[doc = "Checks if the value of the field is `_1`"]
150 #[inline]
151 pub fn is_1(&self) -> bool {
152 *self == SWR::_1
153 }
154}
155#[doc = "Possible values of the field `MDM_AP`"]
156#[derive(Clone, Copy, Debug, PartialEq)]
157pub enum MDM_APR {
158 #[doc = "Reset not caused by host debugger system setting of the System Reset Request bit"]
159 _0,
160 #[doc = "Reset caused by host debugger system setting of the System Reset Request bit"]
161 _1,
162}
163impl MDM_APR {
164 #[doc = r" Returns `true` if the bit is clear (0)"]
165 #[inline]
166 pub fn bit_is_clear(&self) -> bool {
167 !self.bit()
168 }
169 #[doc = r" Returns `true` if the bit is set (1)"]
170 #[inline]
171 pub fn bit_is_set(&self) -> bool {
172 self.bit()
173 }
174 #[doc = r" Value of the field as raw bits"]
175 #[inline]
176 pub fn bit(&self) -> bool {
177 match *self {
178 MDM_APR::_0 => false,
179 MDM_APR::_1 => true,
180 }
181 }
182 #[allow(missing_docs)]
183 #[doc(hidden)]
184 #[inline]
185 pub fn _from(value: bool) -> MDM_APR {
186 match value {
187 false => MDM_APR::_0,
188 true => MDM_APR::_1,
189 }
190 }
191 #[doc = "Checks if the value of the field is `_0`"]
192 #[inline]
193 pub fn is_0(&self) -> bool {
194 *self == MDM_APR::_0
195 }
196 #[doc = "Checks if the value of the field is `_1`"]
197 #[inline]
198 pub fn is_1(&self) -> bool {
199 *self == MDM_APR::_1
200 }
201}
202#[doc = "Possible values of the field `EZPT`"]
203#[derive(Clone, Copy, Debug, PartialEq)]
204pub enum EZPTR {
205 #[doc = "Reset not caused by EzPort receiving the RESET command while the device is in EzPort mode"]
206 _0,
207 #[doc = "Reset caused by EzPort receiving the RESET command while the device is in EzPort mode"]
208 _1,
209}
210impl EZPTR {
211 #[doc = r" Returns `true` if the bit is clear (0)"]
212 #[inline]
213 pub fn bit_is_clear(&self) -> bool {
214 !self.bit()
215 }
216 #[doc = r" Returns `true` if the bit is set (1)"]
217 #[inline]
218 pub fn bit_is_set(&self) -> bool {
219 self.bit()
220 }
221 #[doc = r" Value of the field as raw bits"]
222 #[inline]
223 pub fn bit(&self) -> bool {
224 match *self {
225 EZPTR::_0 => false,
226 EZPTR::_1 => true,
227 }
228 }
229 #[allow(missing_docs)]
230 #[doc(hidden)]
231 #[inline]
232 pub fn _from(value: bool) -> EZPTR {
233 match value {
234 false => EZPTR::_0,
235 true => EZPTR::_1,
236 }
237 }
238 #[doc = "Checks if the value of the field is `_0`"]
239 #[inline]
240 pub fn is_0(&self) -> bool {
241 *self == EZPTR::_0
242 }
243 #[doc = "Checks if the value of the field is `_1`"]
244 #[inline]
245 pub fn is_1(&self) -> bool {
246 *self == EZPTR::_1
247 }
248}
249#[doc = "Possible values of the field `SACKERR`"]
250#[derive(Clone, Copy, Debug, PartialEq)]
251pub enum SACKERRR {
252 #[doc = "Reset not caused by peripheral failure to acknowledge attempt to enter stop mode"]
253 _0,
254 #[doc = "Reset caused by peripheral failure to acknowledge attempt to enter stop mode"]
255 _1,
256}
257impl SACKERRR {
258 #[doc = r" Returns `true` if the bit is clear (0)"]
259 #[inline]
260 pub fn bit_is_clear(&self) -> bool {
261 !self.bit()
262 }
263 #[doc = r" Returns `true` if the bit is set (1)"]
264 #[inline]
265 pub fn bit_is_set(&self) -> bool {
266 self.bit()
267 }
268 #[doc = r" Value of the field as raw bits"]
269 #[inline]
270 pub fn bit(&self) -> bool {
271 match *self {
272 SACKERRR::_0 => false,
273 SACKERRR::_1 => true,
274 }
275 }
276 #[allow(missing_docs)]
277 #[doc(hidden)]
278 #[inline]
279 pub fn _from(value: bool) -> SACKERRR {
280 match value {
281 false => SACKERRR::_0,
282 true => SACKERRR::_1,
283 }
284 }
285 #[doc = "Checks if the value of the field is `_0`"]
286 #[inline]
287 pub fn is_0(&self) -> bool {
288 *self == SACKERRR::_0
289 }
290 #[doc = "Checks if the value of the field is `_1`"]
291 #[inline]
292 pub fn is_1(&self) -> bool {
293 *self == SACKERRR::_1
294 }
295}
296impl R {
297 #[doc = r" Value of the register as raw bits"]
298 #[inline]
299 pub fn bits(&self) -> u8 {
300 self.bits
301 }
302 #[doc = "Bit 0 - JTAG generated reset"]
303 #[inline]
304 pub fn jtag(&self) -> JTAGR {
305 JTAGR::_from({
306 const MASK: bool = true;
307 const OFFSET: u8 = 0;
308 ((self.bits >> OFFSET) & MASK as u8) != 0
309 })
310 }
311 #[doc = "Bit 1 - Core Lockup"]
312 #[inline]
313 pub fn lockup(&self) -> LOCKUPR {
314 LOCKUPR::_from({
315 const MASK: bool = true;
316 const OFFSET: u8 = 1;
317 ((self.bits >> OFFSET) & MASK as u8) != 0
318 })
319 }
320 #[doc = "Bit 2 - Software"]
321 #[inline]
322 pub fn sw(&self) -> SWR {
323 SWR::_from({
324 const MASK: bool = true;
325 const OFFSET: u8 = 2;
326 ((self.bits >> OFFSET) & MASK as u8) != 0
327 })
328 }
329 #[doc = "Bit 3 - MDM-AP system reset request"]
330 #[inline]
331 pub fn mdm_ap(&self) -> MDM_APR {
332 MDM_APR::_from({
333 const MASK: bool = true;
334 const OFFSET: u8 = 3;
335 ((self.bits >> OFFSET) & MASK as u8) != 0
336 })
337 }
338 #[doc = "Bit 4 - EzPort Reset"]
339 #[inline]
340 pub fn ezpt(&self) -> EZPTR {
341 EZPTR::_from({
342 const MASK: bool = true;
343 const OFFSET: u8 = 4;
344 ((self.bits >> OFFSET) & MASK as u8) != 0
345 })
346 }
347 #[doc = "Bit 5 - Stop Mode Acknowledge Error Reset"]
348 #[inline]
349 pub fn sackerr(&self) -> SACKERRR {
350 SACKERRR::_from({
351 const MASK: bool = true;
352 const OFFSET: u8 = 5;
353 ((self.bits >> OFFSET) & MASK as u8) != 0
354 })
355 }
356}