efm32hg210_pac/cmu/
cmd.rs1#[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 #[doc = "5: Select USHFRCO divided by two as HFCLK."]
35 USHFRCODIV2 = 5,
36}
37impl From<HFCLKSEL_AW> for u8 {
38 #[inline(always)]
39 fn from(variant: HFCLKSEL_AW) -> Self {
40 variant as _
41 }
42}
43#[doc = "Field `HFCLKSEL` writer - HFCLK Select"]
44pub type HFCLKSEL_W<'a> = crate::FieldWriter<'a, u32, CMD_SPEC, u8, HFCLKSEL_AW, 3, 0>;
45impl<'a> HFCLKSEL_W<'a> {
46 #[doc = "Select HFRCO as HFCLK."]
47 #[inline(always)]
48 pub fn hfrco(self) -> &'a mut W {
49 self.variant(HFCLKSEL_AW::HFRCO)
50 }
51 #[doc = "Select HFXO as HFCLK."]
52 #[inline(always)]
53 pub fn hfxo(self) -> &'a mut W {
54 self.variant(HFCLKSEL_AW::HFXO)
55 }
56 #[doc = "Select LFRCO as HFCLK."]
57 #[inline(always)]
58 pub fn lfrco(self) -> &'a mut W {
59 self.variant(HFCLKSEL_AW::LFRCO)
60 }
61 #[doc = "Select LFXO as HFCLK."]
62 #[inline(always)]
63 pub fn lfxo(self) -> &'a mut W {
64 self.variant(HFCLKSEL_AW::LFXO)
65 }
66 #[doc = "Select USHFRCO divided by two as HFCLK."]
67 #[inline(always)]
68 pub fn ushfrcodiv2(self) -> &'a mut W {
69 self.variant(HFCLKSEL_AW::USHFRCODIV2)
70 }
71}
72#[doc = "Field `CALSTART` writer - Calibration Start"]
73pub type CALSTART_W<'a> = crate::BitWriter<'a, u32, CMD_SPEC, bool, 3>;
74#[doc = "Field `CALSTOP` writer - Calibration Stop"]
75pub type CALSTOP_W<'a> = crate::BitWriter<'a, u32, CMD_SPEC, bool, 4>;
76impl W {
77 #[doc = "Bits 0:2 - HFCLK Select"]
78 #[inline(always)]
79 pub fn hfclksel(&mut self) -> HFCLKSEL_W {
80 HFCLKSEL_W::new(self)
81 }
82 #[doc = "Bit 3 - Calibration Start"]
83 #[inline(always)]
84 pub fn calstart(&mut self) -> CALSTART_W {
85 CALSTART_W::new(self)
86 }
87 #[doc = "Bit 4 - Calibration Stop"]
88 #[inline(always)]
89 pub fn calstop(&mut self) -> CALSTOP_W {
90 CALSTOP_W::new(self)
91 }
92 #[doc = "Writes raw bits to the register."]
93 #[inline(always)]
94 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
95 self.0.bits(bits);
96 self
97 }
98}
99#[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"]
100pub struct CMD_SPEC;
101impl crate::RegisterSpec for CMD_SPEC {
102 type Ux = u32;
103}
104#[doc = "`write(|w| ..)` method takes [cmd::W](W) writer structure"]
105impl crate::Writable for CMD_SPEC {
106 type Writer = W;
107}
108#[doc = "`reset()` method sets CMD to value 0"]
109impl crate::Resettable for CMD_SPEC {
110 #[inline(always)]
111 fn reset_value() -> Self::Ux {
112 0
113 }
114}