esp32p4/usb_device/
int_st.rs

1#[doc = "Register `INT_ST` reader"]
2pub type R = crate::R<INT_ST_SPEC>;
3#[doc = "Field `JTAG_IN_FLUSH` reader - The raw interrupt status bit for the USB_DEVICE_JTAG_IN_FLUSH_INT interrupt."]
4pub type JTAG_IN_FLUSH_R = crate::BitReader;
5#[doc = "Field `SOF` reader - The raw interrupt status bit for the USB_DEVICE_SOF_INT interrupt."]
6pub type SOF_R = crate::BitReader;
7#[doc = "Field `SERIAL_OUT_RECV_PKT` reader - The raw interrupt status bit for the USB_DEVICE_SERIAL_OUT_RECV_PKT_INT interrupt."]
8pub type SERIAL_OUT_RECV_PKT_R = crate::BitReader;
9#[doc = "Field `SERIAL_IN_EMPTY` reader - The raw interrupt status bit for the USB_DEVICE_SERIAL_IN_EMPTY_INT interrupt."]
10pub type SERIAL_IN_EMPTY_R = crate::BitReader;
11#[doc = "Field `PID_ERR` reader - The raw interrupt status bit for the USB_DEVICE_PID_ERR_INT interrupt."]
12pub type PID_ERR_R = crate::BitReader;
13#[doc = "Field `CRC5_ERR` reader - The raw interrupt status bit for the USB_DEVICE_CRC5_ERR_INT interrupt."]
14pub type CRC5_ERR_R = crate::BitReader;
15#[doc = "Field `CRC16_ERR` reader - The raw interrupt status bit for the USB_DEVICE_CRC16_ERR_INT interrupt."]
16pub type CRC16_ERR_R = crate::BitReader;
17#[doc = "Field `STUFF_ERR` reader - The raw interrupt status bit for the USB_DEVICE_STUFF_ERR_INT interrupt."]
18pub type STUFF_ERR_R = crate::BitReader;
19#[doc = "Field `IN_TOKEN_REC_IN_EP1` reader - The raw interrupt status bit for the USB_DEVICE_IN_TOKEN_REC_IN_EP1_INT interrupt."]
20pub type IN_TOKEN_REC_IN_EP1_R = crate::BitReader;
21#[doc = "Field `USB_BUS_RESET` reader - The raw interrupt status bit for the USB_DEVICE_USB_BUS_RESET_INT interrupt."]
22pub type USB_BUS_RESET_R = crate::BitReader;
23#[doc = "Field `OUT_EP1_ZERO_PAYLOAD` reader - The raw interrupt status bit for the USB_DEVICE_OUT_EP1_ZERO_PAYLOAD_INT interrupt."]
24pub type OUT_EP1_ZERO_PAYLOAD_R = crate::BitReader;
25#[doc = "Field `OUT_EP2_ZERO_PAYLOAD` reader - The raw interrupt status bit for the USB_DEVICE_OUT_EP2_ZERO_PAYLOAD_INT interrupt."]
26pub type OUT_EP2_ZERO_PAYLOAD_R = crate::BitReader;
27#[doc = "Field `RTS_CHG` reader - The raw interrupt status bit for the USB_DEVICE_RTS_CHG_INT interrupt."]
28pub type RTS_CHG_R = crate::BitReader;
29#[doc = "Field `DTR_CHG` reader - The raw interrupt status bit for the USB_DEVICE_DTR_CHG_INT interrupt."]
30pub type DTR_CHG_R = crate::BitReader;
31#[doc = "Field `GET_LINE_CODE` reader - The raw interrupt status bit for the USB_DEVICE_GET_LINE_CODE_INT interrupt."]
32pub type GET_LINE_CODE_R = crate::BitReader;
33#[doc = "Field `SET_LINE_CODE` reader - The raw interrupt status bit for the USB_DEVICE_SET_LINE_CODE_INT interrupt."]
34pub type SET_LINE_CODE_R = crate::BitReader;
35impl R {
36    #[doc = "Bit 0 - The raw interrupt status bit for the USB_DEVICE_JTAG_IN_FLUSH_INT interrupt."]
37    #[inline(always)]
38    pub fn jtag_in_flush(&self) -> JTAG_IN_FLUSH_R {
39        JTAG_IN_FLUSH_R::new((self.bits & 1) != 0)
40    }
41    #[doc = "Bit 1 - The raw interrupt status bit for the USB_DEVICE_SOF_INT interrupt."]
42    #[inline(always)]
43    pub fn sof(&self) -> SOF_R {
44        SOF_R::new(((self.bits >> 1) & 1) != 0)
45    }
46    #[doc = "Bit 2 - The raw interrupt status bit for the USB_DEVICE_SERIAL_OUT_RECV_PKT_INT interrupt."]
47    #[inline(always)]
48    pub fn serial_out_recv_pkt(&self) -> SERIAL_OUT_RECV_PKT_R {
49        SERIAL_OUT_RECV_PKT_R::new(((self.bits >> 2) & 1) != 0)
50    }
51    #[doc = "Bit 3 - The raw interrupt status bit for the USB_DEVICE_SERIAL_IN_EMPTY_INT interrupt."]
52    #[inline(always)]
53    pub fn serial_in_empty(&self) -> SERIAL_IN_EMPTY_R {
54        SERIAL_IN_EMPTY_R::new(((self.bits >> 3) & 1) != 0)
55    }
56    #[doc = "Bit 4 - The raw interrupt status bit for the USB_DEVICE_PID_ERR_INT interrupt."]
57    #[inline(always)]
58    pub fn pid_err(&self) -> PID_ERR_R {
59        PID_ERR_R::new(((self.bits >> 4) & 1) != 0)
60    }
61    #[doc = "Bit 5 - The raw interrupt status bit for the USB_DEVICE_CRC5_ERR_INT interrupt."]
62    #[inline(always)]
63    pub fn crc5_err(&self) -> CRC5_ERR_R {
64        CRC5_ERR_R::new(((self.bits >> 5) & 1) != 0)
65    }
66    #[doc = "Bit 6 - The raw interrupt status bit for the USB_DEVICE_CRC16_ERR_INT interrupt."]
67    #[inline(always)]
68    pub fn crc16_err(&self) -> CRC16_ERR_R {
69        CRC16_ERR_R::new(((self.bits >> 6) & 1) != 0)
70    }
71    #[doc = "Bit 7 - The raw interrupt status bit for the USB_DEVICE_STUFF_ERR_INT interrupt."]
72    #[inline(always)]
73    pub fn stuff_err(&self) -> STUFF_ERR_R {
74        STUFF_ERR_R::new(((self.bits >> 7) & 1) != 0)
75    }
76    #[doc = "Bit 8 - The raw interrupt status bit for the USB_DEVICE_IN_TOKEN_REC_IN_EP1_INT interrupt."]
77    #[inline(always)]
78    pub fn in_token_rec_in_ep1(&self) -> IN_TOKEN_REC_IN_EP1_R {
79        IN_TOKEN_REC_IN_EP1_R::new(((self.bits >> 8) & 1) != 0)
80    }
81    #[doc = "Bit 9 - The raw interrupt status bit for the USB_DEVICE_USB_BUS_RESET_INT interrupt."]
82    #[inline(always)]
83    pub fn usb_bus_reset(&self) -> USB_BUS_RESET_R {
84        USB_BUS_RESET_R::new(((self.bits >> 9) & 1) != 0)
85    }
86    #[doc = "Bit 10 - The raw interrupt status bit for the USB_DEVICE_OUT_EP1_ZERO_PAYLOAD_INT interrupt."]
87    #[inline(always)]
88    pub fn out_ep1_zero_payload(&self) -> OUT_EP1_ZERO_PAYLOAD_R {
89        OUT_EP1_ZERO_PAYLOAD_R::new(((self.bits >> 10) & 1) != 0)
90    }
91    #[doc = "Bit 11 - The raw interrupt status bit for the USB_DEVICE_OUT_EP2_ZERO_PAYLOAD_INT interrupt."]
92    #[inline(always)]
93    pub fn out_ep2_zero_payload(&self) -> OUT_EP2_ZERO_PAYLOAD_R {
94        OUT_EP2_ZERO_PAYLOAD_R::new(((self.bits >> 11) & 1) != 0)
95    }
96    #[doc = "Bit 12 - The raw interrupt status bit for the USB_DEVICE_RTS_CHG_INT interrupt."]
97    #[inline(always)]
98    pub fn rts_chg(&self) -> RTS_CHG_R {
99        RTS_CHG_R::new(((self.bits >> 12) & 1) != 0)
100    }
101    #[doc = "Bit 13 - The raw interrupt status bit for the USB_DEVICE_DTR_CHG_INT interrupt."]
102    #[inline(always)]
103    pub fn dtr_chg(&self) -> DTR_CHG_R {
104        DTR_CHG_R::new(((self.bits >> 13) & 1) != 0)
105    }
106    #[doc = "Bit 14 - The raw interrupt status bit for the USB_DEVICE_GET_LINE_CODE_INT interrupt."]
107    #[inline(always)]
108    pub fn get_line_code(&self) -> GET_LINE_CODE_R {
109        GET_LINE_CODE_R::new(((self.bits >> 14) & 1) != 0)
110    }
111    #[doc = "Bit 15 - The raw interrupt status bit for the USB_DEVICE_SET_LINE_CODE_INT interrupt."]
112    #[inline(always)]
113    pub fn set_line_code(&self) -> SET_LINE_CODE_R {
114        SET_LINE_CODE_R::new(((self.bits >> 15) & 1) != 0)
115    }
116}
117#[cfg(feature = "impl-register-debug")]
118impl core::fmt::Debug for R {
119    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
120        f.debug_struct("INT_ST")
121            .field(
122                "jtag_in_flush",
123                &format_args!("{}", self.jtag_in_flush().bit()),
124            )
125            .field("sof", &format_args!("{}", self.sof().bit()))
126            .field(
127                "serial_out_recv_pkt",
128                &format_args!("{}", self.serial_out_recv_pkt().bit()),
129            )
130            .field(
131                "serial_in_empty",
132                &format_args!("{}", self.serial_in_empty().bit()),
133            )
134            .field("pid_err", &format_args!("{}", self.pid_err().bit()))
135            .field("crc5_err", &format_args!("{}", self.crc5_err().bit()))
136            .field("crc16_err", &format_args!("{}", self.crc16_err().bit()))
137            .field("stuff_err", &format_args!("{}", self.stuff_err().bit()))
138            .field(
139                "in_token_rec_in_ep1",
140                &format_args!("{}", self.in_token_rec_in_ep1().bit()),
141            )
142            .field(
143                "usb_bus_reset",
144                &format_args!("{}", self.usb_bus_reset().bit()),
145            )
146            .field(
147                "out_ep1_zero_payload",
148                &format_args!("{}", self.out_ep1_zero_payload().bit()),
149            )
150            .field(
151                "out_ep2_zero_payload",
152                &format_args!("{}", self.out_ep2_zero_payload().bit()),
153            )
154            .field("rts_chg", &format_args!("{}", self.rts_chg().bit()))
155            .field("dtr_chg", &format_args!("{}", self.dtr_chg().bit()))
156            .field(
157                "get_line_code",
158                &format_args!("{}", self.get_line_code().bit()),
159            )
160            .field(
161                "set_line_code",
162                &format_args!("{}", self.set_line_code().bit()),
163            )
164            .finish()
165    }
166}
167#[cfg(feature = "impl-register-debug")]
168impl core::fmt::Debug for crate::generic::Reg<INT_ST_SPEC> {
169    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
170        core::fmt::Debug::fmt(&self.read(), f)
171    }
172}
173#[doc = "Interrupt status register.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`int_st::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
174pub struct INT_ST_SPEC;
175impl crate::RegisterSpec for INT_ST_SPEC {
176    type Ux = u32;
177}
178#[doc = "`read()` method returns [`int_st::R`](R) reader structure"]
179impl crate::Readable for INT_ST_SPEC {}
180#[doc = "`reset()` method sets INT_ST to value 0"]
181impl crate::Resettable for INT_ST_SPEC {
182    const RESET_VALUE: u32 = 0;
183}