stm32f0/stm32f0x2/stk/
csr.rs1pub type R = crate::R<CSRrs>;
3pub type W = crate::W<CSRrs>;
5pub type ENABLE_R = crate::BitReader;
7pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type TICKINT_R = crate::BitReader;
11pub type TICKINT_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type CLKSOURCE_R = crate::BitReader;
15pub type CLKSOURCE_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type COUNTFLAG_R = crate::BitReader;
19pub type COUNTFLAG_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22 #[inline(always)]
24 pub fn enable(&self) -> ENABLE_R {
25 ENABLE_R::new((self.bits & 1) != 0)
26 }
27 #[inline(always)]
29 pub fn tickint(&self) -> TICKINT_R {
30 TICKINT_R::new(((self.bits >> 1) & 1) != 0)
31 }
32 #[inline(always)]
34 pub fn clksource(&self) -> CLKSOURCE_R {
35 CLKSOURCE_R::new(((self.bits >> 2) & 1) != 0)
36 }
37 #[inline(always)]
39 pub fn countflag(&self) -> COUNTFLAG_R {
40 COUNTFLAG_R::new(((self.bits >> 16) & 1) != 0)
41 }
42}
43impl core::fmt::Debug for R {
44 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
45 f.debug_struct("CSR")
46 .field("enable", &self.enable())
47 .field("tickint", &self.tickint())
48 .field("clksource", &self.clksource())
49 .field("countflag", &self.countflag())
50 .finish()
51 }
52}
53impl W {
54 #[inline(always)]
56 pub fn enable(&mut self) -> ENABLE_W<CSRrs> {
57 ENABLE_W::new(self, 0)
58 }
59 #[inline(always)]
61 pub fn tickint(&mut self) -> TICKINT_W<CSRrs> {
62 TICKINT_W::new(self, 1)
63 }
64 #[inline(always)]
66 pub fn clksource(&mut self) -> CLKSOURCE_W<CSRrs> {
67 CLKSOURCE_W::new(self, 2)
68 }
69 #[inline(always)]
71 pub fn countflag(&mut self) -> COUNTFLAG_W<CSRrs> {
72 COUNTFLAG_W::new(self, 16)
73 }
74}
75pub struct CSRrs;
81impl crate::RegisterSpec for CSRrs {
82 type Ux = u32;
83}
84impl crate::Readable for CSRrs {}
86impl crate::Writable for CSRrs {
88 type Safety = crate::Unsafe;
89}
90impl crate::Resettable for CSRrs {}