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
136
137
#[doc = "Register `ANALOG_CTRL_STATUS` reader"]
pub struct R(crate::R<ANALOG_CTRL_STATUS_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<ANALOG_CTRL_STATUS_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<ANALOG_CTRL_STATUS_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<ANALOG_CTRL_STATUS_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Flash Power Down status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FLASH_PWRDWN_A {
    #[doc = "0: Flash is not in power down mode."]
    PWRUP = 0,
    #[doc = "1: Flash is in power down mode."]
    PWRDWN = 1,
}
impl From<FLASH_PWRDWN_A> for bool {
    #[inline(always)]
    fn from(variant: FLASH_PWRDWN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FLASH_PWRDWN` reader - Flash Power Down status."]
pub struct FLASH_PWRDWN_R(crate::FieldReader<bool, FLASH_PWRDWN_A>);
impl FLASH_PWRDWN_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        FLASH_PWRDWN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FLASH_PWRDWN_A {
        match self.bits {
            false => FLASH_PWRDWN_A::PWRUP,
            true => FLASH_PWRDWN_A::PWRDWN,
        }
    }
    #[doc = "Checks if the value of the field is `PWRUP`"]
    #[inline(always)]
    pub fn is_pwrup(&self) -> bool {
        **self == FLASH_PWRDWN_A::PWRUP
    }
    #[doc = "Checks if the value of the field is `PWRDWN`"]
    #[inline(always)]
    pub fn is_pwrdwn(&self) -> bool {
        **self == FLASH_PWRDWN_A::PWRDWN
    }
}
impl core::ops::Deref for FLASH_PWRDWN_R {
    type Target = crate::FieldReader<bool, FLASH_PWRDWN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Flash initialization error status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FLASH_INIT_ERROR_A {
    #[doc = "0: No error."]
    NOERROR = 0,
    #[doc = "1: At least one error occured during flash initialization.."]
    ERROR = 1,
}
impl From<FLASH_INIT_ERROR_A> for bool {
    #[inline(always)]
    fn from(variant: FLASH_INIT_ERROR_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `FLASH_INIT_ERROR` reader - Flash initialization error status."]
pub struct FLASH_INIT_ERROR_R(crate::FieldReader<bool, FLASH_INIT_ERROR_A>);
impl FLASH_INIT_ERROR_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        FLASH_INIT_ERROR_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FLASH_INIT_ERROR_A {
        match self.bits {
            false => FLASH_INIT_ERROR_A::NOERROR,
            true => FLASH_INIT_ERROR_A::ERROR,
        }
    }
    #[doc = "Checks if the value of the field is `NOERROR`"]
    #[inline(always)]
    pub fn is_noerror(&self) -> bool {
        **self == FLASH_INIT_ERROR_A::NOERROR
    }
    #[doc = "Checks if the value of the field is `ERROR`"]
    #[inline(always)]
    pub fn is_error(&self) -> bool {
        **self == FLASH_INIT_ERROR_A::ERROR
    }
}
impl core::ops::Deref for FLASH_INIT_ERROR_R {
    type Target = crate::FieldReader<bool, FLASH_INIT_ERROR_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bit 12 - Flash Power Down status."]
    #[inline(always)]
    pub fn flash_pwrdwn(&self) -> FLASH_PWRDWN_R {
        FLASH_PWRDWN_R::new(((self.bits >> 12) & 0x01) != 0)
    }
    #[doc = "Bit 13 - Flash initialization error status."]
    #[inline(always)]
    pub fn flash_init_error(&self) -> FLASH_INIT_ERROR_R {
        FLASH_INIT_ERROR_R::new(((self.bits >> 13) & 0x01) != 0)
    }
}
#[doc = "Analog Macroblock Identity registers, Flash Status registers\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 [analog_ctrl_status](index.html) module"]
pub struct ANALOG_CTRL_STATUS_SPEC;
impl crate::RegisterSpec for ANALOG_CTRL_STATUS_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [analog_ctrl_status::R](R) reader structure"]
impl crate::Readable for ANALOG_CTRL_STATUS_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets ANALOG_CTRL_STATUS to value 0x5000_0000"]
impl crate::Resettable for ANALOG_CTRL_STATUS_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x5000_0000
    }
}