stm32f0/stm32f0x0/rtc/
tstr.rs1#[doc = "Register `TSTR` reader"]
2pub struct R(crate::R<TSTR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<TSTR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<TSTR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<TSTR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `PM` reader - AM/PM notation"]
17pub type PM_R = crate::BitReader<bool>;
18#[doc = "Field `HT` reader - Hour tens in BCD format."]
19pub type HT_R = crate::FieldReader<u8, u8>;
20#[doc = "Field `HU` reader - Hour units in BCD format."]
21pub type HU_R = crate::FieldReader<u8, u8>;
22#[doc = "Field `MNT` reader - Minute tens in BCD format."]
23pub type MNT_R = crate::FieldReader<u8, u8>;
24#[doc = "Field `MNU` reader - Minute units in BCD format."]
25pub type MNU_R = crate::FieldReader<u8, u8>;
26#[doc = "Field `ST` reader - Second tens in BCD format."]
27pub type ST_R = crate::FieldReader<u8, u8>;
28#[doc = "Field `SU` reader - Second units in BCD format."]
29pub type SU_R = crate::FieldReader<u8, u8>;
30impl R {
31 #[doc = "Bit 22 - AM/PM notation"]
32 #[inline(always)]
33 pub fn pm(&self) -> PM_R {
34 PM_R::new(((self.bits >> 22) & 1) != 0)
35 }
36 #[doc = "Bits 20:21 - Hour tens in BCD format."]
37 #[inline(always)]
38 pub fn ht(&self) -> HT_R {
39 HT_R::new(((self.bits >> 20) & 3) as u8)
40 }
41 #[doc = "Bits 16:19 - Hour units in BCD format."]
42 #[inline(always)]
43 pub fn hu(&self) -> HU_R {
44 HU_R::new(((self.bits >> 16) & 0x0f) as u8)
45 }
46 #[doc = "Bits 12:14 - Minute tens in BCD format."]
47 #[inline(always)]
48 pub fn mnt(&self) -> MNT_R {
49 MNT_R::new(((self.bits >> 12) & 7) as u8)
50 }
51 #[doc = "Bits 8:11 - Minute units in BCD format."]
52 #[inline(always)]
53 pub fn mnu(&self) -> MNU_R {
54 MNU_R::new(((self.bits >> 8) & 0x0f) as u8)
55 }
56 #[doc = "Bits 4:6 - Second tens in BCD format."]
57 #[inline(always)]
58 pub fn st(&self) -> ST_R {
59 ST_R::new(((self.bits >> 4) & 7) as u8)
60 }
61 #[doc = "Bits 0:3 - Second units in BCD format."]
62 #[inline(always)]
63 pub fn su(&self) -> SU_R {
64 SU_R::new((self.bits & 0x0f) as u8)
65 }
66}
67#[doc = "timestamp time register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tstr](index.html) module"]
68pub struct TSTR_SPEC;
69impl crate::RegisterSpec for TSTR_SPEC {
70 type Ux = u32;
71}
72#[doc = "`read()` method returns [tstr::R](R) reader structure"]
73impl crate::Readable for TSTR_SPEC {
74 type Reader = R;
75}
76#[doc = "`reset()` method sets TSTR to value 0"]
77impl crate::Resettable for TSTR_SPEC {
78 #[inline(always)]
79 fn reset_value() -> Self::Ux {
80 0
81 }
82}