k66/mcg/
s2.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u8,
4}
5impl super::S2 {
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 = "Possible values of the field `PLLCST`"]
15#[derive(Clone, Copy, Debug, PartialEq)]
16pub enum PLLCSTR {
17    #[doc = "Source of PLLCS is PLL clock."]
18    _0,
19    #[doc = "Source of PLLCS is EXT_PLL clock."]
20    _1,
21}
22impl PLLCSTR {
23    #[doc = r" Returns `true` if the bit is clear (0)"]
24    #[inline]
25    pub fn bit_is_clear(&self) -> bool {
26        !self.bit()
27    }
28    #[doc = r" Returns `true` if the bit is set (1)"]
29    #[inline]
30    pub fn bit_is_set(&self) -> bool {
31        self.bit()
32    }
33    #[doc = r" Value of the field as raw bits"]
34    #[inline]
35    pub fn bit(&self) -> bool {
36        match *self {
37            PLLCSTR::_0 => false,
38            PLLCSTR::_1 => true,
39        }
40    }
41    #[allow(missing_docs)]
42    #[doc(hidden)]
43    #[inline]
44    pub fn _from(value: bool) -> PLLCSTR {
45        match value {
46            false => PLLCSTR::_0,
47            true => PLLCSTR::_1,
48        }
49    }
50    #[doc = "Checks if the value of the field is `_0`"]
51    #[inline]
52    pub fn is_0(&self) -> bool {
53        *self == PLLCSTR::_0
54    }
55    #[doc = "Checks if the value of the field is `_1`"]
56    #[inline]
57    pub fn is_1(&self) -> bool {
58        *self == PLLCSTR::_1
59    }
60}
61impl R {
62    #[doc = r" Value of the register as raw bits"]
63    #[inline]
64    pub fn bits(&self) -> u8 {
65        self.bits
66    }
67    #[doc = "Bit 4 - PLL Clock Select Status"]
68    #[inline]
69    pub fn pllcst(&self) -> PLLCSTR {
70        PLLCSTR::_from({
71            const MASK: bool = true;
72            const OFFSET: u8 = 4;
73            ((self.bits >> OFFSET) & MASK as u8) != 0
74        })
75    }
76}