atsamd11c/tcc0/
cc_dith5.rs
1#[doc = "Register `CC%s_DITH5` reader"]
2pub type R = crate::R<CcDith5Spec>;
3#[doc = "Register `CC%s_DITH5` writer"]
4pub type W = crate::W<CcDith5Spec>;
5#[doc = "Field `DITHERCY` reader - Dithering Cycle Number"]
6pub type DithercyR = crate::FieldReader;
7#[doc = "Field `DITHERCY` writer - Dithering Cycle Number"]
8pub type DithercyW<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `CC` reader - Channel Compare/Capture Value"]
10pub type CcR = crate::FieldReader<u32>;
11#[doc = "Field `CC` writer - Channel Compare/Capture Value"]
12pub type CcW<'a, REG> = crate::FieldWriter<'a, REG, 19, u32>;
13impl R {
14 #[doc = "Bits 0:4 - Dithering Cycle Number"]
15 #[inline(always)]
16 pub fn dithercy(&self) -> DithercyR {
17 DithercyR::new((self.bits & 0x1f) as u8)
18 }
19 #[doc = "Bits 5:23 - Channel Compare/Capture Value"]
20 #[inline(always)]
21 pub fn cc(&self) -> CcR {
22 CcR::new((self.bits >> 5) & 0x0007_ffff)
23 }
24}
25impl W {
26 #[doc = "Bits 0:4 - Dithering Cycle Number"]
27 #[inline(always)]
28 #[must_use]
29 pub fn dithercy(&mut self) -> DithercyW<CcDith5Spec> {
30 DithercyW::new(self, 0)
31 }
32 #[doc = "Bits 5:23 - Channel Compare/Capture Value"]
33 #[inline(always)]
34 #[must_use]
35 pub fn cc(&mut self) -> CcW<CcDith5Spec> {
36 CcW::new(self, 5)
37 }
38}
39#[doc = "Compare and Capture\n\nYou can [`read`](crate::Reg::read) this register and get [`cc_dith5::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cc_dith5::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct CcDith5Spec;
41impl crate::RegisterSpec for CcDith5Spec {
42 type Ux = u32;
43}
44#[doc = "`read()` method returns [`cc_dith5::R`](R) reader structure"]
45impl crate::Readable for CcDith5Spec {}
46#[doc = "`write(|w| ..)` method takes [`cc_dith5::W`](W) writer structure"]
47impl crate::Writable for CcDith5Spec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets CC%s_DITH5 to value 0"]
53impl crate::Resettable for CcDith5Spec {
54 const RESET_VALUE: u32 = 0;
55}