ra2a1/system/
sckdivcr.rs

1#[doc = "Register `SCKDIVCR` reader"]
2pub struct R(crate::R<SCKDIVCR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SCKDIVCR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SCKDIVCR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SCKDIVCR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SCKDIVCR` writer"]
17pub struct W(crate::W<SCKDIVCR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SCKDIVCR_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<SCKDIVCR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SCKDIVCR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PCKD` reader - Peripheral Module Clock D (PCLKD) Select"]
38pub type PCKD_R = crate::FieldReader<u8, PCKD_A>;
39#[doc = "Peripheral Module Clock D (PCLKD) Select\n\nValue on reset: 4"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum PCKD_A {
43    #[doc = "0: /1"]
44    _000 = 0,
45    #[doc = "1: /2"]
46    _001 = 1,
47    #[doc = "2: /4"]
48    _010 = 2,
49    #[doc = "3: /8"]
50    _011 = 3,
51    #[doc = "4: /16"]
52    _100 = 4,
53    #[doc = "5: /32"]
54    _101 = 5,
55    #[doc = "6: /64"]
56    _110 = 6,
57}
58impl From<PCKD_A> for u8 {
59    #[inline(always)]
60    fn from(variant: PCKD_A) -> Self {
61        variant as _
62    }
63}
64impl PCKD_R {
65    #[doc = "Get enumerated values variant"]
66    #[inline(always)]
67    pub fn variant(&self) -> PCKD_A {
68        match self.bits {
69            0 => PCKD_A::_000,
70            1 => PCKD_A::_001,
71            2 => PCKD_A::_010,
72            3 => PCKD_A::_011,
73            4 => PCKD_A::_100,
74            5 => PCKD_A::_101,
75            6 => PCKD_A::_110,
76            _ => unreachable!(),
77        }
78    }
79    #[doc = "Checks if the value of the field is `_000`"]
80    #[inline(always)]
81    pub fn is_000(&self) -> bool {
82        *self == PCKD_A::_000
83    }
84    #[doc = "Checks if the value of the field is `_001`"]
85    #[inline(always)]
86    pub fn is_001(&self) -> bool {
87        *self == PCKD_A::_001
88    }
89    #[doc = "Checks if the value of the field is `_010`"]
90    #[inline(always)]
91    pub fn is_010(&self) -> bool {
92        *self == PCKD_A::_010
93    }
94    #[doc = "Checks if the value of the field is `_011`"]
95    #[inline(always)]
96    pub fn is_011(&self) -> bool {
97        *self == PCKD_A::_011
98    }
99    #[doc = "Checks if the value of the field is `_100`"]
100    #[inline(always)]
101    pub fn is_100(&self) -> bool {
102        *self == PCKD_A::_100
103    }
104    #[doc = "Checks if the value of the field is `_101`"]
105    #[inline(always)]
106    pub fn is_101(&self) -> bool {
107        *self == PCKD_A::_101
108    }
109    #[doc = "Checks if the value of the field is `_110`"]
110    #[inline(always)]
111    pub fn is_110(&self) -> bool {
112        *self == PCKD_A::_110
113    }
114}
115#[doc = "Field `PCKD` writer - Peripheral Module Clock D (PCLKD) Select"]
116pub type PCKD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCKDIVCR_SPEC, u8, PCKD_A, 3, O>;
117impl<'a, const O: u8> PCKD_W<'a, O> {
118    #[doc = "/1"]
119    #[inline(always)]
120    pub fn _000(self) -> &'a mut W {
121        self.variant(PCKD_A::_000)
122    }
123    #[doc = "/2"]
124    #[inline(always)]
125    pub fn _001(self) -> &'a mut W {
126        self.variant(PCKD_A::_001)
127    }
128    #[doc = "/4"]
129    #[inline(always)]
130    pub fn _010(self) -> &'a mut W {
131        self.variant(PCKD_A::_010)
132    }
133    #[doc = "/8"]
134    #[inline(always)]
135    pub fn _011(self) -> &'a mut W {
136        self.variant(PCKD_A::_011)
137    }
138    #[doc = "/16"]
139    #[inline(always)]
140    pub fn _100(self) -> &'a mut W {
141        self.variant(PCKD_A::_100)
142    }
143    #[doc = "/32"]
144    #[inline(always)]
145    pub fn _101(self) -> &'a mut W {
146        self.variant(PCKD_A::_101)
147    }
148    #[doc = "/64"]
149    #[inline(always)]
150    pub fn _110(self) -> &'a mut W {
151        self.variant(PCKD_A::_110)
152    }
153}
154#[doc = "Field `PCKB` reader - Peripheral Module Clock B (PCLKB) Select"]
155pub type PCKB_R = crate::FieldReader<u8, PCKB_A>;
156#[doc = "Peripheral Module Clock B (PCLKB) Select\n\nValue on reset: 4"]
157#[derive(Clone, Copy, Debug, PartialEq, Eq)]
158#[repr(u8)]
159pub enum PCKB_A {
160    #[doc = "0: /1"]
161    _000 = 0,
162    #[doc = "1: /2"]
163    _001 = 1,
164    #[doc = "2: /4"]
165    _010 = 2,
166    #[doc = "3: /8"]
167    _011 = 3,
168    #[doc = "4: /16"]
169    _100 = 4,
170    #[doc = "5: /32"]
171    _101 = 5,
172    #[doc = "6: /64"]
173    _110 = 6,
174}
175impl From<PCKB_A> for u8 {
176    #[inline(always)]
177    fn from(variant: PCKB_A) -> Self {
178        variant as _
179    }
180}
181impl PCKB_R {
182    #[doc = "Get enumerated values variant"]
183    #[inline(always)]
184    pub fn variant(&self) -> PCKB_A {
185        match self.bits {
186            0 => PCKB_A::_000,
187            1 => PCKB_A::_001,
188            2 => PCKB_A::_010,
189            3 => PCKB_A::_011,
190            4 => PCKB_A::_100,
191            5 => PCKB_A::_101,
192            6 => PCKB_A::_110,
193            _ => unreachable!(),
194        }
195    }
196    #[doc = "Checks if the value of the field is `_000`"]
197    #[inline(always)]
198    pub fn is_000(&self) -> bool {
199        *self == PCKB_A::_000
200    }
201    #[doc = "Checks if the value of the field is `_001`"]
202    #[inline(always)]
203    pub fn is_001(&self) -> bool {
204        *self == PCKB_A::_001
205    }
206    #[doc = "Checks if the value of the field is `_010`"]
207    #[inline(always)]
208    pub fn is_010(&self) -> bool {
209        *self == PCKB_A::_010
210    }
211    #[doc = "Checks if the value of the field is `_011`"]
212    #[inline(always)]
213    pub fn is_011(&self) -> bool {
214        *self == PCKB_A::_011
215    }
216    #[doc = "Checks if the value of the field is `_100`"]
217    #[inline(always)]
218    pub fn is_100(&self) -> bool {
219        *self == PCKB_A::_100
220    }
221    #[doc = "Checks if the value of the field is `_101`"]
222    #[inline(always)]
223    pub fn is_101(&self) -> bool {
224        *self == PCKB_A::_101
225    }
226    #[doc = "Checks if the value of the field is `_110`"]
227    #[inline(always)]
228    pub fn is_110(&self) -> bool {
229        *self == PCKB_A::_110
230    }
231}
232#[doc = "Field `PCKB` writer - Peripheral Module Clock B (PCLKB) Select"]
233pub type PCKB_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCKDIVCR_SPEC, u8, PCKB_A, 3, O>;
234impl<'a, const O: u8> PCKB_W<'a, O> {
235    #[doc = "/1"]
236    #[inline(always)]
237    pub fn _000(self) -> &'a mut W {
238        self.variant(PCKB_A::_000)
239    }
240    #[doc = "/2"]
241    #[inline(always)]
242    pub fn _001(self) -> &'a mut W {
243        self.variant(PCKB_A::_001)
244    }
245    #[doc = "/4"]
246    #[inline(always)]
247    pub fn _010(self) -> &'a mut W {
248        self.variant(PCKB_A::_010)
249    }
250    #[doc = "/8"]
251    #[inline(always)]
252    pub fn _011(self) -> &'a mut W {
253        self.variant(PCKB_A::_011)
254    }
255    #[doc = "/16"]
256    #[inline(always)]
257    pub fn _100(self) -> &'a mut W {
258        self.variant(PCKB_A::_100)
259    }
260    #[doc = "/32"]
261    #[inline(always)]
262    pub fn _101(self) -> &'a mut W {
263        self.variant(PCKB_A::_101)
264    }
265    #[doc = "/64"]
266    #[inline(always)]
267    pub fn _110(self) -> &'a mut W {
268        self.variant(PCKB_A::_110)
269    }
270}
271#[doc = "Field `ICK` reader - System Clock (ICLK) Select"]
272pub type ICK_R = crate::FieldReader<u8, ICK_A>;
273#[doc = "System Clock (ICLK) Select\n\nValue on reset: 4"]
274#[derive(Clone, Copy, Debug, PartialEq, Eq)]
275#[repr(u8)]
276pub enum ICK_A {
277    #[doc = "0: /1"]
278    _000 = 0,
279    #[doc = "1: /2"]
280    _001 = 1,
281    #[doc = "2: /4"]
282    _010 = 2,
283    #[doc = "3: /8"]
284    _011 = 3,
285    #[doc = "4: /16"]
286    _100 = 4,
287    #[doc = "5: /32"]
288    _101 = 5,
289    #[doc = "6: /64"]
290    _110 = 6,
291}
292impl From<ICK_A> for u8 {
293    #[inline(always)]
294    fn from(variant: ICK_A) -> Self {
295        variant as _
296    }
297}
298impl ICK_R {
299    #[doc = "Get enumerated values variant"]
300    #[inline(always)]
301    pub fn variant(&self) -> ICK_A {
302        match self.bits {
303            0 => ICK_A::_000,
304            1 => ICK_A::_001,
305            2 => ICK_A::_010,
306            3 => ICK_A::_011,
307            4 => ICK_A::_100,
308            5 => ICK_A::_101,
309            6 => ICK_A::_110,
310            _ => unreachable!(),
311        }
312    }
313    #[doc = "Checks if the value of the field is `_000`"]
314    #[inline(always)]
315    pub fn is_000(&self) -> bool {
316        *self == ICK_A::_000
317    }
318    #[doc = "Checks if the value of the field is `_001`"]
319    #[inline(always)]
320    pub fn is_001(&self) -> bool {
321        *self == ICK_A::_001
322    }
323    #[doc = "Checks if the value of the field is `_010`"]
324    #[inline(always)]
325    pub fn is_010(&self) -> bool {
326        *self == ICK_A::_010
327    }
328    #[doc = "Checks if the value of the field is `_011`"]
329    #[inline(always)]
330    pub fn is_011(&self) -> bool {
331        *self == ICK_A::_011
332    }
333    #[doc = "Checks if the value of the field is `_100`"]
334    #[inline(always)]
335    pub fn is_100(&self) -> bool {
336        *self == ICK_A::_100
337    }
338    #[doc = "Checks if the value of the field is `_101`"]
339    #[inline(always)]
340    pub fn is_101(&self) -> bool {
341        *self == ICK_A::_101
342    }
343    #[doc = "Checks if the value of the field is `_110`"]
344    #[inline(always)]
345    pub fn is_110(&self) -> bool {
346        *self == ICK_A::_110
347    }
348}
349#[doc = "Field `ICK` writer - System Clock (ICLK) Select"]
350pub type ICK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCKDIVCR_SPEC, u8, ICK_A, 3, O>;
351impl<'a, const O: u8> ICK_W<'a, O> {
352    #[doc = "/1"]
353    #[inline(always)]
354    pub fn _000(self) -> &'a mut W {
355        self.variant(ICK_A::_000)
356    }
357    #[doc = "/2"]
358    #[inline(always)]
359    pub fn _001(self) -> &'a mut W {
360        self.variant(ICK_A::_001)
361    }
362    #[doc = "/4"]
363    #[inline(always)]
364    pub fn _010(self) -> &'a mut W {
365        self.variant(ICK_A::_010)
366    }
367    #[doc = "/8"]
368    #[inline(always)]
369    pub fn _011(self) -> &'a mut W {
370        self.variant(ICK_A::_011)
371    }
372    #[doc = "/16"]
373    #[inline(always)]
374    pub fn _100(self) -> &'a mut W {
375        self.variant(ICK_A::_100)
376    }
377    #[doc = "/32"]
378    #[inline(always)]
379    pub fn _101(self) -> &'a mut W {
380        self.variant(ICK_A::_101)
381    }
382    #[doc = "/64"]
383    #[inline(always)]
384    pub fn _110(self) -> &'a mut W {
385        self.variant(ICK_A::_110)
386    }
387}
388#[doc = "Field `FCK` reader - Flash IF Clock (FCLK) Select"]
389pub type FCK_R = crate::FieldReader<u8, FCK_A>;
390#[doc = "Flash IF Clock (FCLK) Select\n\nValue on reset: 4"]
391#[derive(Clone, Copy, Debug, PartialEq, Eq)]
392#[repr(u8)]
393pub enum FCK_A {
394    #[doc = "0: /1"]
395    _000 = 0,
396    #[doc = "1: /2"]
397    _001 = 1,
398    #[doc = "2: /4"]
399    _010 = 2,
400    #[doc = "3: /8"]
401    _011 = 3,
402    #[doc = "4: /16"]
403    _100 = 4,
404    #[doc = "5: /32"]
405    _101 = 5,
406    #[doc = "6: /64"]
407    _110 = 6,
408}
409impl From<FCK_A> for u8 {
410    #[inline(always)]
411    fn from(variant: FCK_A) -> Self {
412        variant as _
413    }
414}
415impl FCK_R {
416    #[doc = "Get enumerated values variant"]
417    #[inline(always)]
418    pub fn variant(&self) -> FCK_A {
419        match self.bits {
420            0 => FCK_A::_000,
421            1 => FCK_A::_001,
422            2 => FCK_A::_010,
423            3 => FCK_A::_011,
424            4 => FCK_A::_100,
425            5 => FCK_A::_101,
426            6 => FCK_A::_110,
427            _ => unreachable!(),
428        }
429    }
430    #[doc = "Checks if the value of the field is `_000`"]
431    #[inline(always)]
432    pub fn is_000(&self) -> bool {
433        *self == FCK_A::_000
434    }
435    #[doc = "Checks if the value of the field is `_001`"]
436    #[inline(always)]
437    pub fn is_001(&self) -> bool {
438        *self == FCK_A::_001
439    }
440    #[doc = "Checks if the value of the field is `_010`"]
441    #[inline(always)]
442    pub fn is_010(&self) -> bool {
443        *self == FCK_A::_010
444    }
445    #[doc = "Checks if the value of the field is `_011`"]
446    #[inline(always)]
447    pub fn is_011(&self) -> bool {
448        *self == FCK_A::_011
449    }
450    #[doc = "Checks if the value of the field is `_100`"]
451    #[inline(always)]
452    pub fn is_100(&self) -> bool {
453        *self == FCK_A::_100
454    }
455    #[doc = "Checks if the value of the field is `_101`"]
456    #[inline(always)]
457    pub fn is_101(&self) -> bool {
458        *self == FCK_A::_101
459    }
460    #[doc = "Checks if the value of the field is `_110`"]
461    #[inline(always)]
462    pub fn is_110(&self) -> bool {
463        *self == FCK_A::_110
464    }
465}
466#[doc = "Field `FCK` writer - Flash IF Clock (FCLK) Select"]
467pub type FCK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCKDIVCR_SPEC, u8, FCK_A, 3, O>;
468impl<'a, const O: u8> FCK_W<'a, O> {
469    #[doc = "/1"]
470    #[inline(always)]
471    pub fn _000(self) -> &'a mut W {
472        self.variant(FCK_A::_000)
473    }
474    #[doc = "/2"]
475    #[inline(always)]
476    pub fn _001(self) -> &'a mut W {
477        self.variant(FCK_A::_001)
478    }
479    #[doc = "/4"]
480    #[inline(always)]
481    pub fn _010(self) -> &'a mut W {
482        self.variant(FCK_A::_010)
483    }
484    #[doc = "/8"]
485    #[inline(always)]
486    pub fn _011(self) -> &'a mut W {
487        self.variant(FCK_A::_011)
488    }
489    #[doc = "/16"]
490    #[inline(always)]
491    pub fn _100(self) -> &'a mut W {
492        self.variant(FCK_A::_100)
493    }
494    #[doc = "/32"]
495    #[inline(always)]
496    pub fn _101(self) -> &'a mut W {
497        self.variant(FCK_A::_101)
498    }
499    #[doc = "/64"]
500    #[inline(always)]
501    pub fn _110(self) -> &'a mut W {
502        self.variant(FCK_A::_110)
503    }
504}
505impl R {
506    #[doc = "Bits 0:2 - Peripheral Module Clock D (PCLKD) Select"]
507    #[inline(always)]
508    pub fn pckd(&self) -> PCKD_R {
509        PCKD_R::new((self.bits & 7) as u8)
510    }
511    #[doc = "Bits 8:10 - Peripheral Module Clock B (PCLKB) Select"]
512    #[inline(always)]
513    pub fn pckb(&self) -> PCKB_R {
514        PCKB_R::new(((self.bits >> 8) & 7) as u8)
515    }
516    #[doc = "Bits 24:26 - System Clock (ICLK) Select"]
517    #[inline(always)]
518    pub fn ick(&self) -> ICK_R {
519        ICK_R::new(((self.bits >> 24) & 7) as u8)
520    }
521    #[doc = "Bits 28:30 - Flash IF Clock (FCLK) Select"]
522    #[inline(always)]
523    pub fn fck(&self) -> FCK_R {
524        FCK_R::new(((self.bits >> 28) & 7) as u8)
525    }
526}
527impl W {
528    #[doc = "Bits 0:2 - Peripheral Module Clock D (PCLKD) Select"]
529    #[inline(always)]
530    #[must_use]
531    pub fn pckd(&mut self) -> PCKD_W<0> {
532        PCKD_W::new(self)
533    }
534    #[doc = "Bits 8:10 - Peripheral Module Clock B (PCLKB) Select"]
535    #[inline(always)]
536    #[must_use]
537    pub fn pckb(&mut self) -> PCKB_W<8> {
538        PCKB_W::new(self)
539    }
540    #[doc = "Bits 24:26 - System Clock (ICLK) Select"]
541    #[inline(always)]
542    #[must_use]
543    pub fn ick(&mut self) -> ICK_W<24> {
544        ICK_W::new(self)
545    }
546    #[doc = "Bits 28:30 - Flash IF Clock (FCLK) Select"]
547    #[inline(always)]
548    #[must_use]
549    pub fn fck(&mut self) -> FCK_W<28> {
550        FCK_W::new(self)
551    }
552    #[doc = "Writes raw bits to the register."]
553    #[inline(always)]
554    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
555        self.0.bits(bits);
556        self
557    }
558}
559#[doc = "System Clock Division Control Register\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 [sckdivcr](index.html) module"]
560pub struct SCKDIVCR_SPEC;
561impl crate::RegisterSpec for SCKDIVCR_SPEC {
562    type Ux = u32;
563}
564#[doc = "`read()` method returns [sckdivcr::R](R) reader structure"]
565impl crate::Readable for SCKDIVCR_SPEC {
566    type Reader = R;
567}
568#[doc = "`write(|w| ..)` method takes [sckdivcr::W](W) writer structure"]
569impl crate::Writable for SCKDIVCR_SPEC {
570    type Writer = W;
571    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
572    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
573}
574#[doc = "`reset()` method sets SCKDIVCR to value 0x4400_0404"]
575impl crate::Resettable for SCKDIVCR_SPEC {
576    const RESET_VALUE: Self::Ux = 0x4400_0404;
577}