bl602_pac/rf/
trx_gain1.rs

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