moondancer_pac/generated/usb1_ep_out/
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 `epno` reader - epno field"]
6pub type EPNO_R = crate::FieldReader;
7#[doc = "Field `_0` reader - _0 field"]
8pub type _0_R = crate::FieldReader;
9#[doc = "Field `_0` writer - _0 field"]
10pub type _0_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
11#[doc = "Field `have` reader - have field"]
12pub type HAVE_R = crate::BitReader;
13#[doc = "Field `pid` reader - pid field"]
14pub type PID_R = crate::BitReader;
15#[doc = "Field `_1` reader - _1 field"]
16pub type _1_R = crate::FieldReader;
17#[doc = "Field `_1` writer - _1 field"]
18pub type _1_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
19impl R {
20    #[doc = "Bits 0:3 - epno field"]
21    #[inline(always)]
22    pub fn epno(&self) -> EPNO_R {
23        EPNO_R::new((self.bits & 0x0f) as u8)
24    }
25    #[doc = "Bits 4:7 - _0 field"]
26    #[inline(always)]
27    pub fn _0(&self) -> _0_R {
28        _0_R::new(((self.bits >> 4) & 0x0f) as u8)
29    }
30    #[doc = "Bit 8 - have field"]
31    #[inline(always)]
32    pub fn have(&self) -> HAVE_R {
33        HAVE_R::new(((self.bits >> 8) & 1) != 0)
34    }
35    #[doc = "Bit 9 - pid field"]
36    #[inline(always)]
37    pub fn pid(&self) -> PID_R {
38        PID_R::new(((self.bits >> 9) & 1) != 0)
39    }
40    #[doc = "Bits 10:15 - _1 field"]
41    #[inline(always)]
42    pub fn _1(&self) -> _1_R {
43        _1_R::new(((self.bits >> 10) & 0x3f) as u8)
44    }
45}
46impl W {
47    #[doc = "Bits 4:7 - _0 field"]
48    #[inline(always)]
49    pub fn _0(&mut self) -> _0_W<STATUS_SPEC> {
50        _0_W::new(self, 4)
51    }
52    #[doc = "Bits 10:15 - _1 field"]
53    #[inline(always)]
54    pub fn _1(&mut self) -> _1_W<STATUS_SPEC> {
55        _1_W::new(self, 10)
56    }
57}
58#[doc = "Status register epno: Contains the endpoint number associated with the data in the FIFO -- that is, the endpoint number on which the relevant data was received. have: `1` iff data is available in the 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)."]
59pub struct STATUS_SPEC;
60impl crate::RegisterSpec for STATUS_SPEC {
61    type Ux = u16;
62}
63#[doc = "`read()` method returns [`status::R`](R) reader structure"]
64impl crate::Readable for STATUS_SPEC {}
65#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
66impl crate::Writable for STATUS_SPEC {
67    type Safety = crate::Unsafe;
68    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
69    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
70}
71#[doc = "`reset()` method sets status to value 0"]
72impl crate::Resettable for STATUS_SPEC {
73    const RESET_VALUE: u16 = 0;
74}