atsame54p/gmac/
man.rs

1#[doc = "Register `MAN` reader"]
2pub type R = crate::R<ManSpec>;
3#[doc = "Register `MAN` writer"]
4pub type W = crate::W<ManSpec>;
5#[doc = "Field `DATA` reader - PHY Data"]
6pub type DataR = crate::FieldReader<u16>;
7#[doc = "Field `DATA` writer - PHY Data"]
8pub type DataW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `WTN` reader - Write Ten"]
10pub type WtnR = crate::FieldReader;
11#[doc = "Field `WTN` writer - Write Ten"]
12pub type WtnW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `REGA` reader - Register Address"]
14pub type RegaR = crate::FieldReader;
15#[doc = "Field `REGA` writer - Register Address"]
16pub type RegaW<'a, REG> = crate::FieldWriter<'a, REG, 5>;
17#[doc = "Field `PHYA` reader - PHY Address"]
18pub type PhyaR = crate::FieldReader;
19#[doc = "Field `PHYA` writer - PHY Address"]
20pub type PhyaW<'a, REG> = crate::FieldWriter<'a, REG, 5>;
21#[doc = "Field `OP` reader - Operation"]
22pub type OpR = crate::FieldReader;
23#[doc = "Field `OP` writer - Operation"]
24pub type OpW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
25#[doc = "Field `CLTTO` reader - Clause 22 Operation"]
26pub type ClttoR = crate::BitReader;
27#[doc = "Field `CLTTO` writer - Clause 22 Operation"]
28pub type ClttoW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `WZO` reader - Write ZERO"]
30pub type WzoR = crate::BitReader;
31#[doc = "Field `WZO` writer - Write ZERO"]
32pub type WzoW<'a, REG> = crate::BitWriter<'a, REG>;
33impl R {
34    #[doc = "Bits 0:15 - PHY Data"]
35    #[inline(always)]
36    pub fn data(&self) -> DataR {
37        DataR::new((self.bits & 0xffff) as u16)
38    }
39    #[doc = "Bits 16:17 - Write Ten"]
40    #[inline(always)]
41    pub fn wtn(&self) -> WtnR {
42        WtnR::new(((self.bits >> 16) & 3) as u8)
43    }
44    #[doc = "Bits 18:22 - Register Address"]
45    #[inline(always)]
46    pub fn rega(&self) -> RegaR {
47        RegaR::new(((self.bits >> 18) & 0x1f) as u8)
48    }
49    #[doc = "Bits 23:27 - PHY Address"]
50    #[inline(always)]
51    pub fn phya(&self) -> PhyaR {
52        PhyaR::new(((self.bits >> 23) & 0x1f) as u8)
53    }
54    #[doc = "Bits 28:29 - Operation"]
55    #[inline(always)]
56    pub fn op(&self) -> OpR {
57        OpR::new(((self.bits >> 28) & 3) as u8)
58    }
59    #[doc = "Bit 30 - Clause 22 Operation"]
60    #[inline(always)]
61    pub fn cltto(&self) -> ClttoR {
62        ClttoR::new(((self.bits >> 30) & 1) != 0)
63    }
64    #[doc = "Bit 31 - Write ZERO"]
65    #[inline(always)]
66    pub fn wzo(&self) -> WzoR {
67        WzoR::new(((self.bits >> 31) & 1) != 0)
68    }
69}
70impl W {
71    #[doc = "Bits 0:15 - PHY Data"]
72    #[inline(always)]
73    #[must_use]
74    pub fn data(&mut self) -> DataW<ManSpec> {
75        DataW::new(self, 0)
76    }
77    #[doc = "Bits 16:17 - Write Ten"]
78    #[inline(always)]
79    #[must_use]
80    pub fn wtn(&mut self) -> WtnW<ManSpec> {
81        WtnW::new(self, 16)
82    }
83    #[doc = "Bits 18:22 - Register Address"]
84    #[inline(always)]
85    #[must_use]
86    pub fn rega(&mut self) -> RegaW<ManSpec> {
87        RegaW::new(self, 18)
88    }
89    #[doc = "Bits 23:27 - PHY Address"]
90    #[inline(always)]
91    #[must_use]
92    pub fn phya(&mut self) -> PhyaW<ManSpec> {
93        PhyaW::new(self, 23)
94    }
95    #[doc = "Bits 28:29 - Operation"]
96    #[inline(always)]
97    #[must_use]
98    pub fn op(&mut self) -> OpW<ManSpec> {
99        OpW::new(self, 28)
100    }
101    #[doc = "Bit 30 - Clause 22 Operation"]
102    #[inline(always)]
103    #[must_use]
104    pub fn cltto(&mut self) -> ClttoW<ManSpec> {
105        ClttoW::new(self, 30)
106    }
107    #[doc = "Bit 31 - Write ZERO"]
108    #[inline(always)]
109    #[must_use]
110    pub fn wzo(&mut self) -> WzoW<ManSpec> {
111        WzoW::new(self, 31)
112    }
113}
114#[doc = "PHY Maintenance Register\n\nYou can [`read`](crate::Reg::read) this register and get [`man::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`man::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
115pub struct ManSpec;
116impl crate::RegisterSpec for ManSpec {
117    type Ux = u32;
118}
119#[doc = "`read()` method returns [`man::R`](R) reader structure"]
120impl crate::Readable for ManSpec {}
121#[doc = "`write(|w| ..)` method takes [`man::W`](W) writer structure"]
122impl crate::Writable for ManSpec {
123    type Safety = crate::Unsafe;
124    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
125    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
126}
127#[doc = "`reset()` method sets MAN to value 0"]
128impl crate::Resettable for ManSpec {
129    const RESET_VALUE: u32 = 0;
130}