mcxa_pac/sgi0/
sgi_count.rs1#[doc = "Register `sgi_count` reader"]
2pub type R = crate::R<SgiCountSpec>;
3#[doc = "Register `sgi_count` writer"]
4pub type W = crate::W<SgiCountSpec>;
5#[doc = "Field `count` reader - Calculation counter, incremented with"]
6pub type CountR = crate::FieldReader<u16>;
7#[doc = "Field `count` writer - Calculation counter, incremented with"]
8pub type CountW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `count_rsvd` reader - reserved"]
10pub type CountRsvdR = crate::FieldReader<u16>;
11impl R {
12 #[doc = "Bits 0:15 - Calculation counter, incremented with"]
13 #[inline(always)]
14 pub fn count(&self) -> CountR {
15 CountR::new((self.bits & 0xffff) as u16)
16 }
17 #[doc = "Bits 16:31 - reserved"]
18 #[inline(always)]
19 pub fn count_rsvd(&self) -> CountRsvdR {
20 CountRsvdR::new(((self.bits >> 16) & 0xffff) as u16)
21 }
22}
23#[cfg(feature = "debug")]
24impl core::fmt::Debug for R {
25 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
26 f.debug_struct("sgi_count")
27 .field("count", &self.count())
28 .field("count_rsvd", &self.count_rsvd())
29 .finish()
30 }
31}
32impl W {
33 #[doc = "Bits 0:15 - Calculation counter, incremented with"]
34 #[inline(always)]
35 pub fn count(&mut self) -> CountW<'_, SgiCountSpec> {
36 CountW::new(self, 0)
37 }
38}
39#[doc = "Calculation counter\n\nYou can [`read`](crate::Reg::read) this register and get [`sgi_count::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sgi_count::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct SgiCountSpec;
41impl crate::RegisterSpec for SgiCountSpec {
42 type Ux = u32;
43}
44#[doc = "`read()` method returns [`sgi_count::R`](R) reader structure"]
45impl crate::Readable for SgiCountSpec {}
46#[doc = "`write(|w| ..)` method takes [`sgi_count::W`](W) writer structure"]
47impl crate::Writable for SgiCountSpec {
48 type Safety = crate::Unsafe;
49}
50#[doc = "`reset()` method sets sgi_count to value 0"]
51impl crate::Resettable for SgiCountSpec {}