bl602_pac/hbn/
xtal32k.rs

1#[doc = "Register `xtal32k` reader"]
2pub struct R(crate::R<XTAL32K_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<XTAL32K_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<XTAL32K_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<XTAL32K_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `xtal32k` writer"]
17pub struct W(crate::W<XTAL32K_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<XTAL32K_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<XTAL32K_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<XTAL32K_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `xtal32k_ext_sel` reader - "]
38pub type XTAL32K_EXT_SEL_R = crate::BitReader<bool>;
39#[doc = "Field `xtal32k_ext_sel` writer - "]
40pub type XTAL32K_EXT_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, XTAL32K_SPEC, bool, O>;
41#[doc = "Field `xtal32k_amp_ctrl` reader - "]
42pub type XTAL32K_AMP_CTRL_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `xtal32k_amp_ctrl` writer - "]
44pub type XTAL32K_AMP_CTRL_W<'a, const O: u8> =
45    crate::FieldWriter<'a, u32, XTAL32K_SPEC, u8, u8, 2, O>;
46#[doc = "Field `xtal32k_reg` reader - "]
47pub type XTAL32K_REG_R = crate::FieldReader<u8, u8>;
48#[doc = "Field `xtal32k_reg` writer - "]
49pub type XTAL32K_REG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, XTAL32K_SPEC, u8, u8, 2, O>;
50#[doc = "Field `xtal32k_outbuf_stre` reader - "]
51pub type XTAL32K_OUTBUF_STRE_R = crate::BitReader<bool>;
52#[doc = "Field `xtal32k_outbuf_stre` writer - "]
53pub type XTAL32K_OUTBUF_STRE_W<'a, const O: u8> = crate::BitWriter<'a, u32, XTAL32K_SPEC, bool, O>;
54#[doc = "Field `xtal32k_otf_short` reader - "]
55pub type XTAL32K_OTF_SHORT_R = crate::BitReader<bool>;
56#[doc = "Field `xtal32k_otf_short` writer - "]
57pub type XTAL32K_OTF_SHORT_W<'a, const O: u8> = crate::BitWriter<'a, u32, XTAL32K_SPEC, bool, O>;
58#[doc = "Field `xtal32k_inv_stre` reader - "]
59pub type XTAL32K_INV_STRE_R = crate::FieldReader<u8, u8>;
60#[doc = "Field `xtal32k_inv_stre` writer - "]
61pub type XTAL32K_INV_STRE_W<'a, const O: u8> =
62    crate::FieldWriter<'a, u32, XTAL32K_SPEC, u8, u8, 2, O>;
63#[doc = "Field `xtal32k_capbank` reader - "]
64pub type XTAL32K_CAPBANK_R = crate::FieldReader<u8, u8>;
65#[doc = "Field `xtal32k_capbank` writer - "]
66pub type XTAL32K_CAPBANK_W<'a, const O: u8> =
67    crate::FieldWriter<'a, u32, XTAL32K_SPEC, u8, u8, 6, O>;
68#[doc = "Field `xtal32k_ac_cap_short` reader - "]
69pub type XTAL32K_AC_CAP_SHORT_R = crate::BitReader<bool>;
70#[doc = "Field `xtal32k_ac_cap_short` writer - "]
71pub type XTAL32K_AC_CAP_SHORT_W<'a, const O: u8> = crate::BitWriter<'a, u32, XTAL32K_SPEC, bool, O>;
72#[doc = "Field `pu_xtal32k_buf` reader - "]
73pub type PU_XTAL32K_BUF_R = crate::BitReader<bool>;
74#[doc = "Field `pu_xtal32k_buf` writer - "]
75pub type PU_XTAL32K_BUF_W<'a, const O: u8> = crate::BitWriter<'a, u32, XTAL32K_SPEC, bool, O>;
76#[doc = "Field `pu_xtal32k` reader - "]
77pub type PU_XTAL32K_R = crate::BitReader<bool>;
78#[doc = "Field `pu_xtal32k` writer - "]
79pub type PU_XTAL32K_W<'a, const O: u8> = crate::BitWriter<'a, u32, XTAL32K_SPEC, bool, O>;
80impl R {
81    #[doc = "Bit 2"]
82    #[inline(always)]
83    pub fn xtal32k_ext_sel(&self) -> XTAL32K_EXT_SEL_R {
84        XTAL32K_EXT_SEL_R::new(((self.bits >> 2) & 1) != 0)
85    }
86    #[doc = "Bits 3:4"]
87    #[inline(always)]
88    pub fn xtal32k_amp_ctrl(&self) -> XTAL32K_AMP_CTRL_R {
89        XTAL32K_AMP_CTRL_R::new(((self.bits >> 3) & 3) as u8)
90    }
91    #[doc = "Bits 5:6"]
92    #[inline(always)]
93    pub fn xtal32k_reg(&self) -> XTAL32K_REG_R {
94        XTAL32K_REG_R::new(((self.bits >> 5) & 3) as u8)
95    }
96    #[doc = "Bit 7"]
97    #[inline(always)]
98    pub fn xtal32k_outbuf_stre(&self) -> XTAL32K_OUTBUF_STRE_R {
99        XTAL32K_OUTBUF_STRE_R::new(((self.bits >> 7) & 1) != 0)
100    }
101    #[doc = "Bit 8"]
102    #[inline(always)]
103    pub fn xtal32k_otf_short(&self) -> XTAL32K_OTF_SHORT_R {
104        XTAL32K_OTF_SHORT_R::new(((self.bits >> 8) & 1) != 0)
105    }
106    #[doc = "Bits 9:10"]
107    #[inline(always)]
108    pub fn xtal32k_inv_stre(&self) -> XTAL32K_INV_STRE_R {
109        XTAL32K_INV_STRE_R::new(((self.bits >> 9) & 3) as u8)
110    }
111    #[doc = "Bits 11:16"]
112    #[inline(always)]
113    pub fn xtal32k_capbank(&self) -> XTAL32K_CAPBANK_R {
114        XTAL32K_CAPBANK_R::new(((self.bits >> 11) & 0x3f) as u8)
115    }
116    #[doc = "Bit 17"]
117    #[inline(always)]
118    pub fn xtal32k_ac_cap_short(&self) -> XTAL32K_AC_CAP_SHORT_R {
119        XTAL32K_AC_CAP_SHORT_R::new(((self.bits >> 17) & 1) != 0)
120    }
121    #[doc = "Bit 18"]
122    #[inline(always)]
123    pub fn pu_xtal32k_buf(&self) -> PU_XTAL32K_BUF_R {
124        PU_XTAL32K_BUF_R::new(((self.bits >> 18) & 1) != 0)
125    }
126    #[doc = "Bit 19"]
127    #[inline(always)]
128    pub fn pu_xtal32k(&self) -> PU_XTAL32K_R {
129        PU_XTAL32K_R::new(((self.bits >> 19) & 1) != 0)
130    }
131}
132impl W {
133    #[doc = "Bit 2"]
134    #[inline(always)]
135    #[must_use]
136    pub fn xtal32k_ext_sel(&mut self) -> XTAL32K_EXT_SEL_W<2> {
137        XTAL32K_EXT_SEL_W::new(self)
138    }
139    #[doc = "Bits 3:4"]
140    #[inline(always)]
141    #[must_use]
142    pub fn xtal32k_amp_ctrl(&mut self) -> XTAL32K_AMP_CTRL_W<3> {
143        XTAL32K_AMP_CTRL_W::new(self)
144    }
145    #[doc = "Bits 5:6"]
146    #[inline(always)]
147    #[must_use]
148    pub fn xtal32k_reg(&mut self) -> XTAL32K_REG_W<5> {
149        XTAL32K_REG_W::new(self)
150    }
151    #[doc = "Bit 7"]
152    #[inline(always)]
153    #[must_use]
154    pub fn xtal32k_outbuf_stre(&mut self) -> XTAL32K_OUTBUF_STRE_W<7> {
155        XTAL32K_OUTBUF_STRE_W::new(self)
156    }
157    #[doc = "Bit 8"]
158    #[inline(always)]
159    #[must_use]
160    pub fn xtal32k_otf_short(&mut self) -> XTAL32K_OTF_SHORT_W<8> {
161        XTAL32K_OTF_SHORT_W::new(self)
162    }
163    #[doc = "Bits 9:10"]
164    #[inline(always)]
165    #[must_use]
166    pub fn xtal32k_inv_stre(&mut self) -> XTAL32K_INV_STRE_W<9> {
167        XTAL32K_INV_STRE_W::new(self)
168    }
169    #[doc = "Bits 11:16"]
170    #[inline(always)]
171    #[must_use]
172    pub fn xtal32k_capbank(&mut self) -> XTAL32K_CAPBANK_W<11> {
173        XTAL32K_CAPBANK_W::new(self)
174    }
175    #[doc = "Bit 17"]
176    #[inline(always)]
177    #[must_use]
178    pub fn xtal32k_ac_cap_short(&mut self) -> XTAL32K_AC_CAP_SHORT_W<17> {
179        XTAL32K_AC_CAP_SHORT_W::new(self)
180    }
181    #[doc = "Bit 18"]
182    #[inline(always)]
183    #[must_use]
184    pub fn pu_xtal32k_buf(&mut self) -> PU_XTAL32K_BUF_W<18> {
185        PU_XTAL32K_BUF_W::new(self)
186    }
187    #[doc = "Bit 19"]
188    #[inline(always)]
189    #[must_use]
190    pub fn pu_xtal32k(&mut self) -> PU_XTAL32K_W<19> {
191        PU_XTAL32K_W::new(self)
192    }
193    #[doc = "Writes raw bits to the register."]
194    #[inline(always)]
195    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
196        self.0.bits(bits);
197        self
198    }
199}
200#[doc = "xtal32k.\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 [xtal32k](index.html) module"]
201pub struct XTAL32K_SPEC;
202impl crate::RegisterSpec for XTAL32K_SPEC {
203    type Ux = u32;
204}
205#[doc = "`read()` method returns [xtal32k::R](R) reader structure"]
206impl crate::Readable for XTAL32K_SPEC {
207    type Reader = R;
208}
209#[doc = "`write(|w| ..)` method takes [xtal32k::W](W) writer structure"]
210impl crate::Writable for XTAL32K_SPEC {
211    type Writer = W;
212    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
213    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
214}
215#[doc = "`reset()` method sets xtal32k to value 0x000f_0228"]
216impl crate::Resettable for XTAL32K_SPEC {
217    const RESET_VALUE: Self::Ux = 0x000f_0228;
218}