esp32p4/mcpwm0/timer/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<STATUS_SPEC>;
3#[doc = "Field `VALUE` reader - Represents current PWM timer%s counter value."]
4pub type VALUE_R = crate::FieldReader<u16>;
5#[doc = "Field `DIRECTION` reader - Represents current PWM timer%s counter direction.\\\\0: Increment\\\\1: Decrement"]
6pub type DIRECTION_R = crate::BitReader;
7impl R {
8    #[doc = "Bits 0:15 - Represents current PWM timer%s counter value."]
9    #[inline(always)]
10    pub fn value(&self) -> VALUE_R {
11        VALUE_R::new((self.bits & 0xffff) as u16)
12    }
13    #[doc = "Bit 16 - Represents current PWM timer%s counter direction.\\\\0: Increment\\\\1: Decrement"]
14    #[inline(always)]
15    pub fn direction(&self) -> DIRECTION_R {
16        DIRECTION_R::new(((self.bits >> 16) & 1) != 0)
17    }
18}
19#[cfg(feature = "impl-register-debug")]
20impl core::fmt::Debug for R {
21    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
22        f.debug_struct("STATUS")
23            .field("value", &format_args!("{}", self.value().bits()))
24            .field("direction", &format_args!("{}", self.direction().bit()))
25            .finish()
26    }
27}
28#[cfg(feature = "impl-register-debug")]
29impl core::fmt::Debug for crate::generic::Reg<STATUS_SPEC> {
30    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
31        core::fmt::Debug::fmt(&self.read(), f)
32    }
33}
34#[doc = "PWM timer0 status register.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
35pub struct STATUS_SPEC;
36impl crate::RegisterSpec for STATUS_SPEC {
37    type Ux = u32;
38}
39#[doc = "`read()` method returns [`status::R`](R) reader structure"]
40impl crate::Readable for STATUS_SPEC {}
41#[doc = "`reset()` method sets STATUS to value 0"]
42impl crate::Resettable for STATUS_SPEC {
43    const RESET_VALUE: u32 = 0;
44}