efm32wg_pac/efm32wg230/cmu/
cmd.rs

1#[doc = "Register `CMD` writer"]
2pub struct W(crate::W<CMD_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<CMD_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<CMD_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<CMD_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "HFCLK Select\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq, Eq)]
24#[repr(u8)]
25pub enum HFCLKSEL_AW {
26    #[doc = "1: Select HFRCO as HFCLK."]
27    HFRCO = 1,
28    #[doc = "2: Select HFXO as HFCLK."]
29    HFXO = 2,
30    #[doc = "3: Select LFRCO as HFCLK."]
31    LFRCO = 3,
32    #[doc = "4: Select LFXO as HFCLK."]
33    LFXO = 4,
34}
35impl From<HFCLKSEL_AW> for u8 {
36    #[inline(always)]
37    fn from(variant: HFCLKSEL_AW) -> Self {
38        variant as _
39    }
40}
41#[doc = "Field `HFCLKSEL` writer - HFCLK Select"]
42pub type HFCLKSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMD_SPEC, u8, HFCLKSEL_AW, 3, O>;
43impl<'a, const O: u8> HFCLKSEL_W<'a, O> {
44    #[doc = "Select HFRCO as HFCLK."]
45    #[inline(always)]
46    pub fn hfrco(self) -> &'a mut W {
47        self.variant(HFCLKSEL_AW::HFRCO)
48    }
49    #[doc = "Select HFXO as HFCLK."]
50    #[inline(always)]
51    pub fn hfxo(self) -> &'a mut W {
52        self.variant(HFCLKSEL_AW::HFXO)
53    }
54    #[doc = "Select LFRCO as HFCLK."]
55    #[inline(always)]
56    pub fn lfrco(self) -> &'a mut W {
57        self.variant(HFCLKSEL_AW::LFRCO)
58    }
59    #[doc = "Select LFXO as HFCLK."]
60    #[inline(always)]
61    pub fn lfxo(self) -> &'a mut W {
62        self.variant(HFCLKSEL_AW::LFXO)
63    }
64}
65#[doc = "Field `CALSTART` writer - Calibration Start"]
66pub type CALSTART_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
67#[doc = "Field `CALSTOP` writer - Calibration Stop"]
68pub type CALSTOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMD_SPEC, bool, O>;
69impl W {
70    #[doc = "Bits 0:2 - HFCLK Select"]
71    #[inline(always)]
72    #[must_use]
73    pub fn hfclksel(&mut self) -> HFCLKSEL_W<0> {
74        HFCLKSEL_W::new(self)
75    }
76    #[doc = "Bit 3 - Calibration Start"]
77    #[inline(always)]
78    #[must_use]
79    pub fn calstart(&mut self) -> CALSTART_W<3> {
80        CALSTART_W::new(self)
81    }
82    #[doc = "Bit 4 - Calibration Stop"]
83    #[inline(always)]
84    #[must_use]
85    pub fn calstop(&mut self) -> CALSTOP_W<4> {
86        CALSTOP_W::new(self)
87    }
88    #[doc = "Writes raw bits to the register."]
89    #[inline(always)]
90    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
91        self.0.bits(bits);
92        self
93    }
94}
95#[doc = "Command Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cmd](index.html) module"]
96pub struct CMD_SPEC;
97impl crate::RegisterSpec for CMD_SPEC {
98    type Ux = u32;
99}
100#[doc = "`write(|w| ..)` method takes [cmd::W](W) writer structure"]
101impl crate::Writable for CMD_SPEC {
102    type Writer = W;
103    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
104    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
105}
106#[doc = "`reset()` method sets CMD to value 0"]
107impl crate::Resettable for CMD_SPEC {
108    const RESET_VALUE: Self::Ux = 0;
109}