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