atsam3x4e 0.1.0

Peripheral access API for ATSAM3X4E microcontrollers (generated using svd2rust)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
#[doc = "Register `NCFGR` reader"]
pub type R = crate::R<NcfgrSpec>;
#[doc = "Register `NCFGR` writer"]
pub type W = crate::W<NcfgrSpec>;
#[doc = "Field `SPD` reader - Speed"]
pub type SpdR = crate::BitReader;
#[doc = "Field `SPD` writer - Speed"]
pub type SpdW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `FD` reader - Full Duplex"]
pub type FdR = crate::BitReader;
#[doc = "Field `FD` writer - Full Duplex"]
pub type FdW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `JFRAME` reader - Jumbo Frames"]
pub type JframeR = crate::BitReader;
#[doc = "Field `JFRAME` writer - Jumbo Frames"]
pub type JframeW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CAF` reader - Copy All Frames"]
pub type CafR = crate::BitReader;
#[doc = "Field `CAF` writer - Copy All Frames"]
pub type CafW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `NBC` reader - No Broadcast"]
pub type NbcR = crate::BitReader;
#[doc = "Field `NBC` writer - No Broadcast"]
pub type NbcW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `MTI` reader - Multicast Hash Enable"]
pub type MtiR = crate::BitReader;
#[doc = "Field `MTI` writer - Multicast Hash Enable"]
pub type MtiW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `UNI` reader - Unicast Hash Enable"]
pub type UniR = crate::BitReader;
#[doc = "Field `UNI` writer - Unicast Hash Enable"]
pub type UniW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `BIG` reader - Receive 1536 bytes frames"]
pub type BigR = crate::BitReader;
#[doc = "Field `BIG` writer - Receive 1536 bytes frames"]
pub type BigW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "MDC clock divider\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Clk {
    #[doc = "0: MCK divided by 8 (MCK up to 20 MHz)."]
    Mck8 = 0,
    #[doc = "1: MCK divided by 16 (MCK up to 40 MHz)."]
    Mck16 = 1,
    #[doc = "2: MCK divided by 32 (MCK up to 80 MHz)."]
    Mck32 = 2,
    #[doc = "3: MCK divided by 64 (MCK up to 160 MHz)."]
    Mck64 = 3,
}
impl From<Clk> for u8 {
    #[inline(always)]
    fn from(variant: Clk) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Clk {
    type Ux = u8;
}
impl crate::IsEnum for Clk {}
#[doc = "Field `CLK` reader - MDC clock divider"]
pub type ClkR = crate::FieldReader<Clk>;
impl ClkR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Clk {
        match self.bits {
            0 => Clk::Mck8,
            1 => Clk::Mck16,
            2 => Clk::Mck32,
            3 => Clk::Mck64,
            _ => unreachable!(),
        }
    }
    #[doc = "MCK divided by 8 (MCK up to 20 MHz)."]
    #[inline(always)]
    pub fn is_mck_8(&self) -> bool {
        *self == Clk::Mck8
    }
    #[doc = "MCK divided by 16 (MCK up to 40 MHz)."]
    #[inline(always)]
    pub fn is_mck_16(&self) -> bool {
        *self == Clk::Mck16
    }
    #[doc = "MCK divided by 32 (MCK up to 80 MHz)."]
    #[inline(always)]
    pub fn is_mck_32(&self) -> bool {
        *self == Clk::Mck32
    }
    #[doc = "MCK divided by 64 (MCK up to 160 MHz)."]
    #[inline(always)]
    pub fn is_mck_64(&self) -> bool {
        *self == Clk::Mck64
    }
}
#[doc = "Field `CLK` writer - MDC clock divider"]
pub type ClkW<'a, REG> = crate::FieldWriter<'a, REG, 2, Clk, crate::Safe>;
impl<'a, REG> ClkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "MCK divided by 8 (MCK up to 20 MHz)."]
    #[inline(always)]
    pub fn mck_8(self) -> &'a mut crate::W<REG> {
        self.variant(Clk::Mck8)
    }
    #[doc = "MCK divided by 16 (MCK up to 40 MHz)."]
    #[inline(always)]
    pub fn mck_16(self) -> &'a mut crate::W<REG> {
        self.variant(Clk::Mck16)
    }
    #[doc = "MCK divided by 32 (MCK up to 80 MHz)."]
    #[inline(always)]
    pub fn mck_32(self) -> &'a mut crate::W<REG> {
        self.variant(Clk::Mck32)
    }
    #[doc = "MCK divided by 64 (MCK up to 160 MHz)."]
    #[inline(always)]
    pub fn mck_64(self) -> &'a mut crate::W<REG> {
        self.variant(Clk::Mck64)
    }
}
#[doc = "Field `RTY` reader - Retry test"]
pub type RtyR = crate::BitReader;
#[doc = "Field `RTY` writer - Retry test"]
pub type RtyW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `PAE` reader - Pause Enable"]
pub type PaeR = crate::BitReader;
#[doc = "Field `PAE` writer - Pause Enable"]
pub type PaeW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Receive Buffer Offset\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Rbof {
    #[doc = "0: No offset from start of receive buffer."]
    Offset0 = 0,
    #[doc = "1: One-byte offset from start of receive buffer."]
    Offset1 = 1,
    #[doc = "2: Two-byte offset from start of receive buffer."]
    Offset2 = 2,
    #[doc = "3: Three-byte offset from start of receive buffer."]
    Offset3 = 3,
}
impl From<Rbof> for u8 {
    #[inline(always)]
    fn from(variant: Rbof) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Rbof {
    type Ux = u8;
}
impl crate::IsEnum for Rbof {}
#[doc = "Field `RBOF` reader - Receive Buffer Offset"]
pub type RbofR = crate::FieldReader<Rbof>;
impl RbofR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rbof {
        match self.bits {
            0 => Rbof::Offset0,
            1 => Rbof::Offset1,
            2 => Rbof::Offset2,
            3 => Rbof::Offset3,
            _ => unreachable!(),
        }
    }
    #[doc = "No offset from start of receive buffer."]
    #[inline(always)]
    pub fn is_offset_0(&self) -> bool {
        *self == Rbof::Offset0
    }
    #[doc = "One-byte offset from start of receive buffer."]
    #[inline(always)]
    pub fn is_offset_1(&self) -> bool {
        *self == Rbof::Offset1
    }
    #[doc = "Two-byte offset from start of receive buffer."]
    #[inline(always)]
    pub fn is_offset_2(&self) -> bool {
        *self == Rbof::Offset2
    }
    #[doc = "Three-byte offset from start of receive buffer."]
    #[inline(always)]
    pub fn is_offset_3(&self) -> bool {
        *self == Rbof::Offset3
    }
}
#[doc = "Field `RBOF` writer - Receive Buffer Offset"]
pub type RbofW<'a, REG> = crate::FieldWriter<'a, REG, 2, Rbof, crate::Safe>;
impl<'a, REG> RbofW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "No offset from start of receive buffer."]
    #[inline(always)]
    pub fn offset_0(self) -> &'a mut crate::W<REG> {
        self.variant(Rbof::Offset0)
    }
    #[doc = "One-byte offset from start of receive buffer."]
    #[inline(always)]
    pub fn offset_1(self) -> &'a mut crate::W<REG> {
        self.variant(Rbof::Offset1)
    }
    #[doc = "Two-byte offset from start of receive buffer."]
    #[inline(always)]
    pub fn offset_2(self) -> &'a mut crate::W<REG> {
        self.variant(Rbof::Offset2)
    }
    #[doc = "Three-byte offset from start of receive buffer."]
    #[inline(always)]
    pub fn offset_3(self) -> &'a mut crate::W<REG> {
        self.variant(Rbof::Offset3)
    }
}
#[doc = "Field `RLCE` reader - Receive Length field Checking Enable"]
pub type RlceR = crate::BitReader;
#[doc = "Field `RLCE` writer - Receive Length field Checking Enable"]
pub type RlceW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `DRFCS` reader - Discard Receive FCS"]
pub type DrfcsR = crate::BitReader;
#[doc = "Field `DRFCS` writer - Discard Receive FCS"]
pub type DrfcsW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `EFRHD` reader - "]
pub type EfrhdR = crate::BitReader;
#[doc = "Field `EFRHD` writer - "]
pub type EfrhdW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `IRXFCS` reader - Ignore RX FCS"]
pub type IrxfcsR = crate::BitReader;
#[doc = "Field `IRXFCS` writer - Ignore RX FCS"]
pub type IrxfcsW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
    #[doc = "Bit 0 - Speed"]
    #[inline(always)]
    pub fn spd(&self) -> SpdR {
        SpdR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Full Duplex"]
    #[inline(always)]
    pub fn fd(&self) -> FdR {
        FdR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 3 - Jumbo Frames"]
    #[inline(always)]
    pub fn jframe(&self) -> JframeR {
        JframeR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Copy All Frames"]
    #[inline(always)]
    pub fn caf(&self) -> CafR {
        CafR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - No Broadcast"]
    #[inline(always)]
    pub fn nbc(&self) -> NbcR {
        NbcR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Multicast Hash Enable"]
    #[inline(always)]
    pub fn mti(&self) -> MtiR {
        MtiR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Unicast Hash Enable"]
    #[inline(always)]
    pub fn uni(&self) -> UniR {
        UniR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Receive 1536 bytes frames"]
    #[inline(always)]
    pub fn big(&self) -> BigR {
        BigR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bits 10:11 - MDC clock divider"]
    #[inline(always)]
    pub fn clk(&self) -> ClkR {
        ClkR::new(((self.bits >> 10) & 3) as u8)
    }
    #[doc = "Bit 12 - Retry test"]
    #[inline(always)]
    pub fn rty(&self) -> RtyR {
        RtyR::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Pause Enable"]
    #[inline(always)]
    pub fn pae(&self) -> PaeR {
        PaeR::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bits 14:15 - Receive Buffer Offset"]
    #[inline(always)]
    pub fn rbof(&self) -> RbofR {
        RbofR::new(((self.bits >> 14) & 3) as u8)
    }
    #[doc = "Bit 16 - Receive Length field Checking Enable"]
    #[inline(always)]
    pub fn rlce(&self) -> RlceR {
        RlceR::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - Discard Receive FCS"]
    #[inline(always)]
    pub fn drfcs(&self) -> DrfcsR {
        DrfcsR::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18"]
    #[inline(always)]
    pub fn efrhd(&self) -> EfrhdR {
        EfrhdR::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - Ignore RX FCS"]
    #[inline(always)]
    pub fn irxfcs(&self) -> IrxfcsR {
        IrxfcsR::new(((self.bits >> 19) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Speed"]
    #[inline(always)]
    #[must_use]
    pub fn spd(&mut self) -> SpdW<NcfgrSpec> {
        SpdW::new(self, 0)
    }
    #[doc = "Bit 1 - Full Duplex"]
    #[inline(always)]
    #[must_use]
    pub fn fd(&mut self) -> FdW<NcfgrSpec> {
        FdW::new(self, 1)
    }
    #[doc = "Bit 3 - Jumbo Frames"]
    #[inline(always)]
    #[must_use]
    pub fn jframe(&mut self) -> JframeW<NcfgrSpec> {
        JframeW::new(self, 3)
    }
    #[doc = "Bit 4 - Copy All Frames"]
    #[inline(always)]
    #[must_use]
    pub fn caf(&mut self) -> CafW<NcfgrSpec> {
        CafW::new(self, 4)
    }
    #[doc = "Bit 5 - No Broadcast"]
    #[inline(always)]
    #[must_use]
    pub fn nbc(&mut self) -> NbcW<NcfgrSpec> {
        NbcW::new(self, 5)
    }
    #[doc = "Bit 6 - Multicast Hash Enable"]
    #[inline(always)]
    #[must_use]
    pub fn mti(&mut self) -> MtiW<NcfgrSpec> {
        MtiW::new(self, 6)
    }
    #[doc = "Bit 7 - Unicast Hash Enable"]
    #[inline(always)]
    #[must_use]
    pub fn uni(&mut self) -> UniW<NcfgrSpec> {
        UniW::new(self, 7)
    }
    #[doc = "Bit 8 - Receive 1536 bytes frames"]
    #[inline(always)]
    #[must_use]
    pub fn big(&mut self) -> BigW<NcfgrSpec> {
        BigW::new(self, 8)
    }
    #[doc = "Bits 10:11 - MDC clock divider"]
    #[inline(always)]
    #[must_use]
    pub fn clk(&mut self) -> ClkW<NcfgrSpec> {
        ClkW::new(self, 10)
    }
    #[doc = "Bit 12 - Retry test"]
    #[inline(always)]
    #[must_use]
    pub fn rty(&mut self) -> RtyW<NcfgrSpec> {
        RtyW::new(self, 12)
    }
    #[doc = "Bit 13 - Pause Enable"]
    #[inline(always)]
    #[must_use]
    pub fn pae(&mut self) -> PaeW<NcfgrSpec> {
        PaeW::new(self, 13)
    }
    #[doc = "Bits 14:15 - Receive Buffer Offset"]
    #[inline(always)]
    #[must_use]
    pub fn rbof(&mut self) -> RbofW<NcfgrSpec> {
        RbofW::new(self, 14)
    }
    #[doc = "Bit 16 - Receive Length field Checking Enable"]
    #[inline(always)]
    #[must_use]
    pub fn rlce(&mut self) -> RlceW<NcfgrSpec> {
        RlceW::new(self, 16)
    }
    #[doc = "Bit 17 - Discard Receive FCS"]
    #[inline(always)]
    #[must_use]
    pub fn drfcs(&mut self) -> DrfcsW<NcfgrSpec> {
        DrfcsW::new(self, 17)
    }
    #[doc = "Bit 18"]
    #[inline(always)]
    #[must_use]
    pub fn efrhd(&mut self) -> EfrhdW<NcfgrSpec> {
        EfrhdW::new(self, 18)
    }
    #[doc = "Bit 19 - Ignore RX FCS"]
    #[inline(always)]
    #[must_use]
    pub fn irxfcs(&mut self) -> IrxfcsW<NcfgrSpec> {
        IrxfcsW::new(self, 19)
    }
}
#[doc = "Network Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ncfgr::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ncfgr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct NcfgrSpec;
impl crate::RegisterSpec for NcfgrSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ncfgr::R`](R) reader structure"]
impl crate::Readable for NcfgrSpec {}
#[doc = "`write(|w| ..)` method takes [`ncfgr::W`](W) writer structure"]
impl crate::Writable for NcfgrSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets NCFGR to value 0x0800"]
impl crate::Resettable for NcfgrSpec {
    const RESET_VALUE: u32 = 0x0800;
}