mcxa_pac/i3c0/
stcclock.rs1#[doc = "Register `STCCLOCK` reader"]
2pub type R = crate::R<StcclockSpec>;
3#[doc = "Register `STCCLOCK` writer"]
4pub type W = crate::W<StcclockSpec>;
5#[doc = "Field `ACCURACY` reader - Clock Accuracy"]
6pub type AccuracyR = crate::FieldReader;
7#[doc = "Field `ACCURACY` writer - Clock Accuracy"]
8pub type AccuracyW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `FREQ` reader - Clock Frequency"]
10pub type FreqR = crate::FieldReader;
11#[doc = "Field `FREQ` writer - Clock Frequency"]
12pub type FreqW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13impl R {
14 #[doc = "Bits 0:7 - Clock Accuracy"]
15 #[inline(always)]
16 pub fn accuracy(&self) -> AccuracyR {
17 AccuracyR::new((self.bits & 0xff) as u8)
18 }
19 #[doc = "Bits 8:15 - Clock Frequency"]
20 #[inline(always)]
21 pub fn freq(&self) -> FreqR {
22 FreqR::new(((self.bits >> 8) & 0xff) as u8)
23 }
24}
25#[cfg(feature = "debug")]
26impl core::fmt::Debug for R {
27 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28 f.debug_struct("STCCLOCK")
29 .field("accuracy", &self.accuracy())
30 .field("freq", &self.freq())
31 .finish()
32 }
33}
34impl W {
35 #[doc = "Bits 0:7 - Clock Accuracy"]
36 #[inline(always)]
37 pub fn accuracy(&mut self) -> AccuracyW<'_, StcclockSpec> {
38 AccuracyW::new(self, 0)
39 }
40 #[doc = "Bits 8:15 - Clock Frequency"]
41 #[inline(always)]
42 pub fn freq(&mut self) -> FreqW<'_, StcclockSpec> {
43 FreqW::new(self, 8)
44 }
45}
46#[doc = "Target Time Control Clock\n\nYou can [`read`](crate::Reg::read) this register and get [`stcclock::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`stcclock::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct StcclockSpec;
48impl crate::RegisterSpec for StcclockSpec {
49 type Ux = u32;
50}
51#[doc = "`read()` method returns [`stcclock::R`](R) reader structure"]
52impl crate::Readable for StcclockSpec {}
53#[doc = "`write(|w| ..)` method takes [`stcclock::W`](W) writer structure"]
54impl crate::Writable for StcclockSpec {
55 type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets STCCLOCK to value 0x3014"]
58impl crate::Resettable for StcclockSpec {
59 const RESET_VALUE: u32 = 0x3014;
60}