rp2040_pac/usbctrl_regs/
nak_poll.rs
1#[doc = "Register `NAK_POLL` reader"]
2pub type R = crate::R<NAK_POLL_SPEC>;
3#[doc = "Register `NAK_POLL` writer"]
4pub type W = crate::W<NAK_POLL_SPEC>;
5#[doc = "Field `DELAY_LS` reader - NAK polling interval for a low speed device"]
6pub type DELAY_LS_R = crate::FieldReader<u16>;
7#[doc = "Field `DELAY_LS` writer - NAK polling interval for a low speed device"]
8pub type DELAY_LS_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
9#[doc = "Field `DELAY_FS` reader - NAK polling interval for a full speed device"]
10pub type DELAY_FS_R = crate::FieldReader<u16>;
11#[doc = "Field `DELAY_FS` writer - NAK polling interval for a full speed device"]
12pub type DELAY_FS_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
13impl R {
14 #[doc = "Bits 0:9 - NAK polling interval for a low speed device"]
15 #[inline(always)]
16 pub fn delay_ls(&self) -> DELAY_LS_R {
17 DELAY_LS_R::new((self.bits & 0x03ff) as u16)
18 }
19 #[doc = "Bits 16:25 - NAK polling interval for a full speed device"]
20 #[inline(always)]
21 pub fn delay_fs(&self) -> DELAY_FS_R {
22 DELAY_FS_R::new(((self.bits >> 16) & 0x03ff) as u16)
23 }
24}
25impl W {
26 #[doc = "Bits 0:9 - NAK polling interval for a low speed device"]
27 #[inline(always)]
28 #[must_use]
29 pub fn delay_ls(&mut self) -> DELAY_LS_W<NAK_POLL_SPEC> {
30 DELAY_LS_W::new(self, 0)
31 }
32 #[doc = "Bits 16:25 - NAK polling interval for a full speed device"]
33 #[inline(always)]
34 #[must_use]
35 pub fn delay_fs(&mut self) -> DELAY_FS_W<NAK_POLL_SPEC> {
36 DELAY_FS_W::new(self, 16)
37 }
38 #[doc = r" Writes raw bits to the register."]
39 #[doc = r""]
40 #[doc = r" # Safety"]
41 #[doc = r""]
42 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
43 #[inline(always)]
44 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
45 self.bits = bits;
46 self
47 }
48}
49#[doc = "Used by the host controller. Sets the wait time in microseconds before trying again if the device replies with a NAK.
50
51You can [`read`](crate::generic::Reg::read) this register and get [`nak_poll::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nak_poll::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
52pub struct NAK_POLL_SPEC;
53impl crate::RegisterSpec for NAK_POLL_SPEC {
54 type Ux = u32;
55}
56#[doc = "`read()` method returns [`nak_poll::R`](R) reader structure"]
57impl crate::Readable for NAK_POLL_SPEC {}
58#[doc = "`write(|w| ..)` method takes [`nak_poll::W`](W) writer structure"]
59impl crate::Writable for NAK_POLL_SPEC {
60 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
61 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
62}
63#[doc = "`reset()` method sets NAK_POLL to value 0x0010_0010"]
64impl crate::Resettable for NAK_POLL_SPEC {
65 const RESET_VALUE: u32 = 0x0010_0010;
66}