efm32pg12_pac/emu/
dcdclncompctrl.rs

1#[doc = "Reader of register DCDCLNCOMPCTRL"]
2pub type R = crate::R<u32, super::DCDCLNCOMPCTRL>;
3#[doc = "Writer for register DCDCLNCOMPCTRL"]
4pub type W = crate::W<u32, super::DCDCLNCOMPCTRL>;
5#[doc = "Register DCDCLNCOMPCTRL `reset()`'s with value 0x5720_4077"]
6impl crate::ResetValue for super::DCDCLNCOMPCTRL {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x5720_4077
11    }
12}
13#[doc = "Reader of field `COMPENR1`"]
14pub type COMPENR1_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `COMPENR1`"]
16pub struct COMPENR1_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> COMPENR1_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07);
24        self.w
25    }
26}
27#[doc = "Reader of field `COMPENR2`"]
28pub type COMPENR2_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `COMPENR2`"]
30pub struct COMPENR2_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> COMPENR2_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x1f << 4)) | (((value as u32) & 0x1f) << 4);
38        self.w
39    }
40}
41#[doc = "Reader of field `COMPENR3`"]
42pub type COMPENR3_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `COMPENR3`"]
44pub struct COMPENR3_W<'a> {
45    w: &'a mut W,
46}
47impl<'a> COMPENR3_W<'a> {
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub unsafe fn bits(self, value: u8) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12);
52        self.w
53    }
54}
55#[doc = "Reader of field `COMPENC1`"]
56pub type COMPENC1_R = crate::R<u8, u8>;
57#[doc = "Write proxy for field `COMPENC1`"]
58pub struct COMPENC1_W<'a> {
59    w: &'a mut W,
60}
61impl<'a> COMPENC1_W<'a> {
62    #[doc = r"Writes raw bits to the field"]
63    #[inline(always)]
64    pub unsafe fn bits(self, value: u8) -> &'a mut W {
65        self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20);
66        self.w
67    }
68}
69#[doc = "Reader of field `COMPENC2`"]
70pub type COMPENC2_R = crate::R<u8, u8>;
71#[doc = "Write proxy for field `COMPENC2`"]
72pub struct COMPENC2_W<'a> {
73    w: &'a mut W,
74}
75impl<'a> COMPENC2_W<'a> {
76    #[doc = r"Writes raw bits to the field"]
77    #[inline(always)]
78    pub unsafe fn bits(self, value: u8) -> &'a mut W {
79        self.w.bits = (self.w.bits & !(0x07 << 24)) | (((value as u32) & 0x07) << 24);
80        self.w
81    }
82}
83#[doc = "Reader of field `COMPENC3`"]
84pub type COMPENC3_R = crate::R<u8, u8>;
85#[doc = "Write proxy for field `COMPENC3`"]
86pub struct COMPENC3_W<'a> {
87    w: &'a mut W,
88}
89impl<'a> COMPENC3_W<'a> {
90    #[doc = r"Writes raw bits to the field"]
91    #[inline(always)]
92    pub unsafe fn bits(self, value: u8) -> &'a mut W {
93        self.w.bits = (self.w.bits & !(0x0f << 28)) | (((value as u32) & 0x0f) << 28);
94        self.w
95    }
96}
97impl R {
98    #[doc = "Bits 0:2 - Low Noise Mode Compensator R1 Trim Value"]
99    #[inline(always)]
100    pub fn compenr1(&self) -> COMPENR1_R {
101        COMPENR1_R::new((self.bits & 0x07) as u8)
102    }
103    #[doc = "Bits 4:8 - Low Noise Mode Compensator R2 Trim Value"]
104    #[inline(always)]
105    pub fn compenr2(&self) -> COMPENR2_R {
106        COMPENR2_R::new(((self.bits >> 4) & 0x1f) as u8)
107    }
108    #[doc = "Bits 12:15 - Low Noise Mode Compensator R3 Trim Value"]
109    #[inline(always)]
110    pub fn compenr3(&self) -> COMPENR3_R {
111        COMPENR3_R::new(((self.bits >> 12) & 0x0f) as u8)
112    }
113    #[doc = "Bits 20:21 - Low Noise Mode Compensator C1 Trim Value"]
114    #[inline(always)]
115    pub fn compenc1(&self) -> COMPENC1_R {
116        COMPENC1_R::new(((self.bits >> 20) & 0x03) as u8)
117    }
118    #[doc = "Bits 24:26 - Low Noise Mode Compensator C2 Trim Value"]
119    #[inline(always)]
120    pub fn compenc2(&self) -> COMPENC2_R {
121        COMPENC2_R::new(((self.bits >> 24) & 0x07) as u8)
122    }
123    #[doc = "Bits 28:31 - Low Noise Mode Compensator C3 Trim Value"]
124    #[inline(always)]
125    pub fn compenc3(&self) -> COMPENC3_R {
126        COMPENC3_R::new(((self.bits >> 28) & 0x0f) as u8)
127    }
128}
129impl W {
130    #[doc = "Bits 0:2 - Low Noise Mode Compensator R1 Trim Value"]
131    #[inline(always)]
132    pub fn compenr1(&mut self) -> COMPENR1_W {
133        COMPENR1_W { w: self }
134    }
135    #[doc = "Bits 4:8 - Low Noise Mode Compensator R2 Trim Value"]
136    #[inline(always)]
137    pub fn compenr2(&mut self) -> COMPENR2_W {
138        COMPENR2_W { w: self }
139    }
140    #[doc = "Bits 12:15 - Low Noise Mode Compensator R3 Trim Value"]
141    #[inline(always)]
142    pub fn compenr3(&mut self) -> COMPENR3_W {
143        COMPENR3_W { w: self }
144    }
145    #[doc = "Bits 20:21 - Low Noise Mode Compensator C1 Trim Value"]
146    #[inline(always)]
147    pub fn compenc1(&mut self) -> COMPENC1_W {
148        COMPENC1_W { w: self }
149    }
150    #[doc = "Bits 24:26 - Low Noise Mode Compensator C2 Trim Value"]
151    #[inline(always)]
152    pub fn compenc2(&mut self) -> COMPENC2_W {
153        COMPENC2_W { w: self }
154    }
155    #[doc = "Bits 28:31 - Low Noise Mode Compensator C3 Trim Value"]
156    #[inline(always)]
157    pub fn compenc3(&mut self) -> COMPENC3_W {
158        COMPENC3_W { w: self }
159    }
160}