stm32l4/stm32l4x5/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 - counter value
6pub type CNT_R = crate::FieldReader<u16>;
7///Field `CNT` writer - counter value
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;
11///Field `UIFCPY` writer - UIF copy
12pub type UIFCPY_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    ///Bits 0:15 - counter value
15    #[inline(always)]
16    pub fn cnt(&self) -> CNT_R {
17        CNT_R::new((self.bits & 0xffff) as u16)
18    }
19    ///Bit 31 - UIF copy
20    #[inline(always)]
21    pub fn uifcpy(&self) -> UIFCPY_R {
22        UIFCPY_R::new(((self.bits >> 31) & 1) != 0)
23    }
24}
25impl core::fmt::Debug for R {
26    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27        f.debug_struct("CNT")
28            .field("uifcpy", &self.uifcpy())
29            .field("cnt", &self.cnt())
30            .finish()
31    }
32}
33impl W {
34    ///Bits 0:15 - counter value
35    #[inline(always)]
36    pub fn cnt(&mut self) -> CNT_W<CNTrs> {
37        CNT_W::new(self, 0)
38    }
39    ///Bit 31 - UIF copy
40    #[inline(always)]
41    pub fn uifcpy(&mut self) -> UIFCPY_W<CNTrs> {
42        UIFCPY_W::new(self, 31)
43    }
44}
45/**counter
46
47You 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).
48
49See register [structure](https://stm32-rs.github.io/stm32-rs/STM32L4x5.html#TIM1:CNT)*/
50pub struct CNTrs;
51impl crate::RegisterSpec for CNTrs {
52    type Ux = u32;
53}
54///`read()` method returns [`cnt::R`](R) reader structure
55impl crate::Readable for CNTrs {}
56///`write(|w| ..)` method takes [`cnt::W`](W) writer structure
57impl crate::Writable for CNTrs {
58    type Safety = crate::Unsafe;
59}
60///`reset()` method sets CNT to value 0
61impl crate::Resettable for CNTrs {}