da14531/rfcu/
rf_lna_ctrl1_reg.rs1#[doc = "Register `RF_LNA_CTRL1_REG` reader"]
2pub struct R(crate::R<RF_LNA_CTRL1_REG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<RF_LNA_CTRL1_REG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<RF_LNA_CTRL1_REG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<RF_LNA_CTRL1_REG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `RF_LNA_CTRL1_REG` writer"]
17pub struct W(crate::W<RF_LNA_CTRL1_REG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<RF_LNA_CTRL1_REG_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<RF_LNA_CTRL1_REG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<RF_LNA_CTRL1_REG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `LNA_TRIM_GAIN4_HP` reader - "]
38pub struct LNA_TRIM_GAIN4_HP_R(crate::FieldReader<u8, u8>);
39impl LNA_TRIM_GAIN4_HP_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: u8) -> Self {
42 LNA_TRIM_GAIN4_HP_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for LNA_TRIM_GAIN4_HP_R {
46 type Target = crate::FieldReader<u8, u8>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `LNA_TRIM_GAIN4_HP` writer - "]
53pub struct LNA_TRIM_GAIN4_HP_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> LNA_TRIM_GAIN4_HP_W<'a> {
57 #[doc = r"Writes raw bits to the field"]
58 #[inline(always)]
59 pub unsafe fn bits(self, value: u8) -> &'a mut W {
60 self.w.bits = (self.w.bits & !(0x1f << 20)) | ((value as u32 & 0x1f) << 20);
61 self.w
62 }
63}
64#[doc = "Field `LNA_TRIM_GAIN3_HP` reader - "]
65pub struct LNA_TRIM_GAIN3_HP_R(crate::FieldReader<u8, u8>);
66impl LNA_TRIM_GAIN3_HP_R {
67 #[inline(always)]
68 pub(crate) fn new(bits: u8) -> Self {
69 LNA_TRIM_GAIN3_HP_R(crate::FieldReader::new(bits))
70 }
71}
72impl core::ops::Deref for LNA_TRIM_GAIN3_HP_R {
73 type Target = crate::FieldReader<u8, u8>;
74 #[inline(always)]
75 fn deref(&self) -> &Self::Target {
76 &self.0
77 }
78}
79#[doc = "Field `LNA_TRIM_GAIN3_HP` writer - "]
80pub struct LNA_TRIM_GAIN3_HP_W<'a> {
81 w: &'a mut W,
82}
83impl<'a> LNA_TRIM_GAIN3_HP_W<'a> {
84 #[doc = r"Writes raw bits to the field"]
85 #[inline(always)]
86 pub unsafe fn bits(self, value: u8) -> &'a mut W {
87 self.w.bits = (self.w.bits & !(0x1f << 15)) | ((value as u32 & 0x1f) << 15);
88 self.w
89 }
90}
91#[doc = "Field `LNA_TRIM_GAIN2_HP` reader - "]
92pub struct LNA_TRIM_GAIN2_HP_R(crate::FieldReader<u8, u8>);
93impl LNA_TRIM_GAIN2_HP_R {
94 #[inline(always)]
95 pub(crate) fn new(bits: u8) -> Self {
96 LNA_TRIM_GAIN2_HP_R(crate::FieldReader::new(bits))
97 }
98}
99impl core::ops::Deref for LNA_TRIM_GAIN2_HP_R {
100 type Target = crate::FieldReader<u8, u8>;
101 #[inline(always)]
102 fn deref(&self) -> &Self::Target {
103 &self.0
104 }
105}
106#[doc = "Field `LNA_TRIM_GAIN2_HP` writer - "]
107pub struct LNA_TRIM_GAIN2_HP_W<'a> {
108 w: &'a mut W,
109}
110impl<'a> LNA_TRIM_GAIN2_HP_W<'a> {
111 #[doc = r"Writes raw bits to the field"]
112 #[inline(always)]
113 pub unsafe fn bits(self, value: u8) -> &'a mut W {
114 self.w.bits = (self.w.bits & !(0x1f << 10)) | ((value as u32 & 0x1f) << 10);
115 self.w
116 }
117}
118#[doc = "Field `LNA_TRIM_GAIN1_HP` reader - "]
119pub struct LNA_TRIM_GAIN1_HP_R(crate::FieldReader<u8, u8>);
120impl LNA_TRIM_GAIN1_HP_R {
121 #[inline(always)]
122 pub(crate) fn new(bits: u8) -> Self {
123 LNA_TRIM_GAIN1_HP_R(crate::FieldReader::new(bits))
124 }
125}
126impl core::ops::Deref for LNA_TRIM_GAIN1_HP_R {
127 type Target = crate::FieldReader<u8, u8>;
128 #[inline(always)]
129 fn deref(&self) -> &Self::Target {
130 &self.0
131 }
132}
133#[doc = "Field `LNA_TRIM_GAIN1_HP` writer - "]
134pub struct LNA_TRIM_GAIN1_HP_W<'a> {
135 w: &'a mut W,
136}
137impl<'a> LNA_TRIM_GAIN1_HP_W<'a> {
138 #[doc = r"Writes raw bits to the field"]
139 #[inline(always)]
140 pub unsafe fn bits(self, value: u8) -> &'a mut W {
141 self.w.bits = (self.w.bits & !(0x1f << 5)) | ((value as u32 & 0x1f) << 5);
142 self.w
143 }
144}
145#[doc = "Field `LNA_TRIM_GAIN0_HP` reader - "]
146pub struct LNA_TRIM_GAIN0_HP_R(crate::FieldReader<u8, u8>);
147impl LNA_TRIM_GAIN0_HP_R {
148 #[inline(always)]
149 pub(crate) fn new(bits: u8) -> Self {
150 LNA_TRIM_GAIN0_HP_R(crate::FieldReader::new(bits))
151 }
152}
153impl core::ops::Deref for LNA_TRIM_GAIN0_HP_R {
154 type Target = crate::FieldReader<u8, u8>;
155 #[inline(always)]
156 fn deref(&self) -> &Self::Target {
157 &self.0
158 }
159}
160#[doc = "Field `LNA_TRIM_GAIN0_HP` writer - "]
161pub struct LNA_TRIM_GAIN0_HP_W<'a> {
162 w: &'a mut W,
163}
164impl<'a> LNA_TRIM_GAIN0_HP_W<'a> {
165 #[doc = r"Writes raw bits to the field"]
166 #[inline(always)]
167 pub unsafe fn bits(self, value: u8) -> &'a mut W {
168 self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f);
169 self.w
170 }
171}
172impl R {
173 #[doc = "Bits 20:24"]
174 #[inline(always)]
175 pub fn lna_trim_gain4_hp(&self) -> LNA_TRIM_GAIN4_HP_R {
176 LNA_TRIM_GAIN4_HP_R::new(((self.bits >> 20) & 0x1f) as u8)
177 }
178 #[doc = "Bits 15:19"]
179 #[inline(always)]
180 pub fn lna_trim_gain3_hp(&self) -> LNA_TRIM_GAIN3_HP_R {
181 LNA_TRIM_GAIN3_HP_R::new(((self.bits >> 15) & 0x1f) as u8)
182 }
183 #[doc = "Bits 10:14"]
184 #[inline(always)]
185 pub fn lna_trim_gain2_hp(&self) -> LNA_TRIM_GAIN2_HP_R {
186 LNA_TRIM_GAIN2_HP_R::new(((self.bits >> 10) & 0x1f) as u8)
187 }
188 #[doc = "Bits 5:9"]
189 #[inline(always)]
190 pub fn lna_trim_gain1_hp(&self) -> LNA_TRIM_GAIN1_HP_R {
191 LNA_TRIM_GAIN1_HP_R::new(((self.bits >> 5) & 0x1f) as u8)
192 }
193 #[doc = "Bits 0:4"]
194 #[inline(always)]
195 pub fn lna_trim_gain0_hp(&self) -> LNA_TRIM_GAIN0_HP_R {
196 LNA_TRIM_GAIN0_HP_R::new((self.bits & 0x1f) as u8)
197 }
198}
199impl W {
200 #[doc = "Bits 20:24"]
201 #[inline(always)]
202 pub fn lna_trim_gain4_hp(&mut self) -> LNA_TRIM_GAIN4_HP_W {
203 LNA_TRIM_GAIN4_HP_W { w: self }
204 }
205 #[doc = "Bits 15:19"]
206 #[inline(always)]
207 pub fn lna_trim_gain3_hp(&mut self) -> LNA_TRIM_GAIN3_HP_W {
208 LNA_TRIM_GAIN3_HP_W { w: self }
209 }
210 #[doc = "Bits 10:14"]
211 #[inline(always)]
212 pub fn lna_trim_gain2_hp(&mut self) -> LNA_TRIM_GAIN2_HP_W {
213 LNA_TRIM_GAIN2_HP_W { w: self }
214 }
215 #[doc = "Bits 5:9"]
216 #[inline(always)]
217 pub fn lna_trim_gain1_hp(&mut self) -> LNA_TRIM_GAIN1_HP_W {
218 LNA_TRIM_GAIN1_HP_W { w: self }
219 }
220 #[doc = "Bits 0:4"]
221 #[inline(always)]
222 pub fn lna_trim_gain0_hp(&mut self) -> LNA_TRIM_GAIN0_HP_W {
223 LNA_TRIM_GAIN0_HP_W { w: self }
224 }
225 #[doc = "Writes raw bits to the register."]
226 #[inline(always)]
227 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
228 self.0.bits(bits);
229 self
230 }
231}
232#[doc = "\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 [rf_lna_ctrl1_reg](index.html) module"]
233pub struct RF_LNA_CTRL1_REG_SPEC;
234impl crate::RegisterSpec for RF_LNA_CTRL1_REG_SPEC {
235 type Ux = u32;
236}
237#[doc = "`read()` method returns [rf_lna_ctrl1_reg::R](R) reader structure"]
238impl crate::Readable for RF_LNA_CTRL1_REG_SPEC {
239 type Reader = R;
240}
241#[doc = "`write(|w| ..)` method takes [rf_lna_ctrl1_reg::W](W) writer structure"]
242impl crate::Writable for RF_LNA_CTRL1_REG_SPEC {
243 type Writer = W;
244}
245#[doc = "`reset()` method sets RF_LNA_CTRL1_REG to value 0x0108_4210"]
246impl crate::Resettable for RF_LNA_CTRL1_REG_SPEC {
247 #[inline(always)]
248 fn reset_value() -> Self::Ux {
249 0x0108_4210
250 }
251}