esp32s3/mcpwm0/
cap_status.rs

1#[doc = "Register `CAP_STATUS` reader"]
2pub type R = crate::R<CAP_STATUS_SPEC>;
3#[doc = "Field `CAP0_EDGE` reader - Edge of last capture trigger on channel 0, 0: posedge, 1: negedge"]
4pub type CAP0_EDGE_R = crate::BitReader;
5#[doc = "Field `CAP1_EDGE` reader - Edge of last capture trigger on channel 1, 0: posedge, 1: negedge"]
6pub type CAP1_EDGE_R = crate::BitReader;
7#[doc = "Field `CAP2_EDGE` reader - Edge of last capture trigger on channel 2, 0: posedge, 1: negedge"]
8pub type CAP2_EDGE_R = crate::BitReader;
9impl R {
10    #[doc = "Bit 0 - Edge of last capture trigger on channel 0, 0: posedge, 1: negedge"]
11    #[inline(always)]
12    pub fn cap0_edge(&self) -> CAP0_EDGE_R {
13        CAP0_EDGE_R::new((self.bits & 1) != 0)
14    }
15    #[doc = "Bit 1 - Edge of last capture trigger on channel 1, 0: posedge, 1: negedge"]
16    #[inline(always)]
17    pub fn cap1_edge(&self) -> CAP1_EDGE_R {
18        CAP1_EDGE_R::new(((self.bits >> 1) & 1) != 0)
19    }
20    #[doc = "Bit 2 - Edge of last capture trigger on channel 2, 0: posedge, 1: negedge"]
21    #[inline(always)]
22    pub fn cap2_edge(&self) -> CAP2_EDGE_R {
23        CAP2_EDGE_R::new(((self.bits >> 2) & 1) != 0)
24    }
25}
26#[cfg(feature = "impl-register-debug")]
27impl core::fmt::Debug for R {
28    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
29        f.debug_struct("CAP_STATUS")
30            .field("cap0_edge", &self.cap0_edge())
31            .field("cap1_edge", &self.cap1_edge())
32            .field("cap2_edge", &self.cap2_edge())
33            .finish()
34    }
35}
36#[doc = "Edge of last capture trigger\n\nYou can [`read`](crate::Reg::read) this register and get [`cap_status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct CAP_STATUS_SPEC;
38impl crate::RegisterSpec for CAP_STATUS_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`cap_status::R`](R) reader structure"]
42impl crate::Readable for CAP_STATUS_SPEC {}
43#[doc = "`reset()` method sets CAP_STATUS to value 0"]
44impl crate::Resettable for CAP_STATUS_SPEC {
45    const RESET_VALUE: u32 = 0;
46}