atsamd51g/oscctrl/dpll/
dpllratio.rs

1#[doc = "Register `DPLLRATIO` reader"]
2pub type R = crate::R<DpllratioSpec>;
3#[doc = "Register `DPLLRATIO` writer"]
4pub type W = crate::W<DpllratioSpec>;
5#[doc = "Field `LDR` reader - Loop Divider Ratio"]
6pub type LdrR = crate::FieldReader<u16>;
7#[doc = "Field `LDR` writer - Loop Divider Ratio"]
8pub type LdrW<'a, REG> = crate::FieldWriter<'a, REG, 13, u16>;
9#[doc = "Field `LDRFRAC` reader - Loop Divider Ratio Fractional Part"]
10pub type LdrfracR = crate::FieldReader;
11#[doc = "Field `LDRFRAC` writer - Loop Divider Ratio Fractional Part"]
12pub type LdrfracW<'a, REG> = crate::FieldWriter<'a, REG, 5>;
13impl R {
14    #[doc = "Bits 0:12 - Loop Divider Ratio"]
15    #[inline(always)]
16    pub fn ldr(&self) -> LdrR {
17        LdrR::new((self.bits & 0x1fff) as u16)
18    }
19    #[doc = "Bits 16:20 - Loop Divider Ratio Fractional Part"]
20    #[inline(always)]
21    pub fn ldrfrac(&self) -> LdrfracR {
22        LdrfracR::new(((self.bits >> 16) & 0x1f) as u8)
23    }
24}
25impl W {
26    #[doc = "Bits 0:12 - Loop Divider Ratio"]
27    #[inline(always)]
28    #[must_use]
29    pub fn ldr(&mut self) -> LdrW<DpllratioSpec> {
30        LdrW::new(self, 0)
31    }
32    #[doc = "Bits 16:20 - Loop Divider Ratio Fractional Part"]
33    #[inline(always)]
34    #[must_use]
35    pub fn ldrfrac(&mut self) -> LdrfracW<DpllratioSpec> {
36        LdrfracW::new(self, 16)
37    }
38}
39#[doc = "DPLL Ratio Control\n\nYou can [`read`](crate::Reg::read) this register and get [`dpllratio::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dpllratio::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct DpllratioSpec;
41impl crate::RegisterSpec for DpllratioSpec {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [`dpllratio::R`](R) reader structure"]
45impl crate::Readable for DpllratioSpec {}
46#[doc = "`write(|w| ..)` method takes [`dpllratio::W`](W) writer structure"]
47impl crate::Writable for DpllratioSpec {
48    type Safety = crate::Unsafe;
49    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets DPLLRATIO to value 0"]
53impl crate::Resettable for DpllratioSpec {
54    const RESET_VALUE: u32 = 0;
55}