atsam4lc8c/freqm/version/
mod.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5impl super::VERSION {
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 VERSIONR {
16    bits: u16,
17}
18impl VERSIONR {
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 VARIANTR {
27    bits: u8,
28}
29impl VARIANTR {
30    #[doc = r" Value of the field as raw bits"]
31    #[inline]
32    pub fn bits(&self) -> u8 {
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 - Version number"]
43    #[inline]
44    pub fn version(&self) -> VERSIONR {
45        let bits = {
46            const MASK: u16 = 4095;
47            const OFFSET: u8 = 0;
48            ((self.bits >> OFFSET) & MASK as u32) as u16
49        };
50        VERSIONR { bits }
51    }
52    #[doc = "Bits 16:19 - Variant number"]
53    #[inline]
54    pub fn variant(&self) -> VARIANTR {
55        let bits = {
56            const MASK: u8 = 15;
57            const OFFSET: u8 = 16;
58            ((self.bits >> OFFSET) & MASK as u32) as u8
59        };
60        VARIANTR { bits }
61    }
62}