stm32l4x2_pac/dbgmcu/
idcode.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5impl super::IDCODE {
6    #[doc = r" Reads the contents of the register"]
7    #[inline]
8    pub fn read(&self) -> R {
9        R {
10            bits: self.register.get(),
11        }
12    }
13}
14#[doc = r" Value of the field"]
15pub struct DEV_IDR {
16    bits: u16,
17}
18impl DEV_IDR {
19    #[doc = r" Value of the field as raw bits"]
20    #[inline]
21    pub fn bits(&self) -> u16 {
22        self.bits
23    }
24}
25#[doc = r" Value of the field"]
26pub struct REV_IDR {
27    bits: u16,
28}
29impl REV_IDR {
30    #[doc = r" Value of the field as raw bits"]
31    #[inline]
32    pub fn bits(&self) -> u16 {
33        self.bits
34    }
35}
36impl R {
37    #[doc = r" Value of the register as raw bits"]
38    #[inline]
39    pub fn bits(&self) -> u32 {
40        self.bits
41    }
42    #[doc = "Bits 0:11 - Device identifier"]
43    #[inline]
44    pub fn dev_id(&self) -> DEV_IDR {
45        let bits = {
46            const MASK: u16 = 4095;
47            const OFFSET: u8 = 0;
48            ((self.bits >> OFFSET) & MASK as u32) as u16
49        };
50        DEV_IDR { bits }
51    }
52    #[doc = "Bits 16:31 - Revision identifie"]
53    #[inline]
54    pub fn rev_id(&self) -> REV_IDR {
55        let bits = {
56            const MASK: u16 = 65535;
57            const OFFSET: u8 = 16;
58            ((self.bits >> OFFSET) & MASK as u32) as u16
59        };
60        REV_IDR { bits }
61    }
62}