cc13x2_cc26x2_hal/fcfg1/
config_cc26_fe.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::CONFIG_CC26_FE {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R {
26            bits: self.register.get(),
27        }
28    }
29    #[doc = r" Writes to the register"]
30    #[inline]
31    pub fn write<F>(&self, f: F)
32    where
33        F: FnOnce(&mut W) -> &mut W,
34    {
35        let mut w = W::reset_value();
36        f(&mut w);
37        self.register.set(w.bits);
38    }
39    #[doc = r" Writes the reset value to the register"]
40    #[inline]
41    pub fn reset(&self) {
42        self.write(|w| w)
43    }
44}
45#[doc = r" Value of the field"]
46pub struct IFAMP_IBR {
47    bits: u8,
48}
49impl IFAMP_IBR {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bits(&self) -> u8 {
53        self.bits
54    }
55}
56#[doc = r" Value of the field"]
57pub struct LNA_IBR {
58    bits: u8,
59}
60impl LNA_IBR {
61    #[doc = r" Value of the field as raw bits"]
62    #[inline]
63    pub fn bits(&self) -> u8 {
64        self.bits
65    }
66}
67#[doc = r" Value of the field"]
68pub struct IFAMP_TRIMR {
69    bits: u8,
70}
71impl IFAMP_TRIMR {
72    #[doc = r" Value of the field as raw bits"]
73    #[inline]
74    pub fn bits(&self) -> u8 {
75        self.bits
76    }
77}
78#[doc = r" Value of the field"]
79pub struct CTL_PA0_TRIMR {
80    bits: u8,
81}
82impl CTL_PA0_TRIMR {
83    #[doc = r" Value of the field as raw bits"]
84    #[inline]
85    pub fn bits(&self) -> u8 {
86        self.bits
87    }
88}
89#[doc = r" Value of the field"]
90pub struct PATRIMCOMPLETE_NR {
91    bits: bool,
92}
93impl PATRIMCOMPLETE_NR {
94    #[doc = r" Value of the field as raw bits"]
95    #[inline]
96    pub fn bit(&self) -> bool {
97        self.bits
98    }
99    #[doc = r" Returns `true` if the bit is clear (0)"]
100    #[inline]
101    pub fn bit_is_clear(&self) -> bool {
102        !self.bit()
103    }
104    #[doc = r" Returns `true` if the bit is set (1)"]
105    #[inline]
106    pub fn bit_is_set(&self) -> bool {
107        self.bit()
108    }
109}
110#[doc = r" Value of the field"]
111pub struct RSSITRIMCOMPLETE_NR {
112    bits: bool,
113}
114impl RSSITRIMCOMPLETE_NR {
115    #[doc = r" Value of the field as raw bits"]
116    #[inline]
117    pub fn bit(&self) -> bool {
118        self.bits
119    }
120    #[doc = r" Returns `true` if the bit is clear (0)"]
121    #[inline]
122    pub fn bit_is_clear(&self) -> bool {
123        !self.bit()
124    }
125    #[doc = r" Returns `true` if the bit is set (1)"]
126    #[inline]
127    pub fn bit_is_set(&self) -> bool {
128        self.bit()
129    }
130}
131#[doc = r" Value of the field"]
132pub struct RSSI_OFFSETR {
133    bits: u8,
134}
135impl RSSI_OFFSETR {
136    #[doc = r" Value of the field as raw bits"]
137    #[inline]
138    pub fn bits(&self) -> u8 {
139        self.bits
140    }
141}
142#[doc = r" Proxy"]
143pub struct _IFAMP_IBW<'a> {
144    w: &'a mut W,
145}
146impl<'a> _IFAMP_IBW<'a> {
147    #[doc = r" Writes raw bits to the field"]
148    #[inline]
149    pub unsafe fn bits(self, value: u8) -> &'a mut W {
150        const MASK: u8 = 15;
151        const OFFSET: u8 = 28;
152        self.w.bits &= !((MASK as u32) << OFFSET);
153        self.w.bits |= ((value & MASK) as u32) << OFFSET;
154        self.w
155    }
156}
157#[doc = r" Proxy"]
158pub struct _LNA_IBW<'a> {
159    w: &'a mut W,
160}
161impl<'a> _LNA_IBW<'a> {
162    #[doc = r" Writes raw bits to the field"]
163    #[inline]
164    pub unsafe fn bits(self, value: u8) -> &'a mut W {
165        const MASK: u8 = 15;
166        const OFFSET: u8 = 24;
167        self.w.bits &= !((MASK as u32) << OFFSET);
168        self.w.bits |= ((value & MASK) as u32) << OFFSET;
169        self.w
170    }
171}
172#[doc = r" Proxy"]
173pub struct _IFAMP_TRIMW<'a> {
174    w: &'a mut W,
175}
176impl<'a> _IFAMP_TRIMW<'a> {
177    #[doc = r" Writes raw bits to the field"]
178    #[inline]
179    pub unsafe fn bits(self, value: u8) -> &'a mut W {
180        const MASK: u8 = 31;
181        const OFFSET: u8 = 19;
182        self.w.bits &= !((MASK as u32) << OFFSET);
183        self.w.bits |= ((value & MASK) as u32) << OFFSET;
184        self.w
185    }
186}
187#[doc = r" Proxy"]
188pub struct _CTL_PA0_TRIMW<'a> {
189    w: &'a mut W,
190}
191impl<'a> _CTL_PA0_TRIMW<'a> {
192    #[doc = r" Writes raw bits to the field"]
193    #[inline]
194    pub unsafe fn bits(self, value: u8) -> &'a mut W {
195        const MASK: u8 = 31;
196        const OFFSET: u8 = 14;
197        self.w.bits &= !((MASK as u32) << OFFSET);
198        self.w.bits |= ((value & MASK) as u32) << OFFSET;
199        self.w
200    }
201}
202#[doc = r" Proxy"]
203pub struct _PATRIMCOMPLETE_NW<'a> {
204    w: &'a mut W,
205}
206impl<'a> _PATRIMCOMPLETE_NW<'a> {
207    #[doc = r" Sets the field bit"]
208    pub fn set_bit(self) -> &'a mut W {
209        self.bit(true)
210    }
211    #[doc = r" Clears the field bit"]
212    pub fn clear_bit(self) -> &'a mut W {
213        self.bit(false)
214    }
215    #[doc = r" Writes raw bits to the field"]
216    #[inline]
217    pub fn bit(self, value: bool) -> &'a mut W {
218        const MASK: bool = true;
219        const OFFSET: u8 = 13;
220        self.w.bits &= !((MASK as u32) << OFFSET);
221        self.w.bits |= ((value & MASK) as u32) << OFFSET;
222        self.w
223    }
224}
225#[doc = r" Proxy"]
226pub struct _RSSITRIMCOMPLETE_NW<'a> {
227    w: &'a mut W,
228}
229impl<'a> _RSSITRIMCOMPLETE_NW<'a> {
230    #[doc = r" Sets the field bit"]
231    pub fn set_bit(self) -> &'a mut W {
232        self.bit(true)
233    }
234    #[doc = r" Clears the field bit"]
235    pub fn clear_bit(self) -> &'a mut W {
236        self.bit(false)
237    }
238    #[doc = r" Writes raw bits to the field"]
239    #[inline]
240    pub fn bit(self, value: bool) -> &'a mut W {
241        const MASK: bool = true;
242        const OFFSET: u8 = 12;
243        self.w.bits &= !((MASK as u32) << OFFSET);
244        self.w.bits |= ((value & MASK) as u32) << OFFSET;
245        self.w
246    }
247}
248#[doc = r" Proxy"]
249pub struct _RSSI_OFFSETW<'a> {
250    w: &'a mut W,
251}
252impl<'a> _RSSI_OFFSETW<'a> {
253    #[doc = r" Writes raw bits to the field"]
254    #[inline]
255    pub unsafe fn bits(self, value: u8) -> &'a mut W {
256        const MASK: u8 = 255;
257        const OFFSET: u8 = 0;
258        self.w.bits &= !((MASK as u32) << OFFSET);
259        self.w.bits |= ((value & MASK) as u32) << OFFSET;
260        self.w
261    }
262}
263impl R {
264    #[doc = r" Value of the register as raw bits"]
265    #[inline]
266    pub fn bits(&self) -> u32 {
267        self.bits
268    }
269    #[doc = "Bits 28:31 - 31:28\\] Internal. Only to be used through TI provided API."]
270    #[inline]
271    pub fn ifamp_ib(&self) -> IFAMP_IBR {
272        let bits = {
273            const MASK: u8 = 15;
274            const OFFSET: u8 = 28;
275            ((self.bits >> OFFSET) & MASK as u32) as u8
276        };
277        IFAMP_IBR { bits }
278    }
279    #[doc = "Bits 24:27 - 27:24\\] Internal. Only to be used through TI provided API."]
280    #[inline]
281    pub fn lna_ib(&self) -> LNA_IBR {
282        let bits = {
283            const MASK: u8 = 15;
284            const OFFSET: u8 = 24;
285            ((self.bits >> OFFSET) & MASK as u32) as u8
286        };
287        LNA_IBR { bits }
288    }
289    #[doc = "Bits 19:23 - 23:19\\] Internal. Only to be used through TI provided API."]
290    #[inline]
291    pub fn ifamp_trim(&self) -> IFAMP_TRIMR {
292        let bits = {
293            const MASK: u8 = 31;
294            const OFFSET: u8 = 19;
295            ((self.bits >> OFFSET) & MASK as u32) as u8
296        };
297        IFAMP_TRIMR { bits }
298    }
299    #[doc = "Bits 14:18 - 18:14\\] Internal. Only to be used through TI provided API."]
300    #[inline]
301    pub fn ctl_pa0_trim(&self) -> CTL_PA0_TRIMR {
302        let bits = {
303            const MASK: u8 = 31;
304            const OFFSET: u8 = 14;
305            ((self.bits >> OFFSET) & MASK as u32) as u8
306        };
307        CTL_PA0_TRIMR { bits }
308    }
309    #[doc = "Bit 13 - 13:13\\] Internal. Only to be used through TI provided API."]
310    #[inline]
311    pub fn patrimcomplete_n(&self) -> PATRIMCOMPLETE_NR {
312        let bits = {
313            const MASK: bool = true;
314            const OFFSET: u8 = 13;
315            ((self.bits >> OFFSET) & MASK as u32) != 0
316        };
317        PATRIMCOMPLETE_NR { bits }
318    }
319    #[doc = "Bit 12 - 12:12\\] Internal. Only to be used through TI provided API."]
320    #[inline]
321    pub fn rssitrimcomplete_n(&self) -> RSSITRIMCOMPLETE_NR {
322        let bits = {
323            const MASK: bool = true;
324            const OFFSET: u8 = 12;
325            ((self.bits >> OFFSET) & MASK as u32) != 0
326        };
327        RSSITRIMCOMPLETE_NR { bits }
328    }
329    #[doc = "Bits 0:7 - 7:0\\] Internal. Only to be used through TI provided API."]
330    #[inline]
331    pub fn rssi_offset(&self) -> RSSI_OFFSETR {
332        let bits = {
333            const MASK: u8 = 255;
334            const OFFSET: u8 = 0;
335            ((self.bits >> OFFSET) & MASK as u32) as u8
336        };
337        RSSI_OFFSETR { bits }
338    }
339}
340impl W {
341    #[doc = r" Reset value of the register"]
342    #[inline]
343    pub fn reset_value() -> W {
344        W { bits: 1879052032 }
345    }
346    #[doc = r" Writes raw bits to the register"]
347    #[inline]
348    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
349        self.bits = bits;
350        self
351    }
352    #[doc = "Bits 28:31 - 31:28\\] Internal. Only to be used through TI provided API."]
353    #[inline]
354    pub fn ifamp_ib(&mut self) -> _IFAMP_IBW {
355        _IFAMP_IBW { w: self }
356    }
357    #[doc = "Bits 24:27 - 27:24\\] Internal. Only to be used through TI provided API."]
358    #[inline]
359    pub fn lna_ib(&mut self) -> _LNA_IBW {
360        _LNA_IBW { w: self }
361    }
362    #[doc = "Bits 19:23 - 23:19\\] Internal. Only to be used through TI provided API."]
363    #[inline]
364    pub fn ifamp_trim(&mut self) -> _IFAMP_TRIMW {
365        _IFAMP_TRIMW { w: self }
366    }
367    #[doc = "Bits 14:18 - 18:14\\] Internal. Only to be used through TI provided API."]
368    #[inline]
369    pub fn ctl_pa0_trim(&mut self) -> _CTL_PA0_TRIMW {
370        _CTL_PA0_TRIMW { w: self }
371    }
372    #[doc = "Bit 13 - 13:13\\] Internal. Only to be used through TI provided API."]
373    #[inline]
374    pub fn patrimcomplete_n(&mut self) -> _PATRIMCOMPLETE_NW {
375        _PATRIMCOMPLETE_NW { w: self }
376    }
377    #[doc = "Bit 12 - 12:12\\] Internal. Only to be used through TI provided API."]
378    #[inline]
379    pub fn rssitrimcomplete_n(&mut self) -> _RSSITRIMCOMPLETE_NW {
380        _RSSITRIMCOMPLETE_NW { w: self }
381    }
382    #[doc = "Bits 0:7 - 7:0\\] Internal. Only to be used through TI provided API."]
383    #[inline]
384    pub fn rssi_offset(&mut self) -> _RSSI_OFFSETW {
385        _RSSI_OFFSETW { w: self }
386    }
387}