bl602_pac/rf/
vco2.rs

1#[doc = "Register `vco2` reader"]
2pub struct R(crate::R<VCO2_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<VCO2_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<VCO2_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<VCO2_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `vco2` writer"]
17pub struct W(crate::W<VCO2_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<VCO2_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<VCO2_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<VCO2_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `lo_vco_vbias_cw` reader - "]
38pub type LO_VCO_VBIAS_CW_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `lo_vco_vbias_cw` writer - "]
40pub type LO_VCO_VBIAS_CW_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO2_SPEC, u8, u8, 2, O>;
41#[doc = "Field `lo_vco_idac_boot` reader - "]
42pub type LO_VCO_IDAC_BOOT_R = crate::BitReader<bool>;
43#[doc = "Field `lo_vco_idac_boot` writer - "]
44pub type LO_VCO_IDAC_BOOT_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO2_SPEC, bool, O>;
45#[doc = "Field `lo_vco_short_vbias_filter` reader - "]
46pub type LO_VCO_SHORT_VBIAS_FILTER_R = crate::BitReader<bool>;
47#[doc = "Field `lo_vco_short_vbias_filter` writer - "]
48pub type LO_VCO_SHORT_VBIAS_FILTER_W<'a, const O: u8> =
49    crate::BitWriter<'a, u32, VCO2_SPEC, bool, O>;
50#[doc = "Field `lo_vco_short_idac_filter` reader - "]
51pub type LO_VCO_SHORT_IDAC_FILTER_R = crate::BitReader<bool>;
52#[doc = "Field `lo_vco_short_idac_filter` writer - "]
53pub type LO_VCO_SHORT_IDAC_FILTER_W<'a, const O: u8> =
54    crate::BitWriter<'a, u32, VCO2_SPEC, bool, O>;
55#[doc = "Field `acal_vref_cw` reader - "]
56pub type ACAL_VREF_CW_R = crate::FieldReader<u8, u8>;
57#[doc = "Field `acal_vref_cw` writer - "]
58pub type ACAL_VREF_CW_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VCO2_SPEC, u8, u8, 3, O>;
59#[doc = "Field `acal_vco_ud` reader - "]
60pub type ACAL_VCO_UD_R = crate::BitReader<bool>;
61#[doc = "Field `acal_vco_ud` writer - "]
62pub type ACAL_VCO_UD_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO2_SPEC, bool, O>;
63#[doc = "Field `acal_inc_en_hw` reader - "]
64pub type ACAL_INC_EN_HW_R = crate::BitReader<bool>;
65#[doc = "Field `acal_inc_en_hw` writer - "]
66pub type ACAL_INC_EN_HW_W<'a, const O: u8> = crate::BitWriter<'a, u32, VCO2_SPEC, bool, O>;
67impl R {
68    #[doc = "Bits 0:1"]
69    #[inline(always)]
70    pub fn lo_vco_vbias_cw(&self) -> LO_VCO_VBIAS_CW_R {
71        LO_VCO_VBIAS_CW_R::new((self.bits & 3) as u8)
72    }
73    #[doc = "Bit 4"]
74    #[inline(always)]
75    pub fn lo_vco_idac_boot(&self) -> LO_VCO_IDAC_BOOT_R {
76        LO_VCO_IDAC_BOOT_R::new(((self.bits >> 4) & 1) != 0)
77    }
78    #[doc = "Bit 5"]
79    #[inline(always)]
80    pub fn lo_vco_short_vbias_filter(&self) -> LO_VCO_SHORT_VBIAS_FILTER_R {
81        LO_VCO_SHORT_VBIAS_FILTER_R::new(((self.bits >> 5) & 1) != 0)
82    }
83    #[doc = "Bit 6"]
84    #[inline(always)]
85    pub fn lo_vco_short_idac_filter(&self) -> LO_VCO_SHORT_IDAC_FILTER_R {
86        LO_VCO_SHORT_IDAC_FILTER_R::new(((self.bits >> 6) & 1) != 0)
87    }
88    #[doc = "Bits 8:10"]
89    #[inline(always)]
90    pub fn acal_vref_cw(&self) -> ACAL_VREF_CW_R {
91        ACAL_VREF_CW_R::new(((self.bits >> 8) & 7) as u8)
92    }
93    #[doc = "Bit 12"]
94    #[inline(always)]
95    pub fn acal_vco_ud(&self) -> ACAL_VCO_UD_R {
96        ACAL_VCO_UD_R::new(((self.bits >> 12) & 1) != 0)
97    }
98    #[doc = "Bit 16"]
99    #[inline(always)]
100    pub fn acal_inc_en_hw(&self) -> ACAL_INC_EN_HW_R {
101        ACAL_INC_EN_HW_R::new(((self.bits >> 16) & 1) != 0)
102    }
103}
104impl W {
105    #[doc = "Bits 0:1"]
106    #[inline(always)]
107    #[must_use]
108    pub fn lo_vco_vbias_cw(&mut self) -> LO_VCO_VBIAS_CW_W<0> {
109        LO_VCO_VBIAS_CW_W::new(self)
110    }
111    #[doc = "Bit 4"]
112    #[inline(always)]
113    #[must_use]
114    pub fn lo_vco_idac_boot(&mut self) -> LO_VCO_IDAC_BOOT_W<4> {
115        LO_VCO_IDAC_BOOT_W::new(self)
116    }
117    #[doc = "Bit 5"]
118    #[inline(always)]
119    #[must_use]
120    pub fn lo_vco_short_vbias_filter(&mut self) -> LO_VCO_SHORT_VBIAS_FILTER_W<5> {
121        LO_VCO_SHORT_VBIAS_FILTER_W::new(self)
122    }
123    #[doc = "Bit 6"]
124    #[inline(always)]
125    #[must_use]
126    pub fn lo_vco_short_idac_filter(&mut self) -> LO_VCO_SHORT_IDAC_FILTER_W<6> {
127        LO_VCO_SHORT_IDAC_FILTER_W::new(self)
128    }
129    #[doc = "Bits 8:10"]
130    #[inline(always)]
131    #[must_use]
132    pub fn acal_vref_cw(&mut self) -> ACAL_VREF_CW_W<8> {
133        ACAL_VREF_CW_W::new(self)
134    }
135    #[doc = "Bit 12"]
136    #[inline(always)]
137    #[must_use]
138    pub fn acal_vco_ud(&mut self) -> ACAL_VCO_UD_W<12> {
139        ACAL_VCO_UD_W::new(self)
140    }
141    #[doc = "Bit 16"]
142    #[inline(always)]
143    #[must_use]
144    pub fn acal_inc_en_hw(&mut self) -> ACAL_INC_EN_HW_W<16> {
145        ACAL_INC_EN_HW_W::new(self)
146    }
147    #[doc = "Writes raw bits to the register."]
148    #[inline(always)]
149    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
150        self.0.bits(bits);
151        self
152    }
153}
154#[doc = "vco2.\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 [vco2](index.html) module"]
155pub struct VCO2_SPEC;
156impl crate::RegisterSpec for VCO2_SPEC {
157    type Ux = u32;
158}
159#[doc = "`read()` method returns [vco2::R](R) reader structure"]
160impl crate::Readable for VCO2_SPEC {
161    type Reader = R;
162}
163#[doc = "`write(|w| ..)` method takes [vco2::W](W) writer structure"]
164impl crate::Writable for VCO2_SPEC {
165    type Writer = W;
166    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
167    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
168}
169#[doc = "`reset()` method sets vco2 to value 0"]
170impl crate::Resettable for VCO2_SPEC {
171    const RESET_VALUE: Self::Ux = 0;
172}