1#[doc = "Register `CR` reader"]
2pub struct R(crate::R<CR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CR` writer"]
17pub struct W(crate::W<CR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CR_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<CR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `START` reader - START field"]
38pub type START_R = crate::BitReader<bool>;
39#[doc = "Field `START` writer - START field"]
40pub type START_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
41#[doc = "Field `RESTART` reader - RESTART field"]
42pub type RESTART_R = crate::BitReader<bool>;
43#[doc = "Field `RESTART` writer - RESTART field"]
44pub type RESTART_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
45#[doc = "Field `RESET` reader - RESET field"]
46pub type RESET_R = crate::BitReader<bool>;
47#[doc = "Field `RESET` writer - RESET field"]
48pub type RESET_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
49#[doc = "Field `REINTRV` reader - REINTRV field"]
50pub type REINTRV_R = crate::BitReader<bool>;
51#[doc = "Field `REINTRV` writer - REINTRV field"]
52pub type REINTRV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
53#[doc = "Field `LASTBUF` reader - LASTBUF field"]
54pub type LASTBUF_R = crate::BitReader<bool>;
55#[doc = "Field `LASTBUF` writer - LASTBUF field"]
56pub type LASTBUF_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
57#[doc = "Field `QTAUTO` reader - QTAUTO field"]
58pub type QTAUTO_R = crate::BitReader<bool>;
59#[doc = "Field `QTAUTO` writer - QTAUTO field"]
60pub type QTAUTO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
61#[doc = "Field `HTAUTO` reader - HTAUTO field"]
62pub type HTAUTO_R = crate::BitReader<bool>;
63#[doc = "Field `HTAUTO` writer - HTAUTO field"]
64pub type HTAUTO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
65#[doc = "Field `QTCNT` reader - QTCNT field"]
66pub type QTCNT_R = crate::FieldReader<u8, u8>;
67#[doc = "Field `QTCNT` writer - QTCNT field"]
68pub type QTCNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR_SPEC, u8, u8, 2, O>;
69#[doc = "Field `HTCNT` reader - HTCNT field"]
70pub type HTCNT_R = crate::BitReader<bool>;
71#[doc = "Field `HTCNT` writer - HTCNT field"]
72pub type HTCNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR_SPEC, bool, O>;
73#[doc = "Field `CUCNT` reader - CUCNT field"]
74pub type CUCNT_R = crate::FieldReader<u16, u16>;
75#[doc = "Field `CUCNT` writer - CUCNT field"]
76pub type CUCNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR_SPEC, u16, u16, 16, O>;
77impl R {
78 #[doc = "Bit 0 - START field"]
79 #[inline(always)]
80 pub fn start(&self) -> START_R {
81 START_R::new((self.bits & 1) != 0)
82 }
83 #[doc = "Bit 1 - RESTART field"]
84 #[inline(always)]
85 pub fn restart(&self) -> RESTART_R {
86 RESTART_R::new(((self.bits >> 1) & 1) != 0)
87 }
88 #[doc = "Bit 3 - RESET field"]
89 #[inline(always)]
90 pub fn reset(&self) -> RESET_R {
91 RESET_R::new(((self.bits >> 3) & 1) != 0)
92 }
93 #[doc = "Bit 4 - REINTRV field"]
94 #[inline(always)]
95 pub fn reintrv(&self) -> REINTRV_R {
96 REINTRV_R::new(((self.bits >> 4) & 1) != 0)
97 }
98 #[doc = "Bit 5 - LASTBUF field"]
99 #[inline(always)]
100 pub fn lastbuf(&self) -> LASTBUF_R {
101 LASTBUF_R::new(((self.bits >> 5) & 1) != 0)
102 }
103 #[doc = "Bit 7 - QTAUTO field"]
104 #[inline(always)]
105 pub fn qtauto(&self) -> QTAUTO_R {
106 QTAUTO_R::new(((self.bits >> 7) & 1) != 0)
107 }
108 #[doc = "Bit 8 - HTAUTO field"]
109 #[inline(always)]
110 pub fn htauto(&self) -> HTAUTO_R {
111 HTAUTO_R::new(((self.bits >> 8) & 1) != 0)
112 }
113 #[doc = "Bits 9:10 - QTCNT field"]
114 #[inline(always)]
115 pub fn qtcnt(&self) -> QTCNT_R {
116 QTCNT_R::new(((self.bits >> 9) & 3) as u8)
117 }
118 #[doc = "Bit 11 - HTCNT field"]
119 #[inline(always)]
120 pub fn htcnt(&self) -> HTCNT_R {
121 HTCNT_R::new(((self.bits >> 11) & 1) != 0)
122 }
123 #[doc = "Bits 12:27 - CUCNT field"]
124 #[inline(always)]
125 pub fn cucnt(&self) -> CUCNT_R {
126 CUCNT_R::new(((self.bits >> 12) & 0xffff) as u16)
127 }
128}
129impl W {
130 #[doc = "Bit 0 - START field"]
131 #[inline(always)]
132 pub fn start(&mut self) -> START_W<0> {
133 START_W::new(self)
134 }
135 #[doc = "Bit 1 - RESTART field"]
136 #[inline(always)]
137 pub fn restart(&mut self) -> RESTART_W<1> {
138 RESTART_W::new(self)
139 }
140 #[doc = "Bit 3 - RESET field"]
141 #[inline(always)]
142 pub fn reset(&mut self) -> RESET_W<3> {
143 RESET_W::new(self)
144 }
145 #[doc = "Bit 4 - REINTRV field"]
146 #[inline(always)]
147 pub fn reintrv(&mut self) -> REINTRV_W<4> {
148 REINTRV_W::new(self)
149 }
150 #[doc = "Bit 5 - LASTBUF field"]
151 #[inline(always)]
152 pub fn lastbuf(&mut self) -> LASTBUF_W<5> {
153 LASTBUF_W::new(self)
154 }
155 #[doc = "Bit 7 - QTAUTO field"]
156 #[inline(always)]
157 pub fn qtauto(&mut self) -> QTAUTO_W<7> {
158 QTAUTO_W::new(self)
159 }
160 #[doc = "Bit 8 - HTAUTO field"]
161 #[inline(always)]
162 pub fn htauto(&mut self) -> HTAUTO_W<8> {
163 HTAUTO_W::new(self)
164 }
165 #[doc = "Bits 9:10 - QTCNT field"]
166 #[inline(always)]
167 pub fn qtcnt(&mut self) -> QTCNT_W<9> {
168 QTCNT_W::new(self)
169 }
170 #[doc = "Bit 11 - HTCNT field"]
171 #[inline(always)]
172 pub fn htcnt(&mut self) -> HTCNT_W<11> {
173 HTCNT_W::new(self)
174 }
175 #[doc = "Bits 12:27 - CUCNT field"]
176 #[inline(always)]
177 pub fn cucnt(&mut self) -> CUCNT_W<12> {
178 CUCNT_W::new(self)
179 }
180 #[doc = "Writes raw bits to the register."]
181 #[inline(always)]
182 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
183 self.0.bits(bits);
184 self
185 }
186}
187#[doc = "CR 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 [cr](index.html) module"]
188pub struct CR_SPEC;
189impl crate::RegisterSpec for CR_SPEC {
190 type Ux = u32;
191}
192#[doc = "`read()` method returns [cr::R](R) reader structure"]
193impl crate::Readable for CR_SPEC {
194 type Reader = R;
195}
196#[doc = "`write(|w| ..)` method takes [cr::W](W) writer structure"]
197impl crate::Writable for CR_SPEC {
198 type Writer = W;
199}
200#[doc = "`reset()` method sets CR to value 0"]
201impl crate::Resettable for CR_SPEC {
202 #[inline(always)]
203 fn reset_value() -> Self::Ux {
204 0
205 }
206}