atsamd51p/qspi/
scrambctrl.rs
1#[doc = "Register `SCRAMBCTRL` reader"]
2pub type R = crate::R<ScrambctrlSpec>;
3#[doc = "Register `SCRAMBCTRL` writer"]
4pub type W = crate::W<ScrambctrlSpec>;
5#[doc = "Field `ENABLE` reader - Scrambling/Unscrambling Enable"]
6pub type EnableR = crate::BitReader;
7#[doc = "Field `ENABLE` writer - Scrambling/Unscrambling Enable"]
8pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `RANDOMDIS` reader - Scrambling/Unscrambling Random Value Disable"]
10pub type RandomdisR = crate::BitReader;
11#[doc = "Field `RANDOMDIS` writer - Scrambling/Unscrambling Random Value Disable"]
12pub type RandomdisW<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 #[doc = "Bit 0 - Scrambling/Unscrambling Enable"]
15 #[inline(always)]
16 pub fn enable(&self) -> EnableR {
17 EnableR::new((self.bits & 1) != 0)
18 }
19 #[doc = "Bit 1 - Scrambling/Unscrambling Random Value Disable"]
20 #[inline(always)]
21 pub fn randomdis(&self) -> RandomdisR {
22 RandomdisR::new(((self.bits >> 1) & 1) != 0)
23 }
24}
25impl W {
26 #[doc = "Bit 0 - Scrambling/Unscrambling Enable"]
27 #[inline(always)]
28 #[must_use]
29 pub fn enable(&mut self) -> EnableW<ScrambctrlSpec> {
30 EnableW::new(self, 0)
31 }
32 #[doc = "Bit 1 - Scrambling/Unscrambling Random Value Disable"]
33 #[inline(always)]
34 #[must_use]
35 pub fn randomdis(&mut self) -> RandomdisW<ScrambctrlSpec> {
36 RandomdisW::new(self, 1)
37 }
38}
39#[doc = "Scrambling Mode\n\nYou can [`read`](crate::Reg::read) this register and get [`scrambctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`scrambctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct ScrambctrlSpec;
41impl crate::RegisterSpec for ScrambctrlSpec {
42 type Ux = u32;
43}
44#[doc = "`read()` method returns [`scrambctrl::R`](R) reader structure"]
45impl crate::Readable for ScrambctrlSpec {}
46#[doc = "`write(|w| ..)` method takes [`scrambctrl::W`](W) writer structure"]
47impl crate::Writable for ScrambctrlSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets SCRAMBCTRL to value 0"]
53impl crate::Resettable for ScrambctrlSpec {
54 const RESET_VALUE: u32 = 0;
55}