atsam4e16c_pac/gmac/
man.rs

1#[doc = "Register `MAN` reader"]
2pub struct R(crate::R<MAN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<MAN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<MAN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<MAN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `MAN` writer"]
17pub struct W(crate::W<MAN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<MAN_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<MAN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<MAN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DATA` reader - PHY Data"]
38pub type DATA_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `DATA` writer - PHY Data"]
40pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAN_SPEC, u16, u16, 16, O>;
41#[doc = "Field `WTN` reader - Write Ten"]
42pub type WTN_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `WTN` writer - Write Ten"]
44pub type WTN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAN_SPEC, u8, u8, 2, O>;
45#[doc = "Field `REGA` reader - Register Address"]
46pub type REGA_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `REGA` writer - Register Address"]
48pub type REGA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAN_SPEC, u8, u8, 5, O>;
49#[doc = "Field `PHYA` reader - PHY Address"]
50pub type PHYA_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `PHYA` writer - PHY Address"]
52pub type PHYA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAN_SPEC, u8, u8, 5, O>;
53#[doc = "Field `OP` reader - Operation"]
54pub type OP_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `OP` writer - Operation"]
56pub type OP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAN_SPEC, u8, u8, 2, O>;
57#[doc = "Field `CLTTO` reader - Clause 22 Operation"]
58pub type CLTTO_R = crate::BitReader<bool>;
59#[doc = "Field `CLTTO` writer - Clause 22 Operation"]
60pub type CLTTO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAN_SPEC, bool, O>;
61#[doc = "Field `WZO` reader - Write ZERO"]
62pub type WZO_R = crate::BitReader<bool>;
63#[doc = "Field `WZO` writer - Write ZERO"]
64pub type WZO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAN_SPEC, bool, O>;
65impl R {
66    #[doc = "Bits 0:15 - PHY Data"]
67    #[inline(always)]
68    pub fn data(&self) -> DATA_R {
69        DATA_R::new((self.bits & 0xffff) as u16)
70    }
71    #[doc = "Bits 16:17 - Write Ten"]
72    #[inline(always)]
73    pub fn wtn(&self) -> WTN_R {
74        WTN_R::new(((self.bits >> 16) & 3) as u8)
75    }
76    #[doc = "Bits 18:22 - Register Address"]
77    #[inline(always)]
78    pub fn rega(&self) -> REGA_R {
79        REGA_R::new(((self.bits >> 18) & 0x1f) as u8)
80    }
81    #[doc = "Bits 23:27 - PHY Address"]
82    #[inline(always)]
83    pub fn phya(&self) -> PHYA_R {
84        PHYA_R::new(((self.bits >> 23) & 0x1f) as u8)
85    }
86    #[doc = "Bits 28:29 - Operation"]
87    #[inline(always)]
88    pub fn op(&self) -> OP_R {
89        OP_R::new(((self.bits >> 28) & 3) as u8)
90    }
91    #[doc = "Bit 30 - Clause 22 Operation"]
92    #[inline(always)]
93    pub fn cltto(&self) -> CLTTO_R {
94        CLTTO_R::new(((self.bits >> 30) & 1) != 0)
95    }
96    #[doc = "Bit 31 - Write ZERO"]
97    #[inline(always)]
98    pub fn wzo(&self) -> WZO_R {
99        WZO_R::new(((self.bits >> 31) & 1) != 0)
100    }
101}
102impl W {
103    #[doc = "Bits 0:15 - PHY Data"]
104    #[inline(always)]
105    #[must_use]
106    pub fn data(&mut self) -> DATA_W<0> {
107        DATA_W::new(self)
108    }
109    #[doc = "Bits 16:17 - Write Ten"]
110    #[inline(always)]
111    #[must_use]
112    pub fn wtn(&mut self) -> WTN_W<16> {
113        WTN_W::new(self)
114    }
115    #[doc = "Bits 18:22 - Register Address"]
116    #[inline(always)]
117    #[must_use]
118    pub fn rega(&mut self) -> REGA_W<18> {
119        REGA_W::new(self)
120    }
121    #[doc = "Bits 23:27 - PHY Address"]
122    #[inline(always)]
123    #[must_use]
124    pub fn phya(&mut self) -> PHYA_W<23> {
125        PHYA_W::new(self)
126    }
127    #[doc = "Bits 28:29 - Operation"]
128    #[inline(always)]
129    #[must_use]
130    pub fn op(&mut self) -> OP_W<28> {
131        OP_W::new(self)
132    }
133    #[doc = "Bit 30 - Clause 22 Operation"]
134    #[inline(always)]
135    #[must_use]
136    pub fn cltto(&mut self) -> CLTTO_W<30> {
137        CLTTO_W::new(self)
138    }
139    #[doc = "Bit 31 - Write ZERO"]
140    #[inline(always)]
141    #[must_use]
142    pub fn wzo(&mut self) -> WZO_W<31> {
143        WZO_W::new(self)
144    }
145    #[doc = "Writes raw bits to the register."]
146    #[inline(always)]
147    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
148        self.0.bits(bits);
149        self
150    }
151}
152#[doc = "PHY Maintenance Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [man](index.html) module"]
153pub struct MAN_SPEC;
154impl crate::RegisterSpec for MAN_SPEC {
155    type Ux = u32;
156}
157#[doc = "`read()` method returns [man::R](R) reader structure"]
158impl crate::Readable for MAN_SPEC {
159    type Reader = R;
160}
161#[doc = "`write(|w| ..)` method takes [man::W](W) writer structure"]
162impl crate::Writable for MAN_SPEC {
163    type Writer = W;
164    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
165    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
166}
167#[doc = "`reset()` method sets MAN to value 0"]
168impl crate::Resettable for MAN_SPEC {
169    const RESET_VALUE: Self::Ux = 0;
170}