atsamd51p/cmcc/
maint1.rs

1#[doc = "Register `MAINT1` writer"]
2pub type W = crate::W<Maint1Spec>;
3#[doc = "Field `INDEX` writer - Invalidate Index"]
4pub type IndexW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
5#[doc = "Invalidate Way\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u8)]
8pub enum Wayselect {
9    #[doc = "0: Way 0 is selection for index invalidation"]
10    Way0 = 0,
11    #[doc = "1: Way 1 is selection for index invalidation"]
12    Way1 = 1,
13    #[doc = "2: Way 2 is selection for index invalidation"]
14    Way2 = 2,
15    #[doc = "3: Way 3 is selection for index invalidation"]
16    Way3 = 3,
17}
18impl From<Wayselect> for u8 {
19    #[inline(always)]
20    fn from(variant: Wayselect) -> Self {
21        variant as _
22    }
23}
24impl crate::FieldSpec for Wayselect {
25    type Ux = u8;
26}
27impl crate::IsEnum for Wayselect {}
28#[doc = "Field `WAY` writer - Invalidate Way"]
29pub type WayW<'a, REG> = crate::FieldWriter<'a, REG, 4, Wayselect>;
30impl<'a, REG> WayW<'a, REG>
31where
32    REG: crate::Writable + crate::RegisterSpec,
33    REG::Ux: From<u8>,
34{
35    #[doc = "Way 0 is selection for index invalidation"]
36    #[inline(always)]
37    pub fn way0(self) -> &'a mut crate::W<REG> {
38        self.variant(Wayselect::Way0)
39    }
40    #[doc = "Way 1 is selection for index invalidation"]
41    #[inline(always)]
42    pub fn way1(self) -> &'a mut crate::W<REG> {
43        self.variant(Wayselect::Way1)
44    }
45    #[doc = "Way 2 is selection for index invalidation"]
46    #[inline(always)]
47    pub fn way2(self) -> &'a mut crate::W<REG> {
48        self.variant(Wayselect::Way2)
49    }
50    #[doc = "Way 3 is selection for index invalidation"]
51    #[inline(always)]
52    pub fn way3(self) -> &'a mut crate::W<REG> {
53        self.variant(Wayselect::Way3)
54    }
55}
56impl W {
57    #[doc = "Bits 4:11 - Invalidate Index"]
58    #[inline(always)]
59    #[must_use]
60    pub fn index(&mut self) -> IndexW<Maint1Spec> {
61        IndexW::new(self, 4)
62    }
63    #[doc = "Bits 28:31 - Invalidate Way"]
64    #[inline(always)]
65    #[must_use]
66    pub fn way(&mut self) -> WayW<Maint1Spec> {
67        WayW::new(self, 28)
68    }
69}
70#[doc = "Cache Maintenance Register 1\n\nYou can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`maint1::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
71pub struct Maint1Spec;
72impl crate::RegisterSpec for Maint1Spec {
73    type Ux = u32;
74}
75#[doc = "`write(|w| ..)` method takes [`maint1::W`](W) writer structure"]
76impl crate::Writable for Maint1Spec {
77    type Safety = crate::Unsafe;
78    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
79    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80}
81#[doc = "`reset()` method sets MAINT1 to value 0"]
82impl crate::Resettable for Maint1Spec {
83    const RESET_VALUE: u32 = 0;
84}