d1_pac/csic/csic_parser0/
prs_ch_int_sta.rs1#[doc = "Register `prs_ch%s_int_sta` reader"]
2pub type R = crate::R<PRS_CH_INT_STA_SPEC>;
3#[doc = "Register `prs_ch%s_int_sta` writer"]
4pub type W = crate::W<PRS_CH_INT_STA_SPEC>;
5#[doc = "Field `input_src_pd[0-1]` reader - "]
6pub type INPUT_SRC_PD_R = crate::BitReader<INPUT_SRC_PD_A>;
7#[doc = "\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum INPUT_SRC_PD_A {
10 #[doc = "0: `0`"]
11 NO_PENDING = 0,
12 #[doc = "1: `1`"]
13 PENDING = 1,
14}
15impl From<INPUT_SRC_PD_A> for bool {
16 #[inline(always)]
17 fn from(variant: INPUT_SRC_PD_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl INPUT_SRC_PD_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> INPUT_SRC_PD_A {
25 match self.bits {
26 false => INPUT_SRC_PD_A::NO_PENDING,
27 true => INPUT_SRC_PD_A::PENDING,
28 }
29 }
30 #[doc = "`0`"]
31 #[inline(always)]
32 pub fn is_no_pending(&self) -> bool {
33 *self == INPUT_SRC_PD_A::NO_PENDING
34 }
35 #[doc = "`1`"]
36 #[inline(always)]
37 pub fn is_pending(&self) -> bool {
38 *self == INPUT_SRC_PD_A::PENDING
39 }
40}
41#[doc = "Field `input_src_pd[0-1]` writer - "]
42pub type INPUT_SRC_PD_W<'a, REG> = crate::BitWriter1C<'a, REG, INPUT_SRC_PD_A>;
43impl<'a, REG> INPUT_SRC_PD_W<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "`0`"]
48 #[inline(always)]
49 pub fn no_pending(self) -> &'a mut crate::W<REG> {
50 self.variant(INPUT_SRC_PD_A::NO_PENDING)
51 }
52 #[doc = "`1`"]
53 #[inline(always)]
54 pub fn pending(self) -> &'a mut crate::W<REG> {
55 self.variant(INPUT_SRC_PD_A::PENDING)
56 }
57}
58#[doc = "Field `mul_err_pd` reader - Multi-channel writing error pending"]
59pub type MUL_ERR_PD_R = crate::BitReader<MUL_ERR_PD_A>;
60#[doc = "Multi-channel writing error pending\n\nValue on reset: 0"]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum MUL_ERR_PD_A {
63 #[doc = "0: `0`"]
64 NO_PENDING = 0,
65 #[doc = "1: `1`"]
66 PENDING = 1,
67}
68impl From<MUL_ERR_PD_A> for bool {
69 #[inline(always)]
70 fn from(variant: MUL_ERR_PD_A) -> Self {
71 variant as u8 != 0
72 }
73}
74impl MUL_ERR_PD_R {
75 #[doc = "Get enumerated values variant"]
76 #[inline(always)]
77 pub const fn variant(&self) -> MUL_ERR_PD_A {
78 match self.bits {
79 false => MUL_ERR_PD_A::NO_PENDING,
80 true => MUL_ERR_PD_A::PENDING,
81 }
82 }
83 #[doc = "`0`"]
84 #[inline(always)]
85 pub fn is_no_pending(&self) -> bool {
86 *self == MUL_ERR_PD_A::NO_PENDING
87 }
88 #[doc = "`1`"]
89 #[inline(always)]
90 pub fn is_pending(&self) -> bool {
91 *self == MUL_ERR_PD_A::PENDING
92 }
93}
94#[doc = "Field `mul_err_pd` writer - Multi-channel writing error pending"]
95pub type MUL_ERR_PD_W<'a, REG> = crate::BitWriter1C<'a, REG, MUL_ERR_PD_A>;
96impl<'a, REG> MUL_ERR_PD_W<'a, REG>
97where
98 REG: crate::Writable + crate::RegisterSpec,
99{
100 #[doc = "`0`"]
101 #[inline(always)]
102 pub fn no_pending(self) -> &'a mut crate::W<REG> {
103 self.variant(MUL_ERR_PD_A::NO_PENDING)
104 }
105 #[doc = "`1`"]
106 #[inline(always)]
107 pub fn pending(self) -> &'a mut crate::W<REG> {
108 self.variant(MUL_ERR_PD_A::PENDING)
109 }
110}
111impl R {
112 #[doc = "\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `input_src_pd0` field"]
113 #[inline(always)]
114 pub fn input_src_pd(&self, n: u8) -> INPUT_SRC_PD_R {
115 #[allow(clippy::no_effect)]
116 [(); 2][n as usize];
117 INPUT_SRC_PD_R::new(((self.bits >> n) & 1) != 0)
118 }
119 #[doc = "Bit 0 - input_src_pd0"]
120 #[inline(always)]
121 pub fn input_src_pd0(&self) -> INPUT_SRC_PD_R {
122 INPUT_SRC_PD_R::new((self.bits & 1) != 0)
123 }
124 #[doc = "Bit 1 - input_src_pd1"]
125 #[inline(always)]
126 pub fn input_src_pd1(&self) -> INPUT_SRC_PD_R {
127 INPUT_SRC_PD_R::new(((self.bits >> 1) & 1) != 0)
128 }
129 #[doc = "Bit 2 - Multi-channel writing error pending"]
130 #[inline(always)]
131 pub fn mul_err_pd(&self) -> MUL_ERR_PD_R {
132 MUL_ERR_PD_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_src_pd0` field"]
137 #[inline(always)]
138 #[must_use]
139 pub fn input_src_pd(&mut self, n: u8) -> INPUT_SRC_PD_W<PRS_CH_INT_STA_SPEC> {
140 #[allow(clippy::no_effect)]
141 [(); 2][n as usize];
142 INPUT_SRC_PD_W::new(self, n)
143 }
144 #[doc = "Bit 0 - input_src_pd0"]
145 #[inline(always)]
146 #[must_use]
147 pub fn input_src_pd0(&mut self) -> INPUT_SRC_PD_W<PRS_CH_INT_STA_SPEC> {
148 INPUT_SRC_PD_W::new(self, 0)
149 }
150 #[doc = "Bit 1 - input_src_pd1"]
151 #[inline(always)]
152 #[must_use]
153 pub fn input_src_pd1(&mut self) -> INPUT_SRC_PD_W<PRS_CH_INT_STA_SPEC> {
154 INPUT_SRC_PD_W::new(self, 1)
155 }
156 #[doc = "Bit 2 - Multi-channel writing error pending"]
157 #[inline(always)]
158 #[must_use]
159 pub fn mul_err_pd(&mut self) -> MUL_ERR_PD_W<PRS_CH_INT_STA_SPEC> {
160 MUL_ERR_PD_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 Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prs_ch_int_sta::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_sta::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_STA_SPEC;
175impl crate::RegisterSpec for PRS_CH_INT_STA_SPEC {
176 type Ux = u32;
177}
178#[doc = "`read()` method returns [`prs_ch_int_sta::R`](R) reader structure"]
179impl crate::Readable for PRS_CH_INT_STA_SPEC {}
180#[doc = "`write(|w| ..)` method takes [`prs_ch_int_sta::W`](W) writer structure"]
181impl crate::Writable for PRS_CH_INT_STA_SPEC {
182 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
183 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x05;
184}
185#[doc = "`reset()` method sets prs_ch%s_int_sta to value 0"]
186impl crate::Resettable for PRS_CH_INT_STA_SPEC {
187 const RESET_VALUE: Self::Ux = 0;
188}