moondancer_pac/generated/usb1_ep_control/
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 `address` reader - address field"]
6pub type ADDRESS_R = crate::FieldReader;
7#[doc = "Field `epno` reader - epno field"]
8pub type EPNO_R = crate::FieldReader;
9#[doc = "Field `have` reader - have field"]
10pub type HAVE_R = crate::BitReader;
11#[doc = "Field `_0` reader - _0 field"]
12pub type _0_R = crate::FieldReader;
13#[doc = "Field `_0` writer - _0 field"]
14pub type _0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
15impl R {
16    #[doc = "Bits 0:7 - address field"]
17    #[inline(always)]
18    pub fn address(&self) -> ADDRESS_R {
19        ADDRESS_R::new((self.bits & 0xff) as u8)
20    }
21    #[doc = "Bits 8:11 - epno field"]
22    #[inline(always)]
23    pub fn epno(&self) -> EPNO_R {
24        EPNO_R::new(((self.bits >> 8) & 0x0f) as u8)
25    }
26    #[doc = "Bit 12 - have field"]
27    #[inline(always)]
28    pub fn have(&self) -> HAVE_R {
29        HAVE_R::new(((self.bits >> 12) & 1) != 0)
30    }
31    #[doc = "Bits 13:15 - _0 field"]
32    #[inline(always)]
33    pub fn _0(&self) -> _0_R {
34        _0_R::new(((self.bits >> 13) & 7) as u8)
35    }
36}
37impl W {
38    #[doc = "Bits 13:15 - _0 field"]
39    #[inline(always)]
40    pub fn _0(&mut self) -> _0_W<STATUS_SPEC> {
41        _0_W::new(self, 13)
42    }
43}
44#[doc = "Status register address: Holds the current device's active USB address. epno: The endpoint number associated with the most recently captured SETUP packet. have: `1` iff data is available in the FIFO.\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)."]
45pub struct STATUS_SPEC;
46impl crate::RegisterSpec for STATUS_SPEC {
47    type Ux = u16;
48}
49#[doc = "`read()` method returns [`status::R`](R) reader structure"]
50impl crate::Readable for STATUS_SPEC {}
51#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
52impl crate::Writable for STATUS_SPEC {
53    type Safety = crate::Unsafe;
54    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
55    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
56}
57#[doc = "`reset()` method sets status to value 0"]
58impl crate::Resettable for STATUS_SPEC {
59    const RESET_VALUE: u16 = 0;
60}