atsamd11c/ac/
intenset.rs

1#[doc = "Register `INTENSET` reader"]
2pub type R = crate::R<IntensetSpec>;
3#[doc = "Register `INTENSET` writer"]
4pub type W = crate::W<IntensetSpec>;
5#[doc = "Field `COMP0` reader - Comparator 0 Interrupt Enable"]
6pub type Comp0R = crate::BitReader;
7#[doc = "Field `COMP0` writer - Comparator 0 Interrupt Enable"]
8pub type Comp0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `COMP1` reader - Comparator 1 Interrupt Enable"]
10pub type Comp1R = crate::BitReader;
11#[doc = "Field `COMP1` writer - Comparator 1 Interrupt Enable"]
12pub type Comp1W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `WIN0` reader - Window 0 Interrupt Enable"]
14pub type Win0R = crate::BitReader;
15#[doc = "Field `WIN0` writer - Window 0 Interrupt Enable"]
16pub type Win0W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bit 0 - Comparator 0 Interrupt Enable"]
19    #[inline(always)]
20    pub fn comp0(&self) -> Comp0R {
21        Comp0R::new((self.bits & 1) != 0)
22    }
23    #[doc = "Bit 1 - Comparator 1 Interrupt Enable"]
24    #[inline(always)]
25    pub fn comp1(&self) -> Comp1R {
26        Comp1R::new(((self.bits >> 1) & 1) != 0)
27    }
28    #[doc = "Bit 4 - Window 0 Interrupt Enable"]
29    #[inline(always)]
30    pub fn win0(&self) -> Win0R {
31        Win0R::new(((self.bits >> 4) & 1) != 0)
32    }
33}
34impl W {
35    #[doc = "Bit 0 - Comparator 0 Interrupt Enable"]
36    #[inline(always)]
37    #[must_use]
38    pub fn comp0(&mut self) -> Comp0W<IntensetSpec> {
39        Comp0W::new(self, 0)
40    }
41    #[doc = "Bit 1 - Comparator 1 Interrupt Enable"]
42    #[inline(always)]
43    #[must_use]
44    pub fn comp1(&mut self) -> Comp1W<IntensetSpec> {
45        Comp1W::new(self, 1)
46    }
47    #[doc = "Bit 4 - Window 0 Interrupt Enable"]
48    #[inline(always)]
49    #[must_use]
50    pub fn win0(&mut self) -> Win0W<IntensetSpec> {
51        Win0W::new(self, 4)
52    }
53}
54#[doc = "Interrupt Enable Set\n\nYou can [`read`](crate::Reg::read) this register and get [`intenset::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intenset::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct IntensetSpec;
56impl crate::RegisterSpec for IntensetSpec {
57    type Ux = u8;
58}
59#[doc = "`read()` method returns [`intenset::R`](R) reader structure"]
60impl crate::Readable for IntensetSpec {}
61#[doc = "`write(|w| ..)` method takes [`intenset::W`](W) writer structure"]
62impl crate::Writable for IntensetSpec {
63    type Safety = crate::Unsafe;
64    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
65    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
66}
67#[doc = "`reset()` method sets INTENSET to value 0"]
68impl crate::Resettable for IntensetSpec {
69    const RESET_VALUE: u8 = 0;
70}