|
1 | 1 | #[doc = "Register `lfrosccfg` reader"] |
2 | | -pub struct R(crate::R<LFROSCCFG_SPEC>); |
3 | | -impl core::ops::Deref for R { |
4 | | - type Target = crate::R<LFROSCCFG_SPEC>; |
5 | | - #[inline(always)] |
6 | | - fn deref(&self) -> &Self::Target { |
7 | | - &self.0 |
8 | | - } |
9 | | -} |
10 | | -impl From<crate::R<LFROSCCFG_SPEC>> for R { |
11 | | - #[inline(always)] |
12 | | - fn from(reader: crate::R<LFROSCCFG_SPEC>) -> Self { |
13 | | - R(reader) |
14 | | - } |
15 | | -} |
| 2 | +pub type R = crate::R<LfrosccfgSpec>; |
16 | 3 | #[doc = "Register `lfrosccfg` writer"] |
17 | | -pub struct W(crate::W<LFROSCCFG_SPEC>); |
18 | | -impl core::ops::Deref for W { |
19 | | - type Target = crate::W<LFROSCCFG_SPEC>; |
20 | | - #[inline(always)] |
21 | | - fn deref(&self) -> &Self::Target { |
22 | | - &self.0 |
23 | | - } |
24 | | -} |
25 | | -impl core::ops::DerefMut for W { |
26 | | - #[inline(always)] |
27 | | - fn deref_mut(&mut self) -> &mut Self::Target { |
28 | | - &mut self.0 |
29 | | - } |
30 | | -} |
31 | | -impl From<crate::W<LFROSCCFG_SPEC>> for W { |
32 | | - #[inline(always)] |
33 | | - fn from(writer: crate::W<LFROSCCFG_SPEC>) -> Self { |
34 | | - W(writer) |
35 | | - } |
36 | | -} |
| 4 | +pub type W = crate::W<LfrosccfgSpec>; |
37 | 5 | #[doc = "Field `div` reader - "] |
38 | | -pub type DIV_R = crate::FieldReader<u8, u8>; |
| 6 | +pub type DivR = crate::FieldReader; |
39 | 7 | #[doc = "Field `div` writer - "] |
40 | | -pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 6, O>; |
| 8 | +pub type DivW<'a, REG> = crate::FieldWriter<'a, REG, 6>; |
41 | 9 | #[doc = "Field `trim` reader - "] |
42 | | -pub type TRIM_R = crate::FieldReader<u8, u8>; |
| 10 | +pub type TrimR = crate::FieldReader; |
43 | 11 | #[doc = "Field `trim` writer - "] |
44 | | -pub type TRIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 5, O>; |
| 12 | +pub type TrimW<'a, REG> = crate::FieldWriter<'a, REG, 5>; |
45 | 13 | #[doc = "Field `enable` reader - "] |
46 | | -pub type ENABLE_R = crate::BitReader<bool>; |
| 14 | +pub type EnableR = crate::BitReader; |
47 | 15 | #[doc = "Field `enable` writer - "] |
48 | | -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>; |
| 16 | +pub type EnableW<'a, REG> = crate::BitWriter<'a, REG>; |
49 | 17 | #[doc = "Field `ready` reader - "] |
50 | | -pub type READY_R = crate::BitReader<bool>; |
| 18 | +pub type ReadyR = crate::BitReader; |
51 | 19 | #[doc = "Field `ready` writer - "] |
52 | | -pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>; |
| 20 | +pub type ReadyW<'a, REG> = crate::BitWriter<'a, REG>; |
53 | 21 | impl R { |
54 | 22 | #[doc = "Bits 0:5"] |
55 | 23 | #[inline(always)] |
56 | | - pub fn div(&self) -> DIV_R { |
57 | | - DIV_R::new((self.bits & 0x3f) as u8) |
| 24 | + pub fn div(&self) -> DivR { |
| 25 | + DivR::new((self.bits & 0x3f) as u8) |
58 | 26 | } |
59 | 27 | #[doc = "Bits 16:20"] |
60 | 28 | #[inline(always)] |
61 | | - pub fn trim(&self) -> TRIM_R { |
62 | | - TRIM_R::new(((self.bits >> 16) & 0x1f) as u8) |
| 29 | + pub fn trim(&self) -> TrimR { |
| 30 | + TrimR::new(((self.bits >> 16) & 0x1f) as u8) |
63 | 31 | } |
64 | 32 | #[doc = "Bit 30"] |
65 | 33 | #[inline(always)] |
66 | | - pub fn enable(&self) -> ENABLE_R { |
67 | | - ENABLE_R::new(((self.bits >> 30) & 1) != 0) |
| 34 | + pub fn enable(&self) -> EnableR { |
| 35 | + EnableR::new(((self.bits >> 30) & 1) != 0) |
68 | 36 | } |
69 | 37 | #[doc = "Bit 31"] |
70 | 38 | #[inline(always)] |
71 | | - pub fn ready(&self) -> READY_R { |
72 | | - READY_R::new(((self.bits >> 31) & 1) != 0) |
| 39 | + pub fn ready(&self) -> ReadyR { |
| 40 | + ReadyR::new(((self.bits >> 31) & 1) != 0) |
73 | 41 | } |
74 | 42 | } |
75 | 43 | impl W { |
76 | 44 | #[doc = "Bits 0:5"] |
77 | 45 | #[inline(always)] |
78 | | - pub fn div(&mut self) -> DIV_W<0> { |
79 | | - DIV_W::new(self) |
| 46 | + #[must_use] |
| 47 | + pub fn div(&mut self) -> DivW<LfrosccfgSpec> { |
| 48 | + DivW::new(self, 0) |
80 | 49 | } |
81 | 50 | #[doc = "Bits 16:20"] |
82 | 51 | #[inline(always)] |
83 | | - pub fn trim(&mut self) -> TRIM_W<16> { |
84 | | - TRIM_W::new(self) |
| 52 | + #[must_use] |
| 53 | + pub fn trim(&mut self) -> TrimW<LfrosccfgSpec> { |
| 54 | + TrimW::new(self, 16) |
85 | 55 | } |
86 | 56 | #[doc = "Bit 30"] |
87 | 57 | #[inline(always)] |
88 | | - pub fn enable(&mut self) -> ENABLE_W<30> { |
89 | | - ENABLE_W::new(self) |
| 58 | + #[must_use] |
| 59 | + pub fn enable(&mut self) -> EnableW<LfrosccfgSpec> { |
| 60 | + EnableW::new(self, 30) |
90 | 61 | } |
91 | 62 | #[doc = "Bit 31"] |
92 | 63 | #[inline(always)] |
93 | | - pub fn ready(&mut self) -> READY_W<31> { |
94 | | - READY_W::new(self) |
95 | | - } |
96 | | - #[doc = "Writes raw bits to the register."] |
97 | | - #[inline(always)] |
98 | | - pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { |
99 | | - self.0.bits(bits); |
100 | | - self |
| 64 | + #[must_use] |
| 65 | + pub fn ready(&mut self) -> ReadyW<LfrosccfgSpec> { |
| 66 | + ReadyW::new(self, 31) |
101 | 67 | } |
102 | 68 | } |
103 | | -#[doc = "AON Clock Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lfrosccfg](index.html) module"] |
104 | | -pub struct LFROSCCFG_SPEC; |
105 | | -impl crate::RegisterSpec for LFROSCCFG_SPEC { |
| 69 | +#[doc = "AON Clock Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`lfrosccfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lfrosccfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] |
| 70 | +pub struct LfrosccfgSpec; |
| 71 | +impl crate::RegisterSpec for LfrosccfgSpec { |
106 | 72 | type Ux = u32; |
107 | 73 | } |
108 | | -#[doc = "`read()` method returns [lfrosccfg::R](R) reader structure"] |
109 | | -impl crate::Readable for LFROSCCFG_SPEC { |
110 | | - type Reader = R; |
111 | | -} |
112 | | -#[doc = "`write(|w| ..)` method takes [lfrosccfg::W](W) writer structure"] |
113 | | -impl crate::Writable for LFROSCCFG_SPEC { |
114 | | - type Writer = W; |
| 74 | +#[doc = "`read()` method returns [`lfrosccfg::R`](R) reader structure"] |
| 75 | +impl crate::Readable for LfrosccfgSpec {} |
| 76 | +#[doc = "`write(|w| ..)` method takes [`lfrosccfg::W`](W) writer structure"] |
| 77 | +impl crate::Writable for LfrosccfgSpec { |
| 78 | + type Safety = crate::Unsafe; |
| 79 | + const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0; |
| 80 | + const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0; |
115 | 81 | } |
116 | 82 | #[doc = "`reset()` method sets lfrosccfg to value 0"] |
117 | | -impl crate::Resettable for LFROSCCFG_SPEC { |
118 | | - #[inline(always)] |
119 | | - fn reset_value() -> Self::Ux { |
120 | | - 0 |
121 | | - } |
| 83 | +impl crate::Resettable for LfrosccfgSpec { |
| 84 | + const RESET_VALUE: u32 = 0; |
122 | 85 | } |
0 commit comments