lpc55_pac/i2c0/
intenset.rs

1#[doc = "Register `INTENSET` reader"]
2pub struct R(crate::R<INTENSET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTENSET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTENSET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTENSET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTENSET` writer"]
17pub struct W(crate::W<INTENSET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTENSET_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<INTENSET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTENSET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Master Pending interrupt Enable.\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum MSTPENDINGEN_A {
40    #[doc = "0: Disabled. The MstPending interrupt is disabled."]
41    DISABLED = 0,
42    #[doc = "1: Enabled. The MstPending interrupt is enabled."]
43    ENABLED = 1,
44}
45impl From<MSTPENDINGEN_A> for bool {
46    #[inline(always)]
47    fn from(variant: MSTPENDINGEN_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `MSTPENDINGEN` reader - Master Pending interrupt Enable."]
52pub struct MSTPENDINGEN_R(crate::FieldReader<bool, MSTPENDINGEN_A>);
53impl MSTPENDINGEN_R {
54    #[inline(always)]
55    pub(crate) fn new(bits: bool) -> Self {
56        MSTPENDINGEN_R(crate::FieldReader::new(bits))
57    }
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> MSTPENDINGEN_A {
61        match self.bits {
62            false => MSTPENDINGEN_A::DISABLED,
63            true => MSTPENDINGEN_A::ENABLED,
64        }
65    }
66    #[doc = "Checks if the value of the field is `DISABLED`"]
67    #[inline(always)]
68    pub fn is_disabled(&self) -> bool {
69        **self == MSTPENDINGEN_A::DISABLED
70    }
71    #[doc = "Checks if the value of the field is `ENABLED`"]
72    #[inline(always)]
73    pub fn is_enabled(&self) -> bool {
74        **self == MSTPENDINGEN_A::ENABLED
75    }
76}
77impl core::ops::Deref for MSTPENDINGEN_R {
78    type Target = crate::FieldReader<bool, MSTPENDINGEN_A>;
79    #[inline(always)]
80    fn deref(&self) -> &Self::Target {
81        &self.0
82    }
83}
84#[doc = "Field `MSTPENDINGEN` writer - Master Pending interrupt Enable."]
85pub struct MSTPENDINGEN_W<'a> {
86    w: &'a mut W,
87}
88impl<'a> MSTPENDINGEN_W<'a> {
89    #[doc = r"Writes `variant` to the field"]
90    #[inline(always)]
91    pub fn variant(self, variant: MSTPENDINGEN_A) -> &'a mut W {
92        self.bit(variant.into())
93    }
94    #[doc = "Disabled. The MstPending interrupt is disabled."]
95    #[inline(always)]
96    pub fn disabled(self) -> &'a mut W {
97        self.variant(MSTPENDINGEN_A::DISABLED)
98    }
99    #[doc = "Enabled. The MstPending interrupt is enabled."]
100    #[inline(always)]
101    pub fn enabled(self) -> &'a mut W {
102        self.variant(MSTPENDINGEN_A::ENABLED)
103    }
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
118        self.w
119    }
120}
121#[doc = "Master Arbitration Loss interrupt Enable.\n\nValue on reset: 0"]
122#[derive(Clone, Copy, Debug, PartialEq)]
123pub enum MSTARBLOSSEN_A {
124    #[doc = "0: Disabled. The MstArbLoss interrupt is disabled."]
125    DISABLED = 0,
126    #[doc = "1: Enabled. The MstArbLoss interrupt is enabled."]
127    ENABLED = 1,
128}
129impl From<MSTARBLOSSEN_A> for bool {
130    #[inline(always)]
131    fn from(variant: MSTARBLOSSEN_A) -> Self {
132        variant as u8 != 0
133    }
134}
135#[doc = "Field `MSTARBLOSSEN` reader - Master Arbitration Loss interrupt Enable."]
136pub struct MSTARBLOSSEN_R(crate::FieldReader<bool, MSTARBLOSSEN_A>);
137impl MSTARBLOSSEN_R {
138    #[inline(always)]
139    pub(crate) fn new(bits: bool) -> Self {
140        MSTARBLOSSEN_R(crate::FieldReader::new(bits))
141    }
142    #[doc = r"Get enumerated values variant"]
143    #[inline(always)]
144    pub fn variant(&self) -> MSTARBLOSSEN_A {
145        match self.bits {
146            false => MSTARBLOSSEN_A::DISABLED,
147            true => MSTARBLOSSEN_A::ENABLED,
148        }
149    }
150    #[doc = "Checks if the value of the field is `DISABLED`"]
151    #[inline(always)]
152    pub fn is_disabled(&self) -> bool {
153        **self == MSTARBLOSSEN_A::DISABLED
154    }
155    #[doc = "Checks if the value of the field is `ENABLED`"]
156    #[inline(always)]
157    pub fn is_enabled(&self) -> bool {
158        **self == MSTARBLOSSEN_A::ENABLED
159    }
160}
161impl core::ops::Deref for MSTARBLOSSEN_R {
162    type Target = crate::FieldReader<bool, MSTARBLOSSEN_A>;
163    #[inline(always)]
164    fn deref(&self) -> &Self::Target {
165        &self.0
166    }
167}
168#[doc = "Field `MSTARBLOSSEN` writer - Master Arbitration Loss interrupt Enable."]
169pub struct MSTARBLOSSEN_W<'a> {
170    w: &'a mut W,
171}
172impl<'a> MSTARBLOSSEN_W<'a> {
173    #[doc = r"Writes `variant` to the field"]
174    #[inline(always)]
175    pub fn variant(self, variant: MSTARBLOSSEN_A) -> &'a mut W {
176        self.bit(variant.into())
177    }
178    #[doc = "Disabled. The MstArbLoss interrupt is disabled."]
179    #[inline(always)]
180    pub fn disabled(self) -> &'a mut W {
181        self.variant(MSTARBLOSSEN_A::DISABLED)
182    }
183    #[doc = "Enabled. The MstArbLoss interrupt is enabled."]
184    #[inline(always)]
185    pub fn enabled(self) -> &'a mut W {
186        self.variant(MSTARBLOSSEN_A::ENABLED)
187    }
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
202        self.w
203    }
204}
205#[doc = "Master Start/Stop Error interrupt Enable.\n\nValue on reset: 0"]
206#[derive(Clone, Copy, Debug, PartialEq)]
207pub enum MSTSTSTPERREN_A {
208    #[doc = "0: Disabled. The MstStStpErr interrupt is disabled."]
209    DISABLED = 0,
210    #[doc = "1: Enabled. The MstStStpErr interrupt is enabled."]
211    ENABLED = 1,
212}
213impl From<MSTSTSTPERREN_A> for bool {
214    #[inline(always)]
215    fn from(variant: MSTSTSTPERREN_A) -> Self {
216        variant as u8 != 0
217    }
218}
219#[doc = "Field `MSTSTSTPERREN` reader - Master Start/Stop Error interrupt Enable."]
220pub struct MSTSTSTPERREN_R(crate::FieldReader<bool, MSTSTSTPERREN_A>);
221impl MSTSTSTPERREN_R {
222    #[inline(always)]
223    pub(crate) fn new(bits: bool) -> Self {
224        MSTSTSTPERREN_R(crate::FieldReader::new(bits))
225    }
226    #[doc = r"Get enumerated values variant"]
227    #[inline(always)]
228    pub fn variant(&self) -> MSTSTSTPERREN_A {
229        match self.bits {
230            false => MSTSTSTPERREN_A::DISABLED,
231            true => MSTSTSTPERREN_A::ENABLED,
232        }
233    }
234    #[doc = "Checks if the value of the field is `DISABLED`"]
235    #[inline(always)]
236    pub fn is_disabled(&self) -> bool {
237        **self == MSTSTSTPERREN_A::DISABLED
238    }
239    #[doc = "Checks if the value of the field is `ENABLED`"]
240    #[inline(always)]
241    pub fn is_enabled(&self) -> bool {
242        **self == MSTSTSTPERREN_A::ENABLED
243    }
244}
245impl core::ops::Deref for MSTSTSTPERREN_R {
246    type Target = crate::FieldReader<bool, MSTSTSTPERREN_A>;
247    #[inline(always)]
248    fn deref(&self) -> &Self::Target {
249        &self.0
250    }
251}
252#[doc = "Field `MSTSTSTPERREN` writer - Master Start/Stop Error interrupt Enable."]
253pub struct MSTSTSTPERREN_W<'a> {
254    w: &'a mut W,
255}
256impl<'a> MSTSTSTPERREN_W<'a> {
257    #[doc = r"Writes `variant` to the field"]
258    #[inline(always)]
259    pub fn variant(self, variant: MSTSTSTPERREN_A) -> &'a mut W {
260        self.bit(variant.into())
261    }
262    #[doc = "Disabled. The MstStStpErr interrupt is disabled."]
263    #[inline(always)]
264    pub fn disabled(self) -> &'a mut W {
265        self.variant(MSTSTSTPERREN_A::DISABLED)
266    }
267    #[doc = "Enabled. The MstStStpErr interrupt is enabled."]
268    #[inline(always)]
269    pub fn enabled(self) -> &'a mut W {
270        self.variant(MSTSTSTPERREN_A::ENABLED)
271    }
272    #[doc = r"Sets the field bit"]
273    #[inline(always)]
274    pub fn set_bit(self) -> &'a mut W {
275        self.bit(true)
276    }
277    #[doc = r"Clears the field bit"]
278    #[inline(always)]
279    pub fn clear_bit(self) -> &'a mut W {
280        self.bit(false)
281    }
282    #[doc = r"Writes raw bits to the field"]
283    #[inline(always)]
284    pub fn bit(self, value: bool) -> &'a mut W {
285        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
286        self.w
287    }
288}
289#[doc = "Slave Pending interrupt Enable.\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq)]
291pub enum SLVPENDINGEN_A {
292    #[doc = "0: Disabled. The SlvPending interrupt is disabled."]
293    DISABLED = 0,
294    #[doc = "1: Enabled. The SlvPending interrupt is enabled."]
295    ENABLED = 1,
296}
297impl From<SLVPENDINGEN_A> for bool {
298    #[inline(always)]
299    fn from(variant: SLVPENDINGEN_A) -> Self {
300        variant as u8 != 0
301    }
302}
303#[doc = "Field `SLVPENDINGEN` reader - Slave Pending interrupt Enable."]
304pub struct SLVPENDINGEN_R(crate::FieldReader<bool, SLVPENDINGEN_A>);
305impl SLVPENDINGEN_R {
306    #[inline(always)]
307    pub(crate) fn new(bits: bool) -> Self {
308        SLVPENDINGEN_R(crate::FieldReader::new(bits))
309    }
310    #[doc = r"Get enumerated values variant"]
311    #[inline(always)]
312    pub fn variant(&self) -> SLVPENDINGEN_A {
313        match self.bits {
314            false => SLVPENDINGEN_A::DISABLED,
315            true => SLVPENDINGEN_A::ENABLED,
316        }
317    }
318    #[doc = "Checks if the value of the field is `DISABLED`"]
319    #[inline(always)]
320    pub fn is_disabled(&self) -> bool {
321        **self == SLVPENDINGEN_A::DISABLED
322    }
323    #[doc = "Checks if the value of the field is `ENABLED`"]
324    #[inline(always)]
325    pub fn is_enabled(&self) -> bool {
326        **self == SLVPENDINGEN_A::ENABLED
327    }
328}
329impl core::ops::Deref for SLVPENDINGEN_R {
330    type Target = crate::FieldReader<bool, SLVPENDINGEN_A>;
331    #[inline(always)]
332    fn deref(&self) -> &Self::Target {
333        &self.0
334    }
335}
336#[doc = "Field `SLVPENDINGEN` writer - Slave Pending interrupt Enable."]
337pub struct SLVPENDINGEN_W<'a> {
338    w: &'a mut W,
339}
340impl<'a> SLVPENDINGEN_W<'a> {
341    #[doc = r"Writes `variant` to the field"]
342    #[inline(always)]
343    pub fn variant(self, variant: SLVPENDINGEN_A) -> &'a mut W {
344        self.bit(variant.into())
345    }
346    #[doc = "Disabled. The SlvPending interrupt is disabled."]
347    #[inline(always)]
348    pub fn disabled(self) -> &'a mut W {
349        self.variant(SLVPENDINGEN_A::DISABLED)
350    }
351    #[doc = "Enabled. The SlvPending interrupt is enabled."]
352    #[inline(always)]
353    pub fn enabled(self) -> &'a mut W {
354        self.variant(SLVPENDINGEN_A::ENABLED)
355    }
356    #[doc = r"Sets the field bit"]
357    #[inline(always)]
358    pub fn set_bit(self) -> &'a mut W {
359        self.bit(true)
360    }
361    #[doc = r"Clears the field bit"]
362    #[inline(always)]
363    pub fn clear_bit(self) -> &'a mut W {
364        self.bit(false)
365    }
366    #[doc = r"Writes raw bits to the field"]
367    #[inline(always)]
368    pub fn bit(self, value: bool) -> &'a mut W {
369        self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
370        self.w
371    }
372}
373#[doc = "Slave Not Stretching interrupt Enable.\n\nValue on reset: 0"]
374#[derive(Clone, Copy, Debug, PartialEq)]
375pub enum SLVNOTSTREN_A {
376    #[doc = "0: Disabled. The SlvNotStr interrupt is disabled."]
377    DISABLED = 0,
378    #[doc = "1: Enabled. The SlvNotStr interrupt is enabled."]
379    ENABLED = 1,
380}
381impl From<SLVNOTSTREN_A> for bool {
382    #[inline(always)]
383    fn from(variant: SLVNOTSTREN_A) -> Self {
384        variant as u8 != 0
385    }
386}
387#[doc = "Field `SLVNOTSTREN` reader - Slave Not Stretching interrupt Enable."]
388pub struct SLVNOTSTREN_R(crate::FieldReader<bool, SLVNOTSTREN_A>);
389impl SLVNOTSTREN_R {
390    #[inline(always)]
391    pub(crate) fn new(bits: bool) -> Self {
392        SLVNOTSTREN_R(crate::FieldReader::new(bits))
393    }
394    #[doc = r"Get enumerated values variant"]
395    #[inline(always)]
396    pub fn variant(&self) -> SLVNOTSTREN_A {
397        match self.bits {
398            false => SLVNOTSTREN_A::DISABLED,
399            true => SLVNOTSTREN_A::ENABLED,
400        }
401    }
402    #[doc = "Checks if the value of the field is `DISABLED`"]
403    #[inline(always)]
404    pub fn is_disabled(&self) -> bool {
405        **self == SLVNOTSTREN_A::DISABLED
406    }
407    #[doc = "Checks if the value of the field is `ENABLED`"]
408    #[inline(always)]
409    pub fn is_enabled(&self) -> bool {
410        **self == SLVNOTSTREN_A::ENABLED
411    }
412}
413impl core::ops::Deref for SLVNOTSTREN_R {
414    type Target = crate::FieldReader<bool, SLVNOTSTREN_A>;
415    #[inline(always)]
416    fn deref(&self) -> &Self::Target {
417        &self.0
418    }
419}
420#[doc = "Field `SLVNOTSTREN` writer - Slave Not Stretching interrupt Enable."]
421pub struct SLVNOTSTREN_W<'a> {
422    w: &'a mut W,
423}
424impl<'a> SLVNOTSTREN_W<'a> {
425    #[doc = r"Writes `variant` to the field"]
426    #[inline(always)]
427    pub fn variant(self, variant: SLVNOTSTREN_A) -> &'a mut W {
428        self.bit(variant.into())
429    }
430    #[doc = "Disabled. The SlvNotStr interrupt is disabled."]
431    #[inline(always)]
432    pub fn disabled(self) -> &'a mut W {
433        self.variant(SLVNOTSTREN_A::DISABLED)
434    }
435    #[doc = "Enabled. The SlvNotStr interrupt is enabled."]
436    #[inline(always)]
437    pub fn enabled(self) -> &'a mut W {
438        self.variant(SLVNOTSTREN_A::ENABLED)
439    }
440    #[doc = r"Sets the field bit"]
441    #[inline(always)]
442    pub fn set_bit(self) -> &'a mut W {
443        self.bit(true)
444    }
445    #[doc = r"Clears the field bit"]
446    #[inline(always)]
447    pub fn clear_bit(self) -> &'a mut W {
448        self.bit(false)
449    }
450    #[doc = r"Writes raw bits to the field"]
451    #[inline(always)]
452    pub fn bit(self, value: bool) -> &'a mut W {
453        self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
454        self.w
455    }
456}
457#[doc = "Slave Deselect interrupt Enable.\n\nValue on reset: 0"]
458#[derive(Clone, Copy, Debug, PartialEq)]
459pub enum SLVDESELEN_A {
460    #[doc = "0: Disabled. The SlvDeSel interrupt is disabled."]
461    DISABLED = 0,
462    #[doc = "1: Enabled. The SlvDeSel interrupt is enabled."]
463    ENABLED = 1,
464}
465impl From<SLVDESELEN_A> for bool {
466    #[inline(always)]
467    fn from(variant: SLVDESELEN_A) -> Self {
468        variant as u8 != 0
469    }
470}
471#[doc = "Field `SLVDESELEN` reader - Slave Deselect interrupt Enable."]
472pub struct SLVDESELEN_R(crate::FieldReader<bool, SLVDESELEN_A>);
473impl SLVDESELEN_R {
474    #[inline(always)]
475    pub(crate) fn new(bits: bool) -> Self {
476        SLVDESELEN_R(crate::FieldReader::new(bits))
477    }
478    #[doc = r"Get enumerated values variant"]
479    #[inline(always)]
480    pub fn variant(&self) -> SLVDESELEN_A {
481        match self.bits {
482            false => SLVDESELEN_A::DISABLED,
483            true => SLVDESELEN_A::ENABLED,
484        }
485    }
486    #[doc = "Checks if the value of the field is `DISABLED`"]
487    #[inline(always)]
488    pub fn is_disabled(&self) -> bool {
489        **self == SLVDESELEN_A::DISABLED
490    }
491    #[doc = "Checks if the value of the field is `ENABLED`"]
492    #[inline(always)]
493    pub fn is_enabled(&self) -> bool {
494        **self == SLVDESELEN_A::ENABLED
495    }
496}
497impl core::ops::Deref for SLVDESELEN_R {
498    type Target = crate::FieldReader<bool, SLVDESELEN_A>;
499    #[inline(always)]
500    fn deref(&self) -> &Self::Target {
501        &self.0
502    }
503}
504#[doc = "Field `SLVDESELEN` writer - Slave Deselect interrupt Enable."]
505pub struct SLVDESELEN_W<'a> {
506    w: &'a mut W,
507}
508impl<'a> SLVDESELEN_W<'a> {
509    #[doc = r"Writes `variant` to the field"]
510    #[inline(always)]
511    pub fn variant(self, variant: SLVDESELEN_A) -> &'a mut W {
512        self.bit(variant.into())
513    }
514    #[doc = "Disabled. The SlvDeSel interrupt is disabled."]
515    #[inline(always)]
516    pub fn disabled(self) -> &'a mut W {
517        self.variant(SLVDESELEN_A::DISABLED)
518    }
519    #[doc = "Enabled. The SlvDeSel interrupt is enabled."]
520    #[inline(always)]
521    pub fn enabled(self) -> &'a mut W {
522        self.variant(SLVDESELEN_A::ENABLED)
523    }
524    #[doc = r"Sets the field bit"]
525    #[inline(always)]
526    pub fn set_bit(self) -> &'a mut W {
527        self.bit(true)
528    }
529    #[doc = r"Clears the field bit"]
530    #[inline(always)]
531    pub fn clear_bit(self) -> &'a mut W {
532        self.bit(false)
533    }
534    #[doc = r"Writes raw bits to the field"]
535    #[inline(always)]
536    pub fn bit(self, value: bool) -> &'a mut W {
537        self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15);
538        self.w
539    }
540}
541#[doc = "Monitor data Ready interrupt Enable.\n\nValue on reset: 0"]
542#[derive(Clone, Copy, Debug, PartialEq)]
543pub enum MONRDYEN_A {
544    #[doc = "0: Disabled. The MonRdy interrupt is disabled."]
545    DISABLED = 0,
546    #[doc = "1: Enabled. The MonRdy interrupt is enabled."]
547    ENABLED = 1,
548}
549impl From<MONRDYEN_A> for bool {
550    #[inline(always)]
551    fn from(variant: MONRDYEN_A) -> Self {
552        variant as u8 != 0
553    }
554}
555#[doc = "Field `MONRDYEN` reader - Monitor data Ready interrupt Enable."]
556pub struct MONRDYEN_R(crate::FieldReader<bool, MONRDYEN_A>);
557impl MONRDYEN_R {
558    #[inline(always)]
559    pub(crate) fn new(bits: bool) -> Self {
560        MONRDYEN_R(crate::FieldReader::new(bits))
561    }
562    #[doc = r"Get enumerated values variant"]
563    #[inline(always)]
564    pub fn variant(&self) -> MONRDYEN_A {
565        match self.bits {
566            false => MONRDYEN_A::DISABLED,
567            true => MONRDYEN_A::ENABLED,
568        }
569    }
570    #[doc = "Checks if the value of the field is `DISABLED`"]
571    #[inline(always)]
572    pub fn is_disabled(&self) -> bool {
573        **self == MONRDYEN_A::DISABLED
574    }
575    #[doc = "Checks if the value of the field is `ENABLED`"]
576    #[inline(always)]
577    pub fn is_enabled(&self) -> bool {
578        **self == MONRDYEN_A::ENABLED
579    }
580}
581impl core::ops::Deref for MONRDYEN_R {
582    type Target = crate::FieldReader<bool, MONRDYEN_A>;
583    #[inline(always)]
584    fn deref(&self) -> &Self::Target {
585        &self.0
586    }
587}
588#[doc = "Field `MONRDYEN` writer - Monitor data Ready interrupt Enable."]
589pub struct MONRDYEN_W<'a> {
590    w: &'a mut W,
591}
592impl<'a> MONRDYEN_W<'a> {
593    #[doc = r"Writes `variant` to the field"]
594    #[inline(always)]
595    pub fn variant(self, variant: MONRDYEN_A) -> &'a mut W {
596        self.bit(variant.into())
597    }
598    #[doc = "Disabled. The MonRdy interrupt is disabled."]
599    #[inline(always)]
600    pub fn disabled(self) -> &'a mut W {
601        self.variant(MONRDYEN_A::DISABLED)
602    }
603    #[doc = "Enabled. The MonRdy interrupt is enabled."]
604    #[inline(always)]
605    pub fn enabled(self) -> &'a mut W {
606        self.variant(MONRDYEN_A::ENABLED)
607    }
608    #[doc = r"Sets the field bit"]
609    #[inline(always)]
610    pub fn set_bit(self) -> &'a mut W {
611        self.bit(true)
612    }
613    #[doc = r"Clears the field bit"]
614    #[inline(always)]
615    pub fn clear_bit(self) -> &'a mut W {
616        self.bit(false)
617    }
618    #[doc = r"Writes raw bits to the field"]
619    #[inline(always)]
620    pub fn bit(self, value: bool) -> &'a mut W {
621        self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16);
622        self.w
623    }
624}
625#[doc = "Monitor Overrun interrupt Enable.\n\nValue on reset: 0"]
626#[derive(Clone, Copy, Debug, PartialEq)]
627pub enum MONOVEN_A {
628    #[doc = "0: Disabled. The MonOv interrupt is disabled."]
629    DISABLED = 0,
630    #[doc = "1: Enabled. The MonOv interrupt is enabled."]
631    ENABLED = 1,
632}
633impl From<MONOVEN_A> for bool {
634    #[inline(always)]
635    fn from(variant: MONOVEN_A) -> Self {
636        variant as u8 != 0
637    }
638}
639#[doc = "Field `MONOVEN` reader - Monitor Overrun interrupt Enable."]
640pub struct MONOVEN_R(crate::FieldReader<bool, MONOVEN_A>);
641impl MONOVEN_R {
642    #[inline(always)]
643    pub(crate) fn new(bits: bool) -> Self {
644        MONOVEN_R(crate::FieldReader::new(bits))
645    }
646    #[doc = r"Get enumerated values variant"]
647    #[inline(always)]
648    pub fn variant(&self) -> MONOVEN_A {
649        match self.bits {
650            false => MONOVEN_A::DISABLED,
651            true => MONOVEN_A::ENABLED,
652        }
653    }
654    #[doc = "Checks if the value of the field is `DISABLED`"]
655    #[inline(always)]
656    pub fn is_disabled(&self) -> bool {
657        **self == MONOVEN_A::DISABLED
658    }
659    #[doc = "Checks if the value of the field is `ENABLED`"]
660    #[inline(always)]
661    pub fn is_enabled(&self) -> bool {
662        **self == MONOVEN_A::ENABLED
663    }
664}
665impl core::ops::Deref for MONOVEN_R {
666    type Target = crate::FieldReader<bool, MONOVEN_A>;
667    #[inline(always)]
668    fn deref(&self) -> &Self::Target {
669        &self.0
670    }
671}
672#[doc = "Field `MONOVEN` writer - Monitor Overrun interrupt Enable."]
673pub struct MONOVEN_W<'a> {
674    w: &'a mut W,
675}
676impl<'a> MONOVEN_W<'a> {
677    #[doc = r"Writes `variant` to the field"]
678    #[inline(always)]
679    pub fn variant(self, variant: MONOVEN_A) -> &'a mut W {
680        self.bit(variant.into())
681    }
682    #[doc = "Disabled. The MonOv interrupt is disabled."]
683    #[inline(always)]
684    pub fn disabled(self) -> &'a mut W {
685        self.variant(MONOVEN_A::DISABLED)
686    }
687    #[doc = "Enabled. The MonOv interrupt is enabled."]
688    #[inline(always)]
689    pub fn enabled(self) -> &'a mut W {
690        self.variant(MONOVEN_A::ENABLED)
691    }
692    #[doc = r"Sets the field bit"]
693    #[inline(always)]
694    pub fn set_bit(self) -> &'a mut W {
695        self.bit(true)
696    }
697    #[doc = r"Clears the field bit"]
698    #[inline(always)]
699    pub fn clear_bit(self) -> &'a mut W {
700        self.bit(false)
701    }
702    #[doc = r"Writes raw bits to the field"]
703    #[inline(always)]
704    pub fn bit(self, value: bool) -> &'a mut W {
705        self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17);
706        self.w
707    }
708}
709#[doc = "Monitor Idle interrupt Enable.\n\nValue on reset: 0"]
710#[derive(Clone, Copy, Debug, PartialEq)]
711pub enum MONIDLEEN_A {
712    #[doc = "0: Disabled. The MonIdle interrupt is disabled."]
713    DISABLED = 0,
714    #[doc = "1: Enabled. The MonIdle interrupt is enabled."]
715    ENABLED = 1,
716}
717impl From<MONIDLEEN_A> for bool {
718    #[inline(always)]
719    fn from(variant: MONIDLEEN_A) -> Self {
720        variant as u8 != 0
721    }
722}
723#[doc = "Field `MONIDLEEN` reader - Monitor Idle interrupt Enable."]
724pub struct MONIDLEEN_R(crate::FieldReader<bool, MONIDLEEN_A>);
725impl MONIDLEEN_R {
726    #[inline(always)]
727    pub(crate) fn new(bits: bool) -> Self {
728        MONIDLEEN_R(crate::FieldReader::new(bits))
729    }
730    #[doc = r"Get enumerated values variant"]
731    #[inline(always)]
732    pub fn variant(&self) -> MONIDLEEN_A {
733        match self.bits {
734            false => MONIDLEEN_A::DISABLED,
735            true => MONIDLEEN_A::ENABLED,
736        }
737    }
738    #[doc = "Checks if the value of the field is `DISABLED`"]
739    #[inline(always)]
740    pub fn is_disabled(&self) -> bool {
741        **self == MONIDLEEN_A::DISABLED
742    }
743    #[doc = "Checks if the value of the field is `ENABLED`"]
744    #[inline(always)]
745    pub fn is_enabled(&self) -> bool {
746        **self == MONIDLEEN_A::ENABLED
747    }
748}
749impl core::ops::Deref for MONIDLEEN_R {
750    type Target = crate::FieldReader<bool, MONIDLEEN_A>;
751    #[inline(always)]
752    fn deref(&self) -> &Self::Target {
753        &self.0
754    }
755}
756#[doc = "Field `MONIDLEEN` writer - Monitor Idle interrupt Enable."]
757pub struct MONIDLEEN_W<'a> {
758    w: &'a mut W,
759}
760impl<'a> MONIDLEEN_W<'a> {
761    #[doc = r"Writes `variant` to the field"]
762    #[inline(always)]
763    pub fn variant(self, variant: MONIDLEEN_A) -> &'a mut W {
764        self.bit(variant.into())
765    }
766    #[doc = "Disabled. The MonIdle interrupt is disabled."]
767    #[inline(always)]
768    pub fn disabled(self) -> &'a mut W {
769        self.variant(MONIDLEEN_A::DISABLED)
770    }
771    #[doc = "Enabled. The MonIdle interrupt is enabled."]
772    #[inline(always)]
773    pub fn enabled(self) -> &'a mut W {
774        self.variant(MONIDLEEN_A::ENABLED)
775    }
776    #[doc = r"Sets the field bit"]
777    #[inline(always)]
778    pub fn set_bit(self) -> &'a mut W {
779        self.bit(true)
780    }
781    #[doc = r"Clears the field bit"]
782    #[inline(always)]
783    pub fn clear_bit(self) -> &'a mut W {
784        self.bit(false)
785    }
786    #[doc = r"Writes raw bits to the field"]
787    #[inline(always)]
788    pub fn bit(self, value: bool) -> &'a mut W {
789        self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19);
790        self.w
791    }
792}
793#[doc = "Event time-out interrupt Enable.\n\nValue on reset: 0"]
794#[derive(Clone, Copy, Debug, PartialEq)]
795pub enum EVENTTIMEOUTEN_A {
796    #[doc = "0: Disabled. The Event time-out interrupt is disabled."]
797    DISABLED = 0,
798    #[doc = "1: Enabled. The Event time-out interrupt is enabled."]
799    ENABLED = 1,
800}
801impl From<EVENTTIMEOUTEN_A> for bool {
802    #[inline(always)]
803    fn from(variant: EVENTTIMEOUTEN_A) -> Self {
804        variant as u8 != 0
805    }
806}
807#[doc = "Field `EVENTTIMEOUTEN` reader - Event time-out interrupt Enable."]
808pub struct EVENTTIMEOUTEN_R(crate::FieldReader<bool, EVENTTIMEOUTEN_A>);
809impl EVENTTIMEOUTEN_R {
810    #[inline(always)]
811    pub(crate) fn new(bits: bool) -> Self {
812        EVENTTIMEOUTEN_R(crate::FieldReader::new(bits))
813    }
814    #[doc = r"Get enumerated values variant"]
815    #[inline(always)]
816    pub fn variant(&self) -> EVENTTIMEOUTEN_A {
817        match self.bits {
818            false => EVENTTIMEOUTEN_A::DISABLED,
819            true => EVENTTIMEOUTEN_A::ENABLED,
820        }
821    }
822    #[doc = "Checks if the value of the field is `DISABLED`"]
823    #[inline(always)]
824    pub fn is_disabled(&self) -> bool {
825        **self == EVENTTIMEOUTEN_A::DISABLED
826    }
827    #[doc = "Checks if the value of the field is `ENABLED`"]
828    #[inline(always)]
829    pub fn is_enabled(&self) -> bool {
830        **self == EVENTTIMEOUTEN_A::ENABLED
831    }
832}
833impl core::ops::Deref for EVENTTIMEOUTEN_R {
834    type Target = crate::FieldReader<bool, EVENTTIMEOUTEN_A>;
835    #[inline(always)]
836    fn deref(&self) -> &Self::Target {
837        &self.0
838    }
839}
840#[doc = "Field `EVENTTIMEOUTEN` writer - Event time-out interrupt Enable."]
841pub struct EVENTTIMEOUTEN_W<'a> {
842    w: &'a mut W,
843}
844impl<'a> EVENTTIMEOUTEN_W<'a> {
845    #[doc = r"Writes `variant` to the field"]
846    #[inline(always)]
847    pub fn variant(self, variant: EVENTTIMEOUTEN_A) -> &'a mut W {
848        self.bit(variant.into())
849    }
850    #[doc = "Disabled. The Event time-out interrupt is disabled."]
851    #[inline(always)]
852    pub fn disabled(self) -> &'a mut W {
853        self.variant(EVENTTIMEOUTEN_A::DISABLED)
854    }
855    #[doc = "Enabled. The Event time-out interrupt is enabled."]
856    #[inline(always)]
857    pub fn enabled(self) -> &'a mut W {
858        self.variant(EVENTTIMEOUTEN_A::ENABLED)
859    }
860    #[doc = r"Sets the field bit"]
861    #[inline(always)]
862    pub fn set_bit(self) -> &'a mut W {
863        self.bit(true)
864    }
865    #[doc = r"Clears the field bit"]
866    #[inline(always)]
867    pub fn clear_bit(self) -> &'a mut W {
868        self.bit(false)
869    }
870    #[doc = r"Writes raw bits to the field"]
871    #[inline(always)]
872    pub fn bit(self, value: bool) -> &'a mut W {
873        self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24);
874        self.w
875    }
876}
877#[doc = "SCL time-out interrupt Enable.\n\nValue on reset: 0"]
878#[derive(Clone, Copy, Debug, PartialEq)]
879pub enum SCLTIMEOUTEN_A {
880    #[doc = "0: Disabled. The SCL time-out interrupt is disabled."]
881    DISABLED = 0,
882    #[doc = "1: Enabled. The SCL time-out interrupt is enabled."]
883    ENABLED = 1,
884}
885impl From<SCLTIMEOUTEN_A> for bool {
886    #[inline(always)]
887    fn from(variant: SCLTIMEOUTEN_A) -> Self {
888        variant as u8 != 0
889    }
890}
891#[doc = "Field `SCLTIMEOUTEN` reader - SCL time-out interrupt Enable."]
892pub struct SCLTIMEOUTEN_R(crate::FieldReader<bool, SCLTIMEOUTEN_A>);
893impl SCLTIMEOUTEN_R {
894    #[inline(always)]
895    pub(crate) fn new(bits: bool) -> Self {
896        SCLTIMEOUTEN_R(crate::FieldReader::new(bits))
897    }
898    #[doc = r"Get enumerated values variant"]
899    #[inline(always)]
900    pub fn variant(&self) -> SCLTIMEOUTEN_A {
901        match self.bits {
902            false => SCLTIMEOUTEN_A::DISABLED,
903            true => SCLTIMEOUTEN_A::ENABLED,
904        }
905    }
906    #[doc = "Checks if the value of the field is `DISABLED`"]
907    #[inline(always)]
908    pub fn is_disabled(&self) -> bool {
909        **self == SCLTIMEOUTEN_A::DISABLED
910    }
911    #[doc = "Checks if the value of the field is `ENABLED`"]
912    #[inline(always)]
913    pub fn is_enabled(&self) -> bool {
914        **self == SCLTIMEOUTEN_A::ENABLED
915    }
916}
917impl core::ops::Deref for SCLTIMEOUTEN_R {
918    type Target = crate::FieldReader<bool, SCLTIMEOUTEN_A>;
919    #[inline(always)]
920    fn deref(&self) -> &Self::Target {
921        &self.0
922    }
923}
924#[doc = "Field `SCLTIMEOUTEN` writer - SCL time-out interrupt Enable."]
925pub struct SCLTIMEOUTEN_W<'a> {
926    w: &'a mut W,
927}
928impl<'a> SCLTIMEOUTEN_W<'a> {
929    #[doc = r"Writes `variant` to the field"]
930    #[inline(always)]
931    pub fn variant(self, variant: SCLTIMEOUTEN_A) -> &'a mut W {
932        self.bit(variant.into())
933    }
934    #[doc = "Disabled. The SCL time-out interrupt is disabled."]
935    #[inline(always)]
936    pub fn disabled(self) -> &'a mut W {
937        self.variant(SCLTIMEOUTEN_A::DISABLED)
938    }
939    #[doc = "Enabled. The SCL time-out interrupt is enabled."]
940    #[inline(always)]
941    pub fn enabled(self) -> &'a mut W {
942        self.variant(SCLTIMEOUTEN_A::ENABLED)
943    }
944    #[doc = r"Sets the field bit"]
945    #[inline(always)]
946    pub fn set_bit(self) -> &'a mut W {
947        self.bit(true)
948    }
949    #[doc = r"Clears the field bit"]
950    #[inline(always)]
951    pub fn clear_bit(self) -> &'a mut W {
952        self.bit(false)
953    }
954    #[doc = r"Writes raw bits to the field"]
955    #[inline(always)]
956    pub fn bit(self, value: bool) -> &'a mut W {
957        self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25);
958        self.w
959    }
960}
961impl R {
962    #[doc = "Bit 0 - Master Pending interrupt Enable."]
963    #[inline(always)]
964    pub fn mstpendingen(&self) -> MSTPENDINGEN_R {
965        MSTPENDINGEN_R::new((self.bits & 0x01) != 0)
966    }
967    #[doc = "Bit 4 - Master Arbitration Loss interrupt Enable."]
968    #[inline(always)]
969    pub fn mstarblossen(&self) -> MSTARBLOSSEN_R {
970        MSTARBLOSSEN_R::new(((self.bits >> 4) & 0x01) != 0)
971    }
972    #[doc = "Bit 6 - Master Start/Stop Error interrupt Enable."]
973    #[inline(always)]
974    pub fn mstststperren(&self) -> MSTSTSTPERREN_R {
975        MSTSTSTPERREN_R::new(((self.bits >> 6) & 0x01) != 0)
976    }
977    #[doc = "Bit 8 - Slave Pending interrupt Enable."]
978    #[inline(always)]
979    pub fn slvpendingen(&self) -> SLVPENDINGEN_R {
980        SLVPENDINGEN_R::new(((self.bits >> 8) & 0x01) != 0)
981    }
982    #[doc = "Bit 11 - Slave Not Stretching interrupt Enable."]
983    #[inline(always)]
984    pub fn slvnotstren(&self) -> SLVNOTSTREN_R {
985        SLVNOTSTREN_R::new(((self.bits >> 11) & 0x01) != 0)
986    }
987    #[doc = "Bit 15 - Slave Deselect interrupt Enable."]
988    #[inline(always)]
989    pub fn slvdeselen(&self) -> SLVDESELEN_R {
990        SLVDESELEN_R::new(((self.bits >> 15) & 0x01) != 0)
991    }
992    #[doc = "Bit 16 - Monitor data Ready interrupt Enable."]
993    #[inline(always)]
994    pub fn monrdyen(&self) -> MONRDYEN_R {
995        MONRDYEN_R::new(((self.bits >> 16) & 0x01) != 0)
996    }
997    #[doc = "Bit 17 - Monitor Overrun interrupt Enable."]
998    #[inline(always)]
999    pub fn monoven(&self) -> MONOVEN_R {
1000        MONOVEN_R::new(((self.bits >> 17) & 0x01) != 0)
1001    }
1002    #[doc = "Bit 19 - Monitor Idle interrupt Enable."]
1003    #[inline(always)]
1004    pub fn monidleen(&self) -> MONIDLEEN_R {
1005        MONIDLEEN_R::new(((self.bits >> 19) & 0x01) != 0)
1006    }
1007    #[doc = "Bit 24 - Event time-out interrupt Enable."]
1008    #[inline(always)]
1009    pub fn eventtimeouten(&self) -> EVENTTIMEOUTEN_R {
1010        EVENTTIMEOUTEN_R::new(((self.bits >> 24) & 0x01) != 0)
1011    }
1012    #[doc = "Bit 25 - SCL time-out interrupt Enable."]
1013    #[inline(always)]
1014    pub fn scltimeouten(&self) -> SCLTIMEOUTEN_R {
1015        SCLTIMEOUTEN_R::new(((self.bits >> 25) & 0x01) != 0)
1016    }
1017}
1018impl W {
1019    #[doc = "Bit 0 - Master Pending interrupt Enable."]
1020    #[inline(always)]
1021    pub fn mstpendingen(&mut self) -> MSTPENDINGEN_W {
1022        MSTPENDINGEN_W { w: self }
1023    }
1024    #[doc = "Bit 4 - Master Arbitration Loss interrupt Enable."]
1025    #[inline(always)]
1026    pub fn mstarblossen(&mut self) -> MSTARBLOSSEN_W {
1027        MSTARBLOSSEN_W { w: self }
1028    }
1029    #[doc = "Bit 6 - Master Start/Stop Error interrupt Enable."]
1030    #[inline(always)]
1031    pub fn mstststperren(&mut self) -> MSTSTSTPERREN_W {
1032        MSTSTSTPERREN_W { w: self }
1033    }
1034    #[doc = "Bit 8 - Slave Pending interrupt Enable."]
1035    #[inline(always)]
1036    pub fn slvpendingen(&mut self) -> SLVPENDINGEN_W {
1037        SLVPENDINGEN_W { w: self }
1038    }
1039    #[doc = "Bit 11 - Slave Not Stretching interrupt Enable."]
1040    #[inline(always)]
1041    pub fn slvnotstren(&mut self) -> SLVNOTSTREN_W {
1042        SLVNOTSTREN_W { w: self }
1043    }
1044    #[doc = "Bit 15 - Slave Deselect interrupt Enable."]
1045    #[inline(always)]
1046    pub fn slvdeselen(&mut self) -> SLVDESELEN_W {
1047        SLVDESELEN_W { w: self }
1048    }
1049    #[doc = "Bit 16 - Monitor data Ready interrupt Enable."]
1050    #[inline(always)]
1051    pub fn monrdyen(&mut self) -> MONRDYEN_W {
1052        MONRDYEN_W { w: self }
1053    }
1054    #[doc = "Bit 17 - Monitor Overrun interrupt Enable."]
1055    #[inline(always)]
1056    pub fn monoven(&mut self) -> MONOVEN_W {
1057        MONOVEN_W { w: self }
1058    }
1059    #[doc = "Bit 19 - Monitor Idle interrupt Enable."]
1060    #[inline(always)]
1061    pub fn monidleen(&mut self) -> MONIDLEEN_W {
1062        MONIDLEEN_W { w: self }
1063    }
1064    #[doc = "Bit 24 - Event time-out interrupt Enable."]
1065    #[inline(always)]
1066    pub fn eventtimeouten(&mut self) -> EVENTTIMEOUTEN_W {
1067        EVENTTIMEOUTEN_W { w: self }
1068    }
1069    #[doc = "Bit 25 - SCL time-out interrupt Enable."]
1070    #[inline(always)]
1071    pub fn scltimeouten(&mut self) -> SCLTIMEOUTEN_W {
1072        SCLTIMEOUTEN_W { w: self }
1073    }
1074    #[doc = "Writes raw bits to the register."]
1075    #[inline(always)]
1076    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1077        self.0.bits(bits);
1078        self
1079    }
1080}
1081#[doc = "Interrupt Enable Set and read register.\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 [intenset](index.html) module"]
1082pub struct INTENSET_SPEC;
1083impl crate::RegisterSpec for INTENSET_SPEC {
1084    type Ux = u32;
1085}
1086#[doc = "`read()` method returns [intenset::R](R) reader structure"]
1087impl crate::Readable for INTENSET_SPEC {
1088    type Reader = R;
1089}
1090#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
1091impl crate::Writable for INTENSET_SPEC {
1092    type Writer = W;
1093}
1094#[doc = "`reset()` method sets INTENSET to value 0"]
1095impl crate::Resettable for INTENSET_SPEC {
1096    #[inline(always)]
1097    fn reset_value() -> Self::Ux {
1098        0
1099    }
1100}