atsamd21g/usb/host/
pintenset.rs

1#[doc = "Register `PINTENSET%s` reader"]
2pub type R = crate::R<PintensetSpec>;
3#[doc = "Register `PINTENSET%s` writer"]
4pub type W = crate::W<PintensetSpec>;
5#[doc = "Field `TRCPT0` reader - Transfer Complete 0 Interrupt Enable"]
6pub type Trcpt0R = crate::BitReader;
7#[doc = "Field `TRCPT0` writer - Transfer Complete 0 Interrupt Enable"]
8pub type Trcpt0W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TRCPT1` reader - Transfer Complete 1 Interrupt Enable"]
10pub type Trcpt1R = crate::BitReader;
11#[doc = "Field `TRCPT1` writer - Transfer Complete 1 Interrupt Enable"]
12pub type Trcpt1W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TRFAIL` reader - Error Flow Interrupt Enable"]
14pub type TrfailR = crate::BitReader;
15#[doc = "Field `TRFAIL` writer - Error Flow Interrupt Enable"]
16pub type TrfailW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `PERR` reader - Pipe Error Interrupt Enable"]
18pub type PerrR = crate::BitReader;
19#[doc = "Field `PERR` writer - Pipe Error Interrupt Enable"]
20pub type PerrW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `TXSTP` reader - Transmit Setup Interrupt Enable"]
22pub type TxstpR = crate::BitReader;
23#[doc = "Field `TXSTP` writer - Transmit Setup Interrupt Enable"]
24pub type TxstpW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `STALL` reader - Stall Interrupt Enable"]
26pub type StallR = crate::BitReader;
27#[doc = "Field `STALL` writer - Stall Interrupt Enable"]
28pub type StallW<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bit 0 - Transfer Complete 0 Interrupt Enable"]
31    #[inline(always)]
32    pub fn trcpt0(&self) -> Trcpt0R {
33        Trcpt0R::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - Transfer Complete 1 Interrupt Enable"]
36    #[inline(always)]
37    pub fn trcpt1(&self) -> Trcpt1R {
38        Trcpt1R::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - Error Flow Interrupt Enable"]
41    #[inline(always)]
42    pub fn trfail(&self) -> TrfailR {
43        TrfailR::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - Pipe Error Interrupt Enable"]
46    #[inline(always)]
47    pub fn perr(&self) -> PerrR {
48        PerrR::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - Transmit Setup Interrupt Enable"]
51    #[inline(always)]
52    pub fn txstp(&self) -> TxstpR {
53        TxstpR::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bit 5 - Stall Interrupt Enable"]
56    #[inline(always)]
57    pub fn stall(&self) -> StallR {
58        StallR::new(((self.bits >> 5) & 1) != 0)
59    }
60}
61impl W {
62    #[doc = "Bit 0 - Transfer Complete 0 Interrupt Enable"]
63    #[inline(always)]
64    #[must_use]
65    pub fn trcpt0(&mut self) -> Trcpt0W<PintensetSpec> {
66        Trcpt0W::new(self, 0)
67    }
68    #[doc = "Bit 1 - Transfer Complete 1 Interrupt Enable"]
69    #[inline(always)]
70    #[must_use]
71    pub fn trcpt1(&mut self) -> Trcpt1W<PintensetSpec> {
72        Trcpt1W::new(self, 1)
73    }
74    #[doc = "Bit 2 - Error Flow Interrupt Enable"]
75    #[inline(always)]
76    #[must_use]
77    pub fn trfail(&mut self) -> TrfailW<PintensetSpec> {
78        TrfailW::new(self, 2)
79    }
80    #[doc = "Bit 3 - Pipe Error Interrupt Enable"]
81    #[inline(always)]
82    #[must_use]
83    pub fn perr(&mut self) -> PerrW<PintensetSpec> {
84        PerrW::new(self, 3)
85    }
86    #[doc = "Bit 4 - Transmit Setup Interrupt Enable"]
87    #[inline(always)]
88    #[must_use]
89    pub fn txstp(&mut self) -> TxstpW<PintensetSpec> {
90        TxstpW::new(self, 4)
91    }
92    #[doc = "Bit 5 - Stall Interrupt Enable"]
93    #[inline(always)]
94    #[must_use]
95    pub fn stall(&mut self) -> StallW<PintensetSpec> {
96        StallW::new(self, 5)
97    }
98}
99#[doc = "HOST Pipe Interrupt Flag Set\n\nYou can [`read`](crate::Reg::read) this register and get [`pintenset::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pintenset::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct PintensetSpec;
101impl crate::RegisterSpec for PintensetSpec {
102    type Ux = u8;
103}
104#[doc = "`read()` method returns [`pintenset::R`](R) reader structure"]
105impl crate::Readable for PintensetSpec {}
106#[doc = "`write(|w| ..)` method takes [`pintenset::W`](W) writer structure"]
107impl crate::Writable for PintensetSpec {
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 PINTENSET%s to value 0"]
113impl crate::Resettable for PintensetSpec {
114    const RESET_VALUE: u8 = 0;
115}