esp32c3/usb_device/
int_ena.rs1#[doc = "Register `INT_ENA` reader"]
2pub type R = crate::R<INT_ENA_SPEC>;
3#[doc = "Register `INT_ENA` writer"]
4pub type W = crate::W<INT_ENA_SPEC>;
5#[doc = "Field `JTAG_IN_FLUSH` reader - The interrupt enable bit for the USB_DEVICE_JTAG_IN_FLUSH_INT interrupt."]
6pub type JTAG_IN_FLUSH_R = crate::BitReader;
7#[doc = "Field `JTAG_IN_FLUSH` writer - The interrupt enable bit for the USB_DEVICE_JTAG_IN_FLUSH_INT interrupt."]
8pub type JTAG_IN_FLUSH_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SOF` reader - The interrupt enable bit for the USB_DEVICE_SOF_INT interrupt."]
10pub type SOF_R = crate::BitReader;
11#[doc = "Field `SOF` writer - The interrupt enable bit for the USB_DEVICE_SOF_INT interrupt."]
12pub type SOF_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SERIAL_OUT_RECV_PKT` reader - The interrupt enable bit for the USB_DEVICE_SERIAL_OUT_RECV_PKT_INT interrupt."]
14pub type SERIAL_OUT_RECV_PKT_R = crate::BitReader;
15#[doc = "Field `SERIAL_OUT_RECV_PKT` writer - The interrupt enable bit for the USB_DEVICE_SERIAL_OUT_RECV_PKT_INT interrupt."]
16pub type SERIAL_OUT_RECV_PKT_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SERIAL_IN_EMPTY` reader - The interrupt enable bit for the USB_DEVICE_SERIAL_IN_EMPTY_INT interrupt."]
18pub type SERIAL_IN_EMPTY_R = crate::BitReader;
19#[doc = "Field `SERIAL_IN_EMPTY` writer - The interrupt enable bit for the USB_DEVICE_SERIAL_IN_EMPTY_INT interrupt."]
20pub type SERIAL_IN_EMPTY_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `PID_ERR` reader - The interrupt enable bit for the USB_DEVICE_PID_ERR_INT interrupt."]
22pub type PID_ERR_R = crate::BitReader;
23#[doc = "Field `PID_ERR` writer - The interrupt enable bit for the USB_DEVICE_PID_ERR_INT interrupt."]
24pub type PID_ERR_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `CRC5_ERR` reader - The interrupt enable bit for the USB_DEVICE_CRC5_ERR_INT interrupt."]
26pub type CRC5_ERR_R = crate::BitReader;
27#[doc = "Field `CRC5_ERR` writer - The interrupt enable bit for the USB_DEVICE_CRC5_ERR_INT interrupt."]
28pub type CRC5_ERR_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `CRC16_ERR` reader - The interrupt enable bit for the USB_DEVICE_CRC16_ERR_INT interrupt."]
30pub type CRC16_ERR_R = crate::BitReader;
31#[doc = "Field `CRC16_ERR` writer - The interrupt enable bit for the USB_DEVICE_CRC16_ERR_INT interrupt."]
32pub type CRC16_ERR_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `STUFF_ERR` reader - The interrupt enable bit for the USB_DEVICE_STUFF_ERR_INT interrupt."]
34pub type STUFF_ERR_R = crate::BitReader;
35#[doc = "Field `STUFF_ERR` writer - The interrupt enable bit for the USB_DEVICE_STUFF_ERR_INT interrupt."]
36pub type STUFF_ERR_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `IN_TOKEN_REC_IN_EP1` reader - The interrupt enable bit for the USB_DEVICE_IN_TOKEN_REC_IN_EP1_INT interrupt."]
38pub type IN_TOKEN_REC_IN_EP1_R = crate::BitReader;
39#[doc = "Field `IN_TOKEN_REC_IN_EP1` writer - The interrupt enable bit for the USB_DEVICE_IN_TOKEN_REC_IN_EP1_INT interrupt."]
40pub type IN_TOKEN_REC_IN_EP1_W<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `USB_BUS_RESET` reader - The interrupt enable bit for the USB_DEVICE_USB_BUS_RESET_INT interrupt."]
42pub type USB_BUS_RESET_R = crate::BitReader;
43#[doc = "Field `USB_BUS_RESET` writer - The interrupt enable bit for the USB_DEVICE_USB_BUS_RESET_INT interrupt."]
44pub type USB_BUS_RESET_W<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `OUT_EP1_ZERO_PAYLOAD` reader - The interrupt enable bit for the USB_DEVICE_OUT_EP1_ZERO_PAYLOAD_INT interrupt."]
46pub type OUT_EP1_ZERO_PAYLOAD_R = crate::BitReader;
47#[doc = "Field `OUT_EP1_ZERO_PAYLOAD` writer - The interrupt enable bit for the USB_DEVICE_OUT_EP1_ZERO_PAYLOAD_INT interrupt."]
48pub type OUT_EP1_ZERO_PAYLOAD_W<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `OUT_EP2_ZERO_PAYLOAD` reader - The interrupt enable bit for the USB_DEVICE_OUT_EP2_ZERO_PAYLOAD_INT interrupt."]
50pub type OUT_EP2_ZERO_PAYLOAD_R = crate::BitReader;
51#[doc = "Field `OUT_EP2_ZERO_PAYLOAD` writer - The interrupt enable bit for the USB_DEVICE_OUT_EP2_ZERO_PAYLOAD_INT interrupt."]
52pub type OUT_EP2_ZERO_PAYLOAD_W<'a, REG> = crate::BitWriter<'a, REG>;
53impl R {
54 #[doc = "Bit 0 - The interrupt enable bit for the USB_DEVICE_JTAG_IN_FLUSH_INT interrupt."]
55 #[inline(always)]
56 pub fn jtag_in_flush(&self) -> JTAG_IN_FLUSH_R {
57 JTAG_IN_FLUSH_R::new((self.bits & 1) != 0)
58 }
59 #[doc = "Bit 1 - The interrupt enable bit for the USB_DEVICE_SOF_INT interrupt."]
60 #[inline(always)]
61 pub fn sof(&self) -> SOF_R {
62 SOF_R::new(((self.bits >> 1) & 1) != 0)
63 }
64 #[doc = "Bit 2 - The interrupt enable bit for the USB_DEVICE_SERIAL_OUT_RECV_PKT_INT interrupt."]
65 #[inline(always)]
66 pub fn serial_out_recv_pkt(&self) -> SERIAL_OUT_RECV_PKT_R {
67 SERIAL_OUT_RECV_PKT_R::new(((self.bits >> 2) & 1) != 0)
68 }
69 #[doc = "Bit 3 - The interrupt enable bit for the USB_DEVICE_SERIAL_IN_EMPTY_INT interrupt."]
70 #[inline(always)]
71 pub fn serial_in_empty(&self) -> SERIAL_IN_EMPTY_R {
72 SERIAL_IN_EMPTY_R::new(((self.bits >> 3) & 1) != 0)
73 }
74 #[doc = "Bit 4 - The interrupt enable bit for the USB_DEVICE_PID_ERR_INT interrupt."]
75 #[inline(always)]
76 pub fn pid_err(&self) -> PID_ERR_R {
77 PID_ERR_R::new(((self.bits >> 4) & 1) != 0)
78 }
79 #[doc = "Bit 5 - The interrupt enable bit for the USB_DEVICE_CRC5_ERR_INT interrupt."]
80 #[inline(always)]
81 pub fn crc5_err(&self) -> CRC5_ERR_R {
82 CRC5_ERR_R::new(((self.bits >> 5) & 1) != 0)
83 }
84 #[doc = "Bit 6 - The interrupt enable bit for the USB_DEVICE_CRC16_ERR_INT interrupt."]
85 #[inline(always)]
86 pub fn crc16_err(&self) -> CRC16_ERR_R {
87 CRC16_ERR_R::new(((self.bits >> 6) & 1) != 0)
88 }
89 #[doc = "Bit 7 - The interrupt enable bit for the USB_DEVICE_STUFF_ERR_INT interrupt."]
90 #[inline(always)]
91 pub fn stuff_err(&self) -> STUFF_ERR_R {
92 STUFF_ERR_R::new(((self.bits >> 7) & 1) != 0)
93 }
94 #[doc = "Bit 8 - The interrupt enable bit for the USB_DEVICE_IN_TOKEN_REC_IN_EP1_INT interrupt."]
95 #[inline(always)]
96 pub fn in_token_rec_in_ep1(&self) -> IN_TOKEN_REC_IN_EP1_R {
97 IN_TOKEN_REC_IN_EP1_R::new(((self.bits >> 8) & 1) != 0)
98 }
99 #[doc = "Bit 9 - The interrupt enable bit for the USB_DEVICE_USB_BUS_RESET_INT interrupt."]
100 #[inline(always)]
101 pub fn usb_bus_reset(&self) -> USB_BUS_RESET_R {
102 USB_BUS_RESET_R::new(((self.bits >> 9) & 1) != 0)
103 }
104 #[doc = "Bit 10 - The interrupt enable bit for the USB_DEVICE_OUT_EP1_ZERO_PAYLOAD_INT interrupt."]
105 #[inline(always)]
106 pub fn out_ep1_zero_payload(&self) -> OUT_EP1_ZERO_PAYLOAD_R {
107 OUT_EP1_ZERO_PAYLOAD_R::new(((self.bits >> 10) & 1) != 0)
108 }
109 #[doc = "Bit 11 - The interrupt enable bit for the USB_DEVICE_OUT_EP2_ZERO_PAYLOAD_INT interrupt."]
110 #[inline(always)]
111 pub fn out_ep2_zero_payload(&self) -> OUT_EP2_ZERO_PAYLOAD_R {
112 OUT_EP2_ZERO_PAYLOAD_R::new(((self.bits >> 11) & 1) != 0)
113 }
114}
115#[cfg(feature = "impl-register-debug")]
116impl core::fmt::Debug for R {
117 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
118 f.debug_struct("INT_ENA")
119 .field("jtag_in_flush", &self.jtag_in_flush())
120 .field("sof", &self.sof())
121 .field("serial_out_recv_pkt", &self.serial_out_recv_pkt())
122 .field("serial_in_empty", &self.serial_in_empty())
123 .field("pid_err", &self.pid_err())
124 .field("crc5_err", &self.crc5_err())
125 .field("crc16_err", &self.crc16_err())
126 .field("stuff_err", &self.stuff_err())
127 .field("in_token_rec_in_ep1", &self.in_token_rec_in_ep1())
128 .field("usb_bus_reset", &self.usb_bus_reset())
129 .field("out_ep1_zero_payload", &self.out_ep1_zero_payload())
130 .field("out_ep2_zero_payload", &self.out_ep2_zero_payload())
131 .finish()
132 }
133}
134impl W {
135 #[doc = "Bit 0 - The interrupt enable bit for the USB_DEVICE_JTAG_IN_FLUSH_INT interrupt."]
136 #[inline(always)]
137 pub fn jtag_in_flush(&mut self) -> JTAG_IN_FLUSH_W<INT_ENA_SPEC> {
138 JTAG_IN_FLUSH_W::new(self, 0)
139 }
140 #[doc = "Bit 1 - The interrupt enable bit for the USB_DEVICE_SOF_INT interrupt."]
141 #[inline(always)]
142 pub fn sof(&mut self) -> SOF_W<INT_ENA_SPEC> {
143 SOF_W::new(self, 1)
144 }
145 #[doc = "Bit 2 - The interrupt enable bit for the USB_DEVICE_SERIAL_OUT_RECV_PKT_INT interrupt."]
146 #[inline(always)]
147 pub fn serial_out_recv_pkt(&mut self) -> SERIAL_OUT_RECV_PKT_W<INT_ENA_SPEC> {
148 SERIAL_OUT_RECV_PKT_W::new(self, 2)
149 }
150 #[doc = "Bit 3 - The interrupt enable bit for the USB_DEVICE_SERIAL_IN_EMPTY_INT interrupt."]
151 #[inline(always)]
152 pub fn serial_in_empty(&mut self) -> SERIAL_IN_EMPTY_W<INT_ENA_SPEC> {
153 SERIAL_IN_EMPTY_W::new(self, 3)
154 }
155 #[doc = "Bit 4 - The interrupt enable bit for the USB_DEVICE_PID_ERR_INT interrupt."]
156 #[inline(always)]
157 pub fn pid_err(&mut self) -> PID_ERR_W<INT_ENA_SPEC> {
158 PID_ERR_W::new(self, 4)
159 }
160 #[doc = "Bit 5 - The interrupt enable bit for the USB_DEVICE_CRC5_ERR_INT interrupt."]
161 #[inline(always)]
162 pub fn crc5_err(&mut self) -> CRC5_ERR_W<INT_ENA_SPEC> {
163 CRC5_ERR_W::new(self, 5)
164 }
165 #[doc = "Bit 6 - The interrupt enable bit for the USB_DEVICE_CRC16_ERR_INT interrupt."]
166 #[inline(always)]
167 pub fn crc16_err(&mut self) -> CRC16_ERR_W<INT_ENA_SPEC> {
168 CRC16_ERR_W::new(self, 6)
169 }
170 #[doc = "Bit 7 - The interrupt enable bit for the USB_DEVICE_STUFF_ERR_INT interrupt."]
171 #[inline(always)]
172 pub fn stuff_err(&mut self) -> STUFF_ERR_W<INT_ENA_SPEC> {
173 STUFF_ERR_W::new(self, 7)
174 }
175 #[doc = "Bit 8 - The interrupt enable bit for the USB_DEVICE_IN_TOKEN_REC_IN_EP1_INT interrupt."]
176 #[inline(always)]
177 pub fn in_token_rec_in_ep1(&mut self) -> IN_TOKEN_REC_IN_EP1_W<INT_ENA_SPEC> {
178 IN_TOKEN_REC_IN_EP1_W::new(self, 8)
179 }
180 #[doc = "Bit 9 - The interrupt enable bit for the USB_DEVICE_USB_BUS_RESET_INT interrupt."]
181 #[inline(always)]
182 pub fn usb_bus_reset(&mut self) -> USB_BUS_RESET_W<INT_ENA_SPEC> {
183 USB_BUS_RESET_W::new(self, 9)
184 }
185 #[doc = "Bit 10 - The interrupt enable bit for the USB_DEVICE_OUT_EP1_ZERO_PAYLOAD_INT interrupt."]
186 #[inline(always)]
187 pub fn out_ep1_zero_payload(&mut self) -> OUT_EP1_ZERO_PAYLOAD_W<INT_ENA_SPEC> {
188 OUT_EP1_ZERO_PAYLOAD_W::new(self, 10)
189 }
190 #[doc = "Bit 11 - The interrupt enable bit for the USB_DEVICE_OUT_EP2_ZERO_PAYLOAD_INT interrupt."]
191 #[inline(always)]
192 pub fn out_ep2_zero_payload(&mut self) -> OUT_EP2_ZERO_PAYLOAD_W<INT_ENA_SPEC> {
193 OUT_EP2_ZERO_PAYLOAD_W::new(self, 11)
194 }
195}
196#[doc = "USB_DEVICE_INT_ENA_REG.\n\nYou can [`read`](crate::Reg::read) this register and get [`int_ena::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`int_ena::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
197pub struct INT_ENA_SPEC;
198impl crate::RegisterSpec for INT_ENA_SPEC {
199 type Ux = u32;
200}
201#[doc = "`read()` method returns [`int_ena::R`](R) reader structure"]
202impl crate::Readable for INT_ENA_SPEC {}
203#[doc = "`write(|w| ..)` method takes [`int_ena::W`](W) writer structure"]
204impl crate::Writable for INT_ENA_SPEC {
205 type Safety = crate::Unsafe;
206 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
207 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
208}
209#[doc = "`reset()` method sets INT_ENA to value 0"]
210impl crate::Resettable for INT_ENA_SPEC {
211 const RESET_VALUE: u32 = 0;
212}