atsamd51n/oscctrl/
dfllmul.rs
1#[doc = "Register `DFLLMUL` reader"]
2pub type R = crate::R<DfllmulSpec>;
3#[doc = "Register `DFLLMUL` writer"]
4pub type W = crate::W<DfllmulSpec>;
5#[doc = "Field `MUL` reader - DFLL Multiply Factor"]
6pub type MulR = crate::FieldReader<u16>;
7#[doc = "Field `MUL` writer - DFLL Multiply Factor"]
8pub type MulW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `FSTEP` reader - Fine Maximum Step"]
10pub type FstepR = crate::FieldReader;
11#[doc = "Field `FSTEP` writer - Fine Maximum Step"]
12pub type FstepW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `CSTEP` reader - Coarse Maximum Step"]
14pub type CstepR = crate::FieldReader;
15#[doc = "Field `CSTEP` writer - Coarse Maximum Step"]
16pub type CstepW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
17impl R {
18 #[doc = "Bits 0:15 - DFLL Multiply Factor"]
19 #[inline(always)]
20 pub fn mul(&self) -> MulR {
21 MulR::new((self.bits & 0xffff) as u16)
22 }
23 #[doc = "Bits 16:23 - Fine Maximum Step"]
24 #[inline(always)]
25 pub fn fstep(&self) -> FstepR {
26 FstepR::new(((self.bits >> 16) & 0xff) as u8)
27 }
28 #[doc = "Bits 26:31 - Coarse Maximum Step"]
29 #[inline(always)]
30 pub fn cstep(&self) -> CstepR {
31 CstepR::new(((self.bits >> 26) & 0x3f) as u8)
32 }
33}
34impl W {
35 #[doc = "Bits 0:15 - DFLL Multiply Factor"]
36 #[inline(always)]
37 #[must_use]
38 pub fn mul(&mut self) -> MulW<DfllmulSpec> {
39 MulW::new(self, 0)
40 }
41 #[doc = "Bits 16:23 - Fine Maximum Step"]
42 #[inline(always)]
43 #[must_use]
44 pub fn fstep(&mut self) -> FstepW<DfllmulSpec> {
45 FstepW::new(self, 16)
46 }
47 #[doc = "Bits 26:31 - Coarse Maximum Step"]
48 #[inline(always)]
49 #[must_use]
50 pub fn cstep(&mut self) -> CstepW<DfllmulSpec> {
51 CstepW::new(self, 26)
52 }
53}
54#[doc = "DFLL48M Multiplier\n\nYou can [`read`](crate::Reg::read) this register and get [`dfllmul::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dfllmul::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct DfllmulSpec;
56impl crate::RegisterSpec for DfllmulSpec {
57 type Ux = u32;
58}
59#[doc = "`read()` method returns [`dfllmul::R`](R) reader structure"]
60impl crate::Readable for DfllmulSpec {}
61#[doc = "`write(|w| ..)` method takes [`dfllmul::W`](W) writer structure"]
62impl crate::Writable for DfllmulSpec {
63 type Safety = crate::Unsafe;
64 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets DFLLMUL to value 0"]
68impl crate::Resettable for DfllmulSpec {
69 const RESET_VALUE: u32 = 0;
70}