efm32gg12b410_pac/usb/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `VBUSDETH` reader - VBUS Detect High"]
17pub type VBUSDETH_R = crate::BitReader<bool>;
18#[doc = "Field `LEMACTIVE` reader - Low Energy Mode Active"]
19pub type LEMACTIVE_R = crate::BitReader<bool>;
20#[doc = "Field `DCDTO` reader - Data Contact Detection Timeout"]
21pub type DCDTO_R = crate::BitReader<bool>;
22#[doc = "Field `SDP` reader - Standard Downstream Port Detected"]
23pub type SDP_R = crate::BitReader<bool>;
24#[doc = "Field `CDP` reader - Charging Downstream Port Detected"]
25pub type CDP_R = crate::BitReader<bool>;
26#[doc = "Field `DCP` reader - Dedicated Charging Port Detected"]
27pub type DCP_R = crate::BitReader<bool>;
28#[doc = "Field `ACAFS` reader - ACA Full Speed TypeB Device"]
29pub type ACAFS_R = crate::BitReader<bool>;
30#[doc = "Field `ACALS` reader - ACA Low Speed TypeB Device"]
31pub type ACALS_R = crate::BitReader<bool>;
32#[doc = "Field `USBCDBUSY` reader - USB Charger Detect Busy"]
33pub type USBCDBUSY_R = crate::BitReader<bool>;
34impl R {
35    #[doc = "Bit 0 - VBUS Detect High"]
36    #[inline(always)]
37    pub fn vbusdeth(&self) -> VBUSDETH_R {
38        VBUSDETH_R::new((self.bits & 1) != 0)
39    }
40    #[doc = "Bit 2 - Low Energy Mode Active"]
41    #[inline(always)]
42    pub fn lemactive(&self) -> LEMACTIVE_R {
43        LEMACTIVE_R::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 8 - Data Contact Detection Timeout"]
46    #[inline(always)]
47    pub fn dcdto(&self) -> DCDTO_R {
48        DCDTO_R::new(((self.bits >> 8) & 1) != 0)
49    }
50    #[doc = "Bit 9 - Standard Downstream Port Detected"]
51    #[inline(always)]
52    pub fn sdp(&self) -> SDP_R {
53        SDP_R::new(((self.bits >> 9) & 1) != 0)
54    }
55    #[doc = "Bit 10 - Charging Downstream Port Detected"]
56    #[inline(always)]
57    pub fn cdp(&self) -> CDP_R {
58        CDP_R::new(((self.bits >> 10) & 1) != 0)
59    }
60    #[doc = "Bit 11 - Dedicated Charging Port Detected"]
61    #[inline(always)]
62    pub fn dcp(&self) -> DCP_R {
63        DCP_R::new(((self.bits >> 11) & 1) != 0)
64    }
65    #[doc = "Bit 12 - ACA Full Speed TypeB Device"]
66    #[inline(always)]
67    pub fn acafs(&self) -> ACAFS_R {
68        ACAFS_R::new(((self.bits >> 12) & 1) != 0)
69    }
70    #[doc = "Bit 13 - ACA Low Speed TypeB Device"]
71    #[inline(always)]
72    pub fn acals(&self) -> ACALS_R {
73        ACALS_R::new(((self.bits >> 13) & 1) != 0)
74    }
75    #[doc = "Bit 15 - USB Charger Detect Busy"]
76    #[inline(always)]
77    pub fn usbcdbusy(&self) -> USBCDBUSY_R {
78        USBCDBUSY_R::new(((self.bits >> 15) & 1) != 0)
79    }
80}
81#[doc = "System 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 [status](index.html) module"]
82pub struct STATUS_SPEC;
83impl crate::RegisterSpec for STATUS_SPEC {
84    type Ux = u32;
85}
86#[doc = "`read()` method returns [status::R](R) reader structure"]
87impl crate::Readable for STATUS_SPEC {
88    type Reader = R;
89}
90#[doc = "`reset()` method sets STATUS to value 0"]
91impl crate::Resettable for STATUS_SPEC {
92    #[inline(always)]
93    fn reset_value() -> Self::Ux {
94        0
95    }
96}