saml10d15a/dsu/
ctrl.rs

1#[doc = "Writer for register CTRL"]
2pub type W = crate::W<u8, super::CTRL>;
3#[doc = "Register CTRL `reset()`'s with value 0"]
4impl crate::ResetValue for super::CTRL {
5    type Type = u8;
6    #[inline(always)]
7    fn reset_value() -> Self::Type {
8        0
9    }
10}
11#[doc = "Write proxy for field `SWRST`"]
12pub struct SWRST_W<'a> {
13    w: &'a mut W,
14}
15impl<'a> SWRST_W<'a> {
16    #[doc = r"Sets the field bit"]
17    #[inline(always)]
18    pub fn set_bit(self) -> &'a mut W {
19        self.bit(true)
20    }
21    #[doc = r"Clears the field bit"]
22    #[inline(always)]
23    pub fn clear_bit(self) -> &'a mut W {
24        self.bit(false)
25    }
26    #[doc = r"Writes raw bits to the field"]
27    #[inline(always)]
28    pub fn bit(self, value: bool) -> &'a mut W {
29        self.w.bits = (self.w.bits & !0x01) | ((value as u8) & 0x01);
30        self.w
31    }
32}
33#[doc = "Write proxy for field `CRC`"]
34pub struct CRC_W<'a> {
35    w: &'a mut W,
36}
37impl<'a> CRC_W<'a> {
38    #[doc = r"Sets the field bit"]
39    #[inline(always)]
40    pub fn set_bit(self) -> &'a mut W {
41        self.bit(true)
42    }
43    #[doc = r"Clears the field bit"]
44    #[inline(always)]
45    pub fn clear_bit(self) -> &'a mut W {
46        self.bit(false)
47    }
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub fn bit(self, value: bool) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u8) & 0x01) << 2);
52        self.w
53    }
54}
55#[doc = "Write proxy for field `MBIST`"]
56pub struct MBIST_W<'a> {
57    w: &'a mut W,
58}
59impl<'a> MBIST_W<'a> {
60    #[doc = r"Sets the field bit"]
61    #[inline(always)]
62    pub fn set_bit(self) -> &'a mut W {
63        self.bit(true)
64    }
65    #[doc = r"Clears the field bit"]
66    #[inline(always)]
67    pub fn clear_bit(self) -> &'a mut W {
68        self.bit(false)
69    }
70    #[doc = r"Writes raw bits to the field"]
71    #[inline(always)]
72    pub fn bit(self, value: bool) -> &'a mut W {
73        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u8) & 0x01) << 3);
74        self.w
75    }
76}
77impl W {
78    #[doc = "Bit 0 - Software Reset"]
79    #[inline(always)]
80    pub fn swrst(&mut self) -> SWRST_W {
81        SWRST_W { w: self }
82    }
83    #[doc = "Bit 2 - 32-bit Cyclic Redundancy Code"]
84    #[inline(always)]
85    pub fn crc(&mut self) -> CRC_W {
86        CRC_W { w: self }
87    }
88    #[doc = "Bit 3 - Memory built-in self-test"]
89    #[inline(always)]
90    pub fn mbist(&mut self) -> MBIST_W {
91        MBIST_W { w: self }
92    }
93}