eos_s3/spt/
error_cmp_rtc_0.rs

1#[doc = "Register `ERROR_CMP_RTC_0` reader"]
2pub struct R(crate::R<ERROR_CMP_RTC_0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ERROR_CMP_RTC_0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ERROR_CMP_RTC_0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ERROR_CMP_RTC_0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `ERROR_CMP_RTC_0` writer"]
17pub struct W(crate::W<ERROR_CMP_RTC_0_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<ERROR_CMP_RTC_0_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<ERROR_CMP_RTC_0_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<ERROR_CMP_RTC_0_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `ERROT_CMP_RTC_0_16` reader - Every 16s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 1:0 4002ms event, bits 3:2 4450ms event, bits 5:4 6002ms event, bits 7:6 6450ms event\\]"]
38pub struct ERROT_CMP_RTC_0_16_R(crate::FieldReader<u8, u8>);
39impl ERROT_CMP_RTC_0_16_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u8) -> Self {
42        ERROT_CMP_RTC_0_16_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for ERROT_CMP_RTC_0_16_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 `ERROT_CMP_RTC_0_16` writer - Every 16s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 1:0 4002ms event, bits 3:2 4450ms event, bits 5:4 6002ms event, bits 7:6 6450ms event\\]"]
53pub struct ERROT_CMP_RTC_0_16_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> ERROT_CMP_RTC_0_16_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 & !0xff) | (value as u32 & 0xff);
61        self.w
62    }
63}
64#[doc = "Field `ERROT_CMP_RTC_0_8` reader - Every 8s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 9:8 4002ms event, bits 11:10 4450ms event, bits 13:12 6002ms event, bits 15:14 6450ms event\\]"]
65pub struct ERROT_CMP_RTC_0_8_R(crate::FieldReader<u8, u8>);
66impl ERROT_CMP_RTC_0_8_R {
67    #[inline(always)]
68    pub(crate) fn new(bits: u8) -> Self {
69        ERROT_CMP_RTC_0_8_R(crate::FieldReader::new(bits))
70    }
71}
72impl core::ops::Deref for ERROT_CMP_RTC_0_8_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 `ERROT_CMP_RTC_0_8` writer - Every 8s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 9:8 4002ms event, bits 11:10 4450ms event, bits 13:12 6002ms event, bits 15:14 6450ms event\\]"]
80pub struct ERROT_CMP_RTC_0_8_W<'a> {
81    w: &'a mut W,
82}
83impl<'a> ERROT_CMP_RTC_0_8_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 =
88            (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8);
89        self.w
90    }
91}
92#[doc = "Field `ERROT_CMP_RTC_0_4` reader - Every 4s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 17:16 2002ms event, bits 19:18 2450ms event, bits 21:20 3002ms event, bits 23:22 3450ms event\\]"]
93pub struct ERROT_CMP_RTC_0_4_R(crate::FieldReader<u8, u8>);
94impl ERROT_CMP_RTC_0_4_R {
95    #[inline(always)]
96    pub(crate) fn new(bits: u8) -> Self {
97        ERROT_CMP_RTC_0_4_R(crate::FieldReader::new(bits))
98    }
99}
100impl core::ops::Deref for ERROT_CMP_RTC_0_4_R {
101    type Target = crate::FieldReader<u8, u8>;
102    #[inline(always)]
103    fn deref(&self) -> &Self::Target {
104        &self.0
105    }
106}
107#[doc = "Field `ERROT_CMP_RTC_0_4` writer - Every 4s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 17:16 2002ms event, bits 19:18 2450ms event, bits 21:20 3002ms event, bits 23:22 3450ms event\\]"]
108pub struct ERROT_CMP_RTC_0_4_W<'a> {
109    w: &'a mut W,
110}
111impl<'a> ERROT_CMP_RTC_0_4_W<'a> {
112    #[doc = r"Writes raw bits to the field"]
113    #[inline(always)]
114    pub unsafe fn bits(self, value: u8) -> &'a mut W {
115        self.w.bits =
116            (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16);
117        self.w
118    }
119}
120#[doc = "Field `ERROT_CMP_RTC_0_2` reader - Every 2s there are 2 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 25:24 1002ms event, bits 27:26 1450ms event\\]"]
121pub struct ERROT_CMP_RTC_0_2_R(crate::FieldReader<u8, u8>);
122impl ERROT_CMP_RTC_0_2_R {
123    #[inline(always)]
124    pub(crate) fn new(bits: u8) -> Self {
125        ERROT_CMP_RTC_0_2_R(crate::FieldReader::new(bits))
126    }
127}
128impl core::ops::Deref for ERROT_CMP_RTC_0_2_R {
129    type Target = crate::FieldReader<u8, u8>;
130    #[inline(always)]
131    fn deref(&self) -> &Self::Target {
132        &self.0
133    }
134}
135#[doc = "Field `ERROT_CMP_RTC_0_2` writer - Every 2s there are 2 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 25:24 1002ms event, bits 27:26 1450ms event\\]"]
136pub struct ERROT_CMP_RTC_0_2_W<'a> {
137    w: &'a mut W,
138}
139impl<'a> ERROT_CMP_RTC_0_2_W<'a> {
140    #[doc = r"Writes raw bits to the field"]
141    #[inline(always)]
142    pub unsafe fn bits(self, value: u8) -> &'a mut W {
143        self.w.bits =
144            (self.w.bits & !(0x0f << 24)) | ((value as u32 & 0x0f) << 24);
145        self.w
146    }
147}
148impl R {
149    #[doc = "Bits 0:7 - Every 16s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 1:0 4002ms event, bits 3:2 4450ms event, bits 5:4 6002ms event, bits 7:6 6450ms event\\]"]
150    #[inline(always)]
151    pub fn errot_cmp_rtc_0_16(&self) -> ERROT_CMP_RTC_0_16_R {
152        ERROT_CMP_RTC_0_16_R::new((self.bits & 0xff) as u8)
153    }
154    #[doc = "Bits 8:15 - Every 8s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 9:8 4002ms event, bits 11:10 4450ms event, bits 13:12 6002ms event, bits 15:14 6450ms event\\]"]
155    #[inline(always)]
156    pub fn errot_cmp_rtc_0_8(&self) -> ERROT_CMP_RTC_0_8_R {
157        ERROT_CMP_RTC_0_8_R::new(((self.bits >> 8) & 0xff) as u8)
158    }
159    #[doc = "Bits 16:23 - Every 4s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 17:16 2002ms event, bits 19:18 2450ms event, bits 21:20 3002ms event, bits 23:22 3450ms event\\]"]
160    #[inline(always)]
161    pub fn errot_cmp_rtc_0_4(&self) -> ERROT_CMP_RTC_0_4_R {
162        ERROT_CMP_RTC_0_4_R::new(((self.bits >> 16) & 0xff) as u8)
163    }
164    #[doc = "Bits 24:27 - Every 2s there are 2 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 25:24 1002ms event, bits 27:26 1450ms event\\]"]
165    #[inline(always)]
166    pub fn errot_cmp_rtc_0_2(&self) -> ERROT_CMP_RTC_0_2_R {
167        ERROT_CMP_RTC_0_2_R::new(((self.bits >> 24) & 0x0f) as u8)
168    }
169}
170impl W {
171    #[doc = "Bits 0:7 - Every 16s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 1:0 4002ms event, bits 3:2 4450ms event, bits 5:4 6002ms event, bits 7:6 6450ms event\\]"]
172    #[inline(always)]
173    pub fn errot_cmp_rtc_0_16(&mut self) -> ERROT_CMP_RTC_0_16_W {
174        ERROT_CMP_RTC_0_16_W { w: self }
175    }
176    #[doc = "Bits 8:15 - Every 8s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 9:8 4002ms event, bits 11:10 4450ms event, bits 13:12 6002ms event, bits 15:14 6450ms event\\]"]
177    #[inline(always)]
178    pub fn errot_cmp_rtc_0_8(&mut self) -> ERROT_CMP_RTC_0_8_W {
179        ERROT_CMP_RTC_0_8_W { w: self }
180    }
181    #[doc = "Bits 16:23 - Every 4s there are 4 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 17:16 2002ms event, bits 19:18 2450ms event, bits 21:20 3002ms event, bits 23:22 3450ms event\\]"]
182    #[inline(always)]
183    pub fn errot_cmp_rtc_0_4(&mut self) -> ERROT_CMP_RTC_0_4_W {
184        ERROT_CMP_RTC_0_4_W { w: self }
185    }
186    #[doc = "Bits 24:27 - Every 2s there are 2 sub-events. Each bit pair in this field corresponds to those sub-events. Values of 0 and 2 do nothing. A value of 3 means the counter should decrement 1ms, and a value of 1 means the counter must add 1ms. \\[bits 25:24 1002ms event, bits 27:26 1450ms event\\]"]
187    #[inline(always)]
188    pub fn errot_cmp_rtc_0_2(&mut self) -> ERROT_CMP_RTC_0_2_W {
189        ERROT_CMP_RTC_0_2_W { w: self }
190    }
191    #[doc = "Writes raw bits to the register."]
192    #[inline(always)]
193    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
194        self.0.bits(bits);
195        self
196    }
197}
198#[doc = "2, 4, 6, 8, 16 sec Increment Error Compensation Register\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 [error_cmp_rtc_0](index.html) module"]
199pub struct ERROR_CMP_RTC_0_SPEC;
200impl crate::RegisterSpec for ERROR_CMP_RTC_0_SPEC {
201    type Ux = u32;
202}
203#[doc = "`read()` method returns [error_cmp_rtc_0::R](R) reader structure"]
204impl crate::Readable for ERROR_CMP_RTC_0_SPEC {
205    type Reader = R;
206}
207#[doc = "`write(|w| ..)` method takes [error_cmp_rtc_0::W](W) writer structure"]
208impl crate::Writable for ERROR_CMP_RTC_0_SPEC {
209    type Writer = W;
210}
211#[doc = "`reset()` method sets ERROR_CMP_RTC_0 to value 0"]
212impl crate::Resettable for ERROR_CMP_RTC_0_SPEC {
213    #[inline(always)]
214    fn reset_value() -> Self::Ux {
215        0
216    }
217}