esp32c3/ledc/ch/
duty_r.rs

1#[doc = "Register `DUTY_R` reader"]
2pub type R = crate::R<DUTY_R_SPEC>;
3#[doc = "Field `DUTY_R` reader - reg_duty_lsch0_r."]
4pub type DUTY_R_R = crate::FieldReader<u32>;
5impl R {
6    #[doc = "Bits 0:18 - reg_duty_lsch0_r."]
7    #[inline(always)]
8    pub fn duty_r(&self) -> DUTY_R_R {
9        DUTY_R_R::new(self.bits & 0x0007_ffff)
10    }
11}
12#[cfg(feature = "impl-register-debug")]
13impl core::fmt::Debug for R {
14    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
15        f.debug_struct("DUTY_R")
16            .field("duty_r", &self.duty_r())
17            .finish()
18    }
19}
20#[doc = "LEDC_LSCH0_DUTY_R.\n\nYou can [`read`](crate::Reg::read) this register and get [`duty_r::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
21pub struct DUTY_R_SPEC;
22impl crate::RegisterSpec for DUTY_R_SPEC {
23    type Ux = u32;
24}
25#[doc = "`read()` method returns [`duty_r::R`](R) reader structure"]
26impl crate::Readable for DUTY_R_SPEC {}
27#[doc = "`reset()` method sets DUTY_R to value 0"]
28impl crate::Resettable for DUTY_R_SPEC {
29    const RESET_VALUE: u32 = 0;
30}