esp32s2/gpio_sd/
sigmadelta.rs

1#[doc = "Register `SIGMADELTA%s` reader"]
2pub type R = crate::R<SIGMADELTA_SPEC>;
3#[doc = "Register `SIGMADELTA%s` writer"]
4pub type W = crate::W<SIGMADELTA_SPEC>;
5#[doc = "Field `IN` reader - This field is used to configure the duty cycle of sigma delta modulation output."]
6pub type IN_R = crate::FieldReader;
7#[doc = "Field `IN` writer - This field is used to configure the duty cycle of sigma delta modulation output."]
8pub type IN_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `PRESCALE` reader - This field is used to set a divider value to divide APB clock."]
10pub type PRESCALE_R = crate::FieldReader;
11#[doc = "Field `PRESCALE` writer - This field is used to set a divider value to divide APB clock."]
12pub type PRESCALE_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13impl R {
14    #[doc = "Bits 0:7 - This field is used to configure the duty cycle of sigma delta modulation output."]
15    #[inline(always)]
16    pub fn in_(&self) -> IN_R {
17        IN_R::new((self.bits & 0xff) as u8)
18    }
19    #[doc = "Bits 8:15 - This field is used to set a divider value to divide APB clock."]
20    #[inline(always)]
21    pub fn prescale(&self) -> PRESCALE_R {
22        PRESCALE_R::new(((self.bits >> 8) & 0xff) as u8)
23    }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("SIGMADELTA")
29            .field("in_", &self.in_())
30            .field("prescale", &self.prescale())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:7 - This field is used to configure the duty cycle of sigma delta modulation output."]
36    #[inline(always)]
37    pub fn in_(&mut self) -> IN_W<SIGMADELTA_SPEC> {
38        IN_W::new(self, 0)
39    }
40    #[doc = "Bits 8:15 - This field is used to set a divider value to divide APB clock."]
41    #[inline(always)]
42    pub fn prescale(&mut self) -> PRESCALE_W<SIGMADELTA_SPEC> {
43        PRESCALE_W::new(self, 8)
44    }
45}
46#[doc = "Duty-cycle configuration register of SDM%s\n\nYou can [`read`](crate::Reg::read) this register and get [`sigmadelta::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sigmadelta::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct SIGMADELTA_SPEC;
48impl crate::RegisterSpec for SIGMADELTA_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`sigmadelta::R`](R) reader structure"]
52impl crate::Readable for SIGMADELTA_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`sigmadelta::W`](W) writer structure"]
54impl crate::Writable for SIGMADELTA_SPEC {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets SIGMADELTA%s to value 0xff00"]
58impl crate::Resettable for SIGMADELTA_SPEC {
59    const RESET_VALUE: u32 = 0xff00;
60}