atsamd11d/tcc0/
ccb_dith6.rs
1#[doc = "Register `CCB%s_DITH6` reader"]
2pub type R = crate::R<CcbDith6Spec>;
3#[doc = "Register `CCB%s_DITH6` writer"]
4pub type W = crate::W<CcbDith6Spec>;
5#[doc = "Field `DITHERCYB` reader - Dithering Buffer Cycle Number"]
6pub type DithercybR = crate::FieldReader;
7#[doc = "Field `DITHERCYB` writer - Dithering Buffer Cycle Number"]
8pub type DithercybW<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `CCB` reader - Channel Compare/Capture Buffer Value"]
10pub type CcbR = crate::FieldReader<u32>;
11#[doc = "Field `CCB` writer - Channel Compare/Capture Buffer Value"]
12pub type CcbW<'a, REG> = crate::FieldWriter<'a, REG, 18, u32>;
13impl R {
14 #[doc = "Bits 0:5 - Dithering Buffer Cycle Number"]
15 #[inline(always)]
16 pub fn dithercyb(&self) -> DithercybR {
17 DithercybR::new((self.bits & 0x3f) as u8)
18 }
19 #[doc = "Bits 6:23 - Channel Compare/Capture Buffer Value"]
20 #[inline(always)]
21 pub fn ccb(&self) -> CcbR {
22 CcbR::new((self.bits >> 6) & 0x0003_ffff)
23 }
24}
25impl W {
26 #[doc = "Bits 0:5 - Dithering Buffer Cycle Number"]
27 #[inline(always)]
28 #[must_use]
29 pub fn dithercyb(&mut self) -> DithercybW<CcbDith6Spec> {
30 DithercybW::new(self, 0)
31 }
32 #[doc = "Bits 6:23 - Channel Compare/Capture Buffer Value"]
33 #[inline(always)]
34 #[must_use]
35 pub fn ccb(&mut self) -> CcbW<CcbDith6Spec> {
36 CcbW::new(self, 6)
37 }
38}
39#[doc = "Compare and Capture Buffer\n\nYou can [`read`](crate::Reg::read) this register and get [`ccb_dith6::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ccb_dith6::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct CcbDith6Spec;
41impl crate::RegisterSpec for CcbDith6Spec {
42 type Ux = u32;
43}
44#[doc = "`read()` method returns [`ccb_dith6::R`](R) reader structure"]
45impl crate::Readable for CcbDith6Spec {}
46#[doc = "`write(|w| ..)` method takes [`ccb_dith6::W`](W) writer structure"]
47impl crate::Writable for CcbDith6Spec {
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 CCB%s_DITH6 to value 0"]
53impl crate::Resettable for CcbDith6Spec {
54 const RESET_VALUE: u32 = 0;
55}