atsamd51g/usb/host/host_pipe/
pcfg.rs
1#[doc = "Register `PCFG` reader"]
2pub type R = crate::R<PcfgSpec>;
3#[doc = "Register `PCFG` writer"]
4pub type W = crate::W<PcfgSpec>;
5#[doc = "Field `PTOKEN` reader - Pipe Token"]
6pub type PtokenR = crate::FieldReader;
7#[doc = "Field `PTOKEN` writer - Pipe Token"]
8pub type PtokenW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `BK` reader - Pipe Bank"]
10pub type BkR = crate::BitReader;
11#[doc = "Field `BK` writer - Pipe Bank"]
12pub type BkW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `PTYPE` reader - Pipe Type"]
14pub type PtypeR = crate::FieldReader;
15#[doc = "Field `PTYPE` writer - Pipe Type"]
16pub type PtypeW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
17impl R {
18 #[doc = "Bits 0:1 - Pipe Token"]
19 #[inline(always)]
20 pub fn ptoken(&self) -> PtokenR {
21 PtokenR::new(self.bits & 3)
22 }
23 #[doc = "Bit 2 - Pipe Bank"]
24 #[inline(always)]
25 pub fn bk(&self) -> BkR {
26 BkR::new(((self.bits >> 2) & 1) != 0)
27 }
28 #[doc = "Bits 3:5 - Pipe Type"]
29 #[inline(always)]
30 pub fn ptype(&self) -> PtypeR {
31 PtypeR::new((self.bits >> 3) & 7)
32 }
33}
34impl W {
35 #[doc = "Bits 0:1 - Pipe Token"]
36 #[inline(always)]
37 #[must_use]
38 pub fn ptoken(&mut self) -> PtokenW<PcfgSpec> {
39 PtokenW::new(self, 0)
40 }
41 #[doc = "Bit 2 - Pipe Bank"]
42 #[inline(always)]
43 #[must_use]
44 pub fn bk(&mut self) -> BkW<PcfgSpec> {
45 BkW::new(self, 2)
46 }
47 #[doc = "Bits 3:5 - Pipe Type"]
48 #[inline(always)]
49 #[must_use]
50 pub fn ptype(&mut self) -> PtypeW<PcfgSpec> {
51 PtypeW::new(self, 3)
52 }
53}
54#[doc = "HOST_PIPE End Point Configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`pcfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pcfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct PcfgSpec;
56impl crate::RegisterSpec for PcfgSpec {
57 type Ux = u8;
58}
59#[doc = "`read()` method returns [`pcfg::R`](R) reader structure"]
60impl crate::Readable for PcfgSpec {}
61#[doc = "`write(|w| ..)` method takes [`pcfg::W`](W) writer structure"]
62impl crate::Writable for PcfgSpec {
63 type Safety = crate::Unsafe;
64 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
65 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
66}
67#[doc = "`reset()` method sets PCFG to value 0"]
68impl crate::Resettable for PcfgSpec {
69 const RESET_VALUE: u8 = 0;
70}