atsamd51g/oscctrl/
dfllval.rs
1#[doc = "Register `DFLLVAL` reader"]
2pub type R = crate::R<DfllvalSpec>;
3#[doc = "Register `DFLLVAL` writer"]
4pub type W = crate::W<DfllvalSpec>;
5#[doc = "Field `FINE` reader - Fine Value"]
6pub type FineR = crate::FieldReader;
7#[doc = "Field `FINE` writer - Fine Value"]
8pub type FineW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `COARSE` reader - Coarse Value"]
10pub type CoarseR = crate::FieldReader;
11#[doc = "Field `COARSE` writer - Coarse Value"]
12pub type CoarseW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
13#[doc = "Field `DIFF` reader - Multiplication Ratio Difference"]
14pub type DiffR = crate::FieldReader<u16>;
15#[doc = "Field `DIFF` writer - Multiplication Ratio Difference"]
16pub type DiffW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
17impl R {
18 #[doc = "Bits 0:7 - Fine Value"]
19 #[inline(always)]
20 pub fn fine(&self) -> FineR {
21 FineR::new((self.bits & 0xff) as u8)
22 }
23 #[doc = "Bits 10:15 - Coarse Value"]
24 #[inline(always)]
25 pub fn coarse(&self) -> CoarseR {
26 CoarseR::new(((self.bits >> 10) & 0x3f) as u8)
27 }
28 #[doc = "Bits 16:31 - Multiplication Ratio Difference"]
29 #[inline(always)]
30 pub fn diff(&self) -> DiffR {
31 DiffR::new(((self.bits >> 16) & 0xffff) as u16)
32 }
33}
34impl W {
35 #[doc = "Bits 0:7 - Fine Value"]
36 #[inline(always)]
37 #[must_use]
38 pub fn fine(&mut self) -> FineW<DfllvalSpec> {
39 FineW::new(self, 0)
40 }
41 #[doc = "Bits 10:15 - Coarse Value"]
42 #[inline(always)]
43 #[must_use]
44 pub fn coarse(&mut self) -> CoarseW<DfllvalSpec> {
45 CoarseW::new(self, 10)
46 }
47 #[doc = "Bits 16:31 - Multiplication Ratio Difference"]
48 #[inline(always)]
49 #[must_use]
50 pub fn diff(&mut self) -> DiffW<DfllvalSpec> {
51 DiffW::new(self, 16)
52 }
53}
54#[doc = "DFLL48M Value\n\nYou can [`read`](crate::Reg::read) this register and get [`dfllval::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dfllval::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct DfllvalSpec;
56impl crate::RegisterSpec for DfllvalSpec {
57 type Ux = u32;
58}
59#[doc = "`read()` method returns [`dfllval::R`](R) reader structure"]
60impl crate::Readable for DfllvalSpec {}
61#[doc = "`write(|w| ..)` method takes [`dfllval::W`](W) writer structure"]
62impl crate::Writable for DfllvalSpec {
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 DFLLVAL to value 0"]
68impl crate::Resettable for DfllvalSpec {
69 const RESET_VALUE: u32 = 0;
70}