esp32p4/usb_device/
in_ep2_st.rs

1#[doc = "Register `IN_EP2_ST` reader"]
2pub type R = crate::R<IN_EP2_ST_SPEC>;
3#[doc = "Field `IN_EP2_STATE` reader - State of IN Endpoint 2."]
4pub type IN_EP2_STATE_R = crate::FieldReader;
5#[doc = "Field `IN_EP2_WR_ADDR` reader - Write data address of IN endpoint 2."]
6pub type IN_EP2_WR_ADDR_R = crate::FieldReader;
7#[doc = "Field `IN_EP2_RD_ADDR` reader - Read data address of IN endpoint 2."]
8pub type IN_EP2_RD_ADDR_R = crate::FieldReader;
9impl R {
10    #[doc = "Bits 0:1 - State of IN Endpoint 2."]
11    #[inline(always)]
12    pub fn in_ep2_state(&self) -> IN_EP2_STATE_R {
13        IN_EP2_STATE_R::new((self.bits & 3) as u8)
14    }
15    #[doc = "Bits 2:8 - Write data address of IN endpoint 2."]
16    #[inline(always)]
17    pub fn in_ep2_wr_addr(&self) -> IN_EP2_WR_ADDR_R {
18        IN_EP2_WR_ADDR_R::new(((self.bits >> 2) & 0x7f) as u8)
19    }
20    #[doc = "Bits 9:15 - Read data address of IN endpoint 2."]
21    #[inline(always)]
22    pub fn in_ep2_rd_addr(&self) -> IN_EP2_RD_ADDR_R {
23        IN_EP2_RD_ADDR_R::new(((self.bits >> 9) & 0x7f) as u8)
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("IN_EP2_ST")
30            .field(
31                "in_ep2_state",
32                &format_args!("{}", self.in_ep2_state().bits()),
33            )
34            .field(
35                "in_ep2_wr_addr",
36                &format_args!("{}", self.in_ep2_wr_addr().bits()),
37            )
38            .field(
39                "in_ep2_rd_addr",
40                &format_args!("{}", self.in_ep2_rd_addr().bits()),
41            )
42            .finish()
43    }
44}
45#[cfg(feature = "impl-register-debug")]
46impl core::fmt::Debug for crate::generic::Reg<IN_EP2_ST_SPEC> {
47    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
48        core::fmt::Debug::fmt(&self.read(), f)
49    }
50}
51#[doc = "CDC-ACM interrupt IN endpoint status information.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_ep2_st::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
52pub struct IN_EP2_ST_SPEC;
53impl crate::RegisterSpec for IN_EP2_ST_SPEC {
54    type Ux = u32;
55}
56#[doc = "`read()` method returns [`in_ep2_st::R`](R) reader structure"]
57impl crate::Readable for IN_EP2_ST_SPEC {}
58#[doc = "`reset()` method sets IN_EP2_ST to value 0x01"]
59impl crate::Resettable for IN_EP2_ST_SPEC {
60    const RESET_VALUE: u32 = 0x01;
61}