bl602_pac/rf/
tbb.rs

1#[doc = "Register `tbb` reader"]
2pub struct R(crate::R<TBB_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<TBB_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<TBB_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<TBB_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `tbb` writer"]
17pub struct W(crate::W<TBB_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<TBB_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<TBB_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<TBB_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `tbb_bm_sf` reader - "]
38pub type TBB_BM_SF_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `tbb_bm_sf` writer - "]
40pub type TBB_BM_SF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBB_SPEC, u8, u8, 2, O>;
41#[doc = "Field `tbb_bm_cg` reader - "]
42pub type TBB_BM_CG_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `tbb_bm_cg` writer - "]
44pub type TBB_BM_CG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBB_SPEC, u8, u8, 2, O>;
45#[doc = "Field `tbb_vcm` reader - "]
46pub type TBB_VCM_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `tbb_vcm` writer - "]
48pub type TBB_VCM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBB_SPEC, u8, u8, 2, O>;
49#[doc = "Field `tbb_cflt` reader - "]
50pub type TBB_CFLT_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `tbb_cflt` writer - "]
52pub type TBB_CFLT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBB_SPEC, u8, u8, 2, O>;
53#[doc = "Field `tbb_iq_bias_short` reader - "]
54pub type TBB_IQ_BIAS_SHORT_R = crate::BitReader<bool>;
55#[doc = "Field `tbb_iq_bias_short` writer - "]
56pub type TBB_IQ_BIAS_SHORT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TBB_SPEC, bool, O>;
57#[doc = "Field `tbb_atest_out_en` reader - "]
58pub type TBB_ATEST_OUT_EN_R = crate::BitReader<bool>;
59#[doc = "Field `tbb_atest_out_en` writer - "]
60pub type TBB_ATEST_OUT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, TBB_SPEC, bool, O>;
61#[doc = "Field `tbb_tosdac_q` reader - "]
62pub type TBB_TOSDAC_Q_R = crate::FieldReader<u8, u8>;
63#[doc = "Field `tbb_tosdac_q` writer - "]
64pub type TBB_TOSDAC_Q_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBB_SPEC, u8, u8, 6, O>;
65#[doc = "Field `tbb_tosdac_i` reader - "]
66pub type TBB_TOSDAC_I_R = crate::FieldReader<u8, u8>;
67#[doc = "Field `tbb_tosdac_i` writer - "]
68pub type TBB_TOSDAC_I_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBB_SPEC, u8, u8, 6, O>;
69impl R {
70    #[doc = "Bits 0:1"]
71    #[inline(always)]
72    pub fn tbb_bm_sf(&self) -> TBB_BM_SF_R {
73        TBB_BM_SF_R::new((self.bits & 3) as u8)
74    }
75    #[doc = "Bits 4:5"]
76    #[inline(always)]
77    pub fn tbb_bm_cg(&self) -> TBB_BM_CG_R {
78        TBB_BM_CG_R::new(((self.bits >> 4) & 3) as u8)
79    }
80    #[doc = "Bits 8:9"]
81    #[inline(always)]
82    pub fn tbb_vcm(&self) -> TBB_VCM_R {
83        TBB_VCM_R::new(((self.bits >> 8) & 3) as u8)
84    }
85    #[doc = "Bits 12:13"]
86    #[inline(always)]
87    pub fn tbb_cflt(&self) -> TBB_CFLT_R {
88        TBB_CFLT_R::new(((self.bits >> 12) & 3) as u8)
89    }
90    #[doc = "Bit 14"]
91    #[inline(always)]
92    pub fn tbb_iq_bias_short(&self) -> TBB_IQ_BIAS_SHORT_R {
93        TBB_IQ_BIAS_SHORT_R::new(((self.bits >> 14) & 1) != 0)
94    }
95    #[doc = "Bit 15"]
96    #[inline(always)]
97    pub fn tbb_atest_out_en(&self) -> TBB_ATEST_OUT_EN_R {
98        TBB_ATEST_OUT_EN_R::new(((self.bits >> 15) & 1) != 0)
99    }
100    #[doc = "Bits 16:21"]
101    #[inline(always)]
102    pub fn tbb_tosdac_q(&self) -> TBB_TOSDAC_Q_R {
103        TBB_TOSDAC_Q_R::new(((self.bits >> 16) & 0x3f) as u8)
104    }
105    #[doc = "Bits 24:29"]
106    #[inline(always)]
107    pub fn tbb_tosdac_i(&self) -> TBB_TOSDAC_I_R {
108        TBB_TOSDAC_I_R::new(((self.bits >> 24) & 0x3f) as u8)
109    }
110}
111impl W {
112    #[doc = "Bits 0:1"]
113    #[inline(always)]
114    #[must_use]
115    pub fn tbb_bm_sf(&mut self) -> TBB_BM_SF_W<0> {
116        TBB_BM_SF_W::new(self)
117    }
118    #[doc = "Bits 4:5"]
119    #[inline(always)]
120    #[must_use]
121    pub fn tbb_bm_cg(&mut self) -> TBB_BM_CG_W<4> {
122        TBB_BM_CG_W::new(self)
123    }
124    #[doc = "Bits 8:9"]
125    #[inline(always)]
126    #[must_use]
127    pub fn tbb_vcm(&mut self) -> TBB_VCM_W<8> {
128        TBB_VCM_W::new(self)
129    }
130    #[doc = "Bits 12:13"]
131    #[inline(always)]
132    #[must_use]
133    pub fn tbb_cflt(&mut self) -> TBB_CFLT_W<12> {
134        TBB_CFLT_W::new(self)
135    }
136    #[doc = "Bit 14"]
137    #[inline(always)]
138    #[must_use]
139    pub fn tbb_iq_bias_short(&mut self) -> TBB_IQ_BIAS_SHORT_W<14> {
140        TBB_IQ_BIAS_SHORT_W::new(self)
141    }
142    #[doc = "Bit 15"]
143    #[inline(always)]
144    #[must_use]
145    pub fn tbb_atest_out_en(&mut self) -> TBB_ATEST_OUT_EN_W<15> {
146        TBB_ATEST_OUT_EN_W::new(self)
147    }
148    #[doc = "Bits 16:21"]
149    #[inline(always)]
150    #[must_use]
151    pub fn tbb_tosdac_q(&mut self) -> TBB_TOSDAC_Q_W<16> {
152        TBB_TOSDAC_Q_W::new(self)
153    }
154    #[doc = "Bits 24:29"]
155    #[inline(always)]
156    #[must_use]
157    pub fn tbb_tosdac_i(&mut self) -> TBB_TOSDAC_I_W<24> {
158        TBB_TOSDAC_I_W::new(self)
159    }
160    #[doc = "Writes raw bits to the register."]
161    #[inline(always)]
162    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
163        self.0.bits(bits);
164        self
165    }
166}
167#[doc = "tbb.\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 [tbb](index.html) module"]
168pub struct TBB_SPEC;
169impl crate::RegisterSpec for TBB_SPEC {
170    type Ux = u32;
171}
172#[doc = "`read()` method returns [tbb::R](R) reader structure"]
173impl crate::Readable for TBB_SPEC {
174    type Reader = R;
175}
176#[doc = "`write(|w| ..)` method takes [tbb::W](W) writer structure"]
177impl crate::Writable for TBB_SPEC {
178    type Writer = W;
179    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
180    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
181}
182#[doc = "`reset()` method sets tbb to value 0"]
183impl crate::Resettable for TBB_SPEC {
184    const RESET_VALUE: Self::Ux = 0;
185}