d1_pac/csic/csic_parser0/
prs_ch_int_en.rs1#[doc = "Register `prs_ch%s_int_en` reader"]
2pub type R = crate::R<PRS_CH_INT_EN_SPEC>;
3#[doc = "Register `prs_ch%s_int_en` writer"]
4pub type W = crate::W<PRS_CH_INT_EN_SPEC>;
5#[doc = "Field `input_para_int_en[0-1]` reader - "]
6pub type INPUT_PARA_INT_EN_R = crate::BitReader<INPUT_PARA_INT_EN_A>;
7#[doc = "\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum INPUT_PARA_INT_EN_A {
10 #[doc = "0: `0`"]
11 DISABLE = 0,
12 #[doc = "1: `1`"]
13 ENABLE = 1,
14}
15impl From<INPUT_PARA_INT_EN_A> for bool {
16 #[inline(always)]
17 fn from(variant: INPUT_PARA_INT_EN_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl INPUT_PARA_INT_EN_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> INPUT_PARA_INT_EN_A {
25 match self.bits {
26 false => INPUT_PARA_INT_EN_A::DISABLE,
27 true => INPUT_PARA_INT_EN_A::ENABLE,
28 }
29 }
30 #[doc = "`0`"]
31 #[inline(always)]
32 pub fn is_disable(&self) -> bool {
33 *self == INPUT_PARA_INT_EN_A::DISABLE
34 }
35 #[doc = "`1`"]
36 #[inline(always)]
37 pub fn is_enable(&self) -> bool {
38 *self == INPUT_PARA_INT_EN_A::ENABLE
39 }
40}
41#[doc = "Field `input_para_int_en[0-1]` writer - "]
42pub type INPUT_PARA_INT_EN_W<'a, REG> = crate::BitWriter<'a, REG, INPUT_PARA_INT_EN_A>;
43impl<'a, REG> INPUT_PARA_INT_EN_W<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "`0`"]
48 #[inline(always)]
49 pub fn disable(self) -> &'a mut crate::W<REG> {
50 self.variant(INPUT_PARA_INT_EN_A::DISABLE)
51 }
52 #[doc = "`1`"]
53 #[inline(always)]
54 pub fn enable(self) -> &'a mut crate::W<REG> {
55 self.variant(INPUT_PARA_INT_EN_A::ENABLE)
56 }
57}
58#[doc = "Field `mul_err_int_en` reader - Multi-channel writing error\n\nIndicates error has been detected for writing data to a wrong channel"]
59pub type MUL_ERR_INT_EN_R = crate::BitReader<MUL_ERR_INT_EN_A>;
60#[doc = "Multi-channel writing error\n\nIndicates error has been detected for writing data to a wrong channel\n\nValue on reset: 0"]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum MUL_ERR_INT_EN_A {
63 #[doc = "0: `0`"]
64 DISABLE = 0,
65 #[doc = "1: `1`"]
66 ENABLE = 1,
67}
68impl From<MUL_ERR_INT_EN_A> for bool {
69 #[inline(always)]
70 fn from(variant: MUL_ERR_INT_EN_A) -> Self {
71 variant as u8 != 0
72 }
73}
74impl MUL_ERR_INT_EN_R {
75 #[doc = "Get enumerated values variant"]
76 #[inline(always)]
77 pub const fn variant(&self) -> MUL_ERR_INT_EN_A {
78 match self.bits {
79 false => MUL_ERR_INT_EN_A::DISABLE,
80 true => MUL_ERR_INT_EN_A::ENABLE,
81 }
82 }
83 #[doc = "`0`"]
84 #[inline(always)]
85 pub fn is_disable(&self) -> bool {
86 *self == MUL_ERR_INT_EN_A::DISABLE
87 }
88 #[doc = "`1`"]
89 #[inline(always)]
90 pub fn is_enable(&self) -> bool {
91 *self == MUL_ERR_INT_EN_A::ENABLE
92 }
93}
94#[doc = "Field `mul_err_int_en` writer - Multi-channel writing error\n\nIndicates error has been detected for writing data to a wrong channel"]
95pub type MUL_ERR_INT_EN_W<'a, REG> = crate::BitWriter<'a, REG, MUL_ERR_INT_EN_A>;
96impl<'a, REG> MUL_ERR_INT_EN_W<'a, REG>
97where
98 REG: crate::Writable + crate::RegisterSpec,
99{
100 #[doc = "`0`"]
101 #[inline(always)]
102 pub fn disable(self) -> &'a mut crate::W<REG> {
103 self.variant(MUL_ERR_INT_EN_A::DISABLE)
104 }
105 #[doc = "`1`"]
106 #[inline(always)]
107 pub fn enable(self) -> &'a mut crate::W<REG> {
108 self.variant(MUL_ERR_INT_EN_A::ENABLE)
109 }
110}
111impl R {
112 #[doc = "\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `input_para0_int_en` field"]
113 #[inline(always)]
114 pub fn input_para_int_en(&self, n: u8) -> INPUT_PARA_INT_EN_R {
115 #[allow(clippy::no_effect)]
116 [(); 2][n as usize];
117 INPUT_PARA_INT_EN_R::new(((self.bits >> n) & 1) != 0)
118 }
119 #[doc = "Bit 0 - input_para0_int_en"]
120 #[inline(always)]
121 pub fn input_para0_int_en(&self) -> INPUT_PARA_INT_EN_R {
122 INPUT_PARA_INT_EN_R::new((self.bits & 1) != 0)
123 }
124 #[doc = "Bit 1 - input_para1_int_en"]
125 #[inline(always)]
126 pub fn input_para1_int_en(&self) -> INPUT_PARA_INT_EN_R {
127 INPUT_PARA_INT_EN_R::new(((self.bits >> 1) & 1) != 0)
128 }
129 #[doc = "Bit 2 - Multi-channel writing error\n\nIndicates error has been detected for writing data to a wrong channel"]
130 #[inline(always)]
131 pub fn mul_err_int_en(&self) -> MUL_ERR_INT_EN_R {
132 MUL_ERR_INT_EN_R::new(((self.bits >> 2) & 1) != 0)
133 }
134}
135impl W {
136 #[doc = "\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `input_para0_int_en` field"]
137 #[inline(always)]
138 #[must_use]
139 pub fn input_para_int_en(&mut self, n: u8) -> INPUT_PARA_INT_EN_W<PRS_CH_INT_EN_SPEC> {
140 #[allow(clippy::no_effect)]
141 [(); 2][n as usize];
142 INPUT_PARA_INT_EN_W::new(self, n)
143 }
144 #[doc = "Bit 0 - input_para0_int_en"]
145 #[inline(always)]
146 #[must_use]
147 pub fn input_para0_int_en(&mut self) -> INPUT_PARA_INT_EN_W<PRS_CH_INT_EN_SPEC> {
148 INPUT_PARA_INT_EN_W::new(self, 0)
149 }
150 #[doc = "Bit 1 - input_para1_int_en"]
151 #[inline(always)]
152 #[must_use]
153 pub fn input_para1_int_en(&mut self) -> INPUT_PARA_INT_EN_W<PRS_CH_INT_EN_SPEC> {
154 INPUT_PARA_INT_EN_W::new(self, 1)
155 }
156 #[doc = "Bit 2 - Multi-channel writing error\n\nIndicates error has been detected for writing data to a wrong channel"]
157 #[inline(always)]
158 #[must_use]
159 pub fn mul_err_int_en(&mut self) -> MUL_ERR_INT_EN_W<PRS_CH_INT_EN_SPEC> {
160 MUL_ERR_INT_EN_W::new(self, 2)
161 }
162 #[doc = r" Writes raw bits to the register."]
163 #[doc = r""]
164 #[doc = r" # Safety"]
165 #[doc = r""]
166 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
167 #[inline(always)]
168 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
169 self.bits = bits;
170 self
171 }
172}
173#[doc = "Parser Channel\\[i\\] Interrupt Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prs_ch_int_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 [`prs_ch_int_en::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
174pub struct PRS_CH_INT_EN_SPEC;
175impl crate::RegisterSpec for PRS_CH_INT_EN_SPEC {
176 type Ux = u32;
177}
178#[doc = "`read()` method returns [`prs_ch_int_en::R`](R) reader structure"]
179impl crate::Readable for PRS_CH_INT_EN_SPEC {}
180#[doc = "`write(|w| ..)` method takes [`prs_ch_int_en::W`](W) writer structure"]
181impl crate::Writable for PRS_CH_INT_EN_SPEC {
182 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
183 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
184}
185#[doc = "`reset()` method sets prs_ch%s_int_en to value 0"]
186impl crate::Resettable for PRS_CH_INT_EN_SPEC {
187 const RESET_VALUE: Self::Ux = 0;
188}