atsamd21j/dsu/
ctrl.rs

1#[doc = "Register `CTRL` writer"]
2pub type W = crate::W<CtrlSpec>;
3#[doc = "Field `SWRST` writer - Software Reset"]
4pub type SwrstW<'a, REG> = crate::BitWriter<'a, REG>;
5#[doc = "Field `CRC` writer - 32-bit Cyclic Redundancy Check"]
6pub type CrcW<'a, REG> = crate::BitWriter<'a, REG>;
7#[doc = "Field `MBIST` writer - Memory Built-In Self-Test"]
8pub type MbistW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CE` writer - Chip Erase"]
10pub type CeW<'a, REG> = crate::BitWriter<'a, REG>;
11impl W {
12    #[doc = "Bit 0 - Software Reset"]
13    #[inline(always)]
14    #[must_use]
15    pub fn swrst(&mut self) -> SwrstW<CtrlSpec> {
16        SwrstW::new(self, 0)
17    }
18    #[doc = "Bit 2 - 32-bit Cyclic Redundancy Check"]
19    #[inline(always)]
20    #[must_use]
21    pub fn crc(&mut self) -> CrcW<CtrlSpec> {
22        CrcW::new(self, 2)
23    }
24    #[doc = "Bit 3 - Memory Built-In Self-Test"]
25    #[inline(always)]
26    #[must_use]
27    pub fn mbist(&mut self) -> MbistW<CtrlSpec> {
28        MbistW::new(self, 3)
29    }
30    #[doc = "Bit 4 - Chip Erase"]
31    #[inline(always)]
32    #[must_use]
33    pub fn ce(&mut self) -> CeW<CtrlSpec> {
34        CeW::new(self, 4)
35    }
36}
37#[doc = "Control\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrl::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
38pub struct CtrlSpec;
39impl crate::RegisterSpec for CtrlSpec {
40    type Ux = u8;
41}
42#[doc = "`write(|w| ..)` method takes [`ctrl::W`](W) writer structure"]
43impl crate::Writable for CtrlSpec {
44    type Safety = crate::Unsafe;
45    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
46    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
47}
48#[doc = "`reset()` method sets CTRL to value 0"]
49impl crate::Resettable for CtrlSpec {
50    const RESET_VALUE: u8 = 0;
51}