1#[doc = "Register `TYPE` reader"]
2pub type R = crate::R<TypeSpec>;
3#[doc = "Field `GCLK` reader - dynamic Clock Gating supported"]
4pub type GclkR = crate::BitReader;
5#[doc = "Field `RRP` reader - Round Robin Policy supported"]
6pub type RrpR = crate::BitReader;
7#[doc = "Number of Way\n\nValue on reset: 2"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9#[repr(u8)]
10pub enum Waynumselect {
11 #[doc = "2: 4-WAY set associative"]
12 Arch4way = 2,
13}
14impl From<Waynumselect> for u8 {
15 #[inline(always)]
16 fn from(variant: Waynumselect) -> Self {
17 variant as _
18 }
19}
20impl crate::FieldSpec for Waynumselect {
21 type Ux = u8;
22}
23impl crate::IsEnum for Waynumselect {}
24#[doc = "Field `WAYNUM` reader - Number of Way"]
25pub type WaynumR = crate::FieldReader<Waynumselect>;
26impl WaynumR {
27 #[doc = "Get enumerated values variant"]
28 #[inline(always)]
29 pub const fn variant(&self) -> Option<Waynumselect> {
30 match self.bits {
31 2 => Some(Waynumselect::Arch4way),
32 _ => None,
33 }
34 }
35 #[doc = "4-WAY set associative"]
36 #[inline(always)]
37 pub fn is_arch4way(&self) -> bool {
38 *self == Waynumselect::Arch4way
39 }
40}
41#[doc = "Field `LCKDOWN` reader - Lock Down supported"]
42pub type LckdownR = crate::BitReader;
43#[doc = "Cache Size\n\nValue on reset: 2"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45#[repr(u8)]
46pub enum Csizeselect {
47 #[doc = "0: Cache Size is 1 KB"]
48 Csize1kb = 0,
49 #[doc = "1: Cache Size is 2 KB"]
50 Csize2kb = 1,
51 #[doc = "2: Cache Size is 4 KB"]
52 Csize4kb = 2,
53}
54impl From<Csizeselect> for u8 {
55 #[inline(always)]
56 fn from(variant: Csizeselect) -> Self {
57 variant as _
58 }
59}
60impl crate::FieldSpec for Csizeselect {
61 type Ux = u8;
62}
63impl crate::IsEnum for Csizeselect {}
64#[doc = "Field `CSIZE` reader - Cache Size"]
65pub type CsizeR = crate::FieldReader<Csizeselect>;
66impl CsizeR {
67 #[doc = "Get enumerated values variant"]
68 #[inline(always)]
69 pub const fn variant(&self) -> Option<Csizeselect> {
70 match self.bits {
71 0 => Some(Csizeselect::Csize1kb),
72 1 => Some(Csizeselect::Csize2kb),
73 2 => Some(Csizeselect::Csize4kb),
74 _ => None,
75 }
76 }
77 #[doc = "Cache Size is 1 KB"]
78 #[inline(always)]
79 pub fn is_csize_1kb(&self) -> bool {
80 *self == Csizeselect::Csize1kb
81 }
82 #[doc = "Cache Size is 2 KB"]
83 #[inline(always)]
84 pub fn is_csize_2kb(&self) -> bool {
85 *self == Csizeselect::Csize2kb
86 }
87 #[doc = "Cache Size is 4 KB"]
88 #[inline(always)]
89 pub fn is_csize_4kb(&self) -> bool {
90 *self == Csizeselect::Csize4kb
91 }
92}
93#[doc = "Cache Line Size\n\nValue on reset: 2"]
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95#[repr(u8)]
96pub enum Clsizeselect {
97 #[doc = "2: Cache Line Size is 16 bytes"]
98 Clsize16b = 2,
99}
100impl From<Clsizeselect> for u8 {
101 #[inline(always)]
102 fn from(variant: Clsizeselect) -> Self {
103 variant as _
104 }
105}
106impl crate::FieldSpec for Clsizeselect {
107 type Ux = u8;
108}
109impl crate::IsEnum for Clsizeselect {}
110#[doc = "Field `CLSIZE` reader - Cache Line Size"]
111pub type ClsizeR = crate::FieldReader<Clsizeselect>;
112impl ClsizeR {
113 #[doc = "Get enumerated values variant"]
114 #[inline(always)]
115 pub const fn variant(&self) -> Option<Clsizeselect> {
116 match self.bits {
117 2 => Some(Clsizeselect::Clsize16b),
118 _ => None,
119 }
120 }
121 #[doc = "Cache Line Size is 16 bytes"]
122 #[inline(always)]
123 pub fn is_clsize_16b(&self) -> bool {
124 *self == Clsizeselect::Clsize16b
125 }
126}
127impl R {
128 #[doc = "Bit 1 - dynamic Clock Gating supported"]
129 #[inline(always)]
130 pub fn gclk(&self) -> GclkR {
131 GclkR::new(((self.bits >> 1) & 1) != 0)
132 }
133 #[doc = "Bit 4 - Round Robin Policy supported"]
134 #[inline(always)]
135 pub fn rrp(&self) -> RrpR {
136 RrpR::new(((self.bits >> 4) & 1) != 0)
137 }
138 #[doc = "Bits 5:6 - Number of Way"]
139 #[inline(always)]
140 pub fn waynum(&self) -> WaynumR {
141 WaynumR::new(((self.bits >> 5) & 3) as u8)
142 }
143 #[doc = "Bit 7 - Lock Down supported"]
144 #[inline(always)]
145 pub fn lckdown(&self) -> LckdownR {
146 LckdownR::new(((self.bits >> 7) & 1) != 0)
147 }
148 #[doc = "Bits 8:10 - Cache Size"]
149 #[inline(always)]
150 pub fn csize(&self) -> CsizeR {
151 CsizeR::new(((self.bits >> 8) & 7) as u8)
152 }
153 #[doc = "Bits 11:13 - Cache Line Size"]
154 #[inline(always)]
155 pub fn clsize(&self) -> ClsizeR {
156 ClsizeR::new(((self.bits >> 11) & 7) as u8)
157 }
158}
159#[doc = "Cache Type Register\n\nYou can [`read`](crate::Reg::read) this register and get [`type_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
160pub struct TypeSpec;
161impl crate::RegisterSpec for TypeSpec {
162 type Ux = u32;
163}
164#[doc = "`read()` method returns [`type_::R`](R) reader structure"]
165impl crate::Readable for TypeSpec {}
166#[doc = "`reset()` method sets TYPE to value 0x12d2"]
167impl crate::Resettable for TypeSpec {
168 const RESET_VALUE: u32 = 0x12d2;
169}