d1_pac/ledc/
led_t01_timing_ctrl.rs

1#[doc = "Register `led_t01_timing_ctrl` reader"]
2pub type R = crate::R<LED_T01_TIMING_CTRL_SPEC>;
3#[doc = "Register `led_t01_timing_ctrl` writer"]
4pub type W = crate::W<LED_T01_TIMING_CTRL_SPEC>;
5#[doc = "Field `t0l_time` reader - "]
6pub type T0L_TIME_R = crate::FieldReader;
7#[doc = "Field `t0l_time` writer - "]
8pub type T0L_TIME_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `t0h_time` reader - "]
10pub type T0H_TIME_R = crate::FieldReader;
11#[doc = "Field `t0h_time` writer - "]
12pub type T0H_TIME_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 5>;
13#[doc = "Field `t1l_time` reader - "]
14pub type T1L_TIME_R = crate::FieldReader;
15#[doc = "Field `t1l_time` writer - "]
16pub type T1L_TIME_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 5>;
17#[doc = "Field `t1h_time` reader - "]
18pub type T1H_TIME_R = crate::FieldReader;
19#[doc = "Field `t1h_time` writer - "]
20pub type T1H_TIME_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 6>;
21impl R {
22    #[doc = "Bits 0:5"]
23    #[inline(always)]
24    pub fn t0l_time(&self) -> T0L_TIME_R {
25        T0L_TIME_R::new((self.bits & 0x3f) as u8)
26    }
27    #[doc = "Bits 6:10"]
28    #[inline(always)]
29    pub fn t0h_time(&self) -> T0H_TIME_R {
30        T0H_TIME_R::new(((self.bits >> 6) & 0x1f) as u8)
31    }
32    #[doc = "Bits 16:20"]
33    #[inline(always)]
34    pub fn t1l_time(&self) -> T1L_TIME_R {
35        T1L_TIME_R::new(((self.bits >> 16) & 0x1f) as u8)
36    }
37    #[doc = "Bits 21:26"]
38    #[inline(always)]
39    pub fn t1h_time(&self) -> T1H_TIME_R {
40        T1H_TIME_R::new(((self.bits >> 21) & 0x3f) as u8)
41    }
42}
43impl W {
44    #[doc = "Bits 0:5"]
45    #[inline(always)]
46    #[must_use]
47    pub fn t0l_time(&mut self) -> T0L_TIME_W<LED_T01_TIMING_CTRL_SPEC> {
48        T0L_TIME_W::new(self, 0)
49    }
50    #[doc = "Bits 6:10"]
51    #[inline(always)]
52    #[must_use]
53    pub fn t0h_time(&mut self) -> T0H_TIME_W<LED_T01_TIMING_CTRL_SPEC> {
54        T0H_TIME_W::new(self, 6)
55    }
56    #[doc = "Bits 16:20"]
57    #[inline(always)]
58    #[must_use]
59    pub fn t1l_time(&mut self) -> T1L_TIME_W<LED_T01_TIMING_CTRL_SPEC> {
60        T1L_TIME_W::new(self, 16)
61    }
62    #[doc = "Bits 21:26"]
63    #[inline(always)]
64    #[must_use]
65    pub fn t1h_time(&mut self) -> T1H_TIME_W<LED_T01_TIMING_CTRL_SPEC> {
66        T1H_TIME_W::new(self, 21)
67    }
68    #[doc = r" Writes raw bits to the register."]
69    #[doc = r""]
70    #[doc = r" # Safety"]
71    #[doc = r""]
72    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
73    #[inline(always)]
74    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
75        self.bits = bits;
76        self
77    }
78}
79#[doc = "LEDC T0 T1 Timing Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`led_t01_timing_ctrl::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 [`led_t01_timing_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
80pub struct LED_T01_TIMING_CTRL_SPEC;
81impl crate::RegisterSpec for LED_T01_TIMING_CTRL_SPEC {
82    type Ux = u32;
83}
84#[doc = "`read()` method returns [`led_t01_timing_ctrl::R`](R) reader structure"]
85impl crate::Readable for LED_T01_TIMING_CTRL_SPEC {}
86#[doc = "`write(|w| ..)` method takes [`led_t01_timing_ctrl::W`](W) writer structure"]
87impl crate::Writable for LED_T01_TIMING_CTRL_SPEC {
88    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
89    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
90}
91#[doc = "`reset()` method sets led_t01_timing_ctrl to value 0"]
92impl crate::Resettable for LED_T01_TIMING_CTRL_SPEC {
93    const RESET_VALUE: Self::Ux = 0;
94}