lpc82x_pac/dma0/
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 = "Summarizes whether any enabled interrupts (other than error interrupts) are pending.\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18pub enum ACTIVEINT_A {
19    #[doc = "0: Not pending. No enabled interrupts are pending."]
20    NOT_PENDING = 0,
21    #[doc = "1: Pending. At least one enabled interrupt is pending."]
22    PENDING = 1,
23}
24impl From<ACTIVEINT_A> for bool {
25    #[inline(always)]
26    fn from(variant: ACTIVEINT_A) -> Self {
27        variant as u8 != 0
28    }
29}
30#[doc = "Field `ACTIVEINT` reader - Summarizes whether any enabled interrupts (other than error interrupts) are pending."]
31pub struct ACTIVEINT_R(crate::FieldReader<bool, ACTIVEINT_A>);
32impl ACTIVEINT_R {
33    pub(crate) fn new(bits: bool) -> Self {
34        ACTIVEINT_R(crate::FieldReader::new(bits))
35    }
36    #[doc = r"Get enumerated values variant"]
37    #[inline(always)]
38    pub fn variant(&self) -> ACTIVEINT_A {
39        match self.bits {
40            false => ACTIVEINT_A::NOT_PENDING,
41            true => ACTIVEINT_A::PENDING,
42        }
43    }
44    #[doc = "Checks if the value of the field is `NOT_PENDING`"]
45    #[inline(always)]
46    pub fn is_not_pending(&self) -> bool {
47        **self == ACTIVEINT_A::NOT_PENDING
48    }
49    #[doc = "Checks if the value of the field is `PENDING`"]
50    #[inline(always)]
51    pub fn is_pending(&self) -> bool {
52        **self == ACTIVEINT_A::PENDING
53    }
54}
55impl core::ops::Deref for ACTIVEINT_R {
56    type Target = crate::FieldReader<bool, ACTIVEINT_A>;
57    #[inline(always)]
58    fn deref(&self) -> &Self::Target {
59        &self.0
60    }
61}
62#[doc = "Summarizes whether any error interrupts are pending.\n\nValue on reset: 0"]
63#[derive(Clone, Copy, Debug, PartialEq)]
64pub enum ACTIVEERRINT_A {
65    #[doc = "0: Not pending. No error interrupts are pending."]
66    NOT_PENDING = 0,
67    #[doc = "1: Pending. At least one error interrupt is pending."]
68    PENDING = 1,
69}
70impl From<ACTIVEERRINT_A> for bool {
71    #[inline(always)]
72    fn from(variant: ACTIVEERRINT_A) -> Self {
73        variant as u8 != 0
74    }
75}
76#[doc = "Field `ACTIVEERRINT` reader - Summarizes whether any error interrupts are pending."]
77pub struct ACTIVEERRINT_R(crate::FieldReader<bool, ACTIVEERRINT_A>);
78impl ACTIVEERRINT_R {
79    pub(crate) fn new(bits: bool) -> Self {
80        ACTIVEERRINT_R(crate::FieldReader::new(bits))
81    }
82    #[doc = r"Get enumerated values variant"]
83    #[inline(always)]
84    pub fn variant(&self) -> ACTIVEERRINT_A {
85        match self.bits {
86            false => ACTIVEERRINT_A::NOT_PENDING,
87            true => ACTIVEERRINT_A::PENDING,
88        }
89    }
90    #[doc = "Checks if the value of the field is `NOT_PENDING`"]
91    #[inline(always)]
92    pub fn is_not_pending(&self) -> bool {
93        **self == ACTIVEERRINT_A::NOT_PENDING
94    }
95    #[doc = "Checks if the value of the field is `PENDING`"]
96    #[inline(always)]
97    pub fn is_pending(&self) -> bool {
98        **self == ACTIVEERRINT_A::PENDING
99    }
100}
101impl core::ops::Deref for ACTIVEERRINT_R {
102    type Target = crate::FieldReader<bool, ACTIVEERRINT_A>;
103    #[inline(always)]
104    fn deref(&self) -> &Self::Target {
105        &self.0
106    }
107}
108impl R {
109    #[doc = "Bit 1 - Summarizes whether any enabled interrupts (other than error interrupts) are pending."]
110    #[inline(always)]
111    pub fn activeint(&self) -> ACTIVEINT_R {
112        ACTIVEINT_R::new(((self.bits >> 1) & 0x01) != 0)
113    }
114    #[doc = "Bit 2 - Summarizes whether any error interrupts are pending."]
115    #[inline(always)]
116    pub fn activeerrint(&self) -> ACTIVEERRINT_R {
117        ACTIVEERRINT_R::new(((self.bits >> 2) & 0x01) != 0)
118    }
119}
120#[doc = "Interrupt status.\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"]
121pub struct INTSTAT_SPEC;
122impl crate::RegisterSpec for INTSTAT_SPEC {
123    type Ux = u32;
124}
125#[doc = "`read()` method returns [intstat::R](R) reader structure"]
126impl crate::Readable for INTSTAT_SPEC {
127    type Reader = R;
128}
129#[doc = "`reset()` method sets INTSTAT to value 0"]
130impl crate::Resettable for INTSTAT_SPEC {
131    #[inline(always)]
132    fn reset_value() -> Self::Ux {
133        0
134    }
135}