1pub type R = crate::R<ICSRrs>;
3pub type W = crate::W<ICSRrs>;
5pub type ALRWF_R = crate::BitReader;
7#[cfg_attr(feature = "defmt", derive(defmt::Format))]
11#[derive(Clone, Copy, Debug, PartialEq, Eq)]
12pub enum WUTWFR {
13 UpdateNotAllowed = 0,
15 UpdateAllowed = 1,
17}
18impl From<WUTWFR> for bool {
19 #[inline(always)]
20 fn from(variant: WUTWFR) -> Self {
21 variant as u8 != 0
22 }
23}
24pub type WUTWF_R = crate::BitReader<WUTWFR>;
26impl WUTWF_R {
27 #[inline(always)]
29 pub const fn variant(&self) -> WUTWFR {
30 match self.bits {
31 false => WUTWFR::UpdateNotAllowed,
32 true => WUTWFR::UpdateAllowed,
33 }
34 }
35 #[inline(always)]
37 pub fn is_update_not_allowed(&self) -> bool {
38 *self == WUTWFR::UpdateNotAllowed
39 }
40 #[inline(always)]
42 pub fn is_update_allowed(&self) -> bool {
43 *self == WUTWFR::UpdateAllowed
44 }
45}
46#[cfg_attr(feature = "defmt", derive(defmt::Format))]
50#[derive(Clone, Copy, Debug, PartialEq, Eq)]
51pub enum SHPFR {
52 NoShiftPending = 0,
54 ShiftPending = 1,
56}
57impl From<SHPFR> for bool {
58 #[inline(always)]
59 fn from(variant: SHPFR) -> Self {
60 variant as u8 != 0
61 }
62}
63pub type SHPF_R = crate::BitReader<SHPFR>;
65impl SHPF_R {
66 #[inline(always)]
68 pub const fn variant(&self) -> SHPFR {
69 match self.bits {
70 false => SHPFR::NoShiftPending,
71 true => SHPFR::ShiftPending,
72 }
73 }
74 #[inline(always)]
76 pub fn is_no_shift_pending(&self) -> bool {
77 *self == SHPFR::NoShiftPending
78 }
79 #[inline(always)]
81 pub fn is_shift_pending(&self) -> bool {
82 *self == SHPFR::ShiftPending
83 }
84}
85pub type SHPF_W<'a, REG> = crate::BitWriter<'a, REG, SHPFR>;
87impl<'a, REG> SHPF_W<'a, REG>
88where
89 REG: crate::Writable + crate::RegisterSpec,
90{
91 #[inline(always)]
93 pub fn no_shift_pending(self) -> &'a mut crate::W<REG> {
94 self.variant(SHPFR::NoShiftPending)
95 }
96 #[inline(always)]
98 pub fn shift_pending(self) -> &'a mut crate::W<REG> {
99 self.variant(SHPFR::ShiftPending)
100 }
101}
102#[cfg_attr(feature = "defmt", derive(defmt::Format))]
106#[derive(Clone, Copy, Debug, PartialEq, Eq)]
107pub enum INITSR {
108 NotInitalized = 0,
110 Initalized = 1,
112}
113impl From<INITSR> for bool {
114 #[inline(always)]
115 fn from(variant: INITSR) -> Self {
116 variant as u8 != 0
117 }
118}
119pub type INITS_R = crate::BitReader<INITSR>;
121impl INITS_R {
122 #[inline(always)]
124 pub const fn variant(&self) -> INITSR {
125 match self.bits {
126 false => INITSR::NotInitalized,
127 true => INITSR::Initalized,
128 }
129 }
130 #[inline(always)]
132 pub fn is_not_initalized(&self) -> bool {
133 *self == INITSR::NotInitalized
134 }
135 #[inline(always)]
137 pub fn is_initalized(&self) -> bool {
138 *self == INITSR::Initalized
139 }
140}
141#[cfg_attr(feature = "defmt", derive(defmt::Format))]
145#[derive(Clone, Copy, Debug, PartialEq, Eq)]
146pub enum RSFR {
147 NotSynced = 0,
149 Synced = 1,
151}
152impl From<RSFR> for bool {
153 #[inline(always)]
154 fn from(variant: RSFR) -> Self {
155 variant as u8 != 0
156 }
157}
158pub type RSF_R = crate::BitReader<RSFR>;
160impl RSF_R {
161 #[inline(always)]
163 pub const fn variant(&self) -> RSFR {
164 match self.bits {
165 false => RSFR::NotSynced,
166 true => RSFR::Synced,
167 }
168 }
169 #[inline(always)]
171 pub fn is_not_synced(&self) -> bool {
172 *self == RSFR::NotSynced
173 }
174 #[inline(always)]
176 pub fn is_synced(&self) -> bool {
177 *self == RSFR::Synced
178 }
179}
180#[cfg_attr(feature = "defmt", derive(defmt::Format))]
184#[derive(Clone, Copy, Debug, PartialEq, Eq)]
185pub enum RSFW {
186 Clear = 0,
188}
189impl From<RSFW> for bool {
190 #[inline(always)]
191 fn from(variant: RSFW) -> Self {
192 variant as u8 != 0
193 }
194}
195pub type RSF_W<'a, REG> = crate::BitWriter0C<'a, REG, RSFW>;
197impl<'a, REG> RSF_W<'a, REG>
198where
199 REG: crate::Writable + crate::RegisterSpec,
200{
201 #[inline(always)]
203 pub fn clear(self) -> &'a mut crate::W<REG> {
204 self.variant(RSFW::Clear)
205 }
206}
207#[cfg_attr(feature = "defmt", derive(defmt::Format))]
211#[derive(Clone, Copy, Debug, PartialEq, Eq)]
212pub enum INITFR {
213 NotAllowed = 0,
215 Allowed = 1,
217}
218impl From<INITFR> for bool {
219 #[inline(always)]
220 fn from(variant: INITFR) -> Self {
221 variant as u8 != 0
222 }
223}
224pub type INITF_R = crate::BitReader<INITFR>;
226impl INITF_R {
227 #[inline(always)]
229 pub const fn variant(&self) -> INITFR {
230 match self.bits {
231 false => INITFR::NotAllowed,
232 true => INITFR::Allowed,
233 }
234 }
235 #[inline(always)]
237 pub fn is_not_allowed(&self) -> bool {
238 *self == INITFR::NotAllowed
239 }
240 #[inline(always)]
242 pub fn is_allowed(&self) -> bool {
243 *self == INITFR::Allowed
244 }
245}
246#[cfg_attr(feature = "defmt", derive(defmt::Format))]
250#[derive(Clone, Copy, Debug, PartialEq, Eq)]
251pub enum INIT {
252 FreeRunningMode = 0,
254 InitMode = 1,
256}
257impl From<INIT> for bool {
258 #[inline(always)]
259 fn from(variant: INIT) -> Self {
260 variant as u8 != 0
261 }
262}
263pub type INIT_R = crate::BitReader<INIT>;
265impl INIT_R {
266 #[inline(always)]
268 pub const fn variant(&self) -> INIT {
269 match self.bits {
270 false => INIT::FreeRunningMode,
271 true => INIT::InitMode,
272 }
273 }
274 #[inline(always)]
276 pub fn is_free_running_mode(&self) -> bool {
277 *self == INIT::FreeRunningMode
278 }
279 #[inline(always)]
281 pub fn is_init_mode(&self) -> bool {
282 *self == INIT::InitMode
283 }
284}
285pub type INIT_W<'a, REG> = crate::BitWriter<'a, REG, INIT>;
287impl<'a, REG> INIT_W<'a, REG>
288where
289 REG: crate::Writable + crate::RegisterSpec,
290{
291 #[inline(always)]
293 pub fn free_running_mode(self) -> &'a mut crate::W<REG> {
294 self.variant(INIT::FreeRunningMode)
295 }
296 #[inline(always)]
298 pub fn init_mode(self) -> &'a mut crate::W<REG> {
299 self.variant(INIT::InitMode)
300 }
301}
302#[cfg_attr(feature = "defmt", derive(defmt::Format))]
306#[derive(Clone, Copy, Debug, PartialEq, Eq)]
307pub enum RECALPFR {
308 Pending = 1,
310}
311impl From<RECALPFR> for bool {
312 #[inline(always)]
313 fn from(variant: RECALPFR) -> Self {
314 variant as u8 != 0
315 }
316}
317pub type RECALPF_R = crate::BitReader<RECALPFR>;
319impl RECALPF_R {
320 #[inline(always)]
322 pub const fn variant(&self) -> Option<RECALPFR> {
323 match self.bits {
324 true => Some(RECALPFR::Pending),
325 _ => None,
326 }
327 }
328 #[inline(always)]
330 pub fn is_pending(&self) -> bool {
331 *self == RECALPFR::Pending
332 }
333}
334impl R {
335 #[inline(always)]
339 pub fn alrwf(&self, n: u8) -> ALRWF_R {
340 #[allow(clippy::no_effect)]
341 [(); 2][n as usize];
342 ALRWF_R::new(((self.bits >> n) & 1) != 0)
343 }
344 #[inline(always)]
347 pub fn alrwf_iter(&self) -> impl Iterator<Item = ALRWF_R> + '_ {
348 (0..2).map(move |n| ALRWF_R::new(((self.bits >> n) & 1) != 0))
349 }
350 #[inline(always)]
352 pub fn alrawf(&self) -> ALRWF_R {
353 ALRWF_R::new((self.bits & 1) != 0)
354 }
355 #[inline(always)]
357 pub fn alrbwf(&self) -> ALRWF_R {
358 ALRWF_R::new(((self.bits >> 1) & 1) != 0)
359 }
360 #[inline(always)]
362 pub fn wutwf(&self) -> WUTWF_R {
363 WUTWF_R::new(((self.bits >> 2) & 1) != 0)
364 }
365 #[inline(always)]
367 pub fn shpf(&self) -> SHPF_R {
368 SHPF_R::new(((self.bits >> 3) & 1) != 0)
369 }
370 #[inline(always)]
372 pub fn inits(&self) -> INITS_R {
373 INITS_R::new(((self.bits >> 4) & 1) != 0)
374 }
375 #[inline(always)]
377 pub fn rsf(&self) -> RSF_R {
378 RSF_R::new(((self.bits >> 5) & 1) != 0)
379 }
380 #[inline(always)]
382 pub fn initf(&self) -> INITF_R {
383 INITF_R::new(((self.bits >> 6) & 1) != 0)
384 }
385 #[inline(always)]
387 pub fn init(&self) -> INIT_R {
388 INIT_R::new(((self.bits >> 7) & 1) != 0)
389 }
390 #[inline(always)]
392 pub fn recalpf(&self) -> RECALPF_R {
393 RECALPF_R::new(((self.bits >> 16) & 1) != 0)
394 }
395}
396impl core::fmt::Debug for R {
397 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
398 f.debug_struct("ICSR")
399 .field("alrawf", &self.alrawf())
400 .field("alrbwf", &self.alrbwf())
401 .field("wutwf", &self.wutwf())
402 .field("shpf", &self.shpf())
403 .field("inits", &self.inits())
404 .field("rsf", &self.rsf())
405 .field("initf", &self.initf())
406 .field("init", &self.init())
407 .field("recalpf", &self.recalpf())
408 .finish()
409 }
410}
411impl W {
412 #[inline(always)]
414 pub fn shpf(&mut self) -> SHPF_W<ICSRrs> {
415 SHPF_W::new(self, 3)
416 }
417 #[inline(always)]
419 pub fn rsf(&mut self) -> RSF_W<ICSRrs> {
420 RSF_W::new(self, 5)
421 }
422 #[inline(always)]
424 pub fn init(&mut self) -> INIT_W<ICSRrs> {
425 INIT_W::new(self, 7)
426 }
427}
428pub struct ICSRrs;
434impl crate::RegisterSpec for ICSRrs {
435 type Ux = u32;
436}
437impl crate::Readable for ICSRrs {}
439impl crate::Writable for ICSRrs {
441 type Safety = crate::Unsafe;
442 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x20;
443}
444impl crate::Resettable for ICSRrs {
446 const RESET_VALUE: u32 = 0x07;
447}