cc2538/rfcore_xreg/
fscal1.rs

1#[doc = "Reader of register FSCAL1"]
2pub type R = crate::R<u32, super::FSCAL1>;
3#[doc = "Writer for register FSCAL1"]
4pub type W = crate::W<u32, super::FSCAL1>;
5#[doc = "Register FSCAL1 `reset()`'s with value 0"]
6impl crate::ResetValue for super::FSCAL1 {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `Reserved32`"]
14pub type RESERVED32_R = crate::R<u32, u32>;
15#[doc = "Write proxy for field `Reserved32`"]
16pub struct RESERVED32_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> RESERVED32_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u32) -> &'a mut W {
23        self.w.bits = (self.w.bits & !(0x00ff_ffff << 8)) | (((value as u32) & 0x00ff_ffff) << 8);
24        self.w
25    }
26}
27#[doc = "Reader of field `VCO_CURR_CAL_OE`"]
28pub type VCO_CURR_CAL_OE_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `VCO_CURR_CAL_OE`"]
30pub struct VCO_CURR_CAL_OE_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> VCO_CURR_CAL_OE_W<'a> {
34    #[doc = r"Sets the field bit"]
35    #[inline(always)]
36    pub fn set_bit(self) -> &'a mut W {
37        self.bit(true)
38    }
39    #[doc = r"Clears the field bit"]
40    #[inline(always)]
41    pub fn clear_bit(self) -> &'a mut W {
42        self.bit(false)
43    }
44    #[doc = r"Writes raw bits to the field"]
45    #[inline(always)]
46    pub fn bit(self, value: bool) -> &'a mut W {
47        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
48        self.w
49    }
50}
51#[doc = "Reader of field `VCO_CURR_CAL`"]
52pub type VCO_CURR_CAL_R = crate::R<u8, u8>;
53#[doc = "Write proxy for field `VCO_CURR_CAL`"]
54pub struct VCO_CURR_CAL_W<'a> {
55    w: &'a mut W,
56}
57impl<'a> VCO_CURR_CAL_W<'a> {
58    #[doc = r"Writes raw bits to the field"]
59    #[inline(always)]
60    pub unsafe fn bits(self, value: u8) -> &'a mut W {
61        self.w.bits = (self.w.bits & !(0x1f << 2)) | (((value as u32) & 0x1f) << 2);
62        self.w
63    }
64}
65#[doc = "Reader of field `VCO_CURR`"]
66pub type VCO_CURR_R = crate::R<u8, u8>;
67#[doc = "Write proxy for field `VCO_CURR`"]
68pub struct VCO_CURR_W<'a> {
69    w: &'a mut W,
70}
71impl<'a> VCO_CURR_W<'a> {
72    #[doc = r"Writes raw bits to the field"]
73    #[inline(always)]
74    pub unsafe fn bits(self, value: u8) -> &'a mut W {
75        self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
76        self.w
77    }
78}
79impl R {
80    #[doc = "Bits 8:31 - 31:8\\] This register is 8 bits in a 32-bit address space."]
81    #[inline(always)]
82    pub fn reserved32(&self) -> RESERVED32_R {
83        RESERVED32_R::new(((self.bits >> 8) & 0x00ff_ffff) as u32)
84    }
85    #[doc = "Bit 7 - 7:7\\] Override current calibration"]
86    #[inline(always)]
87    pub fn vco_curr_cal_oe(&self) -> VCO_CURR_CAL_OE_R {
88        VCO_CURR_CAL_OE_R::new(((self.bits >> 7) & 0x01) != 0)
89    }
90    #[doc = "Bits 2:6 - 6:2\\] Calibration result Override value if VCO_CURR_CAL_OE = 1"]
91    #[inline(always)]
92    pub fn vco_curr_cal(&self) -> VCO_CURR_CAL_R {
93        VCO_CURR_CAL_R::new(((self.bits >> 2) & 0x1f) as u8)
94    }
95    #[doc = "Bits 0:1 - 1:0\\] Defines current in VCO core Sets the multiplier between calibrated current and VCO current."]
96    #[inline(always)]
97    pub fn vco_curr(&self) -> VCO_CURR_R {
98        VCO_CURR_R::new((self.bits & 0x03) as u8)
99    }
100}
101impl W {
102    #[doc = "Bits 8:31 - 31:8\\] This register is 8 bits in a 32-bit address space."]
103    #[inline(always)]
104    pub fn reserved32(&mut self) -> RESERVED32_W {
105        RESERVED32_W { w: self }
106    }
107    #[doc = "Bit 7 - 7:7\\] Override current calibration"]
108    #[inline(always)]
109    pub fn vco_curr_cal_oe(&mut self) -> VCO_CURR_CAL_OE_W {
110        VCO_CURR_CAL_OE_W { w: self }
111    }
112    #[doc = "Bits 2:6 - 6:2\\] Calibration result Override value if VCO_CURR_CAL_OE = 1"]
113    #[inline(always)]
114    pub fn vco_curr_cal(&mut self) -> VCO_CURR_CAL_W {
115        VCO_CURR_CAL_W { w: self }
116    }
117    #[doc = "Bits 0:1 - 1:0\\] Defines current in VCO core Sets the multiplier between calibrated current and VCO current."]
118    #[inline(always)]
119    pub fn vco_curr(&mut self) -> VCO_CURR_W {
120        VCO_CURR_W { w: self }
121    }
122}