efm32gg12b830_pac/usb/
if_.rs

1#[doc = "Register `IF` reader"]
2pub struct R(crate::R<IF_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IF_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IF_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IF_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `VBUSDETH` reader - VBUS Detect High Interrupt Flag"]
17pub type VBUSDETH_R = crate::BitReader<bool>;
18#[doc = "Field `VBUSDETL` reader - VBUS Detect Low Interrupt Flag"]
19pub type VBUSDETL_R = crate::BitReader<bool>;
20#[doc = "Field `ERR` reader - Detection Error Interrupt Flag"]
21pub type ERR_R = crate::BitReader<bool>;
22#[doc = "Field `DCD` reader - Data Contact Detection Complete Interrupt Flag"]
23pub type DCD_R = crate::BitReader<bool>;
24#[doc = "Field `PD` reader - Primary Detection Complete Interrupt Flag"]
25pub type PD_R = crate::BitReader<bool>;
26#[doc = "Field `SD` reader - Secondary Detection Complete Interrupt Flag"]
27pub type SD_R = crate::BitReader<bool>;
28impl R {
29    #[doc = "Bit 0 - VBUS Detect High Interrupt Flag"]
30    #[inline(always)]
31    pub fn vbusdeth(&self) -> VBUSDETH_R {
32        VBUSDETH_R::new((self.bits & 1) != 0)
33    }
34    #[doc = "Bit 1 - VBUS Detect Low Interrupt Flag"]
35    #[inline(always)]
36    pub fn vbusdetl(&self) -> VBUSDETL_R {
37        VBUSDETL_R::new(((self.bits >> 1) & 1) != 0)
38    }
39    #[doc = "Bit 8 - Detection Error Interrupt Flag"]
40    #[inline(always)]
41    pub fn err(&self) -> ERR_R {
42        ERR_R::new(((self.bits >> 8) & 1) != 0)
43    }
44    #[doc = "Bit 9 - Data Contact Detection Complete Interrupt Flag"]
45    #[inline(always)]
46    pub fn dcd(&self) -> DCD_R {
47        DCD_R::new(((self.bits >> 9) & 1) != 0)
48    }
49    #[doc = "Bit 10 - Primary Detection Complete Interrupt Flag"]
50    #[inline(always)]
51    pub fn pd(&self) -> PD_R {
52        PD_R::new(((self.bits >> 10) & 1) != 0)
53    }
54    #[doc = "Bit 11 - Secondary Detection Complete Interrupt Flag"]
55    #[inline(always)]
56    pub fn sd(&self) -> SD_R {
57        SD_R::new(((self.bits >> 11) & 1) != 0)
58    }
59}
60#[doc = "Interrupt Flag 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 [if_](index.html) module"]
61pub struct IF_SPEC;
62impl crate::RegisterSpec for IF_SPEC {
63    type Ux = u32;
64}
65#[doc = "`read()` method returns [if_::R](R) reader structure"]
66impl crate::Readable for IF_SPEC {
67    type Reader = R;
68}
69#[doc = "`reset()` method sets IF to value 0"]
70impl crate::Resettable for IF_SPEC {
71    #[inline(always)]
72    fn reset_value() -> Self::Ux {
73        0
74    }
75}