bl702_pac/rf/
vco.rs

1#[doc = "Register `vco` reader"]
2pub struct R(crate::R<VCO_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<VCO_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<VCO_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<VCO_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `vco` writer"]
17pub struct W(crate::W<VCO_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<VCO_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<VCO_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<VCO_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `vco_short_vbias_filter` reader - "]
38pub type VCO_SHORT_VBIAS_FILTER_R = crate::BitReader<bool>;
39#[doc = "Field `vco_short_vbias_filter` writer - "]
40pub type VCO_SHORT_VBIAS_FILTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO_SPEC, bool, O>;
41#[doc = "Field `vco_short_idac_filter` reader - "]
42pub type VCO_SHORT_IDAC_FILTER_R = crate::BitReader<bool>;
43#[doc = "Field `vco_short_idac_filter` writer - "]
44pub type VCO_SHORT_IDAC_FILTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO_SPEC, bool, O>;
45#[doc = "Field `vco_modcap_sel` reader - "]
46pub type VCO_MODCAP_SEL_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `vco_modcap_sel` writer - "]
48pub type VCO_MODCAP_SEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO_SPEC, u8, u8, 2, O>;
49#[doc = "Field `vco_acal_vref` reader - "]
50pub type VCO_ACAL_VREF_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `vco_acal_vref` writer - "]
52pub type VCO_ACAL_VREF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO_SPEC, u8, u8, 3, O>;
53#[doc = "Field `vco_vbias` reader - "]
54pub type VCO_VBIAS_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `vco_vbias` writer - "]
56pub type VCO_VBIAS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO_SPEC, u8, u8, 2, O>;
57#[doc = "Field `vco_idac_boost` reader - "]
58pub type VCO_IDAC_BOOST_R = crate::BitReader<bool>;
59#[doc = "Field `vco_idac_boost` writer - "]
60pub type VCO_IDAC_BOOST_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO_SPEC, bool, O>;
61#[doc = "Field `vco_ldo_vsel` reader - "]
62pub type VCO_LDO_VSEL_R = crate::FieldReader<u8, u8>;
63#[doc = "Field `vco_ldo_vsel` writer - "]
64pub type VCO_LDO_VSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO_SPEC, u8, u8, 2, O>;
65#[doc = "Field `vco_ldo_bypass` reader - "]
66pub type VCO_LDO_BYPASS_R = crate::BitReader<bool>;
67#[doc = "Field `vco_ldo_bypass` writer - "]
68pub type VCO_LDO_BYPASS_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO_SPEC, bool, O>;
69#[doc = "Field `vco_idac` reader - "]
70pub type VCO_IDAC_R = crate::FieldReader<u8, u8>;
71#[doc = "Field `vco_idac` writer - "]
72pub type VCO_IDAC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO_SPEC, u8, u8, 6, O>;
73#[doc = "Field `vco_idac_hw` reader - "]
74pub type VCO_IDAC_HW_R = crate::FieldReader<u8, u8>;
75#[doc = "Field `vco_idac_hw` writer - "]
76pub type VCO_IDAC_HW_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO_SPEC, u8, u8, 6, O>;
77#[doc = "Field `vco_acal_ud` reader - "]
78pub type VCO_ACAL_UD_R = crate::BitReader<bool>;
79#[doc = "Field `vco_acal_ud` writer - "]
80pub type VCO_ACAL_UD_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO_SPEC, bool, O>;
81impl R {
82    #[doc = "Bit 0"]
83    #[inline(always)]
84    pub fn vco_short_vbias_filter(&self) -> VCO_SHORT_VBIAS_FILTER_R {
85        VCO_SHORT_VBIAS_FILTER_R::new((self.bits & 1) != 0)
86    }
87    #[doc = "Bit 1"]
88    #[inline(always)]
89    pub fn vco_short_idac_filter(&self) -> VCO_SHORT_IDAC_FILTER_R {
90        VCO_SHORT_IDAC_FILTER_R::new(((self.bits >> 1) & 1) != 0)
91    }
92    #[doc = "Bits 2:3"]
93    #[inline(always)]
94    pub fn vco_modcap_sel(&self) -> VCO_MODCAP_SEL_R {
95        VCO_MODCAP_SEL_R::new(((self.bits >> 2) & 3) as u8)
96    }
97    #[doc = "Bits 4:6"]
98    #[inline(always)]
99    pub fn vco_acal_vref(&self) -> VCO_ACAL_VREF_R {
100        VCO_ACAL_VREF_R::new(((self.bits >> 4) & 7) as u8)
101    }
102    #[doc = "Bits 8:9"]
103    #[inline(always)]
104    pub fn vco_vbias(&self) -> VCO_VBIAS_R {
105        VCO_VBIAS_R::new(((self.bits >> 8) & 3) as u8)
106    }
107    #[doc = "Bit 12"]
108    #[inline(always)]
109    pub fn vco_idac_boost(&self) -> VCO_IDAC_BOOST_R {
110        VCO_IDAC_BOOST_R::new(((self.bits >> 12) & 1) != 0)
111    }
112    #[doc = "Bits 13:14"]
113    #[inline(always)]
114    pub fn vco_ldo_vsel(&self) -> VCO_LDO_VSEL_R {
115        VCO_LDO_VSEL_R::new(((self.bits >> 13) & 3) as u8)
116    }
117    #[doc = "Bit 15"]
118    #[inline(always)]
119    pub fn vco_ldo_bypass(&self) -> VCO_LDO_BYPASS_R {
120        VCO_LDO_BYPASS_R::new(((self.bits >> 15) & 1) != 0)
121    }
122    #[doc = "Bits 16:21"]
123    #[inline(always)]
124    pub fn vco_idac(&self) -> VCO_IDAC_R {
125        VCO_IDAC_R::new(((self.bits >> 16) & 0x3f) as u8)
126    }
127    #[doc = "Bits 24:29"]
128    #[inline(always)]
129    pub fn vco_idac_hw(&self) -> VCO_IDAC_HW_R {
130        VCO_IDAC_HW_R::new(((self.bits >> 24) & 0x3f) as u8)
131    }
132    #[doc = "Bit 31"]
133    #[inline(always)]
134    pub fn vco_acal_ud(&self) -> VCO_ACAL_UD_R {
135        VCO_ACAL_UD_R::new(((self.bits >> 31) & 1) != 0)
136    }
137}
138impl W {
139    #[doc = "Bit 0"]
140    #[inline(always)]
141    #[must_use]
142    pub fn vco_short_vbias_filter(&mut self) -> VCO_SHORT_VBIAS_FILTER_W<0> {
143        VCO_SHORT_VBIAS_FILTER_W::new(self)
144    }
145    #[doc = "Bit 1"]
146    #[inline(always)]
147    #[must_use]
148    pub fn vco_short_idac_filter(&mut self) -> VCO_SHORT_IDAC_FILTER_W<1> {
149        VCO_SHORT_IDAC_FILTER_W::new(self)
150    }
151    #[doc = "Bits 2:3"]
152    #[inline(always)]
153    #[must_use]
154    pub fn vco_modcap_sel(&mut self) -> VCO_MODCAP_SEL_W<2> {
155        VCO_MODCAP_SEL_W::new(self)
156    }
157    #[doc = "Bits 4:6"]
158    #[inline(always)]
159    #[must_use]
160    pub fn vco_acal_vref(&mut self) -> VCO_ACAL_VREF_W<4> {
161        VCO_ACAL_VREF_W::new(self)
162    }
163    #[doc = "Bits 8:9"]
164    #[inline(always)]
165    #[must_use]
166    pub fn vco_vbias(&mut self) -> VCO_VBIAS_W<8> {
167        VCO_VBIAS_W::new(self)
168    }
169    #[doc = "Bit 12"]
170    #[inline(always)]
171    #[must_use]
172    pub fn vco_idac_boost(&mut self) -> VCO_IDAC_BOOST_W<12> {
173        VCO_IDAC_BOOST_W::new(self)
174    }
175    #[doc = "Bits 13:14"]
176    #[inline(always)]
177    #[must_use]
178    pub fn vco_ldo_vsel(&mut self) -> VCO_LDO_VSEL_W<13> {
179        VCO_LDO_VSEL_W::new(self)
180    }
181    #[doc = "Bit 15"]
182    #[inline(always)]
183    #[must_use]
184    pub fn vco_ldo_bypass(&mut self) -> VCO_LDO_BYPASS_W<15> {
185        VCO_LDO_BYPASS_W::new(self)
186    }
187    #[doc = "Bits 16:21"]
188    #[inline(always)]
189    #[must_use]
190    pub fn vco_idac(&mut self) -> VCO_IDAC_W<16> {
191        VCO_IDAC_W::new(self)
192    }
193    #[doc = "Bits 24:29"]
194    #[inline(always)]
195    #[must_use]
196    pub fn vco_idac_hw(&mut self) -> VCO_IDAC_HW_W<24> {
197        VCO_IDAC_HW_W::new(self)
198    }
199    #[doc = "Bit 31"]
200    #[inline(always)]
201    #[must_use]
202    pub fn vco_acal_ud(&mut self) -> VCO_ACAL_UD_W<31> {
203        VCO_ACAL_UD_W::new(self)
204    }
205    #[doc = "Writes raw bits to the register."]
206    #[inline(always)]
207    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
208        self.0.bits(bits);
209        self
210    }
211}
212#[doc = "vco.\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 [vco](index.html) module"]
213pub struct VCO_SPEC;
214impl crate::RegisterSpec for VCO_SPEC {
215    type Ux = u32;
216}
217#[doc = "`read()` method returns [vco::R](R) reader structure"]
218impl crate::Readable for VCO_SPEC {
219    type Reader = R;
220}
221#[doc = "`write(|w| ..)` method takes [vco::W](W) writer structure"]
222impl crate::Writable for VCO_SPEC {
223    type Writer = W;
224    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
225    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
226}
227#[doc = "`reset()` method sets vco to value 0"]
228impl crate::Resettable for VCO_SPEC {
229    const RESET_VALUE: Self::Ux = 0;
230}