eos_s3/spt/
error_cmp_1s_0.rs1#[doc = "Register `ERROR_CMP_1S_0` reader"]
2pub struct R(crate::R<ERROR_CMP_1S_0_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ERROR_CMP_1S_0_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ERROR_CMP_1S_0_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ERROR_CMP_1S_0_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `ERROR_CMP_1S_0` writer"]
17pub struct W(crate::W<ERROR_CMP_1S_0_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<ERROR_CMP_1S_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_1S_0_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<ERROR_CMP_1S_0_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `ERROR_CMP_1S_0` reader - Each 1s period contains sub-events for every 40ms counted, and a subevent for the first ms counted. Each bit-pair in this field corresponds to one of those sub-events. Values of 0 or 2 in bit pairs do nothing. A value of 3 means the counter should decrease 1ms everytime the subevent is triggered, and a value of 1 means the counter should increment 1ms every time the event is triggered. \\[bits 1:0 = 1st 1ms event, bit 3:2 = 1st 40ms event ... 31:30 = 15th 40ms event\\]"]
38pub struct ERROR_CMP_1S_0_R(crate::FieldReader<u32, u32>);
39impl ERROR_CMP_1S_0_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: u32) -> Self {
42 ERROR_CMP_1S_0_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for ERROR_CMP_1S_0_R {
46 type Target = crate::FieldReader<u32, u32>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `ERROR_CMP_1S_0` writer - Each 1s period contains sub-events for every 40ms counted, and a subevent for the first ms counted. Each bit-pair in this field corresponds to one of those sub-events. Values of 0 or 2 in bit pairs do nothing. A value of 3 means the counter should decrease 1ms everytime the subevent is triggered, and a value of 1 means the counter should increment 1ms every time the event is triggered. \\[bits 1:0 = 1st 1ms event, bit 3:2 = 1st 40ms event ... 31:30 = 15th 40ms event\\]"]
53pub struct ERROR_CMP_1S_0_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> ERROR_CMP_1S_0_W<'a> {
57 #[doc = r"Writes raw bits to the field"]
58 #[inline(always)]
59 pub unsafe fn bits(self, value: u32) -> &'a mut W {
60 self.w.bits = value as u32;
61 self.w
62 }
63}
64impl R {
65 #[doc = "Bits 0:31 - Each 1s period contains sub-events for every 40ms counted, and a subevent for the first ms counted. Each bit-pair in this field corresponds to one of those sub-events. Values of 0 or 2 in bit pairs do nothing. A value of 3 means the counter should decrease 1ms everytime the subevent is triggered, and a value of 1 means the counter should increment 1ms every time the event is triggered. \\[bits 1:0 = 1st 1ms event, bit 3:2 = 1st 40ms event ... 31:30 = 15th 40ms event\\]"]
66 #[inline(always)]
67 pub fn error_cmp_1s_0(&self) -> ERROR_CMP_1S_0_R {
68 ERROR_CMP_1S_0_R::new(self.bits as u32)
69 }
70}
71impl W {
72 #[doc = "Bits 0:31 - Each 1s period contains sub-events for every 40ms counted, and a subevent for the first ms counted. Each bit-pair in this field corresponds to one of those sub-events. Values of 0 or 2 in bit pairs do nothing. A value of 3 means the counter should decrease 1ms everytime the subevent is triggered, and a value of 1 means the counter should increment 1ms every time the event is triggered. \\[bits 1:0 = 1st 1ms event, bit 3:2 = 1st 40ms event ... 31:30 = 15th 40ms event\\]"]
73 #[inline(always)]
74 pub fn error_cmp_1s_0(&mut self) -> ERROR_CMP_1S_0_W {
75 ERROR_CMP_1S_0_W { w: self }
76 }
77 #[doc = "Writes raw bits to the register."]
78 #[inline(always)]
79 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
80 self.0.bits(bits);
81 self
82 }
83}
84#[doc = "1 sec Increment Error Compensation 0 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_1s_0](index.html) module"]
85pub struct ERROR_CMP_1S_0_SPEC;
86impl crate::RegisterSpec for ERROR_CMP_1S_0_SPEC {
87 type Ux = u32;
88}
89#[doc = "`read()` method returns [error_cmp_1s_0::R](R) reader structure"]
90impl crate::Readable for ERROR_CMP_1S_0_SPEC {
91 type Reader = R;
92}
93#[doc = "`write(|w| ..)` method takes [error_cmp_1s_0::W](W) writer structure"]
94impl crate::Writable for ERROR_CMP_1S_0_SPEC {
95 type Writer = W;
96}
97#[doc = "`reset()` method sets ERROR_CMP_1S_0 to value 0"]
98impl crate::Resettable for ERROR_CMP_1S_0_SPEC {
99 #[inline(always)]
100 fn reset_value() -> Self::Ux {
101 0
102 }
103}