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}
85#[cfg_attr(feature = "defmt", derive(defmt::Format))]
89#[derive(Clone, Copy, Debug, PartialEq, Eq)]
90pub enum INITSR {
91 NotInitalized = 0,
93 Initalized = 1,
95}
96impl From<INITSR> for bool {
97 #[inline(always)]
98 fn from(variant: INITSR) -> Self {
99 variant as u8 != 0
100 }
101}
102pub type INITS_R = crate::BitReader<INITSR>;
104impl INITS_R {
105 #[inline(always)]
107 pub const fn variant(&self) -> INITSR {
108 match self.bits {
109 false => INITSR::NotInitalized,
110 true => INITSR::Initalized,
111 }
112 }
113 #[inline(always)]
115 pub fn is_not_initalized(&self) -> bool {
116 *self == INITSR::NotInitalized
117 }
118 #[inline(always)]
120 pub fn is_initalized(&self) -> bool {
121 *self == INITSR::Initalized
122 }
123}
124#[cfg_attr(feature = "defmt", derive(defmt::Format))]
128#[derive(Clone, Copy, Debug, PartialEq, Eq)]
129pub enum RSFR {
130 NotSynced = 0,
132 Synced = 1,
134}
135impl From<RSFR> for bool {
136 #[inline(always)]
137 fn from(variant: RSFR) -> Self {
138 variant as u8 != 0
139 }
140}
141pub type RSF_R = crate::BitReader<RSFR>;
143impl RSF_R {
144 #[inline(always)]
146 pub const fn variant(&self) -> RSFR {
147 match self.bits {
148 false => RSFR::NotSynced,
149 true => RSFR::Synced,
150 }
151 }
152 #[inline(always)]
154 pub fn is_not_synced(&self) -> bool {
155 *self == RSFR::NotSynced
156 }
157 #[inline(always)]
159 pub fn is_synced(&self) -> bool {
160 *self == RSFR::Synced
161 }
162}
163#[cfg_attr(feature = "defmt", derive(defmt::Format))]
167#[derive(Clone, Copy, Debug, PartialEq, Eq)]
168pub enum RSFW {
169 Clear = 0,
171}
172impl From<RSFW> for bool {
173 #[inline(always)]
174 fn from(variant: RSFW) -> Self {
175 variant as u8 != 0
176 }
177}
178pub type RSF_W<'a, REG> = crate::BitWriter0C<'a, REG, RSFW>;
180impl<'a, REG> RSF_W<'a, REG>
181where
182 REG: crate::Writable + crate::RegisterSpec,
183{
184 #[inline(always)]
186 pub fn clear(self) -> &'a mut crate::W<REG> {
187 self.variant(RSFW::Clear)
188 }
189}
190#[cfg_attr(feature = "defmt", derive(defmt::Format))]
194#[derive(Clone, Copy, Debug, PartialEq, Eq)]
195pub enum INITFR {
196 NotAllowed = 0,
198 Allowed = 1,
200}
201impl From<INITFR> for bool {
202 #[inline(always)]
203 fn from(variant: INITFR) -> Self {
204 variant as u8 != 0
205 }
206}
207pub type INITF_R = crate::BitReader<INITFR>;
209impl INITF_R {
210 #[inline(always)]
212 pub const fn variant(&self) -> INITFR {
213 match self.bits {
214 false => INITFR::NotAllowed,
215 true => INITFR::Allowed,
216 }
217 }
218 #[inline(always)]
220 pub fn is_not_allowed(&self) -> bool {
221 *self == INITFR::NotAllowed
222 }
223 #[inline(always)]
225 pub fn is_allowed(&self) -> bool {
226 *self == INITFR::Allowed
227 }
228}
229#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum INIT {
235 FreeRunningMode = 0,
237 InitMode = 1,
239}
240impl From<INIT> for bool {
241 #[inline(always)]
242 fn from(variant: INIT) -> Self {
243 variant as u8 != 0
244 }
245}
246pub type INIT_R = crate::BitReader<INIT>;
248impl INIT_R {
249 #[inline(always)]
251 pub const fn variant(&self) -> INIT {
252 match self.bits {
253 false => INIT::FreeRunningMode,
254 true => INIT::InitMode,
255 }
256 }
257 #[inline(always)]
259 pub fn is_free_running_mode(&self) -> bool {
260 *self == INIT::FreeRunningMode
261 }
262 #[inline(always)]
264 pub fn is_init_mode(&self) -> bool {
265 *self == INIT::InitMode
266 }
267}
268pub type INIT_W<'a, REG> = crate::BitWriter<'a, REG, INIT>;
270impl<'a, REG> INIT_W<'a, REG>
271where
272 REG: crate::Writable + crate::RegisterSpec,
273{
274 #[inline(always)]
276 pub fn free_running_mode(self) -> &'a mut crate::W<REG> {
277 self.variant(INIT::FreeRunningMode)
278 }
279 #[inline(always)]
281 pub fn init_mode(self) -> &'a mut crate::W<REG> {
282 self.variant(INIT::InitMode)
283 }
284}
285#[cfg_attr(feature = "defmt", derive(defmt::Format))]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290pub enum RECALPFR {
291 Pending = 1,
293}
294impl From<RECALPFR> for bool {
295 #[inline(always)]
296 fn from(variant: RECALPFR) -> Self {
297 variant as u8 != 0
298 }
299}
300pub type RECALPF_R = crate::BitReader<RECALPFR>;
302impl RECALPF_R {
303 #[inline(always)]
305 pub const fn variant(&self) -> Option<RECALPFR> {
306 match self.bits {
307 true => Some(RECALPFR::Pending),
308 _ => None,
309 }
310 }
311 #[inline(always)]
313 pub fn is_pending(&self) -> bool {
314 *self == RECALPFR::Pending
315 }
316}
317impl R {
318 #[inline(always)]
322 pub fn alrwf(&self, n: u8) -> ALRWF_R {
323 #[allow(clippy::no_effect)]
324 [(); 2][n as usize];
325 ALRWF_R::new(((self.bits >> n) & 1) != 0)
326 }
327 #[inline(always)]
330 pub fn alrwf_iter(&self) -> impl Iterator<Item = ALRWF_R> + '_ {
331 (0..2).map(move |n| ALRWF_R::new(((self.bits >> n) & 1) != 0))
332 }
333 #[inline(always)]
335 pub fn alrawf(&self) -> ALRWF_R {
336 ALRWF_R::new((self.bits & 1) != 0)
337 }
338 #[inline(always)]
340 pub fn alrbwf(&self) -> ALRWF_R {
341 ALRWF_R::new(((self.bits >> 1) & 1) != 0)
342 }
343 #[inline(always)]
345 pub fn wutwf(&self) -> WUTWF_R {
346 WUTWF_R::new(((self.bits >> 2) & 1) != 0)
347 }
348 #[inline(always)]
350 pub fn shpf(&self) -> SHPF_R {
351 SHPF_R::new(((self.bits >> 3) & 1) != 0)
352 }
353 #[inline(always)]
355 pub fn inits(&self) -> INITS_R {
356 INITS_R::new(((self.bits >> 4) & 1) != 0)
357 }
358 #[inline(always)]
360 pub fn rsf(&self) -> RSF_R {
361 RSF_R::new(((self.bits >> 5) & 1) != 0)
362 }
363 #[inline(always)]
365 pub fn initf(&self) -> INITF_R {
366 INITF_R::new(((self.bits >> 6) & 1) != 0)
367 }
368 #[inline(always)]
370 pub fn init(&self) -> INIT_R {
371 INIT_R::new(((self.bits >> 7) & 1) != 0)
372 }
373 #[inline(always)]
375 pub fn recalpf(&self) -> RECALPF_R {
376 RECALPF_R::new(((self.bits >> 16) & 1) != 0)
377 }
378}
379impl core::fmt::Debug for R {
380 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
381 f.debug_struct("ICSR")
382 .field("alrawf", &self.alrawf())
383 .field("alrbwf", &self.alrbwf())
384 .field("wutwf", &self.wutwf())
385 .field("shpf", &self.shpf())
386 .field("inits", &self.inits())
387 .field("rsf", &self.rsf())
388 .field("initf", &self.initf())
389 .field("init", &self.init())
390 .field("recalpf", &self.recalpf())
391 .finish()
392 }
393}
394impl W {
395 #[inline(always)]
397 pub fn rsf(&mut self) -> RSF_W<ICSRrs> {
398 RSF_W::new(self, 5)
399 }
400 #[inline(always)]
402 pub fn init(&mut self) -> INIT_W<ICSRrs> {
403 INIT_W::new(self, 7)
404 }
405}
406pub struct ICSRrs;
412impl crate::RegisterSpec for ICSRrs {
413 type Ux = u32;
414}
415impl crate::Readable for ICSRrs {}
417impl crate::Writable for ICSRrs {
419 type Safety = crate::Unsafe;
420 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x20;
421}
422impl crate::Resettable for ICSRrs {
424 const RESET_VALUE: u32 = 0x07;
425}