1pub struct R(crate::R<CCSR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CCSR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CCSR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CCSR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<CCSR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CCSR_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<CCSR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CCSR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type CALSEL_R = crate::BitReader<CALSEL_A>;
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum CALSEL_A {
44 OffsetAndLinearity = 0,
46 OffsetOnly = 1,
48}
49impl From<CALSEL_A> for bool {
50 #[inline(always)]
51 fn from(variant: CALSEL_A) -> Self {
52 variant as u8 != 0
53 }
54}
55impl CALSEL_R {
56 #[inline(always)]
58 pub fn variant(&self) -> CALSEL_A {
59 match self.bits {
60 false => CALSEL_A::OffsetAndLinearity,
61 true => CALSEL_A::OffsetOnly,
62 }
63 }
64 #[inline(always)]
66 pub fn is_offset_and_linearity(&self) -> bool {
67 *self == CALSEL_A::OffsetAndLinearity
68 }
69 #[inline(always)]
71 pub fn is_offset_only(&self) -> bool {
72 *self == CALSEL_A::OffsetOnly
73 }
74}
75pub type CALSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCSR_SPEC, CALSEL_A, O>;
77impl<'a, const O: u8> CALSEL_W<'a, O> {
78 #[inline(always)]
80 pub fn offset_and_linearity(self) -> &'a mut W {
81 self.variant(CALSEL_A::OffsetAndLinearity)
82 }
83 #[inline(always)]
85 pub fn offset_only(self) -> &'a mut W {
86 self.variant(CALSEL_A::OffsetOnly)
87 }
88}
89pub type CALSMP_R = crate::FieldReader<u8, CALSMP_A>;
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95#[repr(u8)]
96pub enum CALSMP_A {
97 TowCycles = 0,
99 FourCycles = 1,
101 EightCycles = 2,
103 OneCycles = 3,
105}
106impl From<CALSMP_A> for u8 {
107 #[inline(always)]
108 fn from(variant: CALSMP_A) -> Self {
109 variant as _
110 }
111}
112impl CALSMP_R {
113 #[inline(always)]
115 pub fn variant(&self) -> CALSMP_A {
116 match self.bits {
117 0 => CALSMP_A::TowCycles,
118 1 => CALSMP_A::FourCycles,
119 2 => CALSMP_A::EightCycles,
120 3 => CALSMP_A::OneCycles,
121 _ => unreachable!(),
122 }
123 }
124 #[inline(always)]
126 pub fn is_tow_cycles(&self) -> bool {
127 *self == CALSMP_A::TowCycles
128 }
129 #[inline(always)]
131 pub fn is_four_cycles(&self) -> bool {
132 *self == CALSMP_A::FourCycles
133 }
134 #[inline(always)]
136 pub fn is_eight_cycles(&self) -> bool {
137 *self == CALSMP_A::EightCycles
138 }
139 #[inline(always)]
141 pub fn is_one_cycles(&self) -> bool {
142 *self == CALSMP_A::OneCycles
143 }
144}
145pub type CALSMP_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CCSR_SPEC, u8, CALSMP_A, 2, O>;
147impl<'a, const O: u8> CALSMP_W<'a, O> {
148 #[inline(always)]
150 pub fn tow_cycles(self) -> &'a mut W {
151 self.variant(CALSMP_A::TowCycles)
152 }
153 #[inline(always)]
155 pub fn four_cycles(self) -> &'a mut W {
156 self.variant(CALSMP_A::FourCycles)
157 }
158 #[inline(always)]
160 pub fn eight_cycles(self) -> &'a mut W {
161 self.variant(CALSMP_A::EightCycles)
162 }
163 #[inline(always)]
165 pub fn one_cycles(self) -> &'a mut W {
166 self.variant(CALSMP_A::OneCycles)
167 }
168}
169pub type CALBYP_R = crate::BitReader<bool>;
171pub type CALBYP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCSR_SPEC, bool, O>;
173pub type CALSET_R = crate::BitReader<bool>;
175pub type CALSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCSR_SPEC, bool, O>;
177pub type OFFSUC_R = crate::BitReader<OFFSUCR_A>;
179#[derive(Clone, Copy, Debug, PartialEq, Eq)]
183pub enum OFFSUCR_A {
184 Failed = 0,
186 Succeed = 1,
188}
189impl From<OFFSUCR_A> for bool {
190 #[inline(always)]
191 fn from(variant: OFFSUCR_A) -> Self {
192 variant as u8 != 0
193 }
194}
195impl OFFSUC_R {
196 #[inline(always)]
198 pub fn variant(&self) -> OFFSUCR_A {
199 match self.bits {
200 false => OFFSUCR_A::Failed,
201 true => OFFSUCR_A::Succeed,
202 }
203 }
204 #[inline(always)]
206 pub fn is_failed(&self) -> bool {
207 *self == OFFSUCR_A::Failed
208 }
209 #[inline(always)]
211 pub fn is_succeed(&self) -> bool {
212 *self == OFFSUCR_A::Succeed
213 }
214}
215#[derive(Clone, Copy, Debug, PartialEq, Eq)]
219pub enum OFFSUCW_AW {
220 Clear = 1,
222}
223impl From<OFFSUCW_AW> for bool {
224 #[inline(always)]
225 fn from(variant: OFFSUCW_AW) -> Self {
226 variant as u8 != 0
227 }
228}
229pub type OFFSUC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCSR_SPEC, OFFSUCW_AW, O>;
231impl<'a, const O: u8> OFFSUC_W<'a, O> {
232 #[inline(always)]
234 pub fn clear(self) -> &'a mut W {
235 self.variant(OFFSUCW_AW::Clear)
236 }
237}
238pub type CALSUC_R = crate::BitReader<CALSUCR_A>;
240#[derive(Clone, Copy, Debug, PartialEq, Eq)]
244pub enum CALSUCR_A {
245 Failed = 0,
247 Succeed = 1,
249}
250impl From<CALSUCR_A> for bool {
251 #[inline(always)]
252 fn from(variant: CALSUCR_A) -> Self {
253 variant as u8 != 0
254 }
255}
256impl CALSUC_R {
257 #[inline(always)]
259 pub fn variant(&self) -> CALSUCR_A {
260 match self.bits {
261 false => CALSUCR_A::Failed,
262 true => CALSUCR_A::Succeed,
263 }
264 }
265 #[inline(always)]
267 pub fn is_failed(&self) -> bool {
268 *self == CALSUCR_A::Failed
269 }
270 #[inline(always)]
272 pub fn is_succeed(&self) -> bool {
273 *self == CALSUCR_A::Succeed
274 }
275}
276#[derive(Clone, Copy, Debug, PartialEq, Eq)]
280pub enum CALSUCW_AW {
281 Clear = 1,
283}
284impl From<CALSUCW_AW> for bool {
285 #[inline(always)]
286 fn from(variant: CALSUCW_AW) -> Self {
287 variant as u8 != 0
288 }
289}
290pub type CALSUC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCSR_SPEC, CALSUCW_AW, O>;
292impl<'a, const O: u8> CALSUC_W<'a, O> {
293 #[inline(always)]
295 pub fn clear(self) -> &'a mut W {
296 self.variant(CALSUCW_AW::Clear)
297 }
298}
299pub type CALON_R = crate::BitReader<CALONR_A>;
301#[derive(Clone, Copy, Debug, PartialEq, Eq)]
305pub enum CALONR_A {
306 Off = 0,
308 On = 1,
310}
311impl From<CALONR_A> for bool {
312 #[inline(always)]
313 fn from(variant: CALONR_A) -> Self {
314 variant as u8 != 0
315 }
316}
317impl CALON_R {
318 #[inline(always)]
320 pub fn variant(&self) -> CALONR_A {
321 match self.bits {
322 false => CALONR_A::Off,
323 true => CALONR_A::On,
324 }
325 }
326 #[inline(always)]
328 pub fn is_off(&self) -> bool {
329 *self == CALONR_A::Off
330 }
331 #[inline(always)]
333 pub fn is_on(&self) -> bool {
334 *self == CALONR_A::On
335 }
336}
337impl R {
338 #[inline(always)]
340 pub fn calsel(&self) -> CALSEL_R {
341 CALSEL_R::new(((self.bits >> 11) & 1) != 0)
342 }
343 #[inline(always)]
345 pub fn calsmp(&self) -> CALSMP_R {
346 CALSMP_R::new(((self.bits >> 12) & 3) as u8)
347 }
348 #[inline(always)]
350 pub fn calbyp(&self) -> CALBYP_R {
351 CALBYP_R::new(((self.bits >> 14) & 1) != 0)
352 }
353 #[inline(always)]
355 pub fn calset(&self) -> CALSET_R {
356 CALSET_R::new(((self.bits >> 15) & 1) != 0)
357 }
358 #[inline(always)]
360 pub fn offsuc(&self) -> OFFSUC_R {
361 OFFSUC_R::new(((self.bits >> 29) & 1) != 0)
362 }
363 #[inline(always)]
365 pub fn calsuc(&self) -> CALSUC_R {
366 CALSUC_R::new(((self.bits >> 30) & 1) != 0)
367 }
368 #[inline(always)]
370 pub fn calon(&self) -> CALON_R {
371 CALON_R::new(((self.bits >> 31) & 1) != 0)
372 }
373}
374impl W {
375 #[inline(always)]
377 #[must_use]
378 pub fn calsel(&mut self) -> CALSEL_W<11> {
379 CALSEL_W::new(self)
380 }
381 #[inline(always)]
383 #[must_use]
384 pub fn calsmp(&mut self) -> CALSMP_W<12> {
385 CALSMP_W::new(self)
386 }
387 #[inline(always)]
389 #[must_use]
390 pub fn calbyp(&mut self) -> CALBYP_W<14> {
391 CALBYP_W::new(self)
392 }
393 #[inline(always)]
395 #[must_use]
396 pub fn calset(&mut self) -> CALSET_W<15> {
397 CALSET_W::new(self)
398 }
399 #[inline(always)]
401 #[must_use]
402 pub fn offsuc(&mut self) -> OFFSUC_W<29> {
403 OFFSUC_W::new(self)
404 }
405 #[inline(always)]
407 #[must_use]
408 pub fn calsuc(&mut self) -> CALSUC_W<30> {
409 CALSUC_W::new(self)
410 }
411 #[inline(always)]
413 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
414 self.0.bits(bits);
415 self
416 }
417}
418pub struct CCSR_SPEC;
424impl crate::RegisterSpec for CCSR_SPEC {
425 type Ux = u32;
426}
427impl crate::Readable for CCSR_SPEC {
429 type Reader = R;
430}
431impl crate::Writable for CCSR_SPEC {
433 type Writer = W;
434 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
435 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
436}
437impl crate::Resettable for CCSR_SPEC {
439 const RESET_VALUE: Self::Ux = 0;
440}