atsamd51g/adc0/
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 `FLUSHEI` reader - Flush Event Input Enable"]
6pub type FlusheiR = crate::BitReader;
7#[doc = "Field `FLUSHEI` writer - Flush Event Input Enable"]
8pub type FlusheiW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `STARTEI` reader - Start Conversion Event Input Enable"]
10pub type StarteiR = crate::BitReader;
11#[doc = "Field `STARTEI` writer - Start Conversion Event Input Enable"]
12pub type StarteiW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `FLUSHINV` reader - Flush Event Invert Enable"]
14pub type FlushinvR = crate::BitReader;
15#[doc = "Field `FLUSHINV` writer - Flush Event Invert Enable"]
16pub type FlushinvW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `STARTINV` reader - Start Conversion Event Invert Enable"]
18pub type StartinvR = crate::BitReader;
19#[doc = "Field `STARTINV` writer - Start Conversion Event Invert Enable"]
20pub type StartinvW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `RESRDYEO` reader - Result Ready Event Out"]
22pub type ResrdyeoR = crate::BitReader;
23#[doc = "Field `RESRDYEO` writer - Result Ready Event Out"]
24pub type ResrdyeoW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `WINMONEO` reader - Window Monitor Event Out"]
26pub type WinmoneoR = crate::BitReader;
27#[doc = "Field `WINMONEO` writer - Window Monitor Event Out"]
28pub type WinmoneoW<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bit 0 - Flush Event Input Enable"]
31    #[inline(always)]
32    pub fn flushei(&self) -> FlusheiR {
33        FlusheiR::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - Start Conversion Event Input Enable"]
36    #[inline(always)]
37    pub fn startei(&self) -> StarteiR {
38        StarteiR::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - Flush Event Invert Enable"]
41    #[inline(always)]
42    pub fn flushinv(&self) -> FlushinvR {
43        FlushinvR::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - Start Conversion Event Invert Enable"]
46    #[inline(always)]
47    pub fn startinv(&self) -> StartinvR {
48        StartinvR::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - Result Ready Event Out"]
51    #[inline(always)]
52    pub fn resrdyeo(&self) -> ResrdyeoR {
53        ResrdyeoR::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bit 5 - Window Monitor Event Out"]
56    #[inline(always)]
57    pub fn winmoneo(&self) -> WinmoneoR {
58        WinmoneoR::new(((self.bits >> 5) & 1) != 0)
59    }
60}
61impl W {
62    #[doc = "Bit 0 - Flush Event Input Enable"]
63    #[inline(always)]
64    #[must_use]
65    pub fn flushei(&mut self) -> FlusheiW<EvctrlSpec> {
66        FlusheiW::new(self, 0)
67    }
68    #[doc = "Bit 1 - Start Conversion Event Input Enable"]
69    #[inline(always)]
70    #[must_use]
71    pub fn startei(&mut self) -> StarteiW<EvctrlSpec> {
72        StarteiW::new(self, 1)
73    }
74    #[doc = "Bit 2 - Flush Event Invert Enable"]
75    #[inline(always)]
76    #[must_use]
77    pub fn flushinv(&mut self) -> FlushinvW<EvctrlSpec> {
78        FlushinvW::new(self, 2)
79    }
80    #[doc = "Bit 3 - Start Conversion Event Invert Enable"]
81    #[inline(always)]
82    #[must_use]
83    pub fn startinv(&mut self) -> StartinvW<EvctrlSpec> {
84        StartinvW::new(self, 3)
85    }
86    #[doc = "Bit 4 - Result Ready Event Out"]
87    #[inline(always)]
88    #[must_use]
89    pub fn resrdyeo(&mut self) -> ResrdyeoW<EvctrlSpec> {
90        ResrdyeoW::new(self, 4)
91    }
92    #[doc = "Bit 5 - Window Monitor Event Out"]
93    #[inline(always)]
94    #[must_use]
95    pub fn winmoneo(&mut self) -> WinmoneoW<EvctrlSpec> {
96        WinmoneoW::new(self, 5)
97    }
98}
99#[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)."]
100pub struct EvctrlSpec;
101impl crate::RegisterSpec for EvctrlSpec {
102    type Ux = u8;
103}
104#[doc = "`read()` method returns [`evctrl::R`](R) reader structure"]
105impl crate::Readable for EvctrlSpec {}
106#[doc = "`write(|w| ..)` method takes [`evctrl::W`](W) writer structure"]
107impl crate::Writable for EvctrlSpec {
108    type Safety = crate::Unsafe;
109    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
110    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
111}
112#[doc = "`reset()` method sets EVCTRL to value 0"]
113impl crate::Resettable for EvctrlSpec {
114    const RESET_VALUE: u8 = 0;
115}