atsam3s8c/tc1/
smmr0.rs

1#[doc = "Register `SMMR0` reader"]
2pub type R = crate::R<Smmr0Spec>;
3#[doc = "Register `SMMR0` writer"]
4pub type W = crate::W<Smmr0Spec>;
5#[doc = "Field `GCEN` reader - Gray Count Enable"]
6pub type GcenR = crate::BitReader;
7#[doc = "Field `GCEN` writer - Gray Count Enable"]
8pub type GcenW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `DOWN` reader - DOWN Count"]
10pub type DownR = crate::BitReader;
11#[doc = "Field `DOWN` writer - DOWN Count"]
12pub type DownW<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - Gray Count Enable"]
15    #[inline(always)]
16    pub fn gcen(&self) -> GcenR {
17        GcenR::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - DOWN Count"]
20    #[inline(always)]
21    pub fn down(&self) -> DownR {
22        DownR::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25impl W {
26    #[doc = "Bit 0 - Gray Count Enable"]
27    #[inline(always)]
28    #[must_use]
29    pub fn gcen(&mut self) -> GcenW<Smmr0Spec> {
30        GcenW::new(self, 0)
31    }
32    #[doc = "Bit 1 - DOWN Count"]
33    #[inline(always)]
34    #[must_use]
35    pub fn down(&mut self) -> DownW<Smmr0Spec> {
36        DownW::new(self, 1)
37    }
38}
39#[doc = "Stepper Motor Mode Register (channel = 0)\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`smmr0::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`smmr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct Smmr0Spec;
41impl crate::RegisterSpec for Smmr0Spec {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [`smmr0::R`](R) reader structure"]
45impl crate::Readable for Smmr0Spec {}
46#[doc = "`write(|w| ..)` method takes [`smmr0::W`](W) writer structure"]
47impl crate::Writable for Smmr0Spec {
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 SMMR0 to value 0"]
53impl crate::Resettable for Smmr0Spec {
54    const RESET_VALUE: u32 = 0;
55}