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::TPLOG3 {
10    #[doc = r"Modifies the contents of the register"]
11    #[inline(always)]
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        self.register.set(f(&R { bits }, &mut W { bits }).bits);
18    }
19    #[doc = r"Reads the contents of the register"]
20    #[inline(always)]
21    pub fn read(&self) -> R {
22        R {
23            bits: self.register.get(),
24        }
25    }
26    #[doc = r"Writes to the register"]
27    #[inline(always)]
28    pub fn write<F>(&self, f: F)
29    where
30        F: FnOnce(&mut W) -> &mut W,
31    {
32        self.register.set(
33            f(&mut W {
34                bits: Self::reset_value(),
35            })
36            .bits,
37        );
38    }
39    #[doc = r"Reset value of the register"]
40    #[inline(always)]
41    pub const fn reset_value() -> u32 {
42        0
43    }
44    #[doc = r"Writes the reset value to the register"]
45    #[inline(always)]
46    pub fn reset(&self) {
47        self.register.set(Self::reset_value())
48    }
49}
50#[doc = r"Value of the field"]
51pub struct HIB_TPLOG3_TRIG0R {
52    bits: bool,
53}
54impl HIB_TPLOG3_TRIG0R {
55    #[doc = r"Value of the field as raw bits"]
56    #[inline(always)]
57    pub fn bit(&self) -> bool {
58        self.bits
59    }
60    #[doc = r"Returns `true` if the bit is clear (0)"]
61    #[inline(always)]
62    pub fn bit_is_clear(&self) -> bool {
63        !self.bit()
64    }
65    #[doc = r"Returns `true` if the bit is set (1)"]
66    #[inline(always)]
67    pub fn bit_is_set(&self) -> bool {
68        self.bit()
69    }
70}
71#[doc = r"Proxy"]
72pub struct _HIB_TPLOG3_TRIG0W<'a> {
73    w: &'a mut W,
74}
75impl<'a> _HIB_TPLOG3_TRIG0W<'a> {
76    #[doc = r"Sets the field bit"]
77    #[inline(always)]
78    pub fn set_bit(self) -> &'a mut W {
79        self.bit(true)
80    }
81    #[doc = r"Clears the field bit"]
82    #[inline(always)]
83    pub fn clear_bit(self) -> &'a mut W {
84        self.bit(false)
85    }
86    #[doc = r"Writes raw bits to the field"]
87    #[inline(always)]
88    pub fn bit(self, value: bool) -> &'a mut W {
89        self.w.bits &= !(1 << 0);
90        self.w.bits |= ((value as u32) & 1) << 0;
91        self.w
92    }
93}
94#[doc = r"Value of the field"]
95pub struct HIB_TPLOG3_TRIG1R {
96    bits: bool,
97}
98impl HIB_TPLOG3_TRIG1R {
99    #[doc = r"Value of the field as raw bits"]
100    #[inline(always)]
101    pub fn bit(&self) -> bool {
102        self.bits
103    }
104    #[doc = r"Returns `true` if the bit is clear (0)"]
105    #[inline(always)]
106    pub fn bit_is_clear(&self) -> bool {
107        !self.bit()
108    }
109    #[doc = r"Returns `true` if the bit is set (1)"]
110    #[inline(always)]
111    pub fn bit_is_set(&self) -> bool {
112        self.bit()
113    }
114}
115#[doc = r"Proxy"]
116pub struct _HIB_TPLOG3_TRIG1W<'a> {
117    w: &'a mut W,
118}
119impl<'a> _HIB_TPLOG3_TRIG1W<'a> {
120    #[doc = r"Sets the field bit"]
121    #[inline(always)]
122    pub fn set_bit(self) -> &'a mut W {
123        self.bit(true)
124    }
125    #[doc = r"Clears the field bit"]
126    #[inline(always)]
127    pub fn clear_bit(self) -> &'a mut W {
128        self.bit(false)
129    }
130    #[doc = r"Writes raw bits to the field"]
131    #[inline(always)]
132    pub fn bit(self, value: bool) -> &'a mut W {
133        self.w.bits &= !(1 << 1);
134        self.w.bits |= ((value as u32) & 1) << 1;
135        self.w
136    }
137}
138#[doc = r"Value of the field"]
139pub struct HIB_TPLOG3_TRIG2R {
140    bits: bool,
141}
142impl HIB_TPLOG3_TRIG2R {
143    #[doc = r"Value of the field as raw bits"]
144    #[inline(always)]
145    pub fn bit(&self) -> bool {
146        self.bits
147    }
148    #[doc = r"Returns `true` if the bit is clear (0)"]
149    #[inline(always)]
150    pub fn bit_is_clear(&self) -> bool {
151        !self.bit()
152    }
153    #[doc = r"Returns `true` if the bit is set (1)"]
154    #[inline(always)]
155    pub fn bit_is_set(&self) -> bool {
156        self.bit()
157    }
158}
159#[doc = r"Proxy"]
160pub struct _HIB_TPLOG3_TRIG2W<'a> {
161    w: &'a mut W,
162}
163impl<'a> _HIB_TPLOG3_TRIG2W<'a> {
164    #[doc = r"Sets the field bit"]
165    #[inline(always)]
166    pub fn set_bit(self) -> &'a mut W {
167        self.bit(true)
168    }
169    #[doc = r"Clears the field bit"]
170    #[inline(always)]
171    pub fn clear_bit(self) -> &'a mut W {
172        self.bit(false)
173    }
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub fn bit(self, value: bool) -> &'a mut W {
177        self.w.bits &= !(1 << 2);
178        self.w.bits |= ((value as u32) & 1) << 2;
179        self.w
180    }
181}
182#[doc = r"Value of the field"]
183pub struct HIB_TPLOG3_TRIG3R {
184    bits: bool,
185}
186impl HIB_TPLOG3_TRIG3R {
187    #[doc = r"Value of the field as raw bits"]
188    #[inline(always)]
189    pub fn bit(&self) -> bool {
190        self.bits
191    }
192    #[doc = r"Returns `true` if the bit is clear (0)"]
193    #[inline(always)]
194    pub fn bit_is_clear(&self) -> bool {
195        !self.bit()
196    }
197    #[doc = r"Returns `true` if the bit is set (1)"]
198    #[inline(always)]
199    pub fn bit_is_set(&self) -> bool {
200        self.bit()
201    }
202}
203#[doc = r"Proxy"]
204pub struct _HIB_TPLOG3_TRIG3W<'a> {
205    w: &'a mut W,
206}
207impl<'a> _HIB_TPLOG3_TRIG3W<'a> {
208    #[doc = r"Sets the field bit"]
209    #[inline(always)]
210    pub fn set_bit(self) -> &'a mut W {
211        self.bit(true)
212    }
213    #[doc = r"Clears the field bit"]
214    #[inline(always)]
215    pub fn clear_bit(self) -> &'a mut W {
216        self.bit(false)
217    }
218    #[doc = r"Writes raw bits to the field"]
219    #[inline(always)]
220    pub fn bit(self, value: bool) -> &'a mut W {
221        self.w.bits &= !(1 << 3);
222        self.w.bits |= ((value as u32) & 1) << 3;
223        self.w
224    }
225}
226#[doc = r"Value of the field"]
227pub struct HIB_TPLOG3_XOSCR {
228    bits: bool,
229}
230impl HIB_TPLOG3_XOSCR {
231    #[doc = r"Value of the field as raw bits"]
232    #[inline(always)]
233    pub fn bit(&self) -> bool {
234        self.bits
235    }
236    #[doc = r"Returns `true` if the bit is clear (0)"]
237    #[inline(always)]
238    pub fn bit_is_clear(&self) -> bool {
239        !self.bit()
240    }
241    #[doc = r"Returns `true` if the bit is set (1)"]
242    #[inline(always)]
243    pub fn bit_is_set(&self) -> bool {
244        self.bit()
245    }
246}
247#[doc = r"Proxy"]
248pub struct _HIB_TPLOG3_XOSCW<'a> {
249    w: &'a mut W,
250}
251impl<'a> _HIB_TPLOG3_XOSCW<'a> {
252    #[doc = r"Sets the field bit"]
253    #[inline(always)]
254    pub fn set_bit(self) -> &'a mut W {
255        self.bit(true)
256    }
257    #[doc = r"Clears the field bit"]
258    #[inline(always)]
259    pub fn clear_bit(self) -> &'a mut W {
260        self.bit(false)
261    }
262    #[doc = r"Writes raw bits to the field"]
263    #[inline(always)]
264    pub fn bit(self, value: bool) -> &'a mut W {
265        self.w.bits &= !(1 << 16);
266        self.w.bits |= ((value as u32) & 1) << 16;
267        self.w
268    }
269}
270impl R {
271    #[doc = r"Value of the register as raw bits"]
272    #[inline(always)]
273    pub fn bits(&self) -> u32 {
274        self.bits
275    }
276    #[doc = "Bit 0 - Status of TMPR\\[0\\] Trigger"]
277    #[inline(always)]
278    pub fn hib_tplog3_trig0(&self) -> HIB_TPLOG3_TRIG0R {
279        let bits = ((self.bits >> 0) & 1) != 0;
280        HIB_TPLOG3_TRIG0R { bits }
281    }
282    #[doc = "Bit 1 - Status of TMPR\\[1\\] Trigger"]
283    #[inline(always)]
284    pub fn hib_tplog3_trig1(&self) -> HIB_TPLOG3_TRIG1R {
285        let bits = ((self.bits >> 1) & 1) != 0;
286        HIB_TPLOG3_TRIG1R { bits }
287    }
288    #[doc = "Bit 2 - Status of TMPR\\[2\\] Trigger"]
289    #[inline(always)]
290    pub fn hib_tplog3_trig2(&self) -> HIB_TPLOG3_TRIG2R {
291        let bits = ((self.bits >> 2) & 1) != 0;
292        HIB_TPLOG3_TRIG2R { bits }
293    }
294    #[doc = "Bit 3 - Status of TMPR\\[3\\] Trigger"]
295    #[inline(always)]
296    pub fn hib_tplog3_trig3(&self) -> HIB_TPLOG3_TRIG3R {
297        let bits = ((self.bits >> 3) & 1) != 0;
298        HIB_TPLOG3_TRIG3R { bits }
299    }
300    #[doc = "Bit 16 - Status of external 32"]
301    #[inline(always)]
302    pub fn hib_tplog3_xosc(&self) -> HIB_TPLOG3_XOSCR {
303        let bits = ((self.bits >> 16) & 1) != 0;
304        HIB_TPLOG3_XOSCR { bits }
305    }
306}
307impl W {
308    #[doc = r"Writes raw bits to the register"]
309    #[inline(always)]
310    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
311        self.bits = bits;
312        self
313    }
314    #[doc = "Bit 0 - Status of TMPR\\[0\\] Trigger"]
315    #[inline(always)]
316    pub fn hib_tplog3_trig0(&mut self) -> _HIB_TPLOG3_TRIG0W {
317        _HIB_TPLOG3_TRIG0W { w: self }
318    }
319    #[doc = "Bit 1 - Status of TMPR\\[1\\] Trigger"]
320    #[inline(always)]
321    pub fn hib_tplog3_trig1(&mut self) -> _HIB_TPLOG3_TRIG1W {
322        _HIB_TPLOG3_TRIG1W { w: self }
323    }
324    #[doc = "Bit 2 - Status of TMPR\\[2\\] Trigger"]
325    #[inline(always)]
326    pub fn hib_tplog3_trig2(&mut self) -> _HIB_TPLOG3_TRIG2W {
327        _HIB_TPLOG3_TRIG2W { w: self }
328    }
329    #[doc = "Bit 3 - Status of TMPR\\[3\\] Trigger"]
330    #[inline(always)]
331    pub fn hib_tplog3_trig3(&mut self) -> _HIB_TPLOG3_TRIG3W {
332        _HIB_TPLOG3_TRIG3W { w: self }
333    }
334    #[doc = "Bit 16 - Status of external 32"]
335    #[inline(always)]
336    pub fn hib_tplog3_xosc(&mut self) -> _HIB_TPLOG3_XOSCW {
337        _HIB_TPLOG3_XOSCW { w: self }
338    }
339}