efm32gg12b830_pac/emu/
r5vstatus.rs

1#[doc = "Register `R5VSTATUS` reader"]
2pub struct R(crate::R<R5VSTATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<R5VSTATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<R5VSTATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<R5VSTATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `VREGIDET` reader - VREGI Detected"]
17pub type VREGIDET_R = crate::BitReader<bool>;
18#[doc = "Field `VBUSDET` reader - USB VBUS Detected"]
19pub type VBUSDET_R = crate::BitReader<bool>;
20#[doc = "Field `VREGODET` reader - VREGO Detected"]
21pub type VREGODET_R = crate::BitReader<bool>;
22#[doc = "Field `VBUSGTVREGI` reader - Output of the Supply Comparator Between VBUS and VREGI"]
23pub type VBUSGTVREGI_R = crate::BitReader<bool>;
24#[doc = "Field `LDODROPOUTDET` reader - Regulator Dropout Detection"]
25pub type LDODROPOUTDET_R = crate::BitReader<bool>;
26#[doc = "Field `COLDSTART` reader - Indicates If the Regulator is Going Through a Cold Start"]
27pub type COLDSTART_R = crate::BitReader<bool>;
28impl R {
29    #[doc = "Bit 0 - VREGI Detected"]
30    #[inline(always)]
31    pub fn vregidet(&self) -> VREGIDET_R {
32        VREGIDET_R::new((self.bits & 1) != 0)
33    }
34    #[doc = "Bit 1 - USB VBUS Detected"]
35    #[inline(always)]
36    pub fn vbusdet(&self) -> VBUSDET_R {
37        VBUSDET_R::new(((self.bits >> 1) & 1) != 0)
38    }
39    #[doc = "Bit 2 - VREGO Detected"]
40    #[inline(always)]
41    pub fn vregodet(&self) -> VREGODET_R {
42        VREGODET_R::new(((self.bits >> 2) & 1) != 0)
43    }
44    #[doc = "Bit 3 - Output of the Supply Comparator Between VBUS and VREGI"]
45    #[inline(always)]
46    pub fn vbusgtvregi(&self) -> VBUSGTVREGI_R {
47        VBUSGTVREGI_R::new(((self.bits >> 3) & 1) != 0)
48    }
49    #[doc = "Bit 4 - Regulator Dropout Detection"]
50    #[inline(always)]
51    pub fn ldodropoutdet(&self) -> LDODROPOUTDET_R {
52        LDODROPOUTDET_R::new(((self.bits >> 4) & 1) != 0)
53    }
54    #[doc = "Bit 5 - Indicates If the Regulator is Going Through a Cold Start"]
55    #[inline(always)]
56    pub fn coldstart(&self) -> COLDSTART_R {
57        COLDSTART_R::new(((self.bits >> 5) & 1) != 0)
58    }
59}
60#[doc = "5V Detector Status 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 [r5vstatus](index.html) module"]
61pub struct R5VSTATUS_SPEC;
62impl crate::RegisterSpec for R5VSTATUS_SPEC {
63    type Ux = u32;
64}
65#[doc = "`read()` method returns [r5vstatus::R](R) reader structure"]
66impl crate::Readable for R5VSTATUS_SPEC {
67    type Reader = R;
68}
69#[doc = "`reset()` method sets R5VSTATUS to value 0x20"]
70impl crate::Resettable for R5VSTATUS_SPEC {
71    #[inline(always)]
72    fn reset_value() -> Self::Ux {
73        0x20
74    }
75}