|
| 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 | +} |
| 16 | +#[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 | +} |
| 37 | +#[doc = "Field `div` reader - "] |
| 38 | +pub type DIV_R = crate::FieldReader<u8, u8>; |
| 39 | +#[doc = "Field `div` writer - "] |
| 40 | +pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 6, O>; |
| 41 | +#[doc = "Field `trim` reader - "] |
| 42 | +pub type TRIM_R = crate::FieldReader<u8, u8>; |
| 43 | +#[doc = "Field `trim` writer - "] |
| 44 | +pub type TRIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LFROSCCFG_SPEC, u8, u8, 5, O>; |
| 45 | +#[doc = "Field `enable` reader - "] |
| 46 | +pub type ENABLE_R = crate::BitReader<bool>; |
| 47 | +#[doc = "Field `enable` writer - "] |
| 48 | +pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>; |
| 49 | +#[doc = "Field `ready` reader - "] |
| 50 | +pub type READY_R = crate::BitReader<bool>; |
| 51 | +#[doc = "Field `ready` writer - "] |
| 52 | +pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, LFROSCCFG_SPEC, bool, O>; |
| 53 | +impl R { |
| 54 | + #[doc = "Bits 0:5"] |
| 55 | + #[inline(always)] |
| 56 | + pub fn div(&self) -> DIV_R { |
| 57 | + DIV_R::new((self.bits & 0x3f) as u8) |
| 58 | + } |
| 59 | + #[doc = "Bits 16:20"] |
| 60 | + #[inline(always)] |
| 61 | + pub fn trim(&self) -> TRIM_R { |
| 62 | + TRIM_R::new(((self.bits >> 16) & 0x1f) as u8) |
| 63 | + } |
| 64 | + #[doc = "Bit 30"] |
| 65 | + #[inline(always)] |
| 66 | + pub fn enable(&self) -> ENABLE_R { |
| 67 | + ENABLE_R::new(((self.bits >> 30) & 1) != 0) |
| 68 | + } |
| 69 | + #[doc = "Bit 31"] |
| 70 | + #[inline(always)] |
| 71 | + pub fn ready(&self) -> READY_R { |
| 72 | + READY_R::new(((self.bits >> 31) & 1) != 0) |
| 73 | + } |
| 74 | +} |
| 75 | +impl W { |
| 76 | + #[doc = "Bits 0:5"] |
| 77 | + #[inline(always)] |
| 78 | + pub fn div(&mut self) -> DIV_W<0> { |
| 79 | + DIV_W::new(self) |
| 80 | + } |
| 81 | + #[doc = "Bits 16:20"] |
| 82 | + #[inline(always)] |
| 83 | + pub fn trim(&mut self) -> TRIM_W<16> { |
| 84 | + TRIM_W::new(self) |
| 85 | + } |
| 86 | + #[doc = "Bit 30"] |
| 87 | + #[inline(always)] |
| 88 | + pub fn enable(&mut self) -> ENABLE_W<30> { |
| 89 | + ENABLE_W::new(self) |
| 90 | + } |
| 91 | + #[doc = "Bit 31"] |
| 92 | + #[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 |
| 101 | + } |
| 102 | +} |
| 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 { |
| 106 | + type Ux = u32; |
| 107 | +} |
| 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; |
| 115 | +} |
| 116 | +#[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 | + } |
| 122 | +} |
0 commit comments