moondancer_pac/generated/usb2_ep_in/
status.rs

1#[doc = "Register `status` reader"]
2pub type R = crate::R<STATUS_SPEC>;
3#[doc = "Register `status` writer"]
4pub type W = crate::W<STATUS_SPEC>;
5#[doc = "Field `nak` reader - nak field"]
6pub type NAK_R = crate::FieldReader<u16>;
7#[doc = "Field `epno` reader - epno field"]
8pub type EPNO_R = crate::FieldReader;
9#[doc = "Field `_0` reader - _0 field"]
10pub type _0_R = crate::FieldReader;
11#[doc = "Field `_0` writer - _0 field"]
12pub type _0_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `idle` reader - idle field"]
14pub type IDLE_R = crate::BitReader;
15#[doc = "Field `have` reader - have field"]
16pub type HAVE_R = crate::BitReader;
17#[doc = "Field `pid` reader - pid field"]
18pub type PID_R = crate::BitReader;
19#[doc = "Field `_1` reader - _1 field"]
20pub type _1_R = crate::FieldReader;
21#[doc = "Field `_1` writer - _1 field"]
22pub type _1_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
23impl R {
24    #[doc = "Bits 0:15 - nak field"]
25    #[inline(always)]
26    pub fn nak(&self) -> NAK_R {
27        NAK_R::new((self.bits & 0xffff) as u16)
28    }
29    #[doc = "Bits 16:19 - epno field"]
30    #[inline(always)]
31    pub fn epno(&self) -> EPNO_R {
32        EPNO_R::new(((self.bits >> 16) & 0x0f) as u8)
33    }
34    #[doc = "Bits 20:23 - _0 field"]
35    #[inline(always)]
36    pub fn _0(&self) -> _0_R {
37        _0_R::new(((self.bits >> 20) & 0x0f) as u8)
38    }
39    #[doc = "Bit 24 - idle field"]
40    #[inline(always)]
41    pub fn idle(&self) -> IDLE_R {
42        IDLE_R::new(((self.bits >> 24) & 1) != 0)
43    }
44    #[doc = "Bit 25 - have field"]
45    #[inline(always)]
46    pub fn have(&self) -> HAVE_R {
47        HAVE_R::new(((self.bits >> 25) & 1) != 0)
48    }
49    #[doc = "Bit 26 - pid field"]
50    #[inline(always)]
51    pub fn pid(&self) -> PID_R {
52        PID_R::new(((self.bits >> 26) & 1) != 0)
53    }
54    #[doc = "Bits 27:31 - _1 field"]
55    #[inline(always)]
56    pub fn _1(&self) -> _1_R {
57        _1_R::new(((self.bits >> 27) & 0x1f) as u8)
58    }
59}
60impl W {
61    #[doc = "Bits 20:23 - _0 field"]
62    #[inline(always)]
63    pub fn _0(&mut self) -> _0_W<STATUS_SPEC> {
64        _0_W::new(self, 20)
65    }
66    #[doc = "Bits 27:31 - _1 field"]
67    #[inline(always)]
68    pub fn _1(&mut self) -> _1_W<STATUS_SPEC> {
69        _1_W::new(self, 27)
70    }
71}
72#[doc = "Status register nak: Contains a bitmask of endpoints that have responded with a NAK since the last read of this register. epno: Contains the endpoint being transmitted on. idle: This value is `1` if no packet is actively being transmitted. have: This value is `1` if data is present in the transmit FIFO. pid: Contains the current PID toggle bit for the given endpoint.\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`status::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
73pub struct STATUS_SPEC;
74impl crate::RegisterSpec for STATUS_SPEC {
75    type Ux = u32;
76}
77#[doc = "`read()` method returns [`status::R`](R) reader structure"]
78impl crate::Readable for STATUS_SPEC {}
79#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
80impl crate::Writable for STATUS_SPEC {
81    type Safety = crate::Unsafe;
82    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
83    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
84}
85#[doc = "`reset()` method sets status to value 0"]
86impl crate::Resettable for STATUS_SPEC {
87    const RESET_VALUE: u32 = 0;
88}