esp32c3/usb_device/
in_ep1_st.rs

1#[doc = "Register `IN_EP1_ST` reader"]
2pub type R = crate::R<IN_EP1_ST_SPEC>;
3#[doc = "Field `IN_EP1_STATE` reader - State of IN Endpoint 1."]
4pub type IN_EP1_STATE_R = crate::FieldReader;
5#[doc = "Field `IN_EP1_WR_ADDR` reader - Write data address of IN endpoint 1."]
6pub type IN_EP1_WR_ADDR_R = crate::FieldReader;
7#[doc = "Field `IN_EP1_RD_ADDR` reader - Read data address of IN endpoint 1."]
8pub type IN_EP1_RD_ADDR_R = crate::FieldReader;
9impl R {
10    #[doc = "Bits 0:1 - State of IN Endpoint 1."]
11    #[inline(always)]
12    pub fn in_ep1_state(&self) -> IN_EP1_STATE_R {
13        IN_EP1_STATE_R::new((self.bits & 3) as u8)
14    }
15    #[doc = "Bits 2:8 - Write data address of IN endpoint 1."]
16    #[inline(always)]
17    pub fn in_ep1_wr_addr(&self) -> IN_EP1_WR_ADDR_R {
18        IN_EP1_WR_ADDR_R::new(((self.bits >> 2) & 0x7f) as u8)
19    }
20    #[doc = "Bits 9:15 - Read data address of IN endpoint 1."]
21    #[inline(always)]
22    pub fn in_ep1_rd_addr(&self) -> IN_EP1_RD_ADDR_R {
23        IN_EP1_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_EP1_ST")
30            .field("in_ep1_state", &self.in_ep1_state())
31            .field("in_ep1_wr_addr", &self.in_ep1_wr_addr())
32            .field("in_ep1_rd_addr", &self.in_ep1_rd_addr())
33            .finish()
34    }
35}
36#[doc = "USB_DEVICE_IN_EP1_ST_REG.\n\nYou can [`read`](crate::Reg::read) this register and get [`in_ep1_st::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct IN_EP1_ST_SPEC;
38impl crate::RegisterSpec for IN_EP1_ST_SPEC {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`in_ep1_st::R`](R) reader structure"]
42impl crate::Readable for IN_EP1_ST_SPEC {}
43#[doc = "`reset()` method sets IN_EP1_ST to value 0x01"]
44impl crate::Resettable for IN_EP1_ST_SPEC {
45    const RESET_VALUE: u32 = 0x01;
46}