bl602_pac/rf/
pa1.rs

1#[doc = "Register `pa1` reader"]
2pub struct R(crate::R<PA1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PA1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PA1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PA1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `pa1` writer"]
17pub struct W(crate::W<PA1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PA1_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<PA1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PA1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `pa_iaq` reader - "]
38pub type PA_IAQ_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `pa_iaq` writer - "]
40pub type PA_IAQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PA1_SPEC, u8, u8, 3, O>;
41#[doc = "Field `pa_etb_en` reader - "]
42pub type PA_ETB_EN_R = crate::BitReader<bool>;
43#[doc = "Field `pa_etb_en` writer - "]
44pub type PA_ETB_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PA1_SPEC, bool, O>;
45#[doc = "Field `pa_iet` reader - "]
46pub type PA_IET_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `pa_iet` writer - "]
48pub type PA_IET_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PA1_SPEC, u8, u8, 4, O>;
49#[doc = "Field `pa_vbcore` reader - "]
50pub type PA_VBCORE_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `pa_vbcore` writer - "]
52pub type PA_VBCORE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PA1_SPEC, u8, u8, 4, O>;
53#[doc = "Field `pa_vbcas` reader - "]
54pub type PA_VBCAS_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `pa_vbcas` writer - "]
56pub type PA_VBCAS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PA1_SPEC, u8, u8, 3, O>;
57#[doc = "Field `pa_half_on` reader - "]
58pub type PA_HALF_ON_R = crate::BitReader<bool>;
59#[doc = "Field `pa_half_on` writer - "]
60pub type PA_HALF_ON_W<'a, const O: u8> = crate::BitWriter<'a, u32, PA1_SPEC, bool, O>;
61#[doc = "Field `pa_ib_fix` reader - "]
62pub type PA_IB_FIX_R = crate::BitReader<bool>;
63#[doc = "Field `pa_ib_fix` writer - "]
64pub type PA_IB_FIX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PA1_SPEC, bool, O>;
65#[doc = "Field `pa_lz_bias_en` reader - "]
66pub type PA_LZ_BIAS_EN_R = crate::BitReader<bool>;
67#[doc = "Field `pa_lz_bias_en` writer - "]
68pub type PA_LZ_BIAS_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PA1_SPEC, bool, O>;
69#[doc = "Field `pa_pwrmx_osdac` reader - "]
70pub type PA_PWRMX_OSDAC_R = crate::FieldReader<u8, u8>;
71#[doc = "Field `pa_pwrmx_osdac` writer - "]
72pub type PA_PWRMX_OSDAC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PA1_SPEC, u8, u8, 4, O>;
73#[doc = "Field `pa_pwrmx_dac_pn_switch` reader - "]
74pub type PA_PWRMX_DAC_PN_SWITCH_R = crate::BitReader<bool>;
75#[doc = "Field `pa_pwrmx_dac_pn_switch` writer - "]
76pub type PA_PWRMX_DAC_PN_SWITCH_W<'a, const O: u8> = crate::BitWriter<'a, u32, PA1_SPEC, bool, O>;
77#[doc = "Field `pa_pwrmx_bm` reader - "]
78pub type PA_PWRMX_BM_R = crate::FieldReader<u8, u8>;
79#[doc = "Field `pa_pwrmx_bm` writer - "]
80pub type PA_PWRMX_BM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PA1_SPEC, u8, u8, 3, O>;
81#[doc = "Field `pa_att_gc` reader - "]
82pub type PA_ATT_GC_R = crate::FieldReader<u8, u8>;
83#[doc = "Field `pa_att_gc` writer - "]
84pub type PA_ATT_GC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PA1_SPEC, u8, u8, 4, O>;
85impl R {
86    #[doc = "Bits 0:2"]
87    #[inline(always)]
88    pub fn pa_iaq(&self) -> PA_IAQ_R {
89        PA_IAQ_R::new((self.bits & 7) as u8)
90    }
91    #[doc = "Bit 3"]
92    #[inline(always)]
93    pub fn pa_etb_en(&self) -> PA_ETB_EN_R {
94        PA_ETB_EN_R::new(((self.bits >> 3) & 1) != 0)
95    }
96    #[doc = "Bits 4:7"]
97    #[inline(always)]
98    pub fn pa_iet(&self) -> PA_IET_R {
99        PA_IET_R::new(((self.bits >> 4) & 0x0f) as u8)
100    }
101    #[doc = "Bits 8:11"]
102    #[inline(always)]
103    pub fn pa_vbcore(&self) -> PA_VBCORE_R {
104        PA_VBCORE_R::new(((self.bits >> 8) & 0x0f) as u8)
105    }
106    #[doc = "Bits 12:14"]
107    #[inline(always)]
108    pub fn pa_vbcas(&self) -> PA_VBCAS_R {
109        PA_VBCAS_R::new(((self.bits >> 12) & 7) as u8)
110    }
111    #[doc = "Bit 15"]
112    #[inline(always)]
113    pub fn pa_half_on(&self) -> PA_HALF_ON_R {
114        PA_HALF_ON_R::new(((self.bits >> 15) & 1) != 0)
115    }
116    #[doc = "Bit 16"]
117    #[inline(always)]
118    pub fn pa_ib_fix(&self) -> PA_IB_FIX_R {
119        PA_IB_FIX_R::new(((self.bits >> 16) & 1) != 0)
120    }
121    #[doc = "Bit 17"]
122    #[inline(always)]
123    pub fn pa_lz_bias_en(&self) -> PA_LZ_BIAS_EN_R {
124        PA_LZ_BIAS_EN_R::new(((self.bits >> 17) & 1) != 0)
125    }
126    #[doc = "Bits 18:21"]
127    #[inline(always)]
128    pub fn pa_pwrmx_osdac(&self) -> PA_PWRMX_OSDAC_R {
129        PA_PWRMX_OSDAC_R::new(((self.bits >> 18) & 0x0f) as u8)
130    }
131    #[doc = "Bit 22"]
132    #[inline(always)]
133    pub fn pa_pwrmx_dac_pn_switch(&self) -> PA_PWRMX_DAC_PN_SWITCH_R {
134        PA_PWRMX_DAC_PN_SWITCH_R::new(((self.bits >> 22) & 1) != 0)
135    }
136    #[doc = "Bits 24:26"]
137    #[inline(always)]
138    pub fn pa_pwrmx_bm(&self) -> PA_PWRMX_BM_R {
139        PA_PWRMX_BM_R::new(((self.bits >> 24) & 7) as u8)
140    }
141    #[doc = "Bits 28:31"]
142    #[inline(always)]
143    pub fn pa_att_gc(&self) -> PA_ATT_GC_R {
144        PA_ATT_GC_R::new(((self.bits >> 28) & 0x0f) as u8)
145    }
146}
147impl W {
148    #[doc = "Bits 0:2"]
149    #[inline(always)]
150    #[must_use]
151    pub fn pa_iaq(&mut self) -> PA_IAQ_W<0> {
152        PA_IAQ_W::new(self)
153    }
154    #[doc = "Bit 3"]
155    #[inline(always)]
156    #[must_use]
157    pub fn pa_etb_en(&mut self) -> PA_ETB_EN_W<3> {
158        PA_ETB_EN_W::new(self)
159    }
160    #[doc = "Bits 4:7"]
161    #[inline(always)]
162    #[must_use]
163    pub fn pa_iet(&mut self) -> PA_IET_W<4> {
164        PA_IET_W::new(self)
165    }
166    #[doc = "Bits 8:11"]
167    #[inline(always)]
168    #[must_use]
169    pub fn pa_vbcore(&mut self) -> PA_VBCORE_W<8> {
170        PA_VBCORE_W::new(self)
171    }
172    #[doc = "Bits 12:14"]
173    #[inline(always)]
174    #[must_use]
175    pub fn pa_vbcas(&mut self) -> PA_VBCAS_W<12> {
176        PA_VBCAS_W::new(self)
177    }
178    #[doc = "Bit 15"]
179    #[inline(always)]
180    #[must_use]
181    pub fn pa_half_on(&mut self) -> PA_HALF_ON_W<15> {
182        PA_HALF_ON_W::new(self)
183    }
184    #[doc = "Bit 16"]
185    #[inline(always)]
186    #[must_use]
187    pub fn pa_ib_fix(&mut self) -> PA_IB_FIX_W<16> {
188        PA_IB_FIX_W::new(self)
189    }
190    #[doc = "Bit 17"]
191    #[inline(always)]
192    #[must_use]
193    pub fn pa_lz_bias_en(&mut self) -> PA_LZ_BIAS_EN_W<17> {
194        PA_LZ_BIAS_EN_W::new(self)
195    }
196    #[doc = "Bits 18:21"]
197    #[inline(always)]
198    #[must_use]
199    pub fn pa_pwrmx_osdac(&mut self) -> PA_PWRMX_OSDAC_W<18> {
200        PA_PWRMX_OSDAC_W::new(self)
201    }
202    #[doc = "Bit 22"]
203    #[inline(always)]
204    #[must_use]
205    pub fn pa_pwrmx_dac_pn_switch(&mut self) -> PA_PWRMX_DAC_PN_SWITCH_W<22> {
206        PA_PWRMX_DAC_PN_SWITCH_W::new(self)
207    }
208    #[doc = "Bits 24:26"]
209    #[inline(always)]
210    #[must_use]
211    pub fn pa_pwrmx_bm(&mut self) -> PA_PWRMX_BM_W<24> {
212        PA_PWRMX_BM_W::new(self)
213    }
214    #[doc = "Bits 28:31"]
215    #[inline(always)]
216    #[must_use]
217    pub fn pa_att_gc(&mut self) -> PA_ATT_GC_W<28> {
218        PA_ATT_GC_W::new(self)
219    }
220    #[doc = "Writes raw bits to the register."]
221    #[inline(always)]
222    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
223        self.0.bits(bits);
224        self
225    }
226}
227#[doc = "pa1.\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 [pa1](index.html) module"]
228pub struct PA1_SPEC;
229impl crate::RegisterSpec for PA1_SPEC {
230    type Ux = u32;
231}
232#[doc = "`read()` method returns [pa1::R](R) reader structure"]
233impl crate::Readable for PA1_SPEC {
234    type Reader = R;
235}
236#[doc = "`write(|w| ..)` method takes [pa1::W](W) writer structure"]
237impl crate::Writable for PA1_SPEC {
238    type Writer = W;
239    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
240    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
241}
242#[doc = "`reset()` method sets pa1 to value 0"]
243impl crate::Resettable for PA1_SPEC {
244    const RESET_VALUE: Self::Ux = 0;
245}