esp32/i2s0/
cvsd_conf2.rs

1#[doc = "Register `CVSD_CONF2` reader"]
2pub type R = crate::R<CVSD_CONF2_SPEC>;
3#[doc = "Register `CVSD_CONF2` writer"]
4pub type W = crate::W<CVSD_CONF2_SPEC>;
5#[doc = "Field `CVSD_K` reader - "]
6pub type CVSD_K_R = crate::FieldReader;
7#[doc = "Field `CVSD_K` writer - "]
8pub type CVSD_K_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `CVSD_J` reader - "]
10pub type CVSD_J_R = crate::FieldReader;
11#[doc = "Field `CVSD_J` writer - "]
12pub type CVSD_J_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13#[doc = "Field `CVSD_BETA` reader - "]
14pub type CVSD_BETA_R = crate::FieldReader<u16>;
15#[doc = "Field `CVSD_BETA` writer - "]
16pub type CVSD_BETA_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
17#[doc = "Field `CVSD_H` reader - "]
18pub type CVSD_H_R = crate::FieldReader;
19#[doc = "Field `CVSD_H` writer - "]
20pub type CVSD_H_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
21impl R {
22    #[doc = "Bits 0:2"]
23    #[inline(always)]
24    pub fn cvsd_k(&self) -> CVSD_K_R {
25        CVSD_K_R::new((self.bits & 7) as u8)
26    }
27    #[doc = "Bits 3:5"]
28    #[inline(always)]
29    pub fn cvsd_j(&self) -> CVSD_J_R {
30        CVSD_J_R::new(((self.bits >> 3) & 7) as u8)
31    }
32    #[doc = "Bits 6:15"]
33    #[inline(always)]
34    pub fn cvsd_beta(&self) -> CVSD_BETA_R {
35        CVSD_BETA_R::new(((self.bits >> 6) & 0x03ff) as u16)
36    }
37    #[doc = "Bits 16:18"]
38    #[inline(always)]
39    pub fn cvsd_h(&self) -> CVSD_H_R {
40        CVSD_H_R::new(((self.bits >> 16) & 7) as u8)
41    }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46        f.debug_struct("CVSD_CONF2")
47            .field("cvsd_k", &self.cvsd_k())
48            .field("cvsd_j", &self.cvsd_j())
49            .field("cvsd_beta", &self.cvsd_beta())
50            .field("cvsd_h", &self.cvsd_h())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bits 0:2"]
56    #[inline(always)]
57    pub fn cvsd_k(&mut self) -> CVSD_K_W<CVSD_CONF2_SPEC> {
58        CVSD_K_W::new(self, 0)
59    }
60    #[doc = "Bits 3:5"]
61    #[inline(always)]
62    pub fn cvsd_j(&mut self) -> CVSD_J_W<CVSD_CONF2_SPEC> {
63        CVSD_J_W::new(self, 3)
64    }
65    #[doc = "Bits 6:15"]
66    #[inline(always)]
67    pub fn cvsd_beta(&mut self) -> CVSD_BETA_W<CVSD_CONF2_SPEC> {
68        CVSD_BETA_W::new(self, 6)
69    }
70    #[doc = "Bits 16:18"]
71    #[inline(always)]
72    pub fn cvsd_h(&mut self) -> CVSD_H_W<CVSD_CONF2_SPEC> {
73        CVSD_H_W::new(self, 16)
74    }
75}
76#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`cvsd_conf2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cvsd_conf2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct CVSD_CONF2_SPEC;
78impl crate::RegisterSpec for CVSD_CONF2_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`cvsd_conf2::R`](R) reader structure"]
82impl crate::Readable for CVSD_CONF2_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`cvsd_conf2::W`](W) writer structure"]
84impl crate::Writable for CVSD_CONF2_SPEC {
85    type Safety = crate::Unsafe;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets CVSD_CONF2 to value 0x0005_02a4"]
90impl crate::Resettable for CVSD_CONF2_SPEC {
91    const RESET_VALUE: u32 = 0x0005_02a4;
92}