swm341_pac/usbd/
devsr.rs

1#[doc = "Register `DEVSR` reader"]
2pub struct R(crate::R<DEVSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DEVSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DEVSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DEVSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `CFG` reader - CFG field"]
17pub type CFG_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `INTF` reader - INTF field"]
19pub type INTF_R = crate::FieldReader<u8, u8>;
20#[doc = "Field `ALT` reader - ALT field"]
21pub type ALT_R = crate::FieldReader<u8, u8>;
22#[doc = "Field `SUSP` reader - SUSP field"]
23pub type SUSP_R = crate::BitReader<bool>;
24#[doc = "Field `FRNR` reader - FRNR field"]
25pub type FRNR_R = crate::FieldReader<u16, u16>;
26impl R {
27    #[doc = "Bits 0:3 - CFG field"]
28    #[inline(always)]
29    pub fn cfg(&self) -> CFG_R {
30        CFG_R::new((self.bits & 0x0f) as u8)
31    }
32    #[doc = "Bits 4:7 - INTF field"]
33    #[inline(always)]
34    pub fn intf(&self) -> INTF_R {
35        INTF_R::new(((self.bits >> 4) & 0x0f) as u8)
36    }
37    #[doc = "Bits 8:11 - ALT field"]
38    #[inline(always)]
39    pub fn alt(&self) -> ALT_R {
40        ALT_R::new(((self.bits >> 8) & 0x0f) as u8)
41    }
42    #[doc = "Bit 12 - SUSP field"]
43    #[inline(always)]
44    pub fn susp(&self) -> SUSP_R {
45        SUSP_R::new(((self.bits >> 12) & 1) != 0)
46    }
47    #[doc = "Bits 21:31 - FRNR field"]
48    #[inline(always)]
49    pub fn frnr(&self) -> FRNR_R {
50        FRNR_R::new(((self.bits >> 21) & 0x07ff) as u16)
51    }
52}
53#[doc = "DEVSR 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 [devsr](index.html) module"]
54pub struct DEVSR_SPEC;
55impl crate::RegisterSpec for DEVSR_SPEC {
56    type Ux = u32;
57}
58#[doc = "`read()` method returns [devsr::R](R) reader structure"]
59impl crate::Readable for DEVSR_SPEC {
60    type Reader = R;
61}
62#[doc = "`reset()` method sets DEVSR to value 0"]
63impl crate::Resettable for DEVSR_SPEC {
64    #[inline(always)]
65    fn reset_value() -> Self::Ux {
66        0
67    }
68}