atsamd51g/oscctrl/
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 `CFDEO0` reader - Clock 0 Failure Detector Event Output Enable"]
6pub type Cfdeo0R = crate::BitReader;
7#[doc = "Field `CFDEO0` writer - Clock 0 Failure Detector Event Output Enable"]
8pub type Cfdeo0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CFDEO1` reader - Clock 1 Failure Detector Event Output Enable"]
10pub type Cfdeo1R = crate::BitReader;
11#[doc = "Field `CFDEO1` writer - Clock 1 Failure Detector Event Output Enable"]
12pub type Cfdeo1W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 #[doc = "Bit 0 - Clock 0 Failure Detector Event Output Enable"]
15 #[inline(always)]
16 pub fn cfdeo0(&self) -> Cfdeo0R {
17 Cfdeo0R::new((self.bits & 1) != 0)
18 }
19 #[doc = "Bit 1 - Clock 1 Failure Detector Event Output Enable"]
20 #[inline(always)]
21 pub fn cfdeo1(&self) -> Cfdeo1R {
22 Cfdeo1R::new(((self.bits >> 1) & 1) != 0)
23 }
24}
25impl W {
26 #[doc = "Bit 0 - Clock 0 Failure Detector Event Output Enable"]
27 #[inline(always)]
28 #[must_use]
29 pub fn cfdeo0(&mut self) -> Cfdeo0W<EvctrlSpec> {
30 Cfdeo0W::new(self, 0)
31 }
32 #[doc = "Bit 1 - Clock 1 Failure Detector Event Output Enable"]
33 #[inline(always)]
34 #[must_use]
35 pub fn cfdeo1(&mut self) -> Cfdeo1W<EvctrlSpec> {
36 Cfdeo1W::new(self, 1)
37 }
38}
39#[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)."]
40pub struct EvctrlSpec;
41impl crate::RegisterSpec for EvctrlSpec {
42 type Ux = u8;
43}
44#[doc = "`read()` method returns [`evctrl::R`](R) reader structure"]
45impl crate::Readable for EvctrlSpec {}
46#[doc = "`write(|w| ..)` method takes [`evctrl::W`](W) writer structure"]
47impl crate::Writable for EvctrlSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
51}
52#[doc = "`reset()` method sets EVCTRL to value 0"]
53impl crate::Resettable for EvctrlSpec {
54 const RESET_VALUE: u8 = 0;
55}