esp32p4/ledc/timer/
value.rs

1#[doc = "Register `VALUE` reader"]
2pub type R = crate::R<VALUE_SPEC>;
3#[doc = "Field `CNT` reader - Represents the current counter value of timer %s."]
4pub type CNT_R = crate::FieldReader<u32>;
5impl R {
6    #[doc = "Bits 0:19 - Represents the current counter value of timer %s."]
7    #[inline(always)]
8    pub fn cnt(&self) -> CNT_R {
9        CNT_R::new(self.bits & 0x000f_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("VALUE")
16            .field("cnt", &format_args!("{}", self.cnt().bits()))
17            .finish()
18    }
19}
20#[cfg(feature = "impl-register-debug")]
21impl core::fmt::Debug for crate::generic::Reg<VALUE_SPEC> {
22    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
23        core::fmt::Debug::fmt(&self.read(), f)
24    }
25}
26#[doc = "Timer 0 current counter value register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`value::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
27pub struct VALUE_SPEC;
28impl crate::RegisterSpec for VALUE_SPEC {
29    type Ux = u32;
30}
31#[doc = "`read()` method returns [`value::R`](R) reader structure"]
32impl crate::Readable for VALUE_SPEC {}
33#[doc = "`reset()` method sets VALUE to value 0"]
34impl crate::Resettable for VALUE_SPEC {
35    const RESET_VALUE: u32 = 0;
36}