efm32pg12_pac/emu/
dcdclnfreqctrl.rs

1#[doc = "Reader of register DCDCLNFREQCTRL"]
2pub type R = crate::R<u32, super::DCDCLNFREQCTRL>;
3#[doc = "Writer for register DCDCLNFREQCTRL"]
4pub type W = crate::W<u32, super::DCDCLNFREQCTRL>;
5#[doc = "Register DCDCLNFREQCTRL `reset()`'s with value 0x1000_0000"]
6impl crate::ResetValue for super::DCDCLNFREQCTRL {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x1000_0000
11    }
12}
13#[doc = "Reader of field `RCOBAND`"]
14pub type RCOBAND_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `RCOBAND`"]
16pub struct RCOBAND_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> RCOBAND_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07);
24        self.w
25    }
26}
27#[doc = "Reader of field `RCOTRIM`"]
28pub type RCOTRIM_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `RCOTRIM`"]
30pub struct RCOTRIM_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> RCOTRIM_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x1f << 24)) | (((value as u32) & 0x1f) << 24);
38        self.w
39    }
40}
41impl R {
42    #[doc = "Bits 0:2 - LN Mode RCO Frequency Band Selection"]
43    #[inline(always)]
44    pub fn rcoband(&self) -> RCOBAND_R {
45        RCOBAND_R::new((self.bits & 0x07) as u8)
46    }
47    #[doc = "Bits 24:28 - Reserved for internal use. Do not change."]
48    #[inline(always)]
49    pub fn rcotrim(&self) -> RCOTRIM_R {
50        RCOTRIM_R::new(((self.bits >> 24) & 0x1f) as u8)
51    }
52}
53impl W {
54    #[doc = "Bits 0:2 - LN Mode RCO Frequency Band Selection"]
55    #[inline(always)]
56    pub fn rcoband(&mut self) -> RCOBAND_W {
57        RCOBAND_W { w: self }
58    }
59    #[doc = "Bits 24:28 - Reserved for internal use. Do not change."]
60    #[inline(always)]
61    pub fn rcotrim(&mut self) -> RCOTRIM_W {
62        RCOTRIM_W { w: self }
63    }
64}