1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
#[doc = "Register `CCR` reader"]
pub struct R(crate::R<CCR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CCR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CCR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CCR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Unaligned accesses generates a Hard Fault\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum UNALIGN_TRP_A {
#[doc = "0: Do not trap unaligned halfword and word accesses"]
VALUE_0 = 0,
#[doc = "1: Trap unaligned halfword and word accesses"]
VALUE_1 = 1,
}
impl From<UNALIGN_TRP_A> for bool {
#[inline(always)]
fn from(variant: UNALIGN_TRP_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `UNALIGN_TRP` reader - Unaligned accesses generates a Hard Fault"]
pub struct UNALIGN_TRP_R(crate::FieldReader<bool, UNALIGN_TRP_A>);
impl UNALIGN_TRP_R {
pub(crate) fn new(bits: bool) -> Self {
UNALIGN_TRP_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> UNALIGN_TRP_A {
match self.bits {
false => UNALIGN_TRP_A::VALUE_0,
true => UNALIGN_TRP_A::VALUE_1,
}
}
#[doc = "Checks if the value of the field is `VALUE_0`"]
#[inline(always)]
pub fn is_value_0(&self) -> bool {
**self == UNALIGN_TRP_A::VALUE_0
}
#[doc = "Checks if the value of the field is `VALUE_1`"]
#[inline(always)]
pub fn is_value_1(&self) -> bool {
**self == UNALIGN_TRP_A::VALUE_1
}
}
impl core::ops::Deref for UNALIGN_TRP_R {
type Target = crate::FieldReader<bool, UNALIGN_TRP_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Stack 8-byte aligned on exception entry\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STKALIGN_A {
#[doc = "0: 4-byte aligned"]
VALUE_0 = 0,
#[doc = "1: 8-byte aligned"]
VALUE_1 = 1,
}
impl From<STKALIGN_A> for bool {
#[inline(always)]
fn from(variant: STKALIGN_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `STKALIGN` reader - Stack 8-byte aligned on exception entry"]
pub struct STKALIGN_R(crate::FieldReader<bool, STKALIGN_A>);
impl STKALIGN_R {
pub(crate) fn new(bits: bool) -> Self {
STKALIGN_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> STKALIGN_A {
match self.bits {
false => STKALIGN_A::VALUE_0,
true => STKALIGN_A::VALUE_1,
}
}
#[doc = "Checks if the value of the field is `VALUE_0`"]
#[inline(always)]
pub fn is_value_0(&self) -> bool {
**self == STKALIGN_A::VALUE_0
}
#[doc = "Checks if the value of the field is `VALUE_1`"]
#[inline(always)]
pub fn is_value_1(&self) -> bool {
**self == STKALIGN_A::VALUE_1
}
}
impl core::ops::Deref for STKALIGN_R {
type Target = crate::FieldReader<bool, STKALIGN_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl R {
#[doc = "Bit 3 - Unaligned accesses generates a Hard Fault"]
#[inline(always)]
pub fn unalign_trp(&self) -> UNALIGN_TRP_R {
UNALIGN_TRP_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 9 - Stack 8-byte aligned on exception entry"]
#[inline(always)]
pub fn stkalign(&self) -> STKALIGN_R {
STKALIGN_R::new(((self.bits >> 9) & 0x01) != 0)
}
}
#[doc = "Configuration and Control Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ccr](index.html) module"]
pub struct CCR_SPEC;
impl crate::RegisterSpec for CCR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ccr::R](R) reader structure"]
impl crate::Readable for CCR_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets CCR to value 0x0204"]
impl crate::Resettable for CCR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x0204
}
}
|