atsamd21g/rtc/mode1/
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 `CMP0` reader - Compare 0"]
6pub type Cmp0R = crate::BitReader;
7#[doc = "Field `CMP0` writer - Compare 0"]
8pub type Cmp0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CMP1` reader - Compare 1"]
10pub type Cmp1R = crate::BitReader;
11#[doc = "Field `CMP1` writer - Compare 1"]
12pub type Cmp1W<'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 `OVF` reader - Overflow"]
18pub type OvfR = crate::BitReader;
19#[doc = "Field `OVF` writer - Overflow"]
20pub type OvfW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0 - Compare 0"]
23    #[inline(always)]
24    pub fn cmp0(&self) -> Cmp0R {
25        Cmp0R::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1 - Compare 1"]
28    #[inline(always)]
29    pub fn cmp1(&self) -> Cmp1R {
30        Cmp1R::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 6 - Synchronization Ready"]
33    #[inline(always)]
34    pub fn syncrdy(&self) -> SyncrdyR {
35        SyncrdyR::new(((self.bits >> 6) & 1) != 0)
36    }
37    #[doc = "Bit 7 - Overflow"]
38    #[inline(always)]
39    pub fn ovf(&self) -> OvfR {
40        OvfR::new(((self.bits >> 7) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bit 0 - Compare 0"]
45    #[inline(always)]
46    #[must_use]
47    pub fn cmp0(&mut self) -> Cmp0W<IntflagSpec> {
48        Cmp0W::new(self, 0)
49    }
50    #[doc = "Bit 1 - Compare 1"]
51    #[inline(always)]
52    #[must_use]
53    pub fn cmp1(&mut self) -> Cmp1W<IntflagSpec> {
54        Cmp1W::new(self, 1)
55    }
56    #[doc = "Bit 6 - Synchronization Ready"]
57    #[inline(always)]
58    #[must_use]
59    pub fn syncrdy(&mut self) -> SyncrdyW<IntflagSpec> {
60        SyncrdyW::new(self, 6)
61    }
62    #[doc = "Bit 7 - Overflow"]
63    #[inline(always)]
64    #[must_use]
65    pub fn ovf(&mut self) -> OvfW<IntflagSpec> {
66        OvfW::new(self, 7)
67    }
68}
69#[doc = "MODE1 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)."]
70pub struct IntflagSpec;
71impl crate::RegisterSpec for IntflagSpec {
72    type Ux = u8;
73}
74#[doc = "`read()` method returns [`intflag::R`](R) reader structure"]
75impl crate::Readable for IntflagSpec {}
76#[doc = "`write(|w| ..)` method takes [`intflag::W`](W) writer structure"]
77impl crate::Writable for IntflagSpec {
78    type Safety = crate::Unsafe;
79    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
80    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
81}
82#[doc = "`reset()` method sets INTFLAG to value 0"]
83impl crate::Resettable for IntflagSpec {
84    const RESET_VALUE: u8 = 0;
85}