1#[doc = "Register `ramp` reader"]
2pub type R = crate::R<RAMP_SPEC>;
3#[doc = "Register `ramp` writer"]
4pub type W = crate::W<RAMP_SPEC>;
5#[doc = "Field `rd_en` reader - Ramp Digital Enable"]
6pub type RD_EN_R = crate::BitReader<RD_EN_A>;
7#[doc = "Ramp Digital Enable\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum RD_EN_A {
10 #[doc = "0: `0`"]
11 DISABLE = 0,
12 #[doc = "1: `1`"]
13 ENABLE = 1,
14}
15impl From<RD_EN_A> for bool {
16 #[inline(always)]
17 fn from(variant: RD_EN_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl RD_EN_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> RD_EN_A {
25 match self.bits {
26 false => RD_EN_A::DISABLE,
27 true => RD_EN_A::ENABLE,
28 }
29 }
30 #[doc = "`0`"]
31 #[inline(always)]
32 pub fn is_disable(&self) -> bool {
33 *self == RD_EN_A::DISABLE
34 }
35 #[doc = "`1`"]
36 #[inline(always)]
37 pub fn is_enable(&self) -> bool {
38 *self == RD_EN_A::ENABLE
39 }
40}
41#[doc = "Field `rd_en` writer - Ramp Digital Enable"]
42pub type RD_EN_W<'a, REG> = crate::BitWriter<'a, REG, RD_EN_A>;
43impl<'a, REG> RD_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(RD_EN_A::DISABLE)
51 }
52 #[doc = "`1`"]
53 #[inline(always)]
54 pub fn enable(self) -> &'a mut crate::W<REG> {
55 self.variant(RD_EN_A::ENABLE)
56 }
57}
58#[doc = "Field `rmc_en` reader - Ramp Manual Control Enable"]
59pub type RMC_EN_R = crate::BitReader<RMC_EN_A>;
60#[doc = "Ramp Manual Control Enable\n\nValue on reset: 0"]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum RMC_EN_A {
63 #[doc = "0: `0`"]
64 DISABLE = 0,
65 #[doc = "1: `1`"]
66 ENABLE = 1,
67}
68impl From<RMC_EN_A> for bool {
69 #[inline(always)]
70 fn from(variant: RMC_EN_A) -> Self {
71 variant as u8 != 0
72 }
73}
74impl RMC_EN_R {
75 #[doc = "Get enumerated values variant"]
76 #[inline(always)]
77 pub const fn variant(&self) -> RMC_EN_A {
78 match self.bits {
79 false => RMC_EN_A::DISABLE,
80 true => RMC_EN_A::ENABLE,
81 }
82 }
83 #[doc = "`0`"]
84 #[inline(always)]
85 pub fn is_disable(&self) -> bool {
86 *self == RMC_EN_A::DISABLE
87 }
88 #[doc = "`1`"]
89 #[inline(always)]
90 pub fn is_enable(&self) -> bool {
91 *self == RMC_EN_A::ENABLE
92 }
93}
94#[doc = "Field `rmc_en` writer - Ramp Manual Control Enable"]
95pub type RMC_EN_W<'a, REG> = crate::BitWriter<'a, REG, RMC_EN_A>;
96impl<'a, REG> RMC_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(RMC_EN_A::DISABLE)
104 }
105 #[doc = "`1`"]
106 #[inline(always)]
107 pub fn enable(self) -> &'a mut crate::W<REG> {
108 self.variant(RMC_EN_A::ENABLE)
109 }
110}
111#[doc = "Field `rmu_en` reader - Ramp Manual Up Enable"]
112pub type RMU_EN_R = crate::BitReader<RMU_EN_A>;
113#[doc = "Ramp Manual Up Enable\n\nValue on reset: 0"]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum RMU_EN_A {
116 #[doc = "0: `0`"]
117 DISABLE = 0,
118 #[doc = "1: `1`"]
119 ENABLE = 1,
120}
121impl From<RMU_EN_A> for bool {
122 #[inline(always)]
123 fn from(variant: RMU_EN_A) -> Self {
124 variant as u8 != 0
125 }
126}
127impl RMU_EN_R {
128 #[doc = "Get enumerated values variant"]
129 #[inline(always)]
130 pub const fn variant(&self) -> RMU_EN_A {
131 match self.bits {
132 false => RMU_EN_A::DISABLE,
133 true => RMU_EN_A::ENABLE,
134 }
135 }
136 #[doc = "`0`"]
137 #[inline(always)]
138 pub fn is_disable(&self) -> bool {
139 *self == RMU_EN_A::DISABLE
140 }
141 #[doc = "`1`"]
142 #[inline(always)]
143 pub fn is_enable(&self) -> bool {
144 *self == RMU_EN_A::ENABLE
145 }
146}
147#[doc = "Field `rmu_en` writer - Ramp Manual Up Enable"]
148pub type RMU_EN_W<'a, REG> = crate::BitWriter<'a, REG, RMU_EN_A>;
149impl<'a, REG> RMU_EN_W<'a, REG>
150where
151 REG: crate::Writable + crate::RegisterSpec,
152{
153 #[doc = "`0`"]
154 #[inline(always)]
155 pub fn disable(self) -> &'a mut crate::W<REG> {
156 self.variant(RMU_EN_A::DISABLE)
157 }
158 #[doc = "`1`"]
159 #[inline(always)]
160 pub fn enable(self) -> &'a mut crate::W<REG> {
161 self.variant(RMU_EN_A::ENABLE)
162 }
163}
164#[doc = "Field `rmd_en` reader - Ramp Manual Down Enable"]
165pub type RMD_EN_R = crate::BitReader<RMD_EN_A>;
166#[doc = "Ramp Manual Down Enable\n\nValue on reset: 0"]
167#[derive(Clone, Copy, Debug, PartialEq, Eq)]
168pub enum RMD_EN_A {
169 #[doc = "0: `0`"]
170 DISABLE = 0,
171 #[doc = "1: `1`"]
172 ENABLE = 1,
173}
174impl From<RMD_EN_A> for bool {
175 #[inline(always)]
176 fn from(variant: RMD_EN_A) -> Self {
177 variant as u8 != 0
178 }
179}
180impl RMD_EN_R {
181 #[doc = "Get enumerated values variant"]
182 #[inline(always)]
183 pub const fn variant(&self) -> RMD_EN_A {
184 match self.bits {
185 false => RMD_EN_A::DISABLE,
186 true => RMD_EN_A::ENABLE,
187 }
188 }
189 #[doc = "`0`"]
190 #[inline(always)]
191 pub fn is_disable(&self) -> bool {
192 *self == RMD_EN_A::DISABLE
193 }
194 #[doc = "`1`"]
195 #[inline(always)]
196 pub fn is_enable(&self) -> bool {
197 *self == RMD_EN_A::ENABLE
198 }
199}
200#[doc = "Field `rmd_en` writer - Ramp Manual Down Enable"]
201pub type RMD_EN_W<'a, REG> = crate::BitWriter<'a, REG, RMD_EN_A>;
202impl<'a, REG> RMD_EN_W<'a, REG>
203where
204 REG: crate::Writable + crate::RegisterSpec,
205{
206 #[doc = "`0`"]
207 #[inline(always)]
208 pub fn disable(self) -> &'a mut crate::W<REG> {
209 self.variant(RMD_EN_A::DISABLE)
210 }
211 #[doc = "`1`"]
212 #[inline(always)]
213 pub fn enable(self) -> &'a mut crate::W<REG> {
214 self.variant(RMD_EN_A::ENABLE)
215 }
216}
217#[doc = "Field `ramp_step` reader - RK Frequency Gear, Control Ramp Rise/Fall Total Time\n\nRamp Rise/Fall Total Time = (Ramp Step/Ramp Clk Freq)*4096"]
218pub type RAMP_STEP_R = crate::FieldReader<RAMP_STEP_A>;
219#[doc = "RK Frequency Gear, Control Ramp Rise/Fall Total Time\n\nRamp Rise/Fall Total Time = (Ramp Step/Ramp Clk Freq)*4096\n\nValue on reset: 0"]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221#[repr(u8)]
222pub enum RAMP_STEP_A {
223 #[doc = "0: `0`"]
224 S20 = 0,
225 #[doc = "1: `1`"]
226 S30 = 1,
227 #[doc = "2: `10`"]
228 S40 = 2,
229 #[doc = "3: `11`"]
230 S60 = 3,
231 #[doc = "4: `100`"]
232 S80 = 4,
233 #[doc = "5: `101`"]
234 S120 = 5,
235 #[doc = "6: `110`"]
236 S160 = 6,
237 #[doc = "7: `111`"]
238 S240 = 7,
239}
240impl From<RAMP_STEP_A> for u8 {
241 #[inline(always)]
242 fn from(variant: RAMP_STEP_A) -> Self {
243 variant as _
244 }
245}
246impl crate::FieldSpec for RAMP_STEP_A {
247 type Ux = u8;
248}
249impl RAMP_STEP_R {
250 #[doc = "Get enumerated values variant"]
251 #[inline(always)]
252 pub const fn variant(&self) -> RAMP_STEP_A {
253 match self.bits {
254 0 => RAMP_STEP_A::S20,
255 1 => RAMP_STEP_A::S30,
256 2 => RAMP_STEP_A::S40,
257 3 => RAMP_STEP_A::S60,
258 4 => RAMP_STEP_A::S80,
259 5 => RAMP_STEP_A::S120,
260 6 => RAMP_STEP_A::S160,
261 7 => RAMP_STEP_A::S240,
262 _ => unreachable!(),
263 }
264 }
265 #[doc = "`0`"]
266 #[inline(always)]
267 pub fn is_s20(&self) -> bool {
268 *self == RAMP_STEP_A::S20
269 }
270 #[doc = "`1`"]
271 #[inline(always)]
272 pub fn is_s30(&self) -> bool {
273 *self == RAMP_STEP_A::S30
274 }
275 #[doc = "`10`"]
276 #[inline(always)]
277 pub fn is_s40(&self) -> bool {
278 *self == RAMP_STEP_A::S40
279 }
280 #[doc = "`11`"]
281 #[inline(always)]
282 pub fn is_s60(&self) -> bool {
283 *self == RAMP_STEP_A::S60
284 }
285 #[doc = "`100`"]
286 #[inline(always)]
287 pub fn is_s80(&self) -> bool {
288 *self == RAMP_STEP_A::S80
289 }
290 #[doc = "`101`"]
291 #[inline(always)]
292 pub fn is_s120(&self) -> bool {
293 *self == RAMP_STEP_A::S120
294 }
295 #[doc = "`110`"]
296 #[inline(always)]
297 pub fn is_s160(&self) -> bool {
298 *self == RAMP_STEP_A::S160
299 }
300 #[doc = "`111`"]
301 #[inline(always)]
302 pub fn is_s240(&self) -> bool {
303 *self == RAMP_STEP_A::S240
304 }
305}
306#[doc = "Field `ramp_step` writer - RK Frequency Gear, Control Ramp Rise/Fall Total Time\n\nRamp Rise/Fall Total Time = (Ramp Step/Ramp Clk Freq)*4096"]
307pub type RAMP_STEP_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, RAMP_STEP_A>;
308impl<'a, REG> RAMP_STEP_W<'a, REG>
309where
310 REG: crate::Writable + crate::RegisterSpec,
311 REG::Ux: From<u8>,
312{
313 #[doc = "`0`"]
314 #[inline(always)]
315 pub fn s20(self) -> &'a mut crate::W<REG> {
316 self.variant(RAMP_STEP_A::S20)
317 }
318 #[doc = "`1`"]
319 #[inline(always)]
320 pub fn s30(self) -> &'a mut crate::W<REG> {
321 self.variant(RAMP_STEP_A::S30)
322 }
323 #[doc = "`10`"]
324 #[inline(always)]
325 pub fn s40(self) -> &'a mut crate::W<REG> {
326 self.variant(RAMP_STEP_A::S40)
327 }
328 #[doc = "`11`"]
329 #[inline(always)]
330 pub fn s60(self) -> &'a mut crate::W<REG> {
331 self.variant(RAMP_STEP_A::S60)
332 }
333 #[doc = "`100`"]
334 #[inline(always)]
335 pub fn s80(self) -> &'a mut crate::W<REG> {
336 self.variant(RAMP_STEP_A::S80)
337 }
338 #[doc = "`101`"]
339 #[inline(always)]
340 pub fn s120(self) -> &'a mut crate::W<REG> {
341 self.variant(RAMP_STEP_A::S120)
342 }
343 #[doc = "`110`"]
344 #[inline(always)]
345 pub fn s160(self) -> &'a mut crate::W<REG> {
346 self.variant(RAMP_STEP_A::S160)
347 }
348 #[doc = "`111`"]
349 #[inline(always)]
350 pub fn s240(self) -> &'a mut crate::W<REG> {
351 self.variant(RAMP_STEP_A::S240)
352 }
353}
354#[doc = "Field `gap_step` reader - Gap Step"]
355pub type GAP_STEP_R = crate::FieldReader<GAP_STEP_A>;
356#[doc = "Gap Step\n\nValue on reset: 0"]
357#[derive(Clone, Copy, Debug, PartialEq, Eq)]
358#[repr(u8)]
359pub enum GAP_STEP_A {
360 #[doc = "0: `0`"]
361 RAMP_STEP_X1 = 0,
362 #[doc = "1: `1`"]
363 RAMP_STEP_X2 = 1,
364 #[doc = "2: `10`"]
365 RAMP_STEP_X3 = 2,
366 #[doc = "3: `11`"]
367 RAMP_STEP_X4 = 3,
368}
369impl From<GAP_STEP_A> for u8 {
370 #[inline(always)]
371 fn from(variant: GAP_STEP_A) -> Self {
372 variant as _
373 }
374}
375impl crate::FieldSpec for GAP_STEP_A {
376 type Ux = u8;
377}
378impl GAP_STEP_R {
379 #[doc = "Get enumerated values variant"]
380 #[inline(always)]
381 pub const fn variant(&self) -> GAP_STEP_A {
382 match self.bits {
383 0 => GAP_STEP_A::RAMP_STEP_X1,
384 1 => GAP_STEP_A::RAMP_STEP_X2,
385 2 => GAP_STEP_A::RAMP_STEP_X3,
386 3 => GAP_STEP_A::RAMP_STEP_X4,
387 _ => unreachable!(),
388 }
389 }
390 #[doc = "`0`"]
391 #[inline(always)]
392 pub fn is_ramp_step_x1(&self) -> bool {
393 *self == GAP_STEP_A::RAMP_STEP_X1
394 }
395 #[doc = "`1`"]
396 #[inline(always)]
397 pub fn is_ramp_step_x2(&self) -> bool {
398 *self == GAP_STEP_A::RAMP_STEP_X2
399 }
400 #[doc = "`10`"]
401 #[inline(always)]
402 pub fn is_ramp_step_x3(&self) -> bool {
403 *self == GAP_STEP_A::RAMP_STEP_X3
404 }
405 #[doc = "`11`"]
406 #[inline(always)]
407 pub fn is_ramp_step_x4(&self) -> bool {
408 *self == GAP_STEP_A::RAMP_STEP_X4
409 }
410}
411#[doc = "Field `gap_step` writer - Gap Step"]
412pub type GAP_STEP_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, GAP_STEP_A>;
413impl<'a, REG> GAP_STEP_W<'a, REG>
414where
415 REG: crate::Writable + crate::RegisterSpec,
416 REG::Ux: From<u8>,
417{
418 #[doc = "`0`"]
419 #[inline(always)]
420 pub fn ramp_step_x1(self) -> &'a mut crate::W<REG> {
421 self.variant(GAP_STEP_A::RAMP_STEP_X1)
422 }
423 #[doc = "`1`"]
424 #[inline(always)]
425 pub fn ramp_step_x2(self) -> &'a mut crate::W<REG> {
426 self.variant(GAP_STEP_A::RAMP_STEP_X2)
427 }
428 #[doc = "`10`"]
429 #[inline(always)]
430 pub fn ramp_step_x3(self) -> &'a mut crate::W<REG> {
431 self.variant(GAP_STEP_A::RAMP_STEP_X3)
432 }
433 #[doc = "`11`"]
434 #[inline(always)]
435 pub fn ramp_step_x4(self) -> &'a mut crate::W<REG> {
436 self.variant(GAP_STEP_A::RAMP_STEP_X4)
437 }
438}
439#[doc = "Field `ramp_hold_step` reader - Ramp Hold Step\n\nRamp Hold Time = Ramp Hold Step/Ramp Clk Freq"]
440pub type RAMP_HOLD_STEP_R = crate::FieldReader<RAMP_HOLD_STEP_A>;
441#[doc = "Ramp Hold Step\n\nRamp Hold Time = Ramp Hold Step/Ramp Clk Freq\n\nValue on reset: 0"]
442#[derive(Clone, Copy, Debug, PartialEq, Eq)]
443#[repr(u8)]
444pub enum RAMP_HOLD_STEP_A {
445 #[doc = "0: `0`"]
446 S9600 = 0,
447 #[doc = "1: `1`"]
448 S19200 = 1,
449 #[doc = "2: `10`"]
450 S38400 = 2,
451 #[doc = "3: `11`"]
452 S76800 = 3,
453 #[doc = "4: `100`"]
454 S96000 = 4,
455 #[doc = "5: `101`"]
456 S115200 = 5,
457 #[doc = "6: `110`"]
458 S153600 = 6,
459 #[doc = "7: `111`"]
460 S192000 = 7,
461}
462impl From<RAMP_HOLD_STEP_A> for u8 {
463 #[inline(always)]
464 fn from(variant: RAMP_HOLD_STEP_A) -> Self {
465 variant as _
466 }
467}
468impl crate::FieldSpec for RAMP_HOLD_STEP_A {
469 type Ux = u8;
470}
471impl RAMP_HOLD_STEP_R {
472 #[doc = "Get enumerated values variant"]
473 #[inline(always)]
474 pub const fn variant(&self) -> RAMP_HOLD_STEP_A {
475 match self.bits {
476 0 => RAMP_HOLD_STEP_A::S9600,
477 1 => RAMP_HOLD_STEP_A::S19200,
478 2 => RAMP_HOLD_STEP_A::S38400,
479 3 => RAMP_HOLD_STEP_A::S76800,
480 4 => RAMP_HOLD_STEP_A::S96000,
481 5 => RAMP_HOLD_STEP_A::S115200,
482 6 => RAMP_HOLD_STEP_A::S153600,
483 7 => RAMP_HOLD_STEP_A::S192000,
484 _ => unreachable!(),
485 }
486 }
487 #[doc = "`0`"]
488 #[inline(always)]
489 pub fn is_s9600(&self) -> bool {
490 *self == RAMP_HOLD_STEP_A::S9600
491 }
492 #[doc = "`1`"]
493 #[inline(always)]
494 pub fn is_s19200(&self) -> bool {
495 *self == RAMP_HOLD_STEP_A::S19200
496 }
497 #[doc = "`10`"]
498 #[inline(always)]
499 pub fn is_s38400(&self) -> bool {
500 *self == RAMP_HOLD_STEP_A::S38400
501 }
502 #[doc = "`11`"]
503 #[inline(always)]
504 pub fn is_s76800(&self) -> bool {
505 *self == RAMP_HOLD_STEP_A::S76800
506 }
507 #[doc = "`100`"]
508 #[inline(always)]
509 pub fn is_s96000(&self) -> bool {
510 *self == RAMP_HOLD_STEP_A::S96000
511 }
512 #[doc = "`101`"]
513 #[inline(always)]
514 pub fn is_s115200(&self) -> bool {
515 *self == RAMP_HOLD_STEP_A::S115200
516 }
517 #[doc = "`110`"]
518 #[inline(always)]
519 pub fn is_s153600(&self) -> bool {
520 *self == RAMP_HOLD_STEP_A::S153600
521 }
522 #[doc = "`111`"]
523 #[inline(always)]
524 pub fn is_s192000(&self) -> bool {
525 *self == RAMP_HOLD_STEP_A::S192000
526 }
527}
528#[doc = "Field `ramp_hold_step` writer - Ramp Hold Step\n\nRamp Hold Time = Ramp Hold Step/Ramp Clk Freq"]
529pub type RAMP_HOLD_STEP_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, RAMP_HOLD_STEP_A>;
530impl<'a, REG> RAMP_HOLD_STEP_W<'a, REG>
531where
532 REG: crate::Writable + crate::RegisterSpec,
533 REG::Ux: From<u8>,
534{
535 #[doc = "`0`"]
536 #[inline(always)]
537 pub fn s9600(self) -> &'a mut crate::W<REG> {
538 self.variant(RAMP_HOLD_STEP_A::S9600)
539 }
540 #[doc = "`1`"]
541 #[inline(always)]
542 pub fn s19200(self) -> &'a mut crate::W<REG> {
543 self.variant(RAMP_HOLD_STEP_A::S19200)
544 }
545 #[doc = "`10`"]
546 #[inline(always)]
547 pub fn s38400(self) -> &'a mut crate::W<REG> {
548 self.variant(RAMP_HOLD_STEP_A::S38400)
549 }
550 #[doc = "`11`"]
551 #[inline(always)]
552 pub fn s76800(self) -> &'a mut crate::W<REG> {
553 self.variant(RAMP_HOLD_STEP_A::S76800)
554 }
555 #[doc = "`100`"]
556 #[inline(always)]
557 pub fn s96000(self) -> &'a mut crate::W<REG> {
558 self.variant(RAMP_HOLD_STEP_A::S96000)
559 }
560 #[doc = "`101`"]
561 #[inline(always)]
562 pub fn s115200(self) -> &'a mut crate::W<REG> {
563 self.variant(RAMP_HOLD_STEP_A::S115200)
564 }
565 #[doc = "`110`"]
566 #[inline(always)]
567 pub fn s153600(self) -> &'a mut crate::W<REG> {
568 self.variant(RAMP_HOLD_STEP_A::S153600)
569 }
570 #[doc = "`111`"]
571 #[inline(always)]
572 pub fn s192000(self) -> &'a mut crate::W<REG> {
573 self.variant(RAMP_HOLD_STEP_A::S192000)
574 }
575}
576#[doc = "Field `hp_pull_out_en` reader - Headphone Pullout Enable"]
577pub type HP_PULL_OUT_EN_R = crate::BitReader<HP_PULL_OUT_EN_A>;
578#[doc = "Headphone Pullout Enable\n\nValue on reset: 0"]
579#[derive(Clone, Copy, Debug, PartialEq, Eq)]
580pub enum HP_PULL_OUT_EN_A {
581 #[doc = "0: `0`"]
582 DISABLE = 0,
583 #[doc = "1: `1`"]
584 ENABLE = 1,
585}
586impl From<HP_PULL_OUT_EN_A> for bool {
587 #[inline(always)]
588 fn from(variant: HP_PULL_OUT_EN_A) -> Self {
589 variant as u8 != 0
590 }
591}
592impl HP_PULL_OUT_EN_R {
593 #[doc = "Get enumerated values variant"]
594 #[inline(always)]
595 pub const fn variant(&self) -> HP_PULL_OUT_EN_A {
596 match self.bits {
597 false => HP_PULL_OUT_EN_A::DISABLE,
598 true => HP_PULL_OUT_EN_A::ENABLE,
599 }
600 }
601 #[doc = "`0`"]
602 #[inline(always)]
603 pub fn is_disable(&self) -> bool {
604 *self == HP_PULL_OUT_EN_A::DISABLE
605 }
606 #[doc = "`1`"]
607 #[inline(always)]
608 pub fn is_enable(&self) -> bool {
609 *self == HP_PULL_OUT_EN_A::ENABLE
610 }
611}
612#[doc = "Field `hp_pull_out_en` writer - Headphone Pullout Enable"]
613pub type HP_PULL_OUT_EN_W<'a, REG> = crate::BitWriter<'a, REG, HP_PULL_OUT_EN_A>;
614impl<'a, REG> HP_PULL_OUT_EN_W<'a, REG>
615where
616 REG: crate::Writable + crate::RegisterSpec,
617{
618 #[doc = "`0`"]
619 #[inline(always)]
620 pub fn disable(self) -> &'a mut crate::W<REG> {
621 self.variant(HP_PULL_OUT_EN_A::DISABLE)
622 }
623 #[doc = "`1`"]
624 #[inline(always)]
625 pub fn enable(self) -> &'a mut crate::W<REG> {
626 self.variant(HP_PULL_OUT_EN_A::ENABLE)
627 }
628}
629#[doc = "Field `ramp_clk_div_m` reader - Analog Ramp Clk Div Freq Value : M (from 0 to 31, Default: 24).\n\nAna_Ramp_Clk= 24MHz/(M+1)\n\nDefault Ramp Clk Freq: 24MHz/(24+1)=960 kHz"]
630pub type RAMP_CLK_DIV_M_R = crate::FieldReader;
631#[doc = "Field `ramp_clk_div_m` writer - Analog Ramp Clk Div Freq Value : M (from 0 to 31, Default: 24).\n\nAna_Ramp_Clk= 24MHz/(M+1)\n\nDefault Ramp Clk Freq: 24MHz/(24+1)=960 kHz"]
632pub type RAMP_CLK_DIV_M_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
633#[doc = "Field `ramp_srst` reader - Ramp Soft Reset"]
634pub type RAMP_SRST_R = crate::BitReader<RAMP_SRST_A>;
635#[doc = "Ramp Soft Reset\n\nValue on reset: 0"]
636#[derive(Clone, Copy, Debug, PartialEq, Eq)]
637pub enum RAMP_SRST_A {
638 #[doc = "0: `0`"]
639 DISABLE = 0,
640 #[doc = "1: `1`"]
641 ENABLE = 1,
642}
643impl From<RAMP_SRST_A> for bool {
644 #[inline(always)]
645 fn from(variant: RAMP_SRST_A) -> Self {
646 variant as u8 != 0
647 }
648}
649impl RAMP_SRST_R {
650 #[doc = "Get enumerated values variant"]
651 #[inline(always)]
652 pub const fn variant(&self) -> RAMP_SRST_A {
653 match self.bits {
654 false => RAMP_SRST_A::DISABLE,
655 true => RAMP_SRST_A::ENABLE,
656 }
657 }
658 #[doc = "`0`"]
659 #[inline(always)]
660 pub fn is_disable(&self) -> bool {
661 *self == RAMP_SRST_A::DISABLE
662 }
663 #[doc = "`1`"]
664 #[inline(always)]
665 pub fn is_enable(&self) -> bool {
666 *self == RAMP_SRST_A::ENABLE
667 }
668}
669#[doc = "Field `ramp_srst` writer - Ramp Soft Reset"]
670pub type RAMP_SRST_W<'a, REG> = crate::BitWriter<'a, REG, RAMP_SRST_A>;
671impl<'a, REG> RAMP_SRST_W<'a, REG>
672where
673 REG: crate::Writable + crate::RegisterSpec,
674{
675 #[doc = "`0`"]
676 #[inline(always)]
677 pub fn disable(self) -> &'a mut crate::W<REG> {
678 self.variant(RAMP_SRST_A::DISABLE)
679 }
680 #[doc = "`1`"]
681 #[inline(always)]
682 pub fn enable(self) -> &'a mut crate::W<REG> {
683 self.variant(RAMP_SRST_A::ENABLE)
684 }
685}
686#[doc = "Field `ramp_fall_int` reader - RK Downward Decrease Finish and Rampen Pull Down Instruction"]
687pub type RAMP_FALL_INT_R = crate::BitReader<RAMP_FALL_INT_A>;
688#[doc = "RK Downward Decrease Finish and Rampen Pull Down Instruction\n\nValue on reset: 0"]
689#[derive(Clone, Copy, Debug, PartialEq, Eq)]
690pub enum RAMP_FALL_INT_A {
691 #[doc = "0: `0`"]
692 NO_PENDING = 0,
693 #[doc = "1: `1`"]
694 PENDING = 1,
695}
696impl From<RAMP_FALL_INT_A> for bool {
697 #[inline(always)]
698 fn from(variant: RAMP_FALL_INT_A) -> Self {
699 variant as u8 != 0
700 }
701}
702impl RAMP_FALL_INT_R {
703 #[doc = "Get enumerated values variant"]
704 #[inline(always)]
705 pub const fn variant(&self) -> RAMP_FALL_INT_A {
706 match self.bits {
707 false => RAMP_FALL_INT_A::NO_PENDING,
708 true => RAMP_FALL_INT_A::PENDING,
709 }
710 }
711 #[doc = "`0`"]
712 #[inline(always)]
713 pub fn is_no_pending(&self) -> bool {
714 *self == RAMP_FALL_INT_A::NO_PENDING
715 }
716 #[doc = "`1`"]
717 #[inline(always)]
718 pub fn is_pending(&self) -> bool {
719 *self == RAMP_FALL_INT_A::PENDING
720 }
721}
722#[doc = "Field `ramp_fall_int` writer - RK Downward Decrease Finish and Rampen Pull Down Instruction"]
723pub type RAMP_FALL_INT_W<'a, REG> = crate::BitWriter<'a, REG, RAMP_FALL_INT_A>;
724impl<'a, REG> RAMP_FALL_INT_W<'a, REG>
725where
726 REG: crate::Writable + crate::RegisterSpec,
727{
728 #[doc = "`0`"]
729 #[inline(always)]
730 pub fn no_pending(self) -> &'a mut crate::W<REG> {
731 self.variant(RAMP_FALL_INT_A::NO_PENDING)
732 }
733 #[doc = "`1`"]
734 #[inline(always)]
735 pub fn pending(self) -> &'a mut crate::W<REG> {
736 self.variant(RAMP_FALL_INT_A::PENDING)
737 }
738}
739#[doc = "Field `ramp_fall_int_en` reader - RAMP Fall Int Enable"]
740pub type RAMP_FALL_INT_EN_R = crate::BitReader<RAMP_FALL_INT_EN_A>;
741#[doc = "RAMP Fall Int Enable\n\nValue on reset: 0"]
742#[derive(Clone, Copy, Debug, PartialEq, Eq)]
743pub enum RAMP_FALL_INT_EN_A {
744 #[doc = "0: `0`"]
745 DISABLE = 0,
746 #[doc = "1: `1`"]
747 ENABLE = 1,
748}
749impl From<RAMP_FALL_INT_EN_A> for bool {
750 #[inline(always)]
751 fn from(variant: RAMP_FALL_INT_EN_A) -> Self {
752 variant as u8 != 0
753 }
754}
755impl RAMP_FALL_INT_EN_R {
756 #[doc = "Get enumerated values variant"]
757 #[inline(always)]
758 pub const fn variant(&self) -> RAMP_FALL_INT_EN_A {
759 match self.bits {
760 false => RAMP_FALL_INT_EN_A::DISABLE,
761 true => RAMP_FALL_INT_EN_A::ENABLE,
762 }
763 }
764 #[doc = "`0`"]
765 #[inline(always)]
766 pub fn is_disable(&self) -> bool {
767 *self == RAMP_FALL_INT_EN_A::DISABLE
768 }
769 #[doc = "`1`"]
770 #[inline(always)]
771 pub fn is_enable(&self) -> bool {
772 *self == RAMP_FALL_INT_EN_A::ENABLE
773 }
774}
775#[doc = "Field `ramp_fall_int_en` writer - RAMP Fall Int Enable"]
776pub type RAMP_FALL_INT_EN_W<'a, REG> = crate::BitWriter<'a, REG, RAMP_FALL_INT_EN_A>;
777impl<'a, REG> RAMP_FALL_INT_EN_W<'a, REG>
778where
779 REG: crate::Writable + crate::RegisterSpec,
780{
781 #[doc = "`0`"]
782 #[inline(always)]
783 pub fn disable(self) -> &'a mut crate::W<REG> {
784 self.variant(RAMP_FALL_INT_EN_A::DISABLE)
785 }
786 #[doc = "`1`"]
787 #[inline(always)]
788 pub fn enable(self) -> &'a mut crate::W<REG> {
789 self.variant(RAMP_FALL_INT_EN_A::ENABLE)
790 }
791}
792#[doc = "Field `ramp_rise_int` reader - RK Increase Upward Finish and Rampen Pull Down Instruction"]
793pub type RAMP_RISE_INT_R = crate::BitReader<RAMP_RISE_INT_A>;
794#[doc = "RK Increase Upward Finish and Rampen Pull Down Instruction\n\nValue on reset: 0"]
795#[derive(Clone, Copy, Debug, PartialEq, Eq)]
796pub enum RAMP_RISE_INT_A {
797 #[doc = "0: `0`"]
798 NO_PENDING = 0,
799 #[doc = "1: `1`"]
800 PENDING = 1,
801}
802impl From<RAMP_RISE_INT_A> for bool {
803 #[inline(always)]
804 fn from(variant: RAMP_RISE_INT_A) -> Self {
805 variant as u8 != 0
806 }
807}
808impl RAMP_RISE_INT_R {
809 #[doc = "Get enumerated values variant"]
810 #[inline(always)]
811 pub const fn variant(&self) -> RAMP_RISE_INT_A {
812 match self.bits {
813 false => RAMP_RISE_INT_A::NO_PENDING,
814 true => RAMP_RISE_INT_A::PENDING,
815 }
816 }
817 #[doc = "`0`"]
818 #[inline(always)]
819 pub fn is_no_pending(&self) -> bool {
820 *self == RAMP_RISE_INT_A::NO_PENDING
821 }
822 #[doc = "`1`"]
823 #[inline(always)]
824 pub fn is_pending(&self) -> bool {
825 *self == RAMP_RISE_INT_A::PENDING
826 }
827}
828#[doc = "Field `ramp_rise_int` writer - RK Increase Upward Finish and Rampen Pull Down Instruction"]
829pub type RAMP_RISE_INT_W<'a, REG> = crate::BitWriter<'a, REG, RAMP_RISE_INT_A>;
830impl<'a, REG> RAMP_RISE_INT_W<'a, REG>
831where
832 REG: crate::Writable + crate::RegisterSpec,
833{
834 #[doc = "`0`"]
835 #[inline(always)]
836 pub fn no_pending(self) -> &'a mut crate::W<REG> {
837 self.variant(RAMP_RISE_INT_A::NO_PENDING)
838 }
839 #[doc = "`1`"]
840 #[inline(always)]
841 pub fn pending(self) -> &'a mut crate::W<REG> {
842 self.variant(RAMP_RISE_INT_A::PENDING)
843 }
844}
845#[doc = "Field `ramp_rise_int_en` reader - RAMP Rise Interrupt Enable"]
846pub type RAMP_RISE_INT_EN_R = crate::BitReader<RAMP_RISE_INT_EN_A>;
847#[doc = "RAMP Rise Interrupt Enable\n\nValue on reset: 0"]
848#[derive(Clone, Copy, Debug, PartialEq, Eq)]
849pub enum RAMP_RISE_INT_EN_A {
850 #[doc = "0: `0`"]
851 DISABLE = 0,
852 #[doc = "1: `1`"]
853 ENABLE = 1,
854}
855impl From<RAMP_RISE_INT_EN_A> for bool {
856 #[inline(always)]
857 fn from(variant: RAMP_RISE_INT_EN_A) -> Self {
858 variant as u8 != 0
859 }
860}
861impl RAMP_RISE_INT_EN_R {
862 #[doc = "Get enumerated values variant"]
863 #[inline(always)]
864 pub const fn variant(&self) -> RAMP_RISE_INT_EN_A {
865 match self.bits {
866 false => RAMP_RISE_INT_EN_A::DISABLE,
867 true => RAMP_RISE_INT_EN_A::ENABLE,
868 }
869 }
870 #[doc = "`0`"]
871 #[inline(always)]
872 pub fn is_disable(&self) -> bool {
873 *self == RAMP_RISE_INT_EN_A::DISABLE
874 }
875 #[doc = "`1`"]
876 #[inline(always)]
877 pub fn is_enable(&self) -> bool {
878 *self == RAMP_RISE_INT_EN_A::ENABLE
879 }
880}
881#[doc = "Field `ramp_rise_int_en` writer - RAMP Rise Interrupt Enable"]
882pub type RAMP_RISE_INT_EN_W<'a, REG> = crate::BitWriter<'a, REG, RAMP_RISE_INT_EN_A>;
883impl<'a, REG> RAMP_RISE_INT_EN_W<'a, REG>
884where
885 REG: crate::Writable + crate::RegisterSpec,
886{
887 #[doc = "`0`"]
888 #[inline(always)]
889 pub fn disable(self) -> &'a mut crate::W<REG> {
890 self.variant(RAMP_RISE_INT_EN_A::DISABLE)
891 }
892 #[doc = "`1`"]
893 #[inline(always)]
894 pub fn enable(self) -> &'a mut crate::W<REG> {
895 self.variant(RAMP_RISE_INT_EN_A::ENABLE)
896 }
897}
898impl R {
899 #[doc = "Bit 0 - Ramp Digital Enable"]
900 #[inline(always)]
901 pub fn rd_en(&self) -> RD_EN_R {
902 RD_EN_R::new((self.bits & 1) != 0)
903 }
904 #[doc = "Bit 1 - Ramp Manual Control Enable"]
905 #[inline(always)]
906 pub fn rmc_en(&self) -> RMC_EN_R {
907 RMC_EN_R::new(((self.bits >> 1) & 1) != 0)
908 }
909 #[doc = "Bit 2 - Ramp Manual Up Enable"]
910 #[inline(always)]
911 pub fn rmu_en(&self) -> RMU_EN_R {
912 RMU_EN_R::new(((self.bits >> 2) & 1) != 0)
913 }
914 #[doc = "Bit 3 - Ramp Manual Down Enable"]
915 #[inline(always)]
916 pub fn rmd_en(&self) -> RMD_EN_R {
917 RMD_EN_R::new(((self.bits >> 3) & 1) != 0)
918 }
919 #[doc = "Bits 4:6 - RK Frequency Gear, Control Ramp Rise/Fall Total Time\n\nRamp Rise/Fall Total Time = (Ramp Step/Ramp Clk Freq)*4096"]
920 #[inline(always)]
921 pub fn ramp_step(&self) -> RAMP_STEP_R {
922 RAMP_STEP_R::new(((self.bits >> 4) & 7) as u8)
923 }
924 #[doc = "Bits 8:9 - Gap Step"]
925 #[inline(always)]
926 pub fn gap_step(&self) -> GAP_STEP_R {
927 GAP_STEP_R::new(((self.bits >> 8) & 3) as u8)
928 }
929 #[doc = "Bits 12:14 - Ramp Hold Step\n\nRamp Hold Time = Ramp Hold Step/Ramp Clk Freq"]
930 #[inline(always)]
931 pub fn ramp_hold_step(&self) -> RAMP_HOLD_STEP_R {
932 RAMP_HOLD_STEP_R::new(((self.bits >> 12) & 7) as u8)
933 }
934 #[doc = "Bit 15 - Headphone Pullout Enable"]
935 #[inline(always)]
936 pub fn hp_pull_out_en(&self) -> HP_PULL_OUT_EN_R {
937 HP_PULL_OUT_EN_R::new(((self.bits >> 15) & 1) != 0)
938 }
939 #[doc = "Bits 16:20 - Analog Ramp Clk Div Freq Value : M (from 0 to 31, Default: 24).\n\nAna_Ramp_Clk= 24MHz/(M+1)\n\nDefault Ramp Clk Freq: 24MHz/(24+1)=960 kHz"]
940 #[inline(always)]
941 pub fn ramp_clk_div_m(&self) -> RAMP_CLK_DIV_M_R {
942 RAMP_CLK_DIV_M_R::new(((self.bits >> 16) & 0x1f) as u8)
943 }
944 #[doc = "Bit 24 - Ramp Soft Reset"]
945 #[inline(always)]
946 pub fn ramp_srst(&self) -> RAMP_SRST_R {
947 RAMP_SRST_R::new(((self.bits >> 24) & 1) != 0)
948 }
949 #[doc = "Bit 28 - RK Downward Decrease Finish and Rampen Pull Down Instruction"]
950 #[inline(always)]
951 pub fn ramp_fall_int(&self) -> RAMP_FALL_INT_R {
952 RAMP_FALL_INT_R::new(((self.bits >> 28) & 1) != 0)
953 }
954 #[doc = "Bit 29 - RAMP Fall Int Enable"]
955 #[inline(always)]
956 pub fn ramp_fall_int_en(&self) -> RAMP_FALL_INT_EN_R {
957 RAMP_FALL_INT_EN_R::new(((self.bits >> 29) & 1) != 0)
958 }
959 #[doc = "Bit 30 - RK Increase Upward Finish and Rampen Pull Down Instruction"]
960 #[inline(always)]
961 pub fn ramp_rise_int(&self) -> RAMP_RISE_INT_R {
962 RAMP_RISE_INT_R::new(((self.bits >> 30) & 1) != 0)
963 }
964 #[doc = "Bit 31 - RAMP Rise Interrupt Enable"]
965 #[inline(always)]
966 pub fn ramp_rise_int_en(&self) -> RAMP_RISE_INT_EN_R {
967 RAMP_RISE_INT_EN_R::new(((self.bits >> 31) & 1) != 0)
968 }
969}
970impl W {
971 #[doc = "Bit 0 - Ramp Digital Enable"]
972 #[inline(always)]
973 #[must_use]
974 pub fn rd_en(&mut self) -> RD_EN_W<RAMP_SPEC> {
975 RD_EN_W::new(self, 0)
976 }
977 #[doc = "Bit 1 - Ramp Manual Control Enable"]
978 #[inline(always)]
979 #[must_use]
980 pub fn rmc_en(&mut self) -> RMC_EN_W<RAMP_SPEC> {
981 RMC_EN_W::new(self, 1)
982 }
983 #[doc = "Bit 2 - Ramp Manual Up Enable"]
984 #[inline(always)]
985 #[must_use]
986 pub fn rmu_en(&mut self) -> RMU_EN_W<RAMP_SPEC> {
987 RMU_EN_W::new(self, 2)
988 }
989 #[doc = "Bit 3 - Ramp Manual Down Enable"]
990 #[inline(always)]
991 #[must_use]
992 pub fn rmd_en(&mut self) -> RMD_EN_W<RAMP_SPEC> {
993 RMD_EN_W::new(self, 3)
994 }
995 #[doc = "Bits 4:6 - RK Frequency Gear, Control Ramp Rise/Fall Total Time\n\nRamp Rise/Fall Total Time = (Ramp Step/Ramp Clk Freq)*4096"]
996 #[inline(always)]
997 #[must_use]
998 pub fn ramp_step(&mut self) -> RAMP_STEP_W<RAMP_SPEC> {
999 RAMP_STEP_W::new(self, 4)
1000 }
1001 #[doc = "Bits 8:9 - Gap Step"]
1002 #[inline(always)]
1003 #[must_use]
1004 pub fn gap_step(&mut self) -> GAP_STEP_W<RAMP_SPEC> {
1005 GAP_STEP_W::new(self, 8)
1006 }
1007 #[doc = "Bits 12:14 - Ramp Hold Step\n\nRamp Hold Time = Ramp Hold Step/Ramp Clk Freq"]
1008 #[inline(always)]
1009 #[must_use]
1010 pub fn ramp_hold_step(&mut self) -> RAMP_HOLD_STEP_W<RAMP_SPEC> {
1011 RAMP_HOLD_STEP_W::new(self, 12)
1012 }
1013 #[doc = "Bit 15 - Headphone Pullout Enable"]
1014 #[inline(always)]
1015 #[must_use]
1016 pub fn hp_pull_out_en(&mut self) -> HP_PULL_OUT_EN_W<RAMP_SPEC> {
1017 HP_PULL_OUT_EN_W::new(self, 15)
1018 }
1019 #[doc = "Bits 16:20 - Analog Ramp Clk Div Freq Value : M (from 0 to 31, Default: 24).\n\nAna_Ramp_Clk= 24MHz/(M+1)\n\nDefault Ramp Clk Freq: 24MHz/(24+1)=960 kHz"]
1020 #[inline(always)]
1021 #[must_use]
1022 pub fn ramp_clk_div_m(&mut self) -> RAMP_CLK_DIV_M_W<RAMP_SPEC> {
1023 RAMP_CLK_DIV_M_W::new(self, 16)
1024 }
1025 #[doc = "Bit 24 - Ramp Soft Reset"]
1026 #[inline(always)]
1027 #[must_use]
1028 pub fn ramp_srst(&mut self) -> RAMP_SRST_W<RAMP_SPEC> {
1029 RAMP_SRST_W::new(self, 24)
1030 }
1031 #[doc = "Bit 28 - RK Downward Decrease Finish and Rampen Pull Down Instruction"]
1032 #[inline(always)]
1033 #[must_use]
1034 pub fn ramp_fall_int(&mut self) -> RAMP_FALL_INT_W<RAMP_SPEC> {
1035 RAMP_FALL_INT_W::new(self, 28)
1036 }
1037 #[doc = "Bit 29 - RAMP Fall Int Enable"]
1038 #[inline(always)]
1039 #[must_use]
1040 pub fn ramp_fall_int_en(&mut self) -> RAMP_FALL_INT_EN_W<RAMP_SPEC> {
1041 RAMP_FALL_INT_EN_W::new(self, 29)
1042 }
1043 #[doc = "Bit 30 - RK Increase Upward Finish and Rampen Pull Down Instruction"]
1044 #[inline(always)]
1045 #[must_use]
1046 pub fn ramp_rise_int(&mut self) -> RAMP_RISE_INT_W<RAMP_SPEC> {
1047 RAMP_RISE_INT_W::new(self, 30)
1048 }
1049 #[doc = "Bit 31 - RAMP Rise Interrupt Enable"]
1050 #[inline(always)]
1051 #[must_use]
1052 pub fn ramp_rise_int_en(&mut self) -> RAMP_RISE_INT_EN_W<RAMP_SPEC> {
1053 RAMP_RISE_INT_EN_W::new(self, 31)
1054 }
1055 #[doc = r" Writes raw bits to the register."]
1056 #[doc = r""]
1057 #[doc = r" # Safety"]
1058 #[doc = r""]
1059 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
1060 #[inline(always)]
1061 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1062 self.bits = bits;
1063 self
1064 }
1065}
1066#[doc = "BIAS Analog Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ramp::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 [`ramp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1067pub struct RAMP_SPEC;
1068impl crate::RegisterSpec for RAMP_SPEC {
1069 type Ux = u32;
1070}
1071#[doc = "`read()` method returns [`ramp::R`](R) reader structure"]
1072impl crate::Readable for RAMP_SPEC {}
1073#[doc = "`write(|w| ..)` method takes [`ramp::W`](W) writer structure"]
1074impl crate::Writable for RAMP_SPEC {
1075 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1076 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
1077}
1078#[doc = "`reset()` method sets ramp to value 0"]
1079impl crate::Resettable for RAMP_SPEC {
1080 const RESET_VALUE: Self::Ux = 0;
1081}