mimxrt595s/spi0/
fifointstat.rs

1#[doc = "Register `FIFOINTSTAT` reader"]
2pub struct R(crate::R<FIFOINTSTAT_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FIFOINTSTAT_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FIFOINTSTAT_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FIFOINTSTAT_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `TXERR` reader - TX FIFO Error Interrupt Status"]
17pub type TXERR_R = crate::BitReader<TXERR_A>;
18#[doc = "TX FIFO Error Interrupt Status\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum TXERR_A {
21    #[doc = "0: Not pending"]
22    TXERR_ISNOTPENDING = 0,
23    #[doc = "1: Pending"]
24    TXERR_ISPENDING = 1,
25}
26impl From<TXERR_A> for bool {
27    #[inline(always)]
28    fn from(variant: TXERR_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl TXERR_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> TXERR_A {
36        match self.bits {
37            false => TXERR_A::TXERR_ISNOTPENDING,
38            true => TXERR_A::TXERR_ISPENDING,
39        }
40    }
41    #[doc = "Checks if the value of the field is `TXERR_ISNOTPENDING`"]
42    #[inline(always)]
43    pub fn is_txerr_isnotpending(&self) -> bool {
44        *self == TXERR_A::TXERR_ISNOTPENDING
45    }
46    #[doc = "Checks if the value of the field is `TXERR_ISPENDING`"]
47    #[inline(always)]
48    pub fn is_txerr_ispending(&self) -> bool {
49        *self == TXERR_A::TXERR_ISPENDING
50    }
51}
52#[doc = "Field `RXERR` reader - RX FIFO Error Interrupt Status"]
53pub type RXERR_R = crate::BitReader<RXERR_A>;
54#[doc = "RX FIFO Error Interrupt Status\n\nValue on reset: 0"]
55#[derive(Clone, Copy, Debug, PartialEq, Eq)]
56pub enum RXERR_A {
57    #[doc = "0: Not pending"]
58    RXERR_ISNOTPENDING = 0,
59    #[doc = "1: Pending"]
60    RXERR_ISPENDING = 1,
61}
62impl From<RXERR_A> for bool {
63    #[inline(always)]
64    fn from(variant: RXERR_A) -> Self {
65        variant as u8 != 0
66    }
67}
68impl RXERR_R {
69    #[doc = "Get enumerated values variant"]
70    #[inline(always)]
71    pub fn variant(&self) -> RXERR_A {
72        match self.bits {
73            false => RXERR_A::RXERR_ISNOTPENDING,
74            true => RXERR_A::RXERR_ISPENDING,
75        }
76    }
77    #[doc = "Checks if the value of the field is `RXERR_ISNOTPENDING`"]
78    #[inline(always)]
79    pub fn is_rxerr_isnotpending(&self) -> bool {
80        *self == RXERR_A::RXERR_ISNOTPENDING
81    }
82    #[doc = "Checks if the value of the field is `RXERR_ISPENDING`"]
83    #[inline(always)]
84    pub fn is_rxerr_ispending(&self) -> bool {
85        *self == RXERR_A::RXERR_ISPENDING
86    }
87}
88#[doc = "Field `TXLVL` reader - Transmit FIFO Level Interrupt Status"]
89pub type TXLVL_R = crate::BitReader<TXLVL_A>;
90#[doc = "Transmit FIFO Level Interrupt Status\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum TXLVL_A {
93    #[doc = "0: Not pending"]
94    TXLVL_ISNOTPENDING = 0,
95    #[doc = "1: Pending"]
96    TXLVL_ISPENDING = 1,
97}
98impl From<TXLVL_A> for bool {
99    #[inline(always)]
100    fn from(variant: TXLVL_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl TXLVL_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> TXLVL_A {
108        match self.bits {
109            false => TXLVL_A::TXLVL_ISNOTPENDING,
110            true => TXLVL_A::TXLVL_ISPENDING,
111        }
112    }
113    #[doc = "Checks if the value of the field is `TXLVL_ISNOTPENDING`"]
114    #[inline(always)]
115    pub fn is_txlvl_isnotpending(&self) -> bool {
116        *self == TXLVL_A::TXLVL_ISNOTPENDING
117    }
118    #[doc = "Checks if the value of the field is `TXLVL_ISPENDING`"]
119    #[inline(always)]
120    pub fn is_txlvl_ispending(&self) -> bool {
121        *self == TXLVL_A::TXLVL_ISPENDING
122    }
123}
124#[doc = "Field `RXLVL` reader - Receive FIFO Level Interrupt Status"]
125pub type RXLVL_R = crate::BitReader<RXLVL_A>;
126#[doc = "Receive FIFO Level Interrupt Status\n\nValue on reset: 0"]
127#[derive(Clone, Copy, Debug, PartialEq, Eq)]
128pub enum RXLVL_A {
129    #[doc = "0: Not pending"]
130    RXLVL_ISNOTPENDING = 0,
131    #[doc = "1: Pending"]
132    RXLVL_ISPENDING = 1,
133}
134impl From<RXLVL_A> for bool {
135    #[inline(always)]
136    fn from(variant: RXLVL_A) -> Self {
137        variant as u8 != 0
138    }
139}
140impl RXLVL_R {
141    #[doc = "Get enumerated values variant"]
142    #[inline(always)]
143    pub fn variant(&self) -> RXLVL_A {
144        match self.bits {
145            false => RXLVL_A::RXLVL_ISNOTPENDING,
146            true => RXLVL_A::RXLVL_ISPENDING,
147        }
148    }
149    #[doc = "Checks if the value of the field is `RXLVL_ISNOTPENDING`"]
150    #[inline(always)]
151    pub fn is_rxlvl_isnotpending(&self) -> bool {
152        *self == RXLVL_A::RXLVL_ISNOTPENDING
153    }
154    #[doc = "Checks if the value of the field is `RXLVL_ISPENDING`"]
155    #[inline(always)]
156    pub fn is_rxlvl_ispending(&self) -> bool {
157        *self == RXLVL_A::RXLVL_ISPENDING
158    }
159}
160#[doc = "Field `PERINT` reader - Peripheral Interrupt Status"]
161pub type PERINT_R = crate::BitReader<PERINT_A>;
162#[doc = "Peripheral Interrupt Status\n\nValue on reset: 0"]
163#[derive(Clone, Copy, Debug, PartialEq, Eq)]
164pub enum PERINT_A {
165    #[doc = "0: Not pending"]
166    PERINT_ISNOTPENDING = 0,
167    #[doc = "1: Pending"]
168    PERINT_ISPENDING = 1,
169}
170impl From<PERINT_A> for bool {
171    #[inline(always)]
172    fn from(variant: PERINT_A) -> Self {
173        variant as u8 != 0
174    }
175}
176impl PERINT_R {
177    #[doc = "Get enumerated values variant"]
178    #[inline(always)]
179    pub fn variant(&self) -> PERINT_A {
180        match self.bits {
181            false => PERINT_A::PERINT_ISNOTPENDING,
182            true => PERINT_A::PERINT_ISPENDING,
183        }
184    }
185    #[doc = "Checks if the value of the field is `PERINT_ISNOTPENDING`"]
186    #[inline(always)]
187    pub fn is_perint_isnotpending(&self) -> bool {
188        *self == PERINT_A::PERINT_ISNOTPENDING
189    }
190    #[doc = "Checks if the value of the field is `PERINT_ISPENDING`"]
191    #[inline(always)]
192    pub fn is_perint_ispending(&self) -> bool {
193        *self == PERINT_A::PERINT_ISPENDING
194    }
195}
196impl R {
197    #[doc = "Bit 0 - TX FIFO Error Interrupt Status"]
198    #[inline(always)]
199    pub fn txerr(&self) -> TXERR_R {
200        TXERR_R::new((self.bits & 1) != 0)
201    }
202    #[doc = "Bit 1 - RX FIFO Error Interrupt Status"]
203    #[inline(always)]
204    pub fn rxerr(&self) -> RXERR_R {
205        RXERR_R::new(((self.bits >> 1) & 1) != 0)
206    }
207    #[doc = "Bit 2 - Transmit FIFO Level Interrupt Status"]
208    #[inline(always)]
209    pub fn txlvl(&self) -> TXLVL_R {
210        TXLVL_R::new(((self.bits >> 2) & 1) != 0)
211    }
212    #[doc = "Bit 3 - Receive FIFO Level Interrupt Status"]
213    #[inline(always)]
214    pub fn rxlvl(&self) -> RXLVL_R {
215        RXLVL_R::new(((self.bits >> 3) & 1) != 0)
216    }
217    #[doc = "Bit 4 - Peripheral Interrupt Status"]
218    #[inline(always)]
219    pub fn perint(&self) -> PERINT_R {
220        PERINT_R::new(((self.bits >> 4) & 1) != 0)
221    }
222}
223#[doc = "FIFO Interrupt Status Register\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 [fifointstat](index.html) module"]
224pub struct FIFOINTSTAT_SPEC;
225impl crate::RegisterSpec for FIFOINTSTAT_SPEC {
226    type Ux = u32;
227}
228#[doc = "`read()` method returns [fifointstat::R](R) reader structure"]
229impl crate::Readable for FIFOINTSTAT_SPEC {
230    type Reader = R;
231}
232#[doc = "`reset()` method sets FIFOINTSTAT to value 0"]
233impl crate::Resettable for FIFOINTSTAT_SPEC {
234    const RESET_VALUE: Self::Ux = 0;
235}