lpc82x_pac/i2c0/
intstat.rs1#[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 = "Field `MSTPENDING` reader - Master Pending."]
17pub struct MSTPENDING_R(crate::FieldReader<bool, bool>);
18impl MSTPENDING_R {
19 pub(crate) fn new(bits: bool) -> Self {
20 MSTPENDING_R(crate::FieldReader::new(bits))
21 }
22}
23impl core::ops::Deref for MSTPENDING_R {
24 type Target = crate::FieldReader<bool, bool>;
25 #[inline(always)]
26 fn deref(&self) -> &Self::Target {
27 &self.0
28 }
29}
30#[doc = "Field `MSTARBLOSS` reader - Master Arbitration Loss flag."]
31pub struct MSTARBLOSS_R(crate::FieldReader<bool, bool>);
32impl MSTARBLOSS_R {
33 pub(crate) fn new(bits: bool) -> Self {
34 MSTARBLOSS_R(crate::FieldReader::new(bits))
35 }
36}
37impl core::ops::Deref for MSTARBLOSS_R {
38 type Target = crate::FieldReader<bool, bool>;
39 #[inline(always)]
40 fn deref(&self) -> &Self::Target {
41 &self.0
42 }
43}
44#[doc = "Field `MSTSTSTPERR` reader - Master Start/Stop Error flag."]
45pub struct MSTSTSTPERR_R(crate::FieldReader<bool, bool>);
46impl MSTSTSTPERR_R {
47 pub(crate) fn new(bits: bool) -> Self {
48 MSTSTSTPERR_R(crate::FieldReader::new(bits))
49 }
50}
51impl core::ops::Deref for MSTSTSTPERR_R {
52 type Target = crate::FieldReader<bool, bool>;
53 #[inline(always)]
54 fn deref(&self) -> &Self::Target {
55 &self.0
56 }
57}
58#[doc = "Field `SLVPENDING` reader - Slave Pending."]
59pub struct SLVPENDING_R(crate::FieldReader<bool, bool>);
60impl SLVPENDING_R {
61 pub(crate) fn new(bits: bool) -> Self {
62 SLVPENDING_R(crate::FieldReader::new(bits))
63 }
64}
65impl core::ops::Deref for SLVPENDING_R {
66 type Target = crate::FieldReader<bool, bool>;
67 #[inline(always)]
68 fn deref(&self) -> &Self::Target {
69 &self.0
70 }
71}
72#[doc = "Field `SLVNOTSTR` reader - Slave Not Stretching status."]
73pub struct SLVNOTSTR_R(crate::FieldReader<bool, bool>);
74impl SLVNOTSTR_R {
75 pub(crate) fn new(bits: bool) -> Self {
76 SLVNOTSTR_R(crate::FieldReader::new(bits))
77 }
78}
79impl core::ops::Deref for SLVNOTSTR_R {
80 type Target = crate::FieldReader<bool, bool>;
81 #[inline(always)]
82 fn deref(&self) -> &Self::Target {
83 &self.0
84 }
85}
86#[doc = "Field `SLVDESEL` reader - Slave Deselected flag."]
87pub struct SLVDESEL_R(crate::FieldReader<bool, bool>);
88impl SLVDESEL_R {
89 pub(crate) fn new(bits: bool) -> Self {
90 SLVDESEL_R(crate::FieldReader::new(bits))
91 }
92}
93impl core::ops::Deref for SLVDESEL_R {
94 type Target = crate::FieldReader<bool, bool>;
95 #[inline(always)]
96 fn deref(&self) -> &Self::Target {
97 &self.0
98 }
99}
100#[doc = "Field `MONRDY` reader - Monitor Ready."]
101pub struct MONRDY_R(crate::FieldReader<bool, bool>);
102impl MONRDY_R {
103 pub(crate) fn new(bits: bool) -> Self {
104 MONRDY_R(crate::FieldReader::new(bits))
105 }
106}
107impl core::ops::Deref for MONRDY_R {
108 type Target = crate::FieldReader<bool, bool>;
109 #[inline(always)]
110 fn deref(&self) -> &Self::Target {
111 &self.0
112 }
113}
114#[doc = "Field `MONOV` reader - Monitor Overflow flag."]
115pub struct MONOV_R(crate::FieldReader<bool, bool>);
116impl MONOV_R {
117 pub(crate) fn new(bits: bool) -> Self {
118 MONOV_R(crate::FieldReader::new(bits))
119 }
120}
121impl core::ops::Deref for MONOV_R {
122 type Target = crate::FieldReader<bool, bool>;
123 #[inline(always)]
124 fn deref(&self) -> &Self::Target {
125 &self.0
126 }
127}
128#[doc = "Field `MONIDLE` reader - Monitor Idle flag."]
129pub struct MONIDLE_R(crate::FieldReader<bool, bool>);
130impl MONIDLE_R {
131 pub(crate) fn new(bits: bool) -> Self {
132 MONIDLE_R(crate::FieldReader::new(bits))
133 }
134}
135impl core::ops::Deref for MONIDLE_R {
136 type Target = crate::FieldReader<bool, bool>;
137 #[inline(always)]
138 fn deref(&self) -> &Self::Target {
139 &self.0
140 }
141}
142#[doc = "Field `EVENTTIMEOUT` reader - Event time-out Interrupt flag."]
143pub struct EVENTTIMEOUT_R(crate::FieldReader<bool, bool>);
144impl EVENTTIMEOUT_R {
145 pub(crate) fn new(bits: bool) -> Self {
146 EVENTTIMEOUT_R(crate::FieldReader::new(bits))
147 }
148}
149impl core::ops::Deref for EVENTTIMEOUT_R {
150 type Target = crate::FieldReader<bool, bool>;
151 #[inline(always)]
152 fn deref(&self) -> &Self::Target {
153 &self.0
154 }
155}
156#[doc = "Field `SCLTIMEOUT` reader - SCL time-out Interrupt flag."]
157pub struct SCLTIMEOUT_R(crate::FieldReader<bool, bool>);
158impl SCLTIMEOUT_R {
159 pub(crate) fn new(bits: bool) -> Self {
160 SCLTIMEOUT_R(crate::FieldReader::new(bits))
161 }
162}
163impl core::ops::Deref for SCLTIMEOUT_R {
164 type Target = crate::FieldReader<bool, bool>;
165 #[inline(always)]
166 fn deref(&self) -> &Self::Target {
167 &self.0
168 }
169}
170impl R {
171 #[doc = "Bit 0 - Master Pending."]
172 #[inline(always)]
173 pub fn mstpending(&self) -> MSTPENDING_R {
174 MSTPENDING_R::new((self.bits & 0x01) != 0)
175 }
176 #[doc = "Bit 4 - Master Arbitration Loss flag."]
177 #[inline(always)]
178 pub fn mstarbloss(&self) -> MSTARBLOSS_R {
179 MSTARBLOSS_R::new(((self.bits >> 4) & 0x01) != 0)
180 }
181 #[doc = "Bit 6 - Master Start/Stop Error flag."]
182 #[inline(always)]
183 pub fn mstststperr(&self) -> MSTSTSTPERR_R {
184 MSTSTSTPERR_R::new(((self.bits >> 6) & 0x01) != 0)
185 }
186 #[doc = "Bit 8 - Slave Pending."]
187 #[inline(always)]
188 pub fn slvpending(&self) -> SLVPENDING_R {
189 SLVPENDING_R::new(((self.bits >> 8) & 0x01) != 0)
190 }
191 #[doc = "Bit 11 - Slave Not Stretching status."]
192 #[inline(always)]
193 pub fn slvnotstr(&self) -> SLVNOTSTR_R {
194 SLVNOTSTR_R::new(((self.bits >> 11) & 0x01) != 0)
195 }
196 #[doc = "Bit 15 - Slave Deselected flag."]
197 #[inline(always)]
198 pub fn slvdesel(&self) -> SLVDESEL_R {
199 SLVDESEL_R::new(((self.bits >> 15) & 0x01) != 0)
200 }
201 #[doc = "Bit 16 - Monitor Ready."]
202 #[inline(always)]
203 pub fn monrdy(&self) -> MONRDY_R {
204 MONRDY_R::new(((self.bits >> 16) & 0x01) != 0)
205 }
206 #[doc = "Bit 17 - Monitor Overflow flag."]
207 #[inline(always)]
208 pub fn monov(&self) -> MONOV_R {
209 MONOV_R::new(((self.bits >> 17) & 0x01) != 0)
210 }
211 #[doc = "Bit 19 - Monitor Idle flag."]
212 #[inline(always)]
213 pub fn monidle(&self) -> MONIDLE_R {
214 MONIDLE_R::new(((self.bits >> 19) & 0x01) != 0)
215 }
216 #[doc = "Bit 24 - Event time-out Interrupt flag."]
217 #[inline(always)]
218 pub fn eventtimeout(&self) -> EVENTTIMEOUT_R {
219 EVENTTIMEOUT_R::new(((self.bits >> 24) & 0x01) != 0)
220 }
221 #[doc = "Bit 25 - SCL time-out Interrupt flag."]
222 #[inline(always)]
223 pub fn scltimeout(&self) -> SCLTIMEOUT_R {
224 SCLTIMEOUT_R::new(((self.bits >> 25) & 0x01) != 0)
225 }
226}
227#[doc = "Interrupt Status register for Master, Slave, and Monitor functions.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intstat](index.html) module"]
228pub struct INTSTAT_SPEC;
229impl crate::RegisterSpec for INTSTAT_SPEC {
230 type Ux = u32;
231}
232#[doc = "`read()` method returns [intstat::R](R) reader structure"]
233impl crate::Readable for INTSTAT_SPEC {
234 type Reader = R;
235}
236#[doc = "`reset()` method sets INTSTAT to value 0x0801"]
237impl crate::Resettable for INTSTAT_SPEC {
238 #[inline(always)]
239 fn reset_value() -> Self::Ux {
240 0x0801
241 }
242}