1#[doc = r"Value read from the register"]
2pub struct R {
3 bits: u32,
4}
5#[doc = r"Value to write to the register"]
6pub struct W {
7 bits: u32,
8}
9impl super::DMACTL {
10 #[doc = r"Modifies the contents of the register"]
11 #[inline(always)]
12 pub fn modify<F>(&self, f: F)
13 where
14 for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15 {
16 let bits = self.register.get();
17 self.register.set(f(&R { bits }, &mut W { bits }).bits);
18 }
19 #[doc = r"Reads the contents of the register"]
20 #[inline(always)]
21 pub fn read(&self) -> R {
22 R {
23 bits: self.register.get(),
24 }
25 }
26 #[doc = r"Writes to the register"]
27 #[inline(always)]
28 pub fn write<F>(&self, f: F)
29 where
30 F: FnOnce(&mut W) -> &mut W,
31 {
32 self.register.set(
33 f(&mut W {
34 bits: Self::reset_value(),
35 })
36 .bits,
37 );
38 }
39 #[doc = r"Reset value of the register"]
40 #[inline(always)]
41 pub const fn reset_value() -> u32 {
42 0
43 }
44 #[doc = r"Writes the reset value to the register"]
45 #[inline(always)]
46 pub fn reset(&self) {
47 self.register.set(Self::reset_value())
48 }
49}
50impl R {
51 #[doc = r"Value of the register as raw bits"]
52 #[inline(always)]
53 pub fn bits(&self) -> u32 {
54 self.bits
55 }
56}
57impl W {
58 #[doc = r"Writes raw bits to the register"]
59 #[inline(always)]
60 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
61 self.bits = bits;
62 self
63 }
64}