lpc845_pac/capt/
intstat.rs

1#[doc = "Register `INTSTAT` reader"]
2pub struct R(crate::R<INTSTAT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTSTAT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTSTAT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTSTAT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTSTAT` writer"]
17pub struct W(crate::W<INTSTAT_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTSTAT_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<INTSTAT_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTSTAT_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `YESTOUCH` reader - the status of touch interrrupt"]
38pub struct YESTOUCH_R(crate::FieldReader<bool, bool>);
39impl YESTOUCH_R {
40    pub(crate) fn new(bits: bool) -> Self {
41        YESTOUCH_R(crate::FieldReader::new(bits))
42    }
43}
44impl core::ops::Deref for YESTOUCH_R {
45    type Target = crate::FieldReader<bool, bool>;
46    #[inline(always)]
47    fn deref(&self) -> &Self::Target {
48        &self.0
49    }
50}
51#[doc = "Field `NOTOUCH` reader - the status of no-touch interrrupt"]
52pub struct NOTOUCH_R(crate::FieldReader<bool, bool>);
53impl NOTOUCH_R {
54    pub(crate) fn new(bits: bool) -> Self {
55        NOTOUCH_R(crate::FieldReader::new(bits))
56    }
57}
58impl core::ops::Deref for NOTOUCH_R {
59    type Target = crate::FieldReader<bool, bool>;
60    #[inline(always)]
61    fn deref(&self) -> &Self::Target {
62        &self.0
63    }
64}
65#[doc = "Field `POLLDONE` reader - the status of poll or pollnow completing interrupt"]
66pub struct POLLDONE_R(crate::FieldReader<bool, bool>);
67impl POLLDONE_R {
68    pub(crate) fn new(bits: bool) -> Self {
69        POLLDONE_R(crate::FieldReader::new(bits))
70    }
71}
72impl core::ops::Deref for POLLDONE_R {
73    type Target = crate::FieldReader<bool, bool>;
74    #[inline(always)]
75    fn deref(&self) -> &Self::Target {
76        &self.0
77    }
78}
79#[doc = "Field `TIMEOUT` reader - the status of timeout interrupt"]
80pub struct TIMEOUT_R(crate::FieldReader<bool, bool>);
81impl TIMEOUT_R {
82    pub(crate) fn new(bits: bool) -> Self {
83        TIMEOUT_R(crate::FieldReader::new(bits))
84    }
85}
86impl core::ops::Deref for TIMEOUT_R {
87    type Target = crate::FieldReader<bool, bool>;
88    #[inline(always)]
89    fn deref(&self) -> &Self::Target {
90        &self.0
91    }
92}
93#[doc = "Field `OVERUN` reader - the status of overrun interrupt"]
94pub struct OVERUN_R(crate::FieldReader<bool, bool>);
95impl OVERUN_R {
96    pub(crate) fn new(bits: bool) -> Self {
97        OVERUN_R(crate::FieldReader::new(bits))
98    }
99}
100impl core::ops::Deref for OVERUN_R {
101    type Target = crate::FieldReader<bool, bool>;
102    #[inline(always)]
103    fn deref(&self) -> &Self::Target {
104        &self.0
105    }
106}
107impl R {
108    #[doc = "Bit 0 - the status of touch interrrupt"]
109    #[inline(always)]
110    pub fn yestouch(&self) -> YESTOUCH_R {
111        YESTOUCH_R::new((self.bits & 0x01) != 0)
112    }
113    #[doc = "Bit 1 - the status of no-touch interrrupt"]
114    #[inline(always)]
115    pub fn notouch(&self) -> NOTOUCH_R {
116        NOTOUCH_R::new(((self.bits >> 1) & 0x01) != 0)
117    }
118    #[doc = "Bit 2 - the status of poll or pollnow completing interrupt"]
119    #[inline(always)]
120    pub fn polldone(&self) -> POLLDONE_R {
121        POLLDONE_R::new(((self.bits >> 2) & 0x01) != 0)
122    }
123    #[doc = "Bit 3 - the status of timeout interrupt"]
124    #[inline(always)]
125    pub fn timeout(&self) -> TIMEOUT_R {
126        TIMEOUT_R::new(((self.bits >> 3) & 0x01) != 0)
127    }
128    #[doc = "Bit 4 - the status of overrun interrupt"]
129    #[inline(always)]
130    pub fn overun(&self) -> OVERUN_R {
131        OVERUN_R::new(((self.bits >> 4) & 0x01) != 0)
132    }
133}
134impl W {
135    #[doc = "Writes raw bits to the register."]
136    #[inline(always)]
137    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
138        self.0.bits(bits);
139        self
140    }
141}
142#[doc = "Interrupt status (mask of STATUS and INTEN)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intstat](index.html) module"]
143pub struct INTSTAT_SPEC;
144impl crate::RegisterSpec for INTSTAT_SPEC {
145    type Ux = u32;
146}
147#[doc = "`read()` method returns [intstat::R](R) reader structure"]
148impl crate::Readable for INTSTAT_SPEC {
149    type Reader = R;
150}
151#[doc = "`write(|w| ..)` method takes [intstat::W](W) writer structure"]
152impl crate::Writable for INTSTAT_SPEC {
153    type Writer = W;
154}
155#[doc = "`reset()` method sets INTSTAT to value 0"]
156impl crate::Resettable for INTSTAT_SPEC {
157    #[inline(always)]
158    fn reset_value() -> Self::Ux {
159        0
160    }
161}