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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
#[doc = "Reader of register SRS0"] pub type R = crate::R<u8, super::SRS0>; #[doc = "Low Leakage Wakeup Reset\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum WAKEUP_A { #[doc = "0: Reset not caused by LLWU module wakeup source"] _0 = 0, #[doc = "1: Reset caused by LLWU module wakeup source"] _1 = 1, } impl From<WAKEUP_A> for bool { #[inline(always)] fn from(variant: WAKEUP_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `WAKEUP`"] pub type WAKEUP_R = crate::R<bool, WAKEUP_A>; impl WAKEUP_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WAKEUP_A { match self.bits { false => WAKEUP_A::_0, true => WAKEUP_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { *self == WAKEUP_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == WAKEUP_A::_1 } } #[doc = "Low-Voltage Detect Reset\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum LVD_A { #[doc = "0: Reset not caused by LVD trip or POR"] _0 = 0, #[doc = "1: Reset caused by LVD trip or POR"] _1 = 1, } impl From<LVD_A> for bool { #[inline(always)] fn from(variant: LVD_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `LVD`"] pub type LVD_R = crate::R<bool, LVD_A>; impl LVD_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LVD_A { match self.bits { false => LVD_A::_0, true => LVD_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { *self == LVD_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == LVD_A::_1 } } #[doc = "Loss-of-Clock Reset\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum LOC_A { #[doc = "0: Reset not caused by a loss of external clock."] _0 = 0, #[doc = "1: Reset caused by a loss of external clock."] _1 = 1, } impl From<LOC_A> for bool { #[inline(always)] fn from(variant: LOC_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `LOC`"] pub type LOC_R = crate::R<bool, LOC_A>; impl LOC_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LOC_A { match self.bits { false => LOC_A::_0, true => LOC_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { *self == LOC_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == LOC_A::_1 } } #[doc = "Loss-of-Lock Reset\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum LOL_A { #[doc = "0: Reset not caused by a loss of lock in the PLL"] _0 = 0, #[doc = "1: Reset caused by a loss of lock in the PLL"] _1 = 1, } impl From<LOL_A> for bool { #[inline(always)] fn from(variant: LOL_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `LOL`"] pub type LOL_R = crate::R<bool, LOL_A>; impl LOL_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> LOL_A { match self.bits { false => LOL_A::_0, true => LOL_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { *self == LOL_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == LOL_A::_1 } } #[doc = "Watchdog\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum WDOG_A { #[doc = "0: Reset not caused by watchdog timeout"] _0 = 0, #[doc = "1: Reset caused by watchdog timeout"] _1 = 1, } impl From<WDOG_A> for bool { #[inline(always)] fn from(variant: WDOG_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `WDOG`"] pub type WDOG_R = crate::R<bool, WDOG_A>; impl WDOG_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> WDOG_A { match self.bits { false => WDOG_A::_0, true => WDOG_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { *self == WDOG_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == WDOG_A::_1 } } #[doc = "External Reset Pin\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PIN_A { #[doc = "0: Reset not caused by external reset pin"] _0 = 0, #[doc = "1: Reset caused by external reset pin"] _1 = 1, } impl From<PIN_A> for bool { #[inline(always)] fn from(variant: PIN_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `PIN`"] pub type PIN_R = crate::R<bool, PIN_A>; impl PIN_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PIN_A { match self.bits { false => PIN_A::_0, true => PIN_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { *self == PIN_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == PIN_A::_1 } } #[doc = "Power-On Reset\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum POR_A { #[doc = "0: Reset not caused by POR"] _0 = 0, #[doc = "1: Reset caused by POR"] _1 = 1, } impl From<POR_A> for bool { #[inline(always)] fn from(variant: POR_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `POR`"] pub type POR_R = crate::R<bool, POR_A>; impl POR_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> POR_A { match self.bits { false => POR_A::_0, true => POR_A::_1, } } #[doc = "Checks if the value of the field is `_0`"] #[inline(always)] pub fn is_0(&self) -> bool { *self == POR_A::_0 } #[doc = "Checks if the value of the field is `_1`"] #[inline(always)] pub fn is_1(&self) -> bool { *self == POR_A::_1 } } impl R { #[doc = "Bit 0 - Low Leakage Wakeup Reset"] #[inline(always)] pub fn wakeup(&self) -> WAKEUP_R { WAKEUP_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - Low-Voltage Detect Reset"] #[inline(always)] pub fn lvd(&self) -> LVD_R { LVD_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 2 - Loss-of-Clock Reset"] #[inline(always)] pub fn loc(&self) -> LOC_R { LOC_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 3 - Loss-of-Lock Reset"] #[inline(always)] pub fn lol(&self) -> LOL_R { LOL_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 5 - Watchdog"] #[inline(always)] pub fn wdog(&self) -> WDOG_R { WDOG_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 6 - External Reset Pin"] #[inline(always)] pub fn pin(&self) -> PIN_R { PIN_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 7 - Power-On Reset"] #[inline(always)] pub fn por(&self) -> POR_R { POR_R::new(((self.bits >> 7) & 0x01) != 0) } }