atsamd11d/adc/
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 `STARTEI` reader - Start Conversion Event In"]
6pub type StarteiR = crate::BitReader;
7#[doc = "Field `STARTEI` writer - Start Conversion Event In"]
8pub type StarteiW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SYNCEI` reader - Synchronization Event In"]
10pub type SynceiR = crate::BitReader;
11#[doc = "Field `SYNCEI` writer - Synchronization Event In"]
12pub type SynceiW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `RESRDYEO` reader - Result Ready Event Out"]
14pub type ResrdyeoR = crate::BitReader;
15#[doc = "Field `RESRDYEO` writer - Result Ready Event Out"]
16pub type ResrdyeoW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `WINMONEO` reader - Window Monitor Event Out"]
18pub type WinmoneoR = crate::BitReader;
19#[doc = "Field `WINMONEO` writer - Window Monitor Event Out"]
20pub type WinmoneoW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22 #[doc = "Bit 0 - Start Conversion Event In"]
23 #[inline(always)]
24 pub fn startei(&self) -> StarteiR {
25 StarteiR::new((self.bits & 1) != 0)
26 }
27 #[doc = "Bit 1 - Synchronization Event In"]
28 #[inline(always)]
29 pub fn syncei(&self) -> SynceiR {
30 SynceiR::new(((self.bits >> 1) & 1) != 0)
31 }
32 #[doc = "Bit 4 - Result Ready Event Out"]
33 #[inline(always)]
34 pub fn resrdyeo(&self) -> ResrdyeoR {
35 ResrdyeoR::new(((self.bits >> 4) & 1) != 0)
36 }
37 #[doc = "Bit 5 - Window Monitor Event Out"]
38 #[inline(always)]
39 pub fn winmoneo(&self) -> WinmoneoR {
40 WinmoneoR::new(((self.bits >> 5) & 1) != 0)
41 }
42}
43impl W {
44 #[doc = "Bit 0 - Start Conversion Event In"]
45 #[inline(always)]
46 #[must_use]
47 pub fn startei(&mut self) -> StarteiW<EvctrlSpec> {
48 StarteiW::new(self, 0)
49 }
50 #[doc = "Bit 1 - Synchronization Event In"]
51 #[inline(always)]
52 #[must_use]
53 pub fn syncei(&mut self) -> SynceiW<EvctrlSpec> {
54 SynceiW::new(self, 1)
55 }
56 #[doc = "Bit 4 - Result Ready Event Out"]
57 #[inline(always)]
58 #[must_use]
59 pub fn resrdyeo(&mut self) -> ResrdyeoW<EvctrlSpec> {
60 ResrdyeoW::new(self, 4)
61 }
62 #[doc = "Bit 5 - Window Monitor Event Out"]
63 #[inline(always)]
64 #[must_use]
65 pub fn winmoneo(&mut self) -> WinmoneoW<EvctrlSpec> {
66 WinmoneoW::new(self, 5)
67 }
68}
69#[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)."]
70pub struct EvctrlSpec;
71impl crate::RegisterSpec for EvctrlSpec {
72 type Ux = u8;
73}
74#[doc = "`read()` method returns [`evctrl::R`](R) reader structure"]
75impl crate::Readable for EvctrlSpec {}
76#[doc = "`write(|w| ..)` method takes [`evctrl::W`](W) writer structure"]
77impl crate::Writable for EvctrlSpec {
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 EVCTRL to value 0"]
83impl crate::Resettable for EvctrlSpec {
84 const RESET_VALUE: u8 = 0;
85}