atsamd51p/icm/
ctrl.rs
1#[doc = "Register `CTRL` writer"]
2pub type W = crate::W<CtrlSpec>;
3#[doc = "Field `ENABLE` writer - ICM Enable"]
4pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>;
5#[doc = "Field `DISABLE` writer - ICM Disable Register"]
6pub type DisableW<'a, REG> = crate::BitWriter<'a, REG>;
7#[doc = "Field `SWRST` writer - Software Reset"]
8pub type SwrstW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `REHASH` writer - Recompute Internal Hash"]
10pub type RehashW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
11#[doc = "Field `RMDIS` writer - Region Monitoring Disable"]
12pub type RmdisW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `RMEN` writer - Region Monitoring Enable"]
14pub type RmenW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
15impl W {
16 #[doc = "Bit 0 - ICM Enable"]
17 #[inline(always)]
18 #[must_use]
19 pub fn enable(&mut self) -> EnableW<CtrlSpec> {
20 EnableW::new(self, 0)
21 }
22 #[doc = "Bit 1 - ICM Disable Register"]
23 #[inline(always)]
24 #[must_use]
25 pub fn disable(&mut self) -> DisableW<CtrlSpec> {
26 DisableW::new(self, 1)
27 }
28 #[doc = "Bit 2 - Software Reset"]
29 #[inline(always)]
30 #[must_use]
31 pub fn swrst(&mut self) -> SwrstW<CtrlSpec> {
32 SwrstW::new(self, 2)
33 }
34 #[doc = "Bits 4:7 - Recompute Internal Hash"]
35 #[inline(always)]
36 #[must_use]
37 pub fn rehash(&mut self) -> RehashW<CtrlSpec> {
38 RehashW::new(self, 4)
39 }
40 #[doc = "Bits 8:11 - Region Monitoring Disable"]
41 #[inline(always)]
42 #[must_use]
43 pub fn rmdis(&mut self) -> RmdisW<CtrlSpec> {
44 RmdisW::new(self, 8)
45 }
46 #[doc = "Bits 12:15 - Region Monitoring Enable"]
47 #[inline(always)]
48 #[must_use]
49 pub fn rmen(&mut self) -> RmenW<CtrlSpec> {
50 RmenW::new(self, 12)
51 }
52}
53#[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)."]
54pub struct CtrlSpec;
55impl crate::RegisterSpec for CtrlSpec {
56 type Ux = u32;
57}
58#[doc = "`write(|w| ..)` method takes [`ctrl::W`](W) writer structure"]
59impl crate::Writable for CtrlSpec {
60 type Safety = crate::Unsafe;
61 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
62 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
63}
64#[doc = "`reset()` method sets CTRL to value 0"]
65impl crate::Resettable for CtrlSpec {
66 const RESET_VALUE: u32 = 0;
67}