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 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
#[doc = "Reader of register BODVBAT"] pub type R = crate::R<u32, super::BODVBAT>; #[doc = "Writer for register BODVBAT"] pub type W = crate::W<u32, super::BODVBAT>; #[doc = "Register BODVBAT `reset()`'s with value 0x47"] impl crate::ResetValue for super::BODVBAT { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0x47 } } #[doc = "BoD trigger level.\n\nValue on reset: 7"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum TRIGLVL_A { #[doc = "0: 1.00 V."] V_1P00 = 0, #[doc = "1: 1.10 V."] V_1P10 = 1, #[doc = "2: 1.20 V."] V_1P20 = 2, #[doc = "3: 1.30 V."] V_1P30 = 3, #[doc = "4: 1.40 V."] V_1P40 = 4, #[doc = "5: 1.50 V."] V_1P50 = 5, #[doc = "6: 1.60 V."] V_1P60 = 6, #[doc = "7: 1.65 V."] V_1P65 = 7, #[doc = "8: 1.70 V."] V_1P70 = 8, #[doc = "9: 1.75 V."] V_1P75 = 9, #[doc = "10: 1.80 V."] V_1P80 = 10, #[doc = "11: 1.90 V."] V_1P90 = 11, #[doc = "12: 2.00 V."] V_2P00 = 12, #[doc = "13: 2.10 V."] V_2P10 = 13, #[doc = "14: 2.20 V."] V_2P20 = 14, #[doc = "15: 2.30 V."] V_2P30 = 15, #[doc = "16: 2.40 V."] V_2P40 = 16, #[doc = "17: 2.50 V."] V_2P50 = 17, #[doc = "18: 2.60 V."] V_2P60 = 18, #[doc = "19: 2.70 V."] V_2P70 = 19, #[doc = "20: 2.806 V."] V_2P80 = 20, #[doc = "21: 2.90 V."] V_2P90 = 21, #[doc = "22: 3.00 V."] V_3P00 = 22, #[doc = "23: 3.10 V."] V_3P10 = 23, #[doc = "24: 3.20 V."] V_3P20 = 24, #[doc = "25: 3.30 V."] V_3P30_2 = 25, #[doc = "26: 3.30 V."] V_3P30_3 = 26, #[doc = "27: 3.30 V."] V_3P30_4 = 27, #[doc = "28: 3.30 V."] V_3P30_5 = 28, #[doc = "29: 3.30 V."] V_3P30_6 = 29, #[doc = "30: 3.30 V."] V_3P30_7 = 30, #[doc = "31: 3.30 V."] V_3P30_8 = 31, } impl From<TRIGLVL_A> for u8 { #[inline(always)] fn from(variant: TRIGLVL_A) -> Self { variant as _ } } #[doc = "Reader of field `TRIGLVL`"] pub type TRIGLVL_R = crate::R<u8, TRIGLVL_A>; impl TRIGLVL_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRIGLVL_A { match self.bits { 0 => TRIGLVL_A::V_1P00, 1 => TRIGLVL_A::V_1P10, 2 => TRIGLVL_A::V_1P20, 3 => TRIGLVL_A::V_1P30, 4 => TRIGLVL_A::V_1P40, 5 => TRIGLVL_A::V_1P50, 6 => TRIGLVL_A::V_1P60, 7 => TRIGLVL_A::V_1P65, 8 => TRIGLVL_A::V_1P70, 9 => TRIGLVL_A::V_1P75, 10 => TRIGLVL_A::V_1P80, 11 => TRIGLVL_A::V_1P90, 12 => TRIGLVL_A::V_2P00, 13 => TRIGLVL_A::V_2P10, 14 => TRIGLVL_A::V_2P20, 15 => TRIGLVL_A::V_2P30, 16 => TRIGLVL_A::V_2P40, 17 => TRIGLVL_A::V_2P50, 18 => TRIGLVL_A::V_2P60, 19 => TRIGLVL_A::V_2P70, 20 => TRIGLVL_A::V_2P80, 21 => TRIGLVL_A::V_2P90, 22 => TRIGLVL_A::V_3P00, 23 => TRIGLVL_A::V_3P10, 24 => TRIGLVL_A::V_3P20, 25 => TRIGLVL_A::V_3P30_2, 26 => TRIGLVL_A::V_3P30_3, 27 => TRIGLVL_A::V_3P30_4, 28 => TRIGLVL_A::V_3P30_5, 29 => TRIGLVL_A::V_3P30_6, 30 => TRIGLVL_A::V_3P30_7, 31 => TRIGLVL_A::V_3P30_8, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `V_1P00`"] #[inline(always)] pub fn is_v_1p00(&self) -> bool { *self == TRIGLVL_A::V_1P00 } #[doc = "Checks if the value of the field is `V_1P10`"] #[inline(always)] pub fn is_v_1p10(&self) -> bool { *self == TRIGLVL_A::V_1P10 } #[doc = "Checks if the value of the field is `V_1P20`"] #[inline(always)] pub fn is_v_1p20(&self) -> bool { *self == TRIGLVL_A::V_1P20 } #[doc = "Checks if the value of the field is `V_1P30`"] #[inline(always)] pub fn is_v_1p30(&self) -> bool { *self == TRIGLVL_A::V_1P30 } #[doc = "Checks if the value of the field is `V_1P40`"] #[inline(always)] pub fn is_v_1p40(&self) -> bool { *self == TRIGLVL_A::V_1P40 } #[doc = "Checks if the value of the field is `V_1P50`"] #[inline(always)] pub fn is_v_1p50(&self) -> bool { *self == TRIGLVL_A::V_1P50 } #[doc = "Checks if the value of the field is `V_1P60`"] #[inline(always)] pub fn is_v_1p60(&self) -> bool { *self == TRIGLVL_A::V_1P60 } #[doc = "Checks if the value of the field is `V_1P65`"] #[inline(always)] pub fn is_v_1p65(&self) -> bool { *self == TRIGLVL_A::V_1P65 } #[doc = "Checks if the value of the field is `V_1P70`"] #[inline(always)] pub fn is_v_1p70(&self) -> bool { *self == TRIGLVL_A::V_1P70 } #[doc = "Checks if the value of the field is `V_1P75`"] #[inline(always)] pub fn is_v_1p75(&self) -> bool { *self == TRIGLVL_A::V_1P75 } #[doc = "Checks if the value of the field is `V_1P80`"] #[inline(always)] pub fn is_v_1p80(&self) -> bool { *self == TRIGLVL_A::V_1P80 } #[doc = "Checks if the value of the field is `V_1P90`"] #[inline(always)] pub fn is_v_1p90(&self) -> bool { *self == TRIGLVL_A::V_1P90 } #[doc = "Checks if the value of the field is `V_2P00`"] #[inline(always)] pub fn is_v_2p00(&self) -> bool { *self == TRIGLVL_A::V_2P00 } #[doc = "Checks if the value of the field is `V_2P10`"] #[inline(always)] pub fn is_v_2p10(&self) -> bool { *self == TRIGLVL_A::V_2P10 } #[doc = "Checks if the value of the field is `V_2P20`"] #[inline(always)] pub fn is_v_2p20(&self) -> bool { *self == TRIGLVL_A::V_2P20 } #[doc = "Checks if the value of the field is `V_2P30`"] #[inline(always)] pub fn is_v_2p30(&self) -> bool { *self == TRIGLVL_A::V_2P30 } #[doc = "Checks if the value of the field is `V_2P40`"] #[inline(always)] pub fn is_v_2p40(&self) -> bool { *self == TRIGLVL_A::V_2P40 } #[doc = "Checks if the value of the field is `V_2P50`"] #[inline(always)] pub fn is_v_2p50(&self) -> bool { *self == TRIGLVL_A::V_2P50 } #[doc = "Checks if the value of the field is `V_2P60`"] #[inline(always)] pub fn is_v_2p60(&self) -> bool { *self == TRIGLVL_A::V_2P60 } #[doc = "Checks if the value of the field is `V_2P70`"] #[inline(always)] pub fn is_v_2p70(&self) -> bool { *self == TRIGLVL_A::V_2P70 } #[doc = "Checks if the value of the field is `V_2P80`"] #[inline(always)] pub fn is_v_2p80(&self) -> bool { *self == TRIGLVL_A::V_2P80 } #[doc = "Checks if the value of the field is `V_2P90`"] #[inline(always)] pub fn is_v_2p90(&self) -> bool { *self == TRIGLVL_A::V_2P90 } #[doc = "Checks if the value of the field is `V_3P00`"] #[inline(always)] pub fn is_v_3p00(&self) -> bool { *self == TRIGLVL_A::V_3P00 } #[doc = "Checks if the value of the field is `V_3P10`"] #[inline(always)] pub fn is_v_3p10(&self) -> bool { *self == TRIGLVL_A::V_3P10 } #[doc = "Checks if the value of the field is `V_3P20`"] #[inline(always)] pub fn is_v_3p20(&self) -> bool { *self == TRIGLVL_A::V_3P20 } #[doc = "Checks if the value of the field is `V_3P30_2`"] #[inline(always)] pub fn is_v_3p30_2(&self) -> bool { *self == TRIGLVL_A::V_3P30_2 } #[doc = "Checks if the value of the field is `V_3P30_3`"] #[inline(always)] pub fn is_v_3p30_3(&self) -> bool { *self == TRIGLVL_A::V_3P30_3 } #[doc = "Checks if the value of the field is `V_3P30_4`"] #[inline(always)] pub fn is_v_3p30_4(&self) -> bool { *self == TRIGLVL_A::V_3P30_4 } #[doc = "Checks if the value of the field is `V_3P30_5`"] #[inline(always)] pub fn is_v_3p30_5(&self) -> bool { *self == TRIGLVL_A::V_3P30_5 } #[doc = "Checks if the value of the field is `V_3P30_6`"] #[inline(always)] pub fn is_v_3p30_6(&self) -> bool { *self == TRIGLVL_A::V_3P30_6 } #[doc = "Checks if the value of the field is `V_3P30_7`"] #[inline(always)] pub fn is_v_3p30_7(&self) -> bool { *self == TRIGLVL_A::V_3P30_7 } #[doc = "Checks if the value of the field is `V_3P30_8`"] #[inline(always)] pub fn is_v_3p30_8(&self) -> bool { *self == TRIGLVL_A::V_3P30_8 } } #[doc = "Write proxy for field `TRIGLVL`"] pub struct TRIGLVL_W<'a> { w: &'a mut W, } impl<'a> TRIGLVL_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRIGLVL_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "1.00 V."] #[inline(always)] pub fn v_1p00(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P00) } #[doc = "1.10 V."] #[inline(always)] pub fn v_1p10(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P10) } #[doc = "1.20 V."] #[inline(always)] pub fn v_1p20(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P20) } #[doc = "1.30 V."] #[inline(always)] pub fn v_1p30(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P30) } #[doc = "1.40 V."] #[inline(always)] pub fn v_1p40(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P40) } #[doc = "1.50 V."] #[inline(always)] pub fn v_1p50(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P50) } #[doc = "1.60 V."] #[inline(always)] pub fn v_1p60(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P60) } #[doc = "1.65 V."] #[inline(always)] pub fn v_1p65(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P65) } #[doc = "1.70 V."] #[inline(always)] pub fn v_1p70(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P70) } #[doc = "1.75 V."] #[inline(always)] pub fn v_1p75(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P75) } #[doc = "1.80 V."] #[inline(always)] pub fn v_1p80(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P80) } #[doc = "1.90 V."] #[inline(always)] pub fn v_1p90(self) -> &'a mut W { self.variant(TRIGLVL_A::V_1P90) } #[doc = "2.00 V."] #[inline(always)] pub fn v_2p00(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P00) } #[doc = "2.10 V."] #[inline(always)] pub fn v_2p10(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P10) } #[doc = "2.20 V."] #[inline(always)] pub fn v_2p20(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P20) } #[doc = "2.30 V."] #[inline(always)] pub fn v_2p30(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P30) } #[doc = "2.40 V."] #[inline(always)] pub fn v_2p40(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P40) } #[doc = "2.50 V."] #[inline(always)] pub fn v_2p50(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P50) } #[doc = "2.60 V."] #[inline(always)] pub fn v_2p60(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P60) } #[doc = "2.70 V."] #[inline(always)] pub fn v_2p70(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P70) } #[doc = "2.806 V."] #[inline(always)] pub fn v_2p80(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P80) } #[doc = "2.90 V."] #[inline(always)] pub fn v_2p90(self) -> &'a mut W { self.variant(TRIGLVL_A::V_2P90) } #[doc = "3.00 V."] #[inline(always)] pub fn v_3p00(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P00) } #[doc = "3.10 V."] #[inline(always)] pub fn v_3p10(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P10) } #[doc = "3.20 V."] #[inline(always)] pub fn v_3p20(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P20) } #[doc = "3.30 V."] #[inline(always)] pub fn v_3p30_2(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P30_2) } #[doc = "3.30 V."] #[inline(always)] pub fn v_3p30_3(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P30_3) } #[doc = "3.30 V."] #[inline(always)] pub fn v_3p30_4(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P30_4) } #[doc = "3.30 V."] #[inline(always)] pub fn v_3p30_5(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P30_5) } #[doc = "3.30 V."] #[inline(always)] pub fn v_3p30_6(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P30_6) } #[doc = "3.30 V."] #[inline(always)] pub fn v_3p30_7(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P30_7) } #[doc = "3.30 V."] #[inline(always)] pub fn v_3p30_8(self) -> &'a mut W { self.variant(TRIGLVL_A::V_3P30_8) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); self.w } } #[doc = "BoD Hysteresis control.\n\nValue on reset: 2"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum HYST_A { #[doc = "0: 25 mV."] HYST_25MV = 0, #[doc = "1: 50 mV."] HYST_50MV = 1, #[doc = "2: 75 mV."] HYST_75MV = 2, #[doc = "3: 100 mV."] HYST_100MV = 3, } impl From<HYST_A> for u8 { #[inline(always)] fn from(variant: HYST_A) -> Self { variant as _ } } #[doc = "Reader of field `HYST`"] pub type HYST_R = crate::R<u8, HYST_A>; impl HYST_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> HYST_A { match self.bits { 0 => HYST_A::HYST_25MV, 1 => HYST_A::HYST_50MV, 2 => HYST_A::HYST_75MV, 3 => HYST_A::HYST_100MV, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `HYST_25MV`"] #[inline(always)] pub fn is_hyst_25mv(&self) -> bool { *self == HYST_A::HYST_25MV } #[doc = "Checks if the value of the field is `HYST_50MV`"] #[inline(always)] pub fn is_hyst_50mv(&self) -> bool { *self == HYST_A::HYST_50MV } #[doc = "Checks if the value of the field is `HYST_75MV`"] #[inline(always)] pub fn is_hyst_75mv(&self) -> bool { *self == HYST_A::HYST_75MV } #[doc = "Checks if the value of the field is `HYST_100MV`"] #[inline(always)] pub fn is_hyst_100mv(&self) -> bool { *self == HYST_A::HYST_100MV } } #[doc = "Write proxy for field `HYST`"] pub struct HYST_W<'a> { w: &'a mut W, } impl<'a> HYST_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HYST_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "25 mV."] #[inline(always)] pub fn hyst_25mv(self) -> &'a mut W { self.variant(HYST_A::HYST_25MV) } #[doc = "50 mV."] #[inline(always)] pub fn hyst_50mv(self) -> &'a mut W { self.variant(HYST_A::HYST_50MV) } #[doc = "75 mV."] #[inline(always)] pub fn hyst_75mv(self) -> &'a mut W { self.variant(HYST_A::HYST_75MV) } #[doc = "100 mV."] #[inline(always)] pub fn hyst_100mv(self) -> &'a mut W { self.variant(HYST_A::HYST_100MV) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 5)) | (((value as u32) & 0x03) << 5); self.w } } impl R { #[doc = "Bits 0:4 - BoD trigger level."] #[inline(always)] pub fn triglvl(&self) -> TRIGLVL_R { TRIGLVL_R::new((self.bits & 0x1f) as u8) } #[doc = "Bits 5:6 - BoD Hysteresis control."] #[inline(always)] pub fn hyst(&self) -> HYST_R { HYST_R::new(((self.bits >> 5) & 0x03) as u8) } } impl W { #[doc = "Bits 0:4 - BoD trigger level."] #[inline(always)] pub fn triglvl(&mut self) -> TRIGLVL_W { TRIGLVL_W { w: self } } #[doc = "Bits 5:6 - BoD Hysteresis control."] #[inline(always)] pub fn hyst(&mut self) -> HYST_W { HYST_W { w: self } } }