atsamd21g/tc3/count8/
intflag.rs

1#[doc = "Register `INTFLAG` reader"]
2pub type R = crate::R<IntflagSpec>;
3#[doc = "Register `INTFLAG` writer"]
4pub type W = crate::W<IntflagSpec>;
5#[doc = "Field `OVF` reader - Overflow"]
6pub type OvfR = crate::BitReader;
7#[doc = "Field `OVF` writer - Overflow"]
8pub type OvfW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ERR` reader - Error"]
10pub type ErrR = crate::BitReader;
11#[doc = "Field `ERR` writer - Error"]
12pub type ErrW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SYNCRDY` reader - Synchronization Ready"]
14pub type SyncrdyR = crate::BitReader;
15#[doc = "Field `SYNCRDY` writer - Synchronization Ready"]
16pub type SyncrdyW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `MC0` reader - Match or Capture Channel 0"]
18pub type Mc0R = crate::BitReader;
19#[doc = "Field `MC0` writer - Match or Capture Channel 0"]
20pub type Mc0W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `MC1` reader - Match or Capture Channel 1"]
22pub type Mc1R = crate::BitReader;
23#[doc = "Field `MC1` writer - Match or Capture Channel 1"]
24pub type Mc1W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bit 0 - Overflow"]
27    #[inline(always)]
28    pub fn ovf(&self) -> OvfR {
29        OvfR::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1 - Error"]
32    #[inline(always)]
33    pub fn err(&self) -> ErrR {
34        ErrR::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bit 3 - Synchronization Ready"]
37    #[inline(always)]
38    pub fn syncrdy(&self) -> SyncrdyR {
39        SyncrdyR::new(((self.bits >> 3) & 1) != 0)
40    }
41    #[doc = "Bit 4 - Match or Capture Channel 0"]
42    #[inline(always)]
43    pub fn mc0(&self) -> Mc0R {
44        Mc0R::new(((self.bits >> 4) & 1) != 0)
45    }
46    #[doc = "Bit 5 - Match or Capture Channel 1"]
47    #[inline(always)]
48    pub fn mc1(&self) -> Mc1R {
49        Mc1R::new(((self.bits >> 5) & 1) != 0)
50    }
51}
52impl W {
53    #[doc = "Bit 0 - Overflow"]
54    #[inline(always)]
55    #[must_use]
56    pub fn ovf(&mut self) -> OvfW<IntflagSpec> {
57        OvfW::new(self, 0)
58    }
59    #[doc = "Bit 1 - Error"]
60    #[inline(always)]
61    #[must_use]
62    pub fn err(&mut self) -> ErrW<IntflagSpec> {
63        ErrW::new(self, 1)
64    }
65    #[doc = "Bit 3 - Synchronization Ready"]
66    #[inline(always)]
67    #[must_use]
68    pub fn syncrdy(&mut self) -> SyncrdyW<IntflagSpec> {
69        SyncrdyW::new(self, 3)
70    }
71    #[doc = "Bit 4 - Match or Capture Channel 0"]
72    #[inline(always)]
73    #[must_use]
74    pub fn mc0(&mut self) -> Mc0W<IntflagSpec> {
75        Mc0W::new(self, 4)
76    }
77    #[doc = "Bit 5 - Match or Capture Channel 1"]
78    #[inline(always)]
79    #[must_use]
80    pub fn mc1(&mut self) -> Mc1W<IntflagSpec> {
81        Mc1W::new(self, 5)
82    }
83}
84#[doc = "Interrupt Flag Status and Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`intflag::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intflag::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
85pub struct IntflagSpec;
86impl crate::RegisterSpec for IntflagSpec {
87    type Ux = u8;
88}
89#[doc = "`read()` method returns [`intflag::R`](R) reader structure"]
90impl crate::Readable for IntflagSpec {}
91#[doc = "`write(|w| ..)` method takes [`intflag::W`](W) writer structure"]
92impl crate::Writable for IntflagSpec {
93    type Safety = crate::Unsafe;
94    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
95    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
96}
97#[doc = "`reset()` method sets INTFLAG to value 0"]
98impl crate::Resettable for IntflagSpec {
99    const RESET_VALUE: u8 = 0;
100}