mcxa_pac/i3c0/
mintmasked.rs

1#[doc = "Register `MINTMASKED` reader"]
2pub type R = crate::R<MintmaskedSpec>;
3#[doc = "SLVSTART Interrupt Mask\n\nValue on reset: 0"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6pub enum Slvstart {
7    #[doc = "0: Disabled"]
8    NotEnabled = 0,
9    #[doc = "1: Enabled"]
10    Enabled = 1,
11}
12impl From<Slvstart> for bool {
13    #[inline(always)]
14    fn from(variant: Slvstart) -> Self {
15        variant as u8 != 0
16    }
17}
18#[doc = "Field `SLVSTART` reader - SLVSTART Interrupt Mask"]
19pub type SlvstartR = crate::BitReader<Slvstart>;
20impl SlvstartR {
21    #[doc = "Get enumerated values variant"]
22    #[inline(always)]
23    pub const fn variant(&self) -> Slvstart {
24        match self.bits {
25            false => Slvstart::NotEnabled,
26            true => Slvstart::Enabled,
27        }
28    }
29    #[doc = "Disabled"]
30    #[inline(always)]
31    pub fn is_not_enabled(&self) -> bool {
32        *self == Slvstart::NotEnabled
33    }
34    #[doc = "Enabled"]
35    #[inline(always)]
36    pub fn is_enabled(&self) -> bool {
37        *self == Slvstart::Enabled
38    }
39}
40#[doc = "MCTRLDONE Interrupt Mask\n\nValue on reset: 0"]
41#[cfg_attr(feature = "defmt", derive(defmt::Format))]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum Mctrldone {
44    #[doc = "0: Disabled"]
45    NotEnabled = 0,
46    #[doc = "1: Enabled"]
47    Enabled = 1,
48}
49impl From<Mctrldone> for bool {
50    #[inline(always)]
51    fn from(variant: Mctrldone) -> Self {
52        variant as u8 != 0
53    }
54}
55#[doc = "Field `MCTRLDONE` reader - MCTRLDONE Interrupt Mask"]
56pub type MctrldoneR = crate::BitReader<Mctrldone>;
57impl MctrldoneR {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub const fn variant(&self) -> Mctrldone {
61        match self.bits {
62            false => Mctrldone::NotEnabled,
63            true => Mctrldone::Enabled,
64        }
65    }
66    #[doc = "Disabled"]
67    #[inline(always)]
68    pub fn is_not_enabled(&self) -> bool {
69        *self == Mctrldone::NotEnabled
70    }
71    #[doc = "Enabled"]
72    #[inline(always)]
73    pub fn is_enabled(&self) -> bool {
74        *self == Mctrldone::Enabled
75    }
76}
77#[doc = "COMPLETE Interrupt Mask\n\nValue on reset: 0"]
78#[cfg_attr(feature = "defmt", derive(defmt::Format))]
79#[derive(Clone, Copy, Debug, PartialEq, Eq)]
80pub enum Complete {
81    #[doc = "0: Disabled"]
82    NotEnabled = 0,
83    #[doc = "1: Enabled"]
84    Enabled = 1,
85}
86impl From<Complete> for bool {
87    #[inline(always)]
88    fn from(variant: Complete) -> Self {
89        variant as u8 != 0
90    }
91}
92#[doc = "Field `COMPLETE` reader - COMPLETE Interrupt Mask"]
93pub type CompleteR = crate::BitReader<Complete>;
94impl CompleteR {
95    #[doc = "Get enumerated values variant"]
96    #[inline(always)]
97    pub const fn variant(&self) -> Complete {
98        match self.bits {
99            false => Complete::NotEnabled,
100            true => Complete::Enabled,
101        }
102    }
103    #[doc = "Disabled"]
104    #[inline(always)]
105    pub fn is_not_enabled(&self) -> bool {
106        *self == Complete::NotEnabled
107    }
108    #[doc = "Enabled"]
109    #[inline(always)]
110    pub fn is_enabled(&self) -> bool {
111        *self == Complete::Enabled
112    }
113}
114#[doc = "Field `RXPEND` reader - RXPEND Interrupt Mask"]
115pub type RxpendR = crate::BitReader;
116#[doc = "TXNOTFULL Interrupt Mask\n\nValue on reset: 0"]
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
118#[derive(Clone, Copy, Debug, PartialEq, Eq)]
119pub enum Txnotfull {
120    #[doc = "0: Disabled"]
121    NotEnabled = 0,
122    #[doc = "1: Enabled"]
123    Enabled = 1,
124}
125impl From<Txnotfull> for bool {
126    #[inline(always)]
127    fn from(variant: Txnotfull) -> Self {
128        variant as u8 != 0
129    }
130}
131#[doc = "Field `TXNOTFULL` reader - TXNOTFULL Interrupt Mask"]
132pub type TxnotfullR = crate::BitReader<Txnotfull>;
133impl TxnotfullR {
134    #[doc = "Get enumerated values variant"]
135    #[inline(always)]
136    pub const fn variant(&self) -> Txnotfull {
137        match self.bits {
138            false => Txnotfull::NotEnabled,
139            true => Txnotfull::Enabled,
140        }
141    }
142    #[doc = "Disabled"]
143    #[inline(always)]
144    pub fn is_not_enabled(&self) -> bool {
145        *self == Txnotfull::NotEnabled
146    }
147    #[doc = "Enabled"]
148    #[inline(always)]
149    pub fn is_enabled(&self) -> bool {
150        *self == Txnotfull::Enabled
151    }
152}
153#[doc = "IBIWON Interrupt Mask\n\nValue on reset: 0"]
154#[cfg_attr(feature = "defmt", derive(defmt::Format))]
155#[derive(Clone, Copy, Debug, PartialEq, Eq)]
156pub enum Ibiwon {
157    #[doc = "0: Disabled"]
158    NotEnabled = 0,
159    #[doc = "1: Enabled"]
160    Enabled = 1,
161}
162impl From<Ibiwon> for bool {
163    #[inline(always)]
164    fn from(variant: Ibiwon) -> Self {
165        variant as u8 != 0
166    }
167}
168#[doc = "Field `IBIWON` reader - IBIWON Interrupt Mask"]
169pub type IbiwonR = crate::BitReader<Ibiwon>;
170impl IbiwonR {
171    #[doc = "Get enumerated values variant"]
172    #[inline(always)]
173    pub const fn variant(&self) -> Ibiwon {
174        match self.bits {
175            false => Ibiwon::NotEnabled,
176            true => Ibiwon::Enabled,
177        }
178    }
179    #[doc = "Disabled"]
180    #[inline(always)]
181    pub fn is_not_enabled(&self) -> bool {
182        *self == Ibiwon::NotEnabled
183    }
184    #[doc = "Enabled"]
185    #[inline(always)]
186    pub fn is_enabled(&self) -> bool {
187        *self == Ibiwon::Enabled
188    }
189}
190#[doc = "ERRWARN Interrupt Mask\n\nValue on reset: 0"]
191#[cfg_attr(feature = "defmt", derive(defmt::Format))]
192#[derive(Clone, Copy, Debug, PartialEq, Eq)]
193pub enum Errwarn {
194    #[doc = "0: Disabled"]
195    NotEnabled = 0,
196    #[doc = "1: Enabled"]
197    Enabled = 1,
198}
199impl From<Errwarn> for bool {
200    #[inline(always)]
201    fn from(variant: Errwarn) -> Self {
202        variant as u8 != 0
203    }
204}
205#[doc = "Field `ERRWARN` reader - ERRWARN Interrupt Mask"]
206pub type ErrwarnR = crate::BitReader<Errwarn>;
207impl ErrwarnR {
208    #[doc = "Get enumerated values variant"]
209    #[inline(always)]
210    pub const fn variant(&self) -> Errwarn {
211        match self.bits {
212            false => Errwarn::NotEnabled,
213            true => Errwarn::Enabled,
214        }
215    }
216    #[doc = "Disabled"]
217    #[inline(always)]
218    pub fn is_not_enabled(&self) -> bool {
219        *self == Errwarn::NotEnabled
220    }
221    #[doc = "Enabled"]
222    #[inline(always)]
223    pub fn is_enabled(&self) -> bool {
224        *self == Errwarn::Enabled
225    }
226}
227#[doc = "NOWCONTROLLER Interrupt Mask\n\nValue on reset: 0"]
228#[cfg_attr(feature = "defmt", derive(defmt::Format))]
229#[derive(Clone, Copy, Debug, PartialEq, Eq)]
230pub enum Nowmaster {
231    #[doc = "0: Disabled"]
232    NotEnabled = 0,
233    #[doc = "1: Enabled"]
234    Enabled = 1,
235}
236impl From<Nowmaster> for bool {
237    #[inline(always)]
238    fn from(variant: Nowmaster) -> Self {
239        variant as u8 != 0
240    }
241}
242#[doc = "Field `NOWMASTER` reader - NOWCONTROLLER Interrupt Mask"]
243pub type NowmasterR = crate::BitReader<Nowmaster>;
244impl NowmasterR {
245    #[doc = "Get enumerated values variant"]
246    #[inline(always)]
247    pub const fn variant(&self) -> Nowmaster {
248        match self.bits {
249            false => Nowmaster::NotEnabled,
250            true => Nowmaster::Enabled,
251        }
252    }
253    #[doc = "Disabled"]
254    #[inline(always)]
255    pub fn is_not_enabled(&self) -> bool {
256        *self == Nowmaster::NotEnabled
257    }
258    #[doc = "Enabled"]
259    #[inline(always)]
260    pub fn is_enabled(&self) -> bool {
261        *self == Nowmaster::Enabled
262    }
263}
264impl R {
265    #[doc = "Bit 8 - SLVSTART Interrupt Mask"]
266    #[inline(always)]
267    pub fn slvstart(&self) -> SlvstartR {
268        SlvstartR::new(((self.bits >> 8) & 1) != 0)
269    }
270    #[doc = "Bit 9 - MCTRLDONE Interrupt Mask"]
271    #[inline(always)]
272    pub fn mctrldone(&self) -> MctrldoneR {
273        MctrldoneR::new(((self.bits >> 9) & 1) != 0)
274    }
275    #[doc = "Bit 10 - COMPLETE Interrupt Mask"]
276    #[inline(always)]
277    pub fn complete(&self) -> CompleteR {
278        CompleteR::new(((self.bits >> 10) & 1) != 0)
279    }
280    #[doc = "Bit 11 - RXPEND Interrupt Mask"]
281    #[inline(always)]
282    pub fn rxpend(&self) -> RxpendR {
283        RxpendR::new(((self.bits >> 11) & 1) != 0)
284    }
285    #[doc = "Bit 12 - TXNOTFULL Interrupt Mask"]
286    #[inline(always)]
287    pub fn txnotfull(&self) -> TxnotfullR {
288        TxnotfullR::new(((self.bits >> 12) & 1) != 0)
289    }
290    #[doc = "Bit 13 - IBIWON Interrupt Mask"]
291    #[inline(always)]
292    pub fn ibiwon(&self) -> IbiwonR {
293        IbiwonR::new(((self.bits >> 13) & 1) != 0)
294    }
295    #[doc = "Bit 15 - ERRWARN Interrupt Mask"]
296    #[inline(always)]
297    pub fn errwarn(&self) -> ErrwarnR {
298        ErrwarnR::new(((self.bits >> 15) & 1) != 0)
299    }
300    #[doc = "Bit 19 - NOWCONTROLLER Interrupt Mask"]
301    #[inline(always)]
302    pub fn nowmaster(&self) -> NowmasterR {
303        NowmasterR::new(((self.bits >> 19) & 1) != 0)
304    }
305}
306#[cfg(feature = "debug")]
307impl core::fmt::Debug for R {
308    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
309        f.debug_struct("MINTMASKED")
310            .field("slvstart", &self.slvstart())
311            .field("mctrldone", &self.mctrldone())
312            .field("complete", &self.complete())
313            .field("rxpend", &self.rxpend())
314            .field("txnotfull", &self.txnotfull())
315            .field("ibiwon", &self.ibiwon())
316            .field("errwarn", &self.errwarn())
317            .field("nowmaster", &self.nowmaster())
318            .finish()
319    }
320}
321#[doc = "Controller Interrupt Mask\n\nYou can [`read`](crate::Reg::read) this register and get [`mintmasked::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
322pub struct MintmaskedSpec;
323impl crate::RegisterSpec for MintmaskedSpec {
324    type Ux = u32;
325}
326#[doc = "`read()` method returns [`mintmasked::R`](R) reader structure"]
327impl crate::Readable for MintmaskedSpec {}
328#[doc = "`reset()` method sets MINTMASKED to value 0"]
329impl crate::Resettable for MintmaskedSpec {}