d1_pac/dsp_msgbox/msgbox/
msgbox_rd_irq_en.rs1#[doc = "Register `msgbox_rd_irq_en` reader"]
2pub type R = crate::R<MSGBOX_RD_IRQ_EN_SPEC>;
3#[doc = "Register `msgbox_rd_irq_en` writer"]
4pub type W = crate::W<MSGBOX_RD_IRQ_EN_SPEC>;
5#[doc = "Field `reception_mq_irq_en[0-3]` reader - Reception Channel\\[i\\] Interrupt Enable"]
6pub type RECEPTION_MQ_IRQ_EN_R = crate::BitReader<RECEPTION_MQ_IRQ_EN_A>;
7#[doc = "Reception Channel\\[i\\] Interrupt Enable\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum RECEPTION_MQ_IRQ_EN_A {
10 #[doc = "0: Disable"]
11 DISABLE = 0,
12 #[doc = "1: Enable"]
13 ENABLE = 1,
14}
15impl From<RECEPTION_MQ_IRQ_EN_A> for bool {
16 #[inline(always)]
17 fn from(variant: RECEPTION_MQ_IRQ_EN_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl RECEPTION_MQ_IRQ_EN_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> RECEPTION_MQ_IRQ_EN_A {
25 match self.bits {
26 false => RECEPTION_MQ_IRQ_EN_A::DISABLE,
27 true => RECEPTION_MQ_IRQ_EN_A::ENABLE,
28 }
29 }
30 #[doc = "Disable"]
31 #[inline(always)]
32 pub fn is_disable(&self) -> bool {
33 *self == RECEPTION_MQ_IRQ_EN_A::DISABLE
34 }
35 #[doc = "Enable"]
36 #[inline(always)]
37 pub fn is_enable(&self) -> bool {
38 *self == RECEPTION_MQ_IRQ_EN_A::ENABLE
39 }
40}
41#[doc = "Field `reception_mq_irq_en[0-3]` writer - Reception Channel\\[i\\] Interrupt Enable"]
42pub type RECEPTION_MQ_IRQ_EN_W<'a, REG> = crate::BitWriter<'a, REG, RECEPTION_MQ_IRQ_EN_A>;
43impl<'a, REG> RECEPTION_MQ_IRQ_EN_W<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "Disable"]
48 #[inline(always)]
49 pub fn disable(self) -> &'a mut crate::W<REG> {
50 self.variant(RECEPTION_MQ_IRQ_EN_A::DISABLE)
51 }
52 #[doc = "Enable"]
53 #[inline(always)]
54 pub fn enable(self) -> &'a mut crate::W<REG> {
55 self.variant(RECEPTION_MQ_IRQ_EN_A::ENABLE)
56 }
57}
58impl R {
59 #[doc = "Reception Channel\\[i\\] Interrupt Enable\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `reception_mq0_irq_en` field"]
60 #[inline(always)]
61 pub fn reception_mq_irq_en(&self, n: u8) -> RECEPTION_MQ_IRQ_EN_R {
62 #[allow(clippy::no_effect)]
63 [(); 4][n as usize];
64 RECEPTION_MQ_IRQ_EN_R::new(((self.bits >> (n * 2)) & 1) != 0)
65 }
66 #[doc = "Bit 0 - Reception Channel\\[i\\] Interrupt Enable"]
67 #[inline(always)]
68 pub fn reception_mq0_irq_en(&self) -> RECEPTION_MQ_IRQ_EN_R {
69 RECEPTION_MQ_IRQ_EN_R::new((self.bits & 1) != 0)
70 }
71 #[doc = "Bit 2 - Reception Channel\\[i\\] Interrupt Enable"]
72 #[inline(always)]
73 pub fn reception_mq1_irq_en(&self) -> RECEPTION_MQ_IRQ_EN_R {
74 RECEPTION_MQ_IRQ_EN_R::new(((self.bits >> 2) & 1) != 0)
75 }
76 #[doc = "Bit 4 - Reception Channel\\[i\\] Interrupt Enable"]
77 #[inline(always)]
78 pub fn reception_mq2_irq_en(&self) -> RECEPTION_MQ_IRQ_EN_R {
79 RECEPTION_MQ_IRQ_EN_R::new(((self.bits >> 4) & 1) != 0)
80 }
81 #[doc = "Bit 6 - Reception Channel\\[i\\] Interrupt Enable"]
82 #[inline(always)]
83 pub fn reception_mq3_irq_en(&self) -> RECEPTION_MQ_IRQ_EN_R {
84 RECEPTION_MQ_IRQ_EN_R::new(((self.bits >> 6) & 1) != 0)
85 }
86}
87impl W {
88 #[doc = "Reception Channel\\[i\\] Interrupt Enable\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `reception_mq0_irq_en` field"]
89 #[inline(always)]
90 #[must_use]
91 pub fn reception_mq_irq_en(&mut self, n: u8) -> RECEPTION_MQ_IRQ_EN_W<MSGBOX_RD_IRQ_EN_SPEC> {
92 #[allow(clippy::no_effect)]
93 [(); 4][n as usize];
94 RECEPTION_MQ_IRQ_EN_W::new(self, n * 2)
95 }
96 #[doc = "Bit 0 - Reception Channel\\[i\\] Interrupt Enable"]
97 #[inline(always)]
98 #[must_use]
99 pub fn reception_mq0_irq_en(&mut self) -> RECEPTION_MQ_IRQ_EN_W<MSGBOX_RD_IRQ_EN_SPEC> {
100 RECEPTION_MQ_IRQ_EN_W::new(self, 0)
101 }
102 #[doc = "Bit 2 - Reception Channel\\[i\\] Interrupt Enable"]
103 #[inline(always)]
104 #[must_use]
105 pub fn reception_mq1_irq_en(&mut self) -> RECEPTION_MQ_IRQ_EN_W<MSGBOX_RD_IRQ_EN_SPEC> {
106 RECEPTION_MQ_IRQ_EN_W::new(self, 2)
107 }
108 #[doc = "Bit 4 - Reception Channel\\[i\\] Interrupt Enable"]
109 #[inline(always)]
110 #[must_use]
111 pub fn reception_mq2_irq_en(&mut self) -> RECEPTION_MQ_IRQ_EN_W<MSGBOX_RD_IRQ_EN_SPEC> {
112 RECEPTION_MQ_IRQ_EN_W::new(self, 4)
113 }
114 #[doc = "Bit 6 - Reception Channel\\[i\\] Interrupt Enable"]
115 #[inline(always)]
116 #[must_use]
117 pub fn reception_mq3_irq_en(&mut self) -> RECEPTION_MQ_IRQ_EN_W<MSGBOX_RD_IRQ_EN_SPEC> {
118 RECEPTION_MQ_IRQ_EN_W::new(self, 6)
119 }
120 #[doc = r" Writes raw bits to the register."]
121 #[doc = r""]
122 #[doc = r" # Safety"]
123 #[doc = r""]
124 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
125 #[inline(always)]
126 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
127 self.bits = bits;
128 self
129 }
130}
131#[doc = "Message Box Read Interrupt Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msgbox_rd_irq_en::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`msgbox_rd_irq_en::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
132pub struct MSGBOX_RD_IRQ_EN_SPEC;
133impl crate::RegisterSpec for MSGBOX_RD_IRQ_EN_SPEC {
134 type Ux = u32;
135}
136#[doc = "`read()` method returns [`msgbox_rd_irq_en::R`](R) reader structure"]
137impl crate::Readable for MSGBOX_RD_IRQ_EN_SPEC {}
138#[doc = "`write(|w| ..)` method takes [`msgbox_rd_irq_en::W`](W) writer structure"]
139impl crate::Writable for MSGBOX_RD_IRQ_EN_SPEC {
140 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
141 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
142}
143#[doc = "`reset()` method sets msgbox_rd_irq_en to value 0"]
144impl crate::Resettable for MSGBOX_RD_IRQ_EN_SPEC {
145 const RESET_VALUE: Self::Ux = 0;
146}