atsamd11d/ac/
evctrl.rs

1#[doc = "Register `EVCTRL` reader"]
2pub type R = crate::R<EvctrlSpec>;
3#[doc = "Register `EVCTRL` writer"]
4pub type W = crate::W<EvctrlSpec>;
5#[doc = "Field `COMPEO0` reader - Comparator 0 Event Output Enable"]
6pub type Compeo0R = crate::BitReader;
7#[doc = "Field `COMPEO0` writer - Comparator 0 Event Output Enable"]
8pub type Compeo0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `COMPEO1` reader - Comparator 1 Event Output Enable"]
10pub type Compeo1R = crate::BitReader;
11#[doc = "Field `COMPEO1` writer - Comparator 1 Event Output Enable"]
12pub type Compeo1W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `WINEO0` reader - Window 0 Event Output Enable"]
14pub type Wineo0R = crate::BitReader;
15#[doc = "Field `WINEO0` writer - Window 0 Event Output Enable"]
16pub type Wineo0W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `COMPEI0` reader - Comparator 0 Event Input"]
18pub type Compei0R = crate::BitReader;
19#[doc = "Field `COMPEI0` writer - Comparator 0 Event Input"]
20pub type Compei0W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `COMPEI1` reader - Comparator 1 Event Input"]
22pub type Compei1R = crate::BitReader;
23#[doc = "Field `COMPEI1` writer - Comparator 1 Event Input"]
24pub type Compei1W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bit 0 - Comparator 0 Event Output Enable"]
27    #[inline(always)]
28    pub fn compeo0(&self) -> Compeo0R {
29        Compeo0R::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1 - Comparator 1 Event Output Enable"]
32    #[inline(always)]
33    pub fn compeo1(&self) -> Compeo1R {
34        Compeo1R::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bit 4 - Window 0 Event Output Enable"]
37    #[inline(always)]
38    pub fn wineo0(&self) -> Wineo0R {
39        Wineo0R::new(((self.bits >> 4) & 1) != 0)
40    }
41    #[doc = "Bit 8 - Comparator 0 Event Input"]
42    #[inline(always)]
43    pub fn compei0(&self) -> Compei0R {
44        Compei0R::new(((self.bits >> 8) & 1) != 0)
45    }
46    #[doc = "Bit 9 - Comparator 1 Event Input"]
47    #[inline(always)]
48    pub fn compei1(&self) -> Compei1R {
49        Compei1R::new(((self.bits >> 9) & 1) != 0)
50    }
51}
52impl W {
53    #[doc = "Bit 0 - Comparator 0 Event Output Enable"]
54    #[inline(always)]
55    #[must_use]
56    pub fn compeo0(&mut self) -> Compeo0W<EvctrlSpec> {
57        Compeo0W::new(self, 0)
58    }
59    #[doc = "Bit 1 - Comparator 1 Event Output Enable"]
60    #[inline(always)]
61    #[must_use]
62    pub fn compeo1(&mut self) -> Compeo1W<EvctrlSpec> {
63        Compeo1W::new(self, 1)
64    }
65    #[doc = "Bit 4 - Window 0 Event Output Enable"]
66    #[inline(always)]
67    #[must_use]
68    pub fn wineo0(&mut self) -> Wineo0W<EvctrlSpec> {
69        Wineo0W::new(self, 4)
70    }
71    #[doc = "Bit 8 - Comparator 0 Event Input"]
72    #[inline(always)]
73    #[must_use]
74    pub fn compei0(&mut self) -> Compei0W<EvctrlSpec> {
75        Compei0W::new(self, 8)
76    }
77    #[doc = "Bit 9 - Comparator 1 Event Input"]
78    #[inline(always)]
79    #[must_use]
80    pub fn compei1(&mut self) -> Compei1W<EvctrlSpec> {
81        Compei1W::new(self, 9)
82    }
83}
84#[doc = "Event Control\n\nYou can [`read`](crate::Reg::read) this register and get [`evctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`evctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
85pub struct EvctrlSpec;
86impl crate::RegisterSpec for EvctrlSpec {
87    type Ux = u16;
88}
89#[doc = "`read()` method returns [`evctrl::R`](R) reader structure"]
90impl crate::Readable for EvctrlSpec {}
91#[doc = "`write(|w| ..)` method takes [`evctrl::W`](W) writer structure"]
92impl crate::Writable for EvctrlSpec {
93    type Safety = crate::Unsafe;
94    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
95    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
96}
97#[doc = "`reset()` method sets EVCTRL to value 0"]
98impl crate::Resettable for EvctrlSpec {
99    const RESET_VALUE: u16 = 0;
100}