atsaml21j18a/oscctrl/
dfllval.rs1#[doc = "Register `DFLLVAL` reader"]
2pub struct R(crate::R<DFLLVAL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<DFLLVAL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<DFLLVAL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<DFLLVAL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `DFLLVAL` writer"]
17pub struct W(crate::W<DFLLVAL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<DFLLVAL_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<DFLLVAL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<DFLLVAL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `FINE` reader - Fine Value"]
38pub type FINE_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `FINE` writer - Fine Value"]
40pub type FINE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DFLLVAL_SPEC, u16, u16, 10, O>;
41#[doc = "Field `COARSE` reader - Coarse Value"]
42pub type COARSE_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `COARSE` writer - Coarse Value"]
44pub type COARSE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DFLLVAL_SPEC, u8, u8, 6, O>;
45#[doc = "Field `DIFF` reader - Multiplication Ratio Difference"]
46pub type DIFF_R = crate::FieldReader<u16, u16>;
47impl R {
48 #[doc = "Bits 0:9 - Fine Value"]
49 #[inline(always)]
50 pub fn fine(&self) -> FINE_R {
51 FINE_R::new((self.bits & 0x03ff) as u16)
52 }
53 #[doc = "Bits 10:15 - Coarse Value"]
54 #[inline(always)]
55 pub fn coarse(&self) -> COARSE_R {
56 COARSE_R::new(((self.bits >> 10) & 0x3f) as u8)
57 }
58 #[doc = "Bits 16:31 - Multiplication Ratio Difference"]
59 #[inline(always)]
60 pub fn diff(&self) -> DIFF_R {
61 DIFF_R::new(((self.bits >> 16) & 0xffff) as u16)
62 }
63}
64impl W {
65 #[doc = "Bits 0:9 - Fine Value"]
66 #[inline(always)]
67 #[must_use]
68 pub fn fine(&mut self) -> FINE_W<0> {
69 FINE_W::new(self)
70 }
71 #[doc = "Bits 10:15 - Coarse Value"]
72 #[inline(always)]
73 #[must_use]
74 pub fn coarse(&mut self) -> COARSE_W<10> {
75 COARSE_W::new(self)
76 }
77 #[doc = "Writes raw bits to the register."]
78 #[inline(always)]
79 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
80 self.0.bits(bits);
81 self
82 }
83}
84#[doc = "DFLL48M Value\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 [dfllval](index.html) module"]
85pub struct DFLLVAL_SPEC;
86impl crate::RegisterSpec for DFLLVAL_SPEC {
87 type Ux = u32;
88}
89#[doc = "`read()` method returns [dfllval::R](R) reader structure"]
90impl crate::Readable for DFLLVAL_SPEC {
91 type Reader = R;
92}
93#[doc = "`write(|w| ..)` method takes [dfllval::W](W) writer structure"]
94impl crate::Writable for DFLLVAL_SPEC {
95 type Writer = W;
96 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
97 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
98}
99#[doc = "`reset()` method sets DFLLVAL to value 0"]
100impl crate::Resettable for DFLLVAL_SPEC {
101 const RESET_VALUE: Self::Ux = 0;
102}