atsam4sd16b_pac/cmcc/
maint1.rs

1#[doc = "Register `MAINT1` writer"]
2pub struct W(crate::W<MAINT1_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<MAINT1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<MAINT1_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<MAINT1_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Field `INDEX` writer - Invalidate Index"]
23pub type INDEX_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAINT1_SPEC, u8, u8, 5, O>;
24#[doc = "Invalidate Way"]
25#[derive(Clone, Copy, Debug, PartialEq, Eq)]
26#[repr(u8)]
27pub enum WAY_AW {
28    #[doc = "0: Way 0 is selection for index invalidation"]
29    WAY0 = 0,
30    #[doc = "1: Way 1 is selection for index invalidation"]
31    WAY1 = 1,
32    #[doc = "2: Way 2 is selection for index invalidation"]
33    WAY2 = 2,
34    #[doc = "3: Way 3 is selection for index invalidation"]
35    WAY3 = 3,
36}
37impl From<WAY_AW> for u8 {
38    #[inline(always)]
39    fn from(variant: WAY_AW) -> Self {
40        variant as _
41    }
42}
43#[doc = "Field `WAY` writer - Invalidate Way"]
44pub type WAY_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, MAINT1_SPEC, u8, WAY_AW, 2, O>;
45impl<'a, const O: u8> WAY_W<'a, O> {
46    #[doc = "Way 0 is selection for index invalidation"]
47    #[inline(always)]
48    pub fn way0(self) -> &'a mut W {
49        self.variant(WAY_AW::WAY0)
50    }
51    #[doc = "Way 1 is selection for index invalidation"]
52    #[inline(always)]
53    pub fn way1(self) -> &'a mut W {
54        self.variant(WAY_AW::WAY1)
55    }
56    #[doc = "Way 2 is selection for index invalidation"]
57    #[inline(always)]
58    pub fn way2(self) -> &'a mut W {
59        self.variant(WAY_AW::WAY2)
60    }
61    #[doc = "Way 3 is selection for index invalidation"]
62    #[inline(always)]
63    pub fn way3(self) -> &'a mut W {
64        self.variant(WAY_AW::WAY3)
65    }
66}
67impl W {
68    #[doc = "Bits 4:8 - Invalidate Index"]
69    #[inline(always)]
70    #[must_use]
71    pub fn index(&mut self) -> INDEX_W<4> {
72        INDEX_W::new(self)
73    }
74    #[doc = "Bits 30:31 - Invalidate Way"]
75    #[inline(always)]
76    #[must_use]
77    pub fn way(&mut self) -> WAY_W<30> {
78        WAY_W::new(self)
79    }
80    #[doc = "Writes raw bits to the register."]
81    #[inline(always)]
82    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
83        self.0.bits(bits);
84        self
85    }
86}
87#[doc = "Cache Maintenance Register 1\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maint1](index.html) module"]
88pub struct MAINT1_SPEC;
89impl crate::RegisterSpec for MAINT1_SPEC {
90    type Ux = u32;
91}
92#[doc = "`write(|w| ..)` method takes [maint1::W](W) writer structure"]
93impl crate::Writable for MAINT1_SPEC {
94    type Writer = W;
95    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
96    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
97}