esp32h2/ledc/
ch_gamma_conf.rs

1#[doc = "Register `CH%s_GAMMA_CONF` reader"]
2pub type R = crate::R<CH_GAMMA_CONF_SPEC>;
3#[doc = "Register `CH%s_GAMMA_CONF` writer"]
4pub type W = crate::W<CH_GAMMA_CONF_SPEC>;
5#[doc = "Field `CH_GAMMA_ENTRY_NUM` reader - Ledc ch%s gamma entry num."]
6pub type CH_GAMMA_ENTRY_NUM_R = crate::FieldReader;
7#[doc = "Field `CH_GAMMA_ENTRY_NUM` writer - Ledc ch%s gamma entry num."]
8pub type CH_GAMMA_ENTRY_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `CH_GAMMA_PAUSE` writer - Ledc ch%s gamma pause, write 1 to pause."]
10pub type CH_GAMMA_PAUSE_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `CH_GAMMA_RESUME` writer - Ledc ch%s gamma resume, write 1 to resume."]
12pub type CH_GAMMA_RESUME_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bits 0:4 - Ledc ch%s gamma entry num."]
15    #[inline(always)]
16    pub fn ch_gamma_entry_num(&self) -> CH_GAMMA_ENTRY_NUM_R {
17        CH_GAMMA_ENTRY_NUM_R::new((self.bits & 0x1f) as u8)
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("CH_GAMMA_CONF")
24            .field("ch_gamma_entry_num", &self.ch_gamma_entry_num())
25            .finish()
26    }
27}
28impl W {
29    #[doc = "Bits 0:4 - Ledc ch%s gamma entry num."]
30    #[inline(always)]
31    pub fn ch_gamma_entry_num(&mut self) -> CH_GAMMA_ENTRY_NUM_W<CH_GAMMA_CONF_SPEC> {
32        CH_GAMMA_ENTRY_NUM_W::new(self, 0)
33    }
34    #[doc = "Bit 5 - Ledc ch%s gamma pause, write 1 to pause."]
35    #[inline(always)]
36    pub fn ch_gamma_pause(&mut self) -> CH_GAMMA_PAUSE_W<CH_GAMMA_CONF_SPEC> {
37        CH_GAMMA_PAUSE_W::new(self, 5)
38    }
39    #[doc = "Bit 6 - Ledc ch%s gamma resume, write 1 to resume."]
40    #[inline(always)]
41    pub fn ch_gamma_resume(&mut self) -> CH_GAMMA_RESUME_W<CH_GAMMA_CONF_SPEC> {
42        CH_GAMMA_RESUME_W::new(self, 6)
43    }
44}
45#[doc = "Ledc ch%s gamma config register.\n\nYou can [`read`](crate::Reg::read) this register and get [`ch_gamma_conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch_gamma_conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
46pub struct CH_GAMMA_CONF_SPEC;
47impl crate::RegisterSpec for CH_GAMMA_CONF_SPEC {
48    type Ux = u32;
49}
50#[doc = "`read()` method returns [`ch_gamma_conf::R`](R) reader structure"]
51impl crate::Readable for CH_GAMMA_CONF_SPEC {}
52#[doc = "`write(|w| ..)` method takes [`ch_gamma_conf::W`](W) writer structure"]
53impl crate::Writable for CH_GAMMA_CONF_SPEC {
54    type Safety = crate::Unsafe;
55}
56#[doc = "`reset()` method sets CH%s_GAMMA_CONF to value 0"]
57impl crate::Resettable for CH_GAMMA_CONF_SPEC {}