atsamd51j/usb/device/device_endpoint/
epstatus.rs

1#[doc = "Register `EPSTATUS` reader"]
2pub type R = crate::R<EpstatusSpec>;
3#[doc = "Field `DTGLOUT` reader - Data Toggle Out"]
4pub type DtgloutR = crate::BitReader;
5#[doc = "Field `DTGLIN` reader - Data Toggle In"]
6pub type DtglinR = crate::BitReader;
7#[doc = "Field `CURBK` reader - Current Bank"]
8pub type CurbkR = crate::BitReader;
9#[doc = "Field `STALLRQ0` reader - Stall 0 Request"]
10pub type Stallrq0R = crate::BitReader;
11#[doc = "Field `STALLRQ1` reader - Stall 1 Request"]
12pub type Stallrq1R = crate::BitReader;
13#[doc = "Field `BK0RDY` reader - Bank 0 ready"]
14pub type Bk0rdyR = crate::BitReader;
15#[doc = "Field `BK1RDY` reader - Bank 1 ready"]
16pub type Bk1rdyR = crate::BitReader;
17impl R {
18    #[doc = "Bit 0 - Data Toggle Out"]
19    #[inline(always)]
20    pub fn dtglout(&self) -> DtgloutR {
21        DtgloutR::new((self.bits & 1) != 0)
22    }
23    #[doc = "Bit 1 - Data Toggle In"]
24    #[inline(always)]
25    pub fn dtglin(&self) -> DtglinR {
26        DtglinR::new(((self.bits >> 1) & 1) != 0)
27    }
28    #[doc = "Bit 2 - Current Bank"]
29    #[inline(always)]
30    pub fn curbk(&self) -> CurbkR {
31        CurbkR::new(((self.bits >> 2) & 1) != 0)
32    }
33    #[doc = "Bit 4 - Stall 0 Request"]
34    #[inline(always)]
35    pub fn stallrq0(&self) -> Stallrq0R {
36        Stallrq0R::new(((self.bits >> 4) & 1) != 0)
37    }
38    #[doc = "Bit 5 - Stall 1 Request"]
39    #[inline(always)]
40    pub fn stallrq1(&self) -> Stallrq1R {
41        Stallrq1R::new(((self.bits >> 5) & 1) != 0)
42    }
43    #[doc = "Bit 6 - Bank 0 ready"]
44    #[inline(always)]
45    pub fn bk0rdy(&self) -> Bk0rdyR {
46        Bk0rdyR::new(((self.bits >> 6) & 1) != 0)
47    }
48    #[doc = "Bit 7 - Bank 1 ready"]
49    #[inline(always)]
50    pub fn bk1rdy(&self) -> Bk1rdyR {
51        Bk1rdyR::new(((self.bits >> 7) & 1) != 0)
52    }
53}
54#[doc = "DEVICE_ENDPOINT End Point Pipe Status\n\nYou can [`read`](crate::Reg::read) this register and get [`epstatus::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct EpstatusSpec;
56impl crate::RegisterSpec for EpstatusSpec {
57    type Ux = u8;
58}
59#[doc = "`read()` method returns [`epstatus::R`](R) reader structure"]
60impl crate::Readable for EpstatusSpec {}
61#[doc = "`reset()` method sets EPSTATUS to value 0"]
62impl crate::Resettable for EpstatusSpec {
63    const RESET_VALUE: u8 = 0;
64}