esp32p4/ledc/
ch_gamma_conf.rs1#[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 - Configures the number of duty cycle fading rages for LEDC ch%s."]
6pub type CH_GAMMA_ENTRY_NUM_R = crate::FieldReader;
7#[doc = "Field `CH_GAMMA_ENTRY_NUM` writer - Configures the number of duty cycle fading rages for LEDC ch%s."]
8pub type CH_GAMMA_ENTRY_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `CH_GAMMA_PAUSE` writer - Configures whether or not to pause duty cycle fading of LEDC ch%s.\\\\0: Invalid. No effect\\\\1: Pause"]
10pub type CH_GAMMA_PAUSE_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `CH_GAMMA_RESUME` writer - Configures whether or nor to resume duty cycle fading of LEDC ch%s.\\\\0: Invalid. No effect\\\\1: Resume"]
12pub type CH_GAMMA_RESUME_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 #[doc = "Bits 0:4 - Configures the number of duty cycle fading rages for LEDC ch%s."]
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(
25 "ch_gamma_entry_num",
26 &format_args!("{}", self.ch_gamma_entry_num().bits()),
27 )
28 .finish()
29 }
30}
31#[cfg(feature = "impl-register-debug")]
32impl core::fmt::Debug for crate::generic::Reg<CH_GAMMA_CONF_SPEC> {
33 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
34 core::fmt::Debug::fmt(&self.read(), f)
35 }
36}
37impl W {
38 #[doc = "Bits 0:4 - Configures the number of duty cycle fading rages for LEDC ch%s."]
39 #[inline(always)]
40 #[must_use]
41 pub fn ch_gamma_entry_num(&mut self) -> CH_GAMMA_ENTRY_NUM_W<CH_GAMMA_CONF_SPEC> {
42 CH_GAMMA_ENTRY_NUM_W::new(self, 0)
43 }
44 #[doc = "Bit 5 - Configures whether or not to pause duty cycle fading of LEDC ch%s.\\\\0: Invalid. No effect\\\\1: Pause"]
45 #[inline(always)]
46 #[must_use]
47 pub fn ch_gamma_pause(&mut self) -> CH_GAMMA_PAUSE_W<CH_GAMMA_CONF_SPEC> {
48 CH_GAMMA_PAUSE_W::new(self, 5)
49 }
50 #[doc = "Bit 6 - Configures whether or nor to resume duty cycle fading of LEDC ch%s.\\\\0: Invalid. No effect\\\\1: Resume"]
51 #[inline(always)]
52 #[must_use]
53 pub fn ch_gamma_resume(&mut self) -> CH_GAMMA_RESUME_W<CH_GAMMA_CONF_SPEC> {
54 CH_GAMMA_RESUME_W::new(self, 6)
55 }
56}
57#[doc = "Ledc ch%s gamma config register.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ch_gamma_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 [`ch_gamma_conf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
58pub struct CH_GAMMA_CONF_SPEC;
59impl crate::RegisterSpec for CH_GAMMA_CONF_SPEC {
60 type Ux = u32;
61}
62#[doc = "`read()` method returns [`ch_gamma_conf::R`](R) reader structure"]
63impl crate::Readable for CH_GAMMA_CONF_SPEC {}
64#[doc = "`write(|w| ..)` method takes [`ch_gamma_conf::W`](W) writer structure"]
65impl crate::Writable for CH_GAMMA_CONF_SPEC {
66 type Safety = crate::Unsafe;
67 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
68 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
69}
70#[doc = "`reset()` method sets CH%s_GAMMA_CONF to value 0"]
71impl crate::Resettable for CH_GAMMA_CONF_SPEC {
72 const RESET_VALUE: u32 = 0;
73}