esp32p4/lp_i2s0/
vad_conf.rs

1#[doc = "Register `VAD_CONF` reader"]
2pub type R = crate::R<VAD_CONF_SPEC>;
3#[doc = "Register `VAD_CONF` writer"]
4pub type W = crate::W<VAD_CONF_SPEC>;
5#[doc = "Field `VAD_EN` reader - VAD enable register"]
6pub type VAD_EN_R = crate::BitReader;
7#[doc = "Field `VAD_EN` writer - VAD enable register"]
8pub type VAD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `VAD_RESET` writer - VAD reset register"]
10pub type VAD_RESET_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `VAD_FORCE_START` writer - VAD force start register."]
12pub type VAD_FORCE_START_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - VAD enable register"]
15    #[inline(always)]
16    pub fn vad_en(&self) -> VAD_EN_R {
17        VAD_EN_R::new((self.bits & 1) != 0)
18    }
19}
20#[cfg(feature = "impl-register-debug")]
21impl core::fmt::Debug for R {
22    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
23        f.debug_struct("VAD_CONF")
24            .field("vad_en", &format_args!("{}", self.vad_en().bit()))
25            .finish()
26    }
27}
28#[cfg(feature = "impl-register-debug")]
29impl core::fmt::Debug for crate::generic::Reg<VAD_CONF_SPEC> {
30    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
31        core::fmt::Debug::fmt(&self.read(), f)
32    }
33}
34impl W {
35    #[doc = "Bit 0 - VAD enable register"]
36    #[inline(always)]
37    #[must_use]
38    pub fn vad_en(&mut self) -> VAD_EN_W<VAD_CONF_SPEC> {
39        VAD_EN_W::new(self, 0)
40    }
41    #[doc = "Bit 1 - VAD reset register"]
42    #[inline(always)]
43    #[must_use]
44    pub fn vad_reset(&mut self) -> VAD_RESET_W<VAD_CONF_SPEC> {
45        VAD_RESET_W::new(self, 1)
46    }
47    #[doc = "Bit 2 - VAD force start register."]
48    #[inline(always)]
49    #[must_use]
50    pub fn vad_force_start(&mut self) -> VAD_FORCE_START_W<VAD_CONF_SPEC> {
51        VAD_FORCE_START_W::new(self, 2)
52    }
53}
54#[doc = "I2S VAD Configure register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vad_conf::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 [`vad_conf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct VAD_CONF_SPEC;
56impl crate::RegisterSpec for VAD_CONF_SPEC {
57    type Ux = u32;
58}
59#[doc = "`read()` method returns [`vad_conf::R`](R) reader structure"]
60impl crate::Readable for VAD_CONF_SPEC {}
61#[doc = "`write(|w| ..)` method takes [`vad_conf::W`](W) writer structure"]
62impl crate::Writable for VAD_CONF_SPEC {
63    type Safety = crate::Unsafe;
64    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets VAD_CONF to value 0"]
68impl crate::Resettable for VAD_CONF_SPEC {
69    const RESET_VALUE: u32 = 0;
70}