stm32wl/stm32wle5/tim1/
cnt.rs

1///Register `CNT` reader
2pub type R = crate::R<CNTrs>;
3///Register `CNT` writer
4pub type W = crate::W<CNTrs>;
5///Field `CNT` reader - CNT
6pub type CNT_R = crate::FieldReader<u16>;
7///Field `CNT` writer - CNT
8pub type CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16, crate::Safe>;
9///Field `UIFCPY` reader - UIF copy
10pub type UIFCPY_R = crate::BitReader;
11impl R {
12    ///Bits 0:15 - CNT
13    #[inline(always)]
14    pub fn cnt(&self) -> CNT_R {
15        CNT_R::new((self.bits & 0xffff) as u16)
16    }
17    ///Bit 31 - UIF copy
18    #[inline(always)]
19    pub fn uifcpy(&self) -> UIFCPY_R {
20        UIFCPY_R::new(((self.bits >> 31) & 1) != 0)
21    }
22}
23impl core::fmt::Debug for R {
24    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
25        f.debug_struct("CNT")
26            .field("uifcpy", &self.uifcpy())
27            .field("cnt", &self.cnt())
28            .finish()
29    }
30}
31impl W {
32    ///Bits 0:15 - CNT
33    #[inline(always)]
34    pub fn cnt(&mut self) -> CNT_W<CNTrs> {
35        CNT_W::new(self, 0)
36    }
37}
38/**counter
39
40You can [`read`](crate::Reg::read) this register and get [`cnt::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cnt::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
41
42See register [structure](https://stm32-rs.github.io/stm32-rs/STM32WLE5.html#TIM1:CNT)*/
43pub struct CNTrs;
44impl crate::RegisterSpec for CNTrs {
45    type Ux = u32;
46}
47///`read()` method returns [`cnt::R`](R) reader structure
48impl crate::Readable for CNTrs {}
49///`write(|w| ..)` method takes [`cnt::W`](W) writer structure
50impl crate::Writable for CNTrs {
51    type Safety = crate::Unsafe;
52}
53///`reset()` method sets CNT to value 0
54impl crate::Resettable for CNTrs {}