atsamd11d/sysctrl/
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<u16>;
7#[doc = "Field `FINE` writer - Fine Value"]
8pub type FineW<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
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>;
15impl R {
16    #[doc = "Bits 0:9 - Fine Value"]
17    #[inline(always)]
18    pub fn fine(&self) -> FineR {
19        FineR::new((self.bits & 0x03ff) as u16)
20    }
21    #[doc = "Bits 10:15 - Coarse Value"]
22    #[inline(always)]
23    pub fn coarse(&self) -> CoarseR {
24        CoarseR::new(((self.bits >> 10) & 0x3f) as u8)
25    }
26    #[doc = "Bits 16:31 - Multiplication Ratio Difference"]
27    #[inline(always)]
28    pub fn diff(&self) -> DiffR {
29        DiffR::new(((self.bits >> 16) & 0xffff) as u16)
30    }
31}
32impl W {
33    #[doc = "Bits 0:9 - Fine Value"]
34    #[inline(always)]
35    #[must_use]
36    pub fn fine(&mut self) -> FineW<DfllvalSpec> {
37        FineW::new(self, 0)
38    }
39    #[doc = "Bits 10:15 - Coarse Value"]
40    #[inline(always)]
41    #[must_use]
42    pub fn coarse(&mut self) -> CoarseW<DfllvalSpec> {
43        CoarseW::new(self, 10)
44    }
45}
46#[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)."]
47pub struct DfllvalSpec;
48impl crate::RegisterSpec for DfllvalSpec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`dfllval::R`](R) reader structure"]
52impl crate::Readable for DfllvalSpec {}
53#[doc = "`write(|w| ..)` method takes [`dfllval::W`](W) writer structure"]
54impl crate::Writable for DfllvalSpec {
55    type Safety = crate::Unsafe;
56    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
57    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
58}
59#[doc = "`reset()` method sets DFLLVAL to value 0"]
60impl crate::Resettable for DfllvalSpec {
61    const RESET_VALUE: u32 = 0;
62}