1#[doc = "Register `fcal` reader"]
2pub struct R(crate::R<FCAL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<FCAL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<FCAL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<FCAL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `fcal` writer"]
17pub struct W(crate::W<FCAL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<FCAL_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<FCAL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<FCAL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `fcal_div_ratio_adj_en` reader - "]
38pub type FCAL_DIV_RATIO_ADJ_EN_R = crate::BitReader<bool>;
39#[doc = "Field `fcal_div_ratio_adj_en` writer - "]
40pub type FCAL_DIV_RATIO_ADJ_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCAL_SPEC, bool, O>;
41#[doc = "Field `fcal_coarse_pha_threshold` reader - "]
42pub type FCAL_COARSE_PHA_THRESHOLD_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `fcal_coarse_pha_threshold` writer - "]
44pub type FCAL_COARSE_PHA_THRESHOLD_W<'a, const O: u8> =
45 crate::FieldWriter<'a, u32, FCAL_SPEC, u8, u8, 2, O>;
46#[doc = "Field `fcal_mom_toggle_cnt` reader - "]
47pub type FCAL_MOM_TOGGLE_CNT_R = crate::BitReader<bool>;
48#[doc = "Field `fcal_mom_toggle_cnt` writer - "]
49pub type FCAL_MOM_TOGGLE_CNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCAL_SPEC, bool, O>;
50#[doc = "Field `fcal_clk_period` reader - "]
51pub type FCAL_CLK_PERIOD_R = crate::FieldReader<u8, u8>;
52#[doc = "Field `fcal_clk_period` writer - "]
53pub type FCAL_CLK_PERIOD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCAL_SPEC, u8, u8, 2, O>;
54#[doc = "Field `fcal_mode` reader - "]
55pub type FCAL_MODE_R = crate::FieldReader<u8, u8>;
56#[doc = "Field `fcal_mode` writer - "]
57pub type FCAL_MODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCAL_SPEC, u8, u8, 2, O>;
58#[doc = "Field `fcal_mom_ini_ext` reader - "]
59pub type FCAL_MOM_INI_EXT_R = crate::FieldReader<u8, u8>;
60#[doc = "Field `fcal_mom_ini_ext` writer - "]
61pub type FCAL_MOM_INI_EXT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCAL_SPEC, u8, u8, 8, O>;
62impl R {
63 #[doc = "Bit 0"]
64 #[inline(always)]
65 pub fn fcal_div_ratio_adj_en(&self) -> FCAL_DIV_RATIO_ADJ_EN_R {
66 FCAL_DIV_RATIO_ADJ_EN_R::new((self.bits & 1) != 0)
67 }
68 #[doc = "Bits 1:2"]
69 #[inline(always)]
70 pub fn fcal_coarse_pha_threshold(&self) -> FCAL_COARSE_PHA_THRESHOLD_R {
71 FCAL_COARSE_PHA_THRESHOLD_R::new(((self.bits >> 1) & 3) as u8)
72 }
73 #[doc = "Bit 3"]
74 #[inline(always)]
75 pub fn fcal_mom_toggle_cnt(&self) -> FCAL_MOM_TOGGLE_CNT_R {
76 FCAL_MOM_TOGGLE_CNT_R::new(((self.bits >> 3) & 1) != 0)
77 }
78 #[doc = "Bits 4:5"]
79 #[inline(always)]
80 pub fn fcal_clk_period(&self) -> FCAL_CLK_PERIOD_R {
81 FCAL_CLK_PERIOD_R::new(((self.bits >> 4) & 3) as u8)
82 }
83 #[doc = "Bits 6:7"]
84 #[inline(always)]
85 pub fn fcal_mode(&self) -> FCAL_MODE_R {
86 FCAL_MODE_R::new(((self.bits >> 6) & 3) as u8)
87 }
88 #[doc = "Bits 16:23"]
89 #[inline(always)]
90 pub fn fcal_mom_ini_ext(&self) -> FCAL_MOM_INI_EXT_R {
91 FCAL_MOM_INI_EXT_R::new(((self.bits >> 16) & 0xff) as u8)
92 }
93}
94impl W {
95 #[doc = "Bit 0"]
96 #[inline(always)]
97 #[must_use]
98 pub fn fcal_div_ratio_adj_en(&mut self) -> FCAL_DIV_RATIO_ADJ_EN_W<0> {
99 FCAL_DIV_RATIO_ADJ_EN_W::new(self)
100 }
101 #[doc = "Bits 1:2"]
102 #[inline(always)]
103 #[must_use]
104 pub fn fcal_coarse_pha_threshold(&mut self) -> FCAL_COARSE_PHA_THRESHOLD_W<1> {
105 FCAL_COARSE_PHA_THRESHOLD_W::new(self)
106 }
107 #[doc = "Bit 3"]
108 #[inline(always)]
109 #[must_use]
110 pub fn fcal_mom_toggle_cnt(&mut self) -> FCAL_MOM_TOGGLE_CNT_W<3> {
111 FCAL_MOM_TOGGLE_CNT_W::new(self)
112 }
113 #[doc = "Bits 4:5"]
114 #[inline(always)]
115 #[must_use]
116 pub fn fcal_clk_period(&mut self) -> FCAL_CLK_PERIOD_W<4> {
117 FCAL_CLK_PERIOD_W::new(self)
118 }
119 #[doc = "Bits 6:7"]
120 #[inline(always)]
121 #[must_use]
122 pub fn fcal_mode(&mut self) -> FCAL_MODE_W<6> {
123 FCAL_MODE_W::new(self)
124 }
125 #[doc = "Bits 16:23"]
126 #[inline(always)]
127 #[must_use]
128 pub fn fcal_mom_ini_ext(&mut self) -> FCAL_MOM_INI_EXT_W<16> {
129 FCAL_MOM_INI_EXT_W::new(self)
130 }
131 #[doc = "Writes raw bits to the register."]
132 #[inline(always)]
133 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
134 self.0.bits(bits);
135 self
136 }
137}
138#[doc = "fcal.\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 [fcal](index.html) module"]
139pub struct FCAL_SPEC;
140impl crate::RegisterSpec for FCAL_SPEC {
141 type Ux = u32;
142}
143#[doc = "`read()` method returns [fcal::R](R) reader structure"]
144impl crate::Readable for FCAL_SPEC {
145 type Reader = R;
146}
147#[doc = "`write(|w| ..)` method takes [fcal::W](W) writer structure"]
148impl crate::Writable for FCAL_SPEC {
149 type Writer = W;
150 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
151 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
152}
153#[doc = "`reset()` method sets fcal to value 0"]
154impl crate::Resettable for FCAL_SPEC {
155 const RESET_VALUE: Self::Ux = 0;
156}