atsamd51g/usb/device/device_endpoint/
epcfg.rs

1#[doc = "Register `EPCFG` reader"]
2pub type R = crate::R<EpcfgSpec>;
3#[doc = "Register `EPCFG` writer"]
4pub type W = crate::W<EpcfgSpec>;
5#[doc = "Field `EPTYPE0` reader - End Point Type0"]
6pub type Eptype0R = crate::FieldReader;
7#[doc = "Field `EPTYPE0` writer - End Point Type0"]
8pub type Eptype0W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `EPTYPE1` reader - End Point Type1"]
10pub type Eptype1R = crate::FieldReader;
11#[doc = "Field `EPTYPE1` writer - End Point Type1"]
12pub type Eptype1W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13impl R {
14    #[doc = "Bits 0:2 - End Point Type0"]
15    #[inline(always)]
16    pub fn eptype0(&self) -> Eptype0R {
17        Eptype0R::new(self.bits & 7)
18    }
19    #[doc = "Bits 4:6 - End Point Type1"]
20    #[inline(always)]
21    pub fn eptype1(&self) -> Eptype1R {
22        Eptype1R::new((self.bits >> 4) & 7)
23    }
24}
25impl W {
26    #[doc = "Bits 0:2 - End Point Type0"]
27    #[inline(always)]
28    #[must_use]
29    pub fn eptype0(&mut self) -> Eptype0W<EpcfgSpec> {
30        Eptype0W::new(self, 0)
31    }
32    #[doc = "Bits 4:6 - End Point Type1"]
33    #[inline(always)]
34    #[must_use]
35    pub fn eptype1(&mut self) -> Eptype1W<EpcfgSpec> {
36        Eptype1W::new(self, 4)
37    }
38}
39#[doc = "DEVICE_ENDPOINT End Point Configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`epcfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`epcfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct EpcfgSpec;
41impl crate::RegisterSpec for EpcfgSpec {
42    type Ux = u8;
43}
44#[doc = "`read()` method returns [`epcfg::R`](R) reader structure"]
45impl crate::Readable for EpcfgSpec {}
46#[doc = "`write(|w| ..)` method takes [`epcfg::W`](W) writer structure"]
47impl crate::Writable for EpcfgSpec {
48    type Safety = crate::Unsafe;
49    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
50    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
51}
52#[doc = "`reset()` method sets EPCFG to value 0"]
53impl crate::Resettable for EpcfgSpec {
54    const RESET_VALUE: u8 = 0;
55}