mcxa_pac/mau0/
gexp_status_ie.rs1#[doc = "Register `GEXP_STATUS_IE` reader"]
2pub type R = crate::R<GexpStatusIeSpec>;
3#[doc = "Register `GEXP_STATUS_IE` writer"]
4pub type W = crate::W<GexpStatusIeSpec>;
5#[doc = "Direct operation Error Interrupt Enable\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum ErrorIe {
9 #[doc = "0: Disable"]
10 Disable = 0,
11 #[doc = "1: Enable"]
12 Enable = 1,
13}
14impl From<ErrorIe> for bool {
15 #[inline(always)]
16 fn from(variant: ErrorIe) -> Self {
17 variant as u8 != 0
18 }
19}
20#[doc = "Field `ERROR_IE` reader - Direct operation Error Interrupt Enable"]
21pub type ErrorIeR = crate::BitReader<ErrorIe>;
22impl ErrorIeR {
23 #[doc = "Get enumerated values variant"]
24 #[inline(always)]
25 pub const fn variant(&self) -> ErrorIe {
26 match self.bits {
27 false => ErrorIe::Disable,
28 true => ErrorIe::Enable,
29 }
30 }
31 #[doc = "Disable"]
32 #[inline(always)]
33 pub fn is_disable(&self) -> bool {
34 *self == ErrorIe::Disable
35 }
36 #[doc = "Enable"]
37 #[inline(always)]
38 pub fn is_enable(&self) -> bool {
39 *self == ErrorIe::Enable
40 }
41}
42#[doc = "Field `ERROR_IE` writer - Direct operation Error Interrupt Enable"]
43pub type ErrorIeW<'a, REG> = crate::BitWriter<'a, REG, ErrorIe>;
44impl<'a, REG> ErrorIeW<'a, REG>
45where
46 REG: crate::Writable + crate::RegisterSpec,
47{
48 #[doc = "Disable"]
49 #[inline(always)]
50 pub fn disable(self) -> &'a mut crate::W<REG> {
51 self.variant(ErrorIe::Disable)
52 }
53 #[doc = "Enable"]
54 #[inline(always)]
55 pub fn enable(self) -> &'a mut crate::W<REG> {
56 self.variant(ErrorIe::Enable)
57 }
58}
59impl R {
60 #[doc = "Bit 0 - Direct operation Error Interrupt Enable"]
61 #[inline(always)]
62 pub fn error_ie(&self) -> ErrorIeR {
63 ErrorIeR::new((self.bits & 1) != 0)
64 }
65}
66#[cfg(feature = "debug")]
67impl core::fmt::Debug for R {
68 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
69 f.debug_struct("GEXP_STATUS_IE")
70 .field("error_ie", &self.error_ie())
71 .finish()
72 }
73}
74impl W {
75 #[doc = "Bit 0 - Direct operation Error Interrupt Enable"]
76 #[inline(always)]
77 pub fn error_ie(&mut self) -> ErrorIeW<'_, GexpStatusIeSpec> {
78 ErrorIeW::new(self, 0)
79 }
80}
81#[doc = "General Exception Status Interrupt Enable\n\nYou can [`read`](crate::Reg::read) this register and get [`gexp_status_ie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gexp_status_ie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
82pub struct GexpStatusIeSpec;
83impl crate::RegisterSpec for GexpStatusIeSpec {
84 type Ux = u32;
85}
86#[doc = "`read()` method returns [`gexp_status_ie::R`](R) reader structure"]
87impl crate::Readable for GexpStatusIeSpec {}
88#[doc = "`write(|w| ..)` method takes [`gexp_status_ie::W`](W) writer structure"]
89impl crate::Writable for GexpStatusIeSpec {
90 type Safety = crate::Unsafe;
91}
92#[doc = "`reset()` method sets GEXP_STATUS_IE to value 0"]
93impl crate::Resettable for GexpStatusIeSpec {}