d1_pac/i2s_pcm/
asrcmbiststat.rs1#[doc = "Register `asrcmbiststat` reader"]
2pub type R = crate::R<ASRCMBISTSTAT_SPEC>;
3#[doc = "Register `asrcmbiststat` writer"]
4pub type W = crate::W<ASRCMBISTSTAT_SPEC>;
5#[doc = "Field `ram_busy_status` reader - RAM busy status"]
6pub type RAM_BUSY_STATUS_R = crate::BitReader<RAM_BUSY_STATUS_A>;
7#[doc = "RAM busy status\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum RAM_BUSY_STATUS_A {
10 #[doc = "0: `0`"]
11 IDLE = 0,
12 #[doc = "1: `1`"]
13 BUSY = 1,
14}
15impl From<RAM_BUSY_STATUS_A> for bool {
16 #[inline(always)]
17 fn from(variant: RAM_BUSY_STATUS_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl RAM_BUSY_STATUS_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> RAM_BUSY_STATUS_A {
25 match self.bits {
26 false => RAM_BUSY_STATUS_A::IDLE,
27 true => RAM_BUSY_STATUS_A::BUSY,
28 }
29 }
30 #[doc = "`0`"]
31 #[inline(always)]
32 pub fn is_idle(&self) -> bool {
33 *self == RAM_BUSY_STATUS_A::IDLE
34 }
35 #[doc = "`1`"]
36 #[inline(always)]
37 pub fn is_busy(&self) -> bool {
38 *self == RAM_BUSY_STATUS_A::BUSY
39 }
40}
41#[doc = "Field `ram_stop_status` reader - RAM stop status"]
42pub type RAM_STOP_STATUS_R = crate::BitReader<RAM_STOP_STATUS_A>;
43#[doc = "RAM stop status\n\nValue on reset: 0"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum RAM_STOP_STATUS_A {
46 #[doc = "0: `0`"]
47 RUNNING = 0,
48 #[doc = "1: `1`"]
49 STOP = 1,
50}
51impl From<RAM_STOP_STATUS_A> for bool {
52 #[inline(always)]
53 fn from(variant: RAM_STOP_STATUS_A) -> Self {
54 variant as u8 != 0
55 }
56}
57impl RAM_STOP_STATUS_R {
58 #[doc = "Get enumerated values variant"]
59 #[inline(always)]
60 pub const fn variant(&self) -> RAM_STOP_STATUS_A {
61 match self.bits {
62 false => RAM_STOP_STATUS_A::RUNNING,
63 true => RAM_STOP_STATUS_A::STOP,
64 }
65 }
66 #[doc = "`0`"]
67 #[inline(always)]
68 pub fn is_running(&self) -> bool {
69 *self == RAM_STOP_STATUS_A::RUNNING
70 }
71 #[doc = "`1`"]
72 #[inline(always)]
73 pub fn is_stop(&self) -> bool {
74 *self == RAM_STOP_STATUS_A::STOP
75 }
76}
77#[doc = "Field `ram_bist_error_cycle` reader - RAM BIST error cycle"]
78pub type RAM_BIST_ERROR_CYCLE_R = crate::FieldReader;
79#[doc = "Field `ram_bist_error_pattern` reader - RAM BIST error pattern"]
80pub type RAM_BIST_ERROR_PATTERN_R = crate::FieldReader;
81#[doc = "Field `ram_bist_err_status` reader - RAM BIST error status"]
82pub type RAM_BIST_ERR_STATUS_R = crate::BitReader<RAM_BIST_ERR_STATUS_A>;
83#[doc = "RAM BIST error status\n\nValue on reset: 0"]
84#[derive(Clone, Copy, Debug, PartialEq, Eq)]
85pub enum RAM_BIST_ERR_STATUS_A {
86 #[doc = "0: `0`"]
87 NO_EFFECT = 0,
88 #[doc = "1: `1`"]
89 ERROR = 1,
90}
91impl From<RAM_BIST_ERR_STATUS_A> for bool {
92 #[inline(always)]
93 fn from(variant: RAM_BIST_ERR_STATUS_A) -> Self {
94 variant as u8 != 0
95 }
96}
97impl RAM_BIST_ERR_STATUS_R {
98 #[doc = "Get enumerated values variant"]
99 #[inline(always)]
100 pub const fn variant(&self) -> RAM_BIST_ERR_STATUS_A {
101 match self.bits {
102 false => RAM_BIST_ERR_STATUS_A::NO_EFFECT,
103 true => RAM_BIST_ERR_STATUS_A::ERROR,
104 }
105 }
106 #[doc = "`0`"]
107 #[inline(always)]
108 pub fn is_no_effect(&self) -> bool {
109 *self == RAM_BIST_ERR_STATUS_A::NO_EFFECT
110 }
111 #[doc = "`1`"]
112 #[inline(always)]
113 pub fn is_error(&self) -> bool {
114 *self == RAM_BIST_ERR_STATUS_A::ERROR
115 }
116}
117#[doc = "Field `rom_busy_status` reader - ROM busy status"]
118pub type ROM_BUSY_STATUS_R = crate::BitReader<ROM_BUSY_STATUS_A>;
119#[doc = "ROM busy status\n\nValue on reset: 0"]
120#[derive(Clone, Copy, Debug, PartialEq, Eq)]
121pub enum ROM_BUSY_STATUS_A {
122 #[doc = "0: `0`"]
123 IDLE = 0,
124 #[doc = "1: `1`"]
125 BUSY = 1,
126}
127impl From<ROM_BUSY_STATUS_A> for bool {
128 #[inline(always)]
129 fn from(variant: ROM_BUSY_STATUS_A) -> Self {
130 variant as u8 != 0
131 }
132}
133impl ROM_BUSY_STATUS_R {
134 #[doc = "Get enumerated values variant"]
135 #[inline(always)]
136 pub const fn variant(&self) -> ROM_BUSY_STATUS_A {
137 match self.bits {
138 false => ROM_BUSY_STATUS_A::IDLE,
139 true => ROM_BUSY_STATUS_A::BUSY,
140 }
141 }
142 #[doc = "`0`"]
143 #[inline(always)]
144 pub fn is_idle(&self) -> bool {
145 *self == ROM_BUSY_STATUS_A::IDLE
146 }
147 #[doc = "`1`"]
148 #[inline(always)]
149 pub fn is_busy(&self) -> bool {
150 *self == ROM_BUSY_STATUS_A::BUSY
151 }
152}
153#[doc = "Field `rom_bist_error_sum` reader - ROM BIST error sum"]
154pub type ROM_BIST_ERROR_SUM_R = crate::BitReader;
155#[doc = "Field `rom_bist_error_xor` reader - ROM BIST error xor"]
156pub type ROM_BIST_ERROR_XOR_R = crate::BitReader;
157impl R {
158 #[doc = "Bit 0 - RAM busy status"]
159 #[inline(always)]
160 pub fn ram_busy_status(&self) -> RAM_BUSY_STATUS_R {
161 RAM_BUSY_STATUS_R::new((self.bits & 1) != 0)
162 }
163 #[doc = "Bit 1 - RAM stop status"]
164 #[inline(always)]
165 pub fn ram_stop_status(&self) -> RAM_STOP_STATUS_R {
166 RAM_STOP_STATUS_R::new(((self.bits >> 1) & 1) != 0)
167 }
168 #[doc = "Bits 2:3 - RAM BIST error cycle"]
169 #[inline(always)]
170 pub fn ram_bist_error_cycle(&self) -> RAM_BIST_ERROR_CYCLE_R {
171 RAM_BIST_ERROR_CYCLE_R::new(((self.bits >> 2) & 3) as u8)
172 }
173 #[doc = "Bits 4:6 - RAM BIST error pattern"]
174 #[inline(always)]
175 pub fn ram_bist_error_pattern(&self) -> RAM_BIST_ERROR_PATTERN_R {
176 RAM_BIST_ERROR_PATTERN_R::new(((self.bits >> 4) & 7) as u8)
177 }
178 #[doc = "Bit 7 - RAM BIST error status"]
179 #[inline(always)]
180 pub fn ram_bist_err_status(&self) -> RAM_BIST_ERR_STATUS_R {
181 RAM_BIST_ERR_STATUS_R::new(((self.bits >> 7) & 1) != 0)
182 }
183 #[doc = "Bit 16 - ROM busy status"]
184 #[inline(always)]
185 pub fn rom_busy_status(&self) -> ROM_BUSY_STATUS_R {
186 ROM_BUSY_STATUS_R::new(((self.bits >> 16) & 1) != 0)
187 }
188 #[doc = "Bit 17 - ROM BIST error sum"]
189 #[inline(always)]
190 pub fn rom_bist_error_sum(&self) -> ROM_BIST_ERROR_SUM_R {
191 ROM_BIST_ERROR_SUM_R::new(((self.bits >> 17) & 1) != 0)
192 }
193 #[doc = "Bit 18 - ROM BIST error xor"]
194 #[inline(always)]
195 pub fn rom_bist_error_xor(&self) -> ROM_BIST_ERROR_XOR_R {
196 ROM_BIST_ERROR_XOR_R::new(((self.bits >> 18) & 1) != 0)
197 }
198}
199impl W {
200 #[doc = r" Writes raw bits to the register."]
201 #[doc = r""]
202 #[doc = r" # Safety"]
203 #[doc = r""]
204 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
205 #[inline(always)]
206 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
207 self.bits = bits;
208 self
209 }
210}
211#[doc = "ASRC MBIST Test Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`asrcmbiststat::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 [`asrcmbiststat::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
212pub struct ASRCMBISTSTAT_SPEC;
213impl crate::RegisterSpec for ASRCMBISTSTAT_SPEC {
214 type Ux = u32;
215}
216#[doc = "`read()` method returns [`asrcmbiststat::R`](R) reader structure"]
217impl crate::Readable for ASRCMBISTSTAT_SPEC {}
218#[doc = "`write(|w| ..)` method takes [`asrcmbiststat::W`](W) writer structure"]
219impl crate::Writable for ASRCMBISTSTAT_SPEC {
220 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
221 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
222}
223#[doc = "`reset()` method sets asrcmbiststat to value 0"]
224impl crate::Resettable for ASRCMBISTSTAT_SPEC {
225 const RESET_VALUE: Self::Ux = 0;
226}