efm32g230_pac/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)]
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> = crate::FieldWriter<'a, u32, CMD_SPEC, u8, HFCLKSEL_AW, 3, 0>;
43impl<'a> HFCLKSEL_W<'a> {
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> = crate::BitWriter<'a, u32, CMD_SPEC, bool, 3>;
67impl W {
68    #[doc = "Bits 0:2 - HFCLK Select"]
69    #[inline(always)]
70    pub fn hfclksel(&mut self) -> HFCLKSEL_W {
71        HFCLKSEL_W::new(self)
72    }
73    #[doc = "Bit 3 - Calibration Start"]
74    #[inline(always)]
75    pub fn calstart(&mut self) -> CALSTART_W {
76        CALSTART_W::new(self)
77    }
78    #[doc = "Writes raw bits to the register."]
79    #[inline(always)]
80    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
81        self.0.bits(bits);
82        self
83    }
84}
85#[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"]
86pub struct CMD_SPEC;
87impl crate::RegisterSpec for CMD_SPEC {
88    type Ux = u32;
89}
90#[doc = "`write(|w| ..)` method takes [cmd::W](W) writer structure"]
91impl crate::Writable for CMD_SPEC {
92    type Writer = W;
93}
94#[doc = "`reset()` method sets CMD to value 0"]
95impl crate::Resettable for CMD_SPEC {
96    #[inline(always)]
97    fn reset_value() -> Self::Ux {
98        0
99    }
100}